diff --git a/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo b/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo index 4ed9946..4e163d0 100644 Binary files a/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo and b/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo differ diff --git a/ISBN_Check_test/Form3.Designer.cs b/ISBN_Check_test/Form3.Designer.cs index e0dbca2..1bc466c 100644 --- a/ISBN_Check_test/Form3.Designer.cs +++ b/ISBN_Check_test/Form3.Designer.cs @@ -29,7 +29,7 @@ namespace ISBN_Check_test /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.button1 = new System.Windows.Forms.Button(); this.tb_book_name = new System.Windows.Forms.TextBox(); this.tb_author = new System.Windows.Forms.TextBox(); @@ -93,14 +93,14 @@ namespace ISBN_Check_test // // dataGridView1 // - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Column1, @@ -160,6 +160,7 @@ namespace ISBN_Check_test this.label1.Size = new System.Drawing.Size(46, 13); this.label1.TabIndex = 6; this.label1.Text = "도서명"; + this.label1.Click += new System.EventHandler(this.label1_Click); // // label2 // diff --git a/ISBN_Check_test/Form3.cs b/ISBN_Check_test/Form3.cs index 94db591..40387a2 100644 --- a/ISBN_Check_test/Form3.cs +++ b/ISBN_Check_test/Form3.cs @@ -69,5 +69,17 @@ namespace ISBN_Check_test button1_Click(null, null); } } + + private void label1_Click(object sender, EventArgs e) + { + // yyyyMMddhhmmss + + string tmp = "yyyyMMddhhmmss"; + string msg = string.Empty; + + msg += tmp.Substring(0, 4) + "\n" + tmp.Substring(4, 2) + "\n" + tmp.Substring(6, 2) + "\n" + tmp.Substring(8,2) + "\n" + tmp.Substring(10,2) + "\n" + tmp.Substring(12,2); + + MessageBox.Show(msg); + } } } diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.application b/ISBN_Check_test/bin/Debug/ISBN_Check_test.application index 1226cbe..ec8e334 100644 --- a/ISBN_Check_test/bin/Debug/ISBN_Check_test.application +++ b/ISBN_Check_test/bin/Debug/ISBN_Check_test.application @@ -21,7 +21,7 @@ - AaoHzLkwZWtFm8QYK27OUKe4na5NBW/Zw7Qrlpq5Dkg= + a4jOxsmi+bTIiwhb3SPbmb6L1xcjoBg1z9x1JZ6GTKQ= diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe index ba9a256..b1acb8a 100644 Binary files a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe and b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe differ diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest index 79ee55c..6e1421e 100644 --- a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest +++ b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe.manifest @@ -3,7 +3,7 @@ - + @@ -43,13 +43,13 @@ - + - DRCM1xsajjzBfDtTQaRfXXxAUM0gBoJpUTj+frt24N4= + sJtRJUuCXQIaz6twsCpewElVltlc6NpvIbx0LSSzeLg= @@ -80,7 +80,7 @@ - eRUddpuV+QaOy4tSMp2pGEYHFiG+3CWNCzorNeq1ZTk= + VMPQHKSieXevI1Q5Ythv36A/XEljFScABlMsffq4u4Y= \ No newline at end of file diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb b/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb index 9f4851f..2235a9d 100644 Binary files a/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb and b/ISBN_Check_test/bin/Debug/ISBN_Check_test.pdb differ diff --git a/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe b/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe index 1ede522..d42f4d7 100644 Binary files a/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe and b/ISBN_Check_test/bin/Debug/app.publish/ISBN_Check_test.exe differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.application b/ISBN_Check_test/obj/Debug/ISBN_Check_test.application index 1226cbe..ec8e334 100644 --- a/ISBN_Check_test/obj/Debug/ISBN_Check_test.application +++ b/ISBN_Check_test/obj/Debug/ISBN_Check_test.application @@ -21,7 +21,7 @@ - AaoHzLkwZWtFm8QYK27OUKe4na5NBW/Zw7Qrlpq5Dkg= + a4jOxsmi+bTIiwhb3SPbmb6L1xcjoBg1z9x1JZ6GTKQ= diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache index b2a1881..0afa59e 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csproj.GenerateResource.cache differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache index 38e8623..02c784d 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.csprojAssemblyReference.cache differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe index ba9a256..b1acb8a 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe differ diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest index 79ee55c..6e1421e 100644 --- a/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest +++ b/ISBN_Check_test/obj/Debug/ISBN_Check_test.exe.manifest @@ -3,7 +3,7 @@ - + @@ -43,13 +43,13 @@ - + - DRCM1xsajjzBfDtTQaRfXXxAUM0gBoJpUTj+frt24N4= + sJtRJUuCXQIaz6twsCpewElVltlc6NpvIbx0LSSzeLg= @@ -80,7 +80,7 @@ - eRUddpuV+QaOy4tSMp2pGEYHFiG+3CWNCzorNeq1ZTk= + VMPQHKSieXevI1Q5Ythv36A/XEljFScABlMsffq4u4Y= \ No newline at end of file diff --git a/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb b/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb index 9f4851f..2235a9d 100644 Binary files a/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb and b/ISBN_Check_test/obj/Debug/ISBN_Check_test.pdb differ diff --git a/unimarc/.vs/WindowsFormsApp1/v16/.suo b/unimarc/.vs/WindowsFormsApp1/v16/.suo index b36716b..d351abc 100644 Binary files a/unimarc/.vs/WindowsFormsApp1/v16/.suo and b/unimarc/.vs/WindowsFormsApp1/v16/.suo differ diff --git a/unimarc/WindowsFormsApp1/Email.cs b/unimarc/WindowsFormsApp1/Email.cs index 1f6952e..c65bd64 100644 --- a/unimarc/WindowsFormsApp1/Email.cs +++ b/unimarc/WindowsFormsApp1/Email.cs @@ -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 /// /// DB에 저장된 회사명. /// 받는 업체의 메일주소. - 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 설정 diff --git a/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe b/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe index 48234bd..9a95578 100644 Binary files a/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe and b/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe differ diff --git a/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb b/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb index 64483b3..e2d7b3f 100644 Binary files a/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb and b/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.pdb differ diff --git a/unimarc/WindowsFormsApp1/bin/Debug/ko/WindowsFormsApp1.resources.dll b/unimarc/WindowsFormsApp1/bin/Debug/ko/WindowsFormsApp1.resources.dll index 25a67ef..2399343 100644 Binary files a/unimarc/WindowsFormsApp1/bin/Debug/ko/WindowsFormsApp1.resources.dll and b/unimarc/WindowsFormsApp1/bin/Debug/ko/WindowsFormsApp1.resources.dll differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache index 1c271ac..d3937d2 100644 Binary files a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache and b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe index 48234bd..9a95578 100644 Binary files a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe and b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.exe differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb index 64483b3..e2d7b3f 100644 Binary files a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb and b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.pdb differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/ko/WindowsFormsApp1.resources.dll b/unimarc/WindowsFormsApp1/obj/Debug/ko/WindowsFormsApp1.resources.dll index 25a67ef..2399343 100644 Binary files a/unimarc/WindowsFormsApp1/obj/Debug/ko/WindowsFormsApp1.resources.dll and b/unimarc/WindowsFormsApp1/obj/Debug/ko/WindowsFormsApp1.resources.dll differ diff --git a/unimarc/WindowsFormsApp1/납품관리/Order_input.cs b/unimarc/WindowsFormsApp1/납품관리/Order_input.cs index 1b5ccfd..4c39da1 100644 --- a/unimarc/WindowsFormsApp1/납품관리/Order_input.cs +++ b/unimarc/WindowsFormsApp1/납품관리/Order_input.cs @@ -335,6 +335,7 @@ namespace WindowsFormsApp1.Delivery } private void button13_Click(object sender, EventArgs e) { + /* List chkIdx = new List(); 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]); } } } \ No newline at end of file