* unimarc
a. 팩스전송 완료. b. 마크목록 폼 작성중 1. 엑셀반출 기능 추가중 사용 작업중 2. 마크편집 폼 수정 중 (마크 반출 test프로젝트 진행완료, 본 프로젝트에 적용중. / 저장기능활성화 작업완료) 2-1. 기존의 칸채우기에서 예상되지 못한 버그가 발생하여 칸채우기 숨김. 2-2. 008태크 재배치 => TextBox에 적용완료. 변경사항 메모장으로 넘기는 작업 진행해야함. 2-3. 현재 TODO : 저장기능 * ISBN 체크 프로그램 - ★작업완료★ a. 현재 마크팀 배포완료. - 추후 수정사항발생시 수정할 것. TODOLIST 1. 주문관리 팩스연동 완료 2. 전송된 팩스 확인 작업개시, 이메일 전송모듈 수정할것.
This commit is contained in:
		| @@ -13,28 +13,50 @@ namespace WindowsFormsApp1 | ||||
|     class Email | ||||
|     { | ||||
|         Helper_DB db = new Helper_DB(); | ||||
|         public void Send_mail() | ||||
|         public void Send_mail(string compidx, string pur, string filePath) | ||||
|         { | ||||
|             db.DBcon(); | ||||
|             #region Setup | ||||
|             // 보내는 이 : 메일ID, 메일PW, smtp주소, 포트번호 | ||||
|             string sender_Area = "`comp_name`, `email_ID`, `email_PW`, `smtp`, `port`"; | ||||
|             string tmp_db = db.DB_Select_Search(sender_Area, "Comp", "idx", compidx); | ||||
|  | ||||
|             string[] arr_db = tmp_db.Split('|'); | ||||
|  | ||||
|             // 받는 이 : 메일 | ||||
|             string taker_Area = "`email`"; | ||||
|             tmp_db = db.DB_Select_Search(taker_Area, "Purchase", "sangho", pur); | ||||
|  | ||||
|             string[] arr_pur = tmp_db.Split('|'); | ||||
|             #endregion | ||||
|  | ||||
|             MailMessage mail = new MailMessage(); | ||||
|  | ||||
|             // 보내는 사람 이메일 | ||||
|             mail.From = new MailAddress("admin@gloriabook.co.kr"); | ||||
|             mail.From = new MailAddress("jhk132765@naver.com"); | ||||
|  | ||||
|             // 받는 사람 이메일 | ||||
|             mail.To.Add("jhk132765@gmail.com"); | ||||
|  | ||||
|             // 메일 제목 | ||||
|             mail.Subject = "메일 제목"; | ||||
|             mail.Subject = "메일 제목"; // arr_db[0] + "주문분입니다."; | ||||
|  | ||||
|             // 메일 내용 | ||||
|             mail.Body = "메일 내용"; | ||||
|             mail.Body = "메일 내용";    // arr_db[0] + "주문분입니다."; | ||||
|  | ||||
|             // 첨부파일 | ||||
|             System.Net.Mail.Attachment attachment; | ||||
|  | ||||
|             // 첨부파일 붙이기 | ||||
|             attachment = new System.Net.Mail.Attachment(filePath); | ||||
|             mail.Attachments.Add(attachment); | ||||
|  | ||||
|             // SMTP 및 포트 설정 | ||||
|             SmtpClient smtp = new SmtpClient("localhost", 25); | ||||
|             SmtpClient smtp = new SmtpClient("smtp.naver.com", 587);  // (arr_db[3], Convert.Int32(arr_db[4]); | ||||
|             smtp.EnableSsl = true; | ||||
|  | ||||
|             // 계정 설정 | ||||
|             smtp.Credentials = new NetworkCredential("admin@gloriabook.co.kr", "gloria815"); | ||||
|             smtp.Credentials = new NetworkCredential("jhk132765@naver.com", "cjaeks3356!");    // (arr_db[1], arr_db[2]); | ||||
|  | ||||
|             try | ||||
|             { | ||||
| @@ -52,11 +74,11 @@ namespace WindowsFormsApp1 | ||||
|         /// </summary> | ||||
|         /// <param name="comp_name">DB에 저장된 회사명.</param> | ||||
|         /// <param name="taker">받는 업체의 메일주소.</param> | ||||
|         public void Send_Test_mail(string comp_name, string taker, string title, string content) | ||||
|         public void Send_Test_mail(string compidx, string taker, string title, string content) | ||||
|         { | ||||
|             db.DBcon(); | ||||
|             string tmpdata = db.DB_Select_Search("`email_ID`, `email_PW`, `smtp`, `port`",  | ||||
|                 "Comp", "comp_name", comp_name); | ||||
|                 "Comp", "idx", compidx); | ||||
|             string[] data = tmpdata.Split('|'); | ||||
|             int port = Convert.ToInt32(data[3]); | ||||
|             if(port == 465) { port = 587; } // 465포트는 기술적으로 사용되지않음. 587로 대체. | ||||
| @@ -132,7 +154,7 @@ namespace WindowsFormsApp1 | ||||
|  | ||||
|             if(link != "") { Attach_File(mail, link); } | ||||
|  | ||||
|             // 포트 설정 ( TODO: 보내는이 메일에 따라 수정이 필요함. DB내 저장된 smtp 정보 가져오면 될 것 같음. ) | ||||
|             // 포트 설정 | ||||
|             SmtpClient tp = new SmtpClient(smtp, port); | ||||
|  | ||||
|             // SSL 설정 | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -335,6 +335,7 @@ namespace WindowsFormsApp1.Delivery | ||||
|         } | ||||
|         private void button13_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             /* | ||||
|             List<int> chkIdx = new List<int>(); | ||||
|             for (int a = 0; a < dataGridView1.Rows.Count; a++) | ||||
|             { | ||||
| @@ -352,6 +353,22 @@ namespace WindowsFormsApp1.Delivery | ||||
|                     return; | ||||
|                 } | ||||
|             } | ||||
|             */ | ||||
|             string pur = "dasd"; | ||||
|             string FilePath = string.Empty; | ||||
|             string filename = string.Empty; | ||||
|  | ||||
|             OpenFileDialog Odig = openFileDialog1; | ||||
|             Odig.Filter = "Excel Files(*.xls)|*.xls|Excel Files(*.xlsx)|*.xlsx|All FIles(*.*)|*.*"; | ||||
|             Odig.Title = "파일을 선택해주세요."; | ||||
|  | ||||
|             if (Odig.ShowDialog() == DialogResult.OK) | ||||
|             { | ||||
|                 FilePath = Odig.FileName; | ||||
|                 filename = Path.GetFileName(FilePath); | ||||
|                 FilePath = Path.GetDirectoryName(FilePath); | ||||
|             } | ||||
|             else return; | ||||
|  | ||||
|             if (cb_ordersend.SelectedItem.ToString() == "팩스") { | ||||
|  | ||||
| @@ -396,20 +413,6 @@ namespace WindowsFormsApp1.Delivery | ||||
|  | ||||
|                 string[] fax_param = data_list.ToArray(); | ||||
|  | ||||
|                 string FilePath = string.Empty; | ||||
|                 string filename = string.Empty; | ||||
|  | ||||
|                 OpenFileDialog Odig = openFileDialog1; | ||||
|                 Odig.Filter = "Excel Files(*.xls)|*.xls|Excel Files(*.xlsx)|*.xlsx|All FIles(*.*)|*.*"; | ||||
|                 Odig.Title = "엑셀파일을 선택해주세요."; | ||||
|  | ||||
|                 if (Odig.ShowDialog() == DialogResult.OK) { | ||||
|                     FilePath = Odig.FileName; | ||||
|                     filename = Path.GetFileName(FilePath); | ||||
|                     FilePath = Path.GetDirectoryName(FilePath); | ||||
|                 } | ||||
|                 else return; | ||||
|  | ||||
|                 FTP ftp = new FTP(); | ||||
|  | ||||
|                 // TODO: openFileDialog 사용. 파일경로 가져와야함. | ||||
| @@ -435,16 +438,20 @@ namespace WindowsFormsApp1.Delivery | ||||
|                 else MessageBox.Show("접속 실패"); | ||||
|  | ||||
|                 // 바로빌 FAX API연동 | ||||
|                  | ||||
|                 fax.Send_BaroFax(filename, fax_param); | ||||
|  | ||||
|                 db.DB_Update("Comp", "fax_Key", fax.Send_BaroFax(filename, fax_param), "idx", compidx); | ||||
|             } | ||||
|             if (cb_ordersend.SelectedItem.ToString() == "메일") { | ||||
|                 MessageBox.Show("TODO: 구현해야함."); | ||||
|                 Email email = new Email(); | ||||
|                 email.Send_mail(compidx, pur, Odig.FileName); | ||||
|             } | ||||
|         } | ||||
|         private void btn_send_chk_Click(object sender, EventArgs e) | ||||
|         { | ||||
|             fax.Send_chk_BaroFax(); | ||||
|             string db_tmp = db.DB_Select_Search("`fax_Key`", "Comp", "idx", compidx); | ||||
|             string[] fax_key = db_tmp.Split('|'); | ||||
|  | ||||
|             fax.Send_chk_BaroFax(fax_key[0]); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 SeungHo Yang
					SeungHo Yang