From e7c7bc2b36df55b24e14e9fe9cbee22c284da125 Mon Sep 17 00:00:00 2001 From: SeungHo Yang Date: Wed, 13 Aug 2025 12:06:09 +0900 Subject: [PATCH] =?UTF-8?q?dls=20=EB=B3=B5=EB=B3=B8=EC=A1=B0=EC=82=AC=20?= =?UTF-8?q?=20=201.=EB=82=A9=ED=92=88=EC=B2=98=20=EC=9E=85=EB=A0=A5?= =?UTF-8?q?=EC=B9=B8=20=EA=B8=B0=EB=B3=B8=20=ED=95=9C=EA=B8=80=EB=A1=9C=20?= =?UTF-8?q?=20=202.=EB=82=A9=ED=92=88=EC=B2=98=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=ED=95=98=EB=A9=B4=20=EC=9E=90=EB=8F=99=20=EC=A0=91=EC=86=8D=20?= =?UTF-8?q?=20=203.=EB=B3=B5=EB=B3=B8=EC=A1=B0=EC=82=AC=EA=B2=B0=EA=B3=BC?= =?UTF-8?q?=EB=A5=BC=20Y/N=EC=97=90=EC=84=9C=20=EA=B6=8C=EC=88=98=EB=A1=9C?= =?UTF-8?q?=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 납품처 정보 변경 후 발생되는 데이터베이스 오류 수정 퀵메뉴 관련 오류 수정 --- unimarc/unimarc/Helper_DB.cs | 7 +- unimarc/unimarc/Main.cs | 10 +-- unimarc/unimarc/Properties/AssemblyInfo.cs | 4 +- unimarc/unimarc/SearchModel/DLSSearcher.cs | 68 ++++++++++++++------ unimarc/unimarc/납품관리/Commodity_Search.cs | 1 + unimarc/unimarc/마크/DLS_Copy.Designer.cs | 54 ++++++++-------- unimarc/unimarc/마크/DLS_Copy.cs | 35 ++++++++-- unimarc/unimarc/편의기능/Quick_menu.cs | 2 +- 8 files changed, 121 insertions(+), 60 deletions(-) diff --git a/unimarc/unimarc/Helper_DB.cs b/unimarc/unimarc/Helper_DB.cs index 64387b6..62484b5 100644 --- a/unimarc/unimarc/Helper_DB.cs +++ b/unimarc/unimarc/Helper_DB.cs @@ -194,7 +194,7 @@ namespace WindowsFormsApp1 } public void DB_Send_CMD_reVoid(string cmd) { - using (conn) + //using (conn) { conn.Open(); MySqlTransaction tran = conn.BeginTransaction(); @@ -211,6 +211,11 @@ namespace WindowsFormsApp1 tran.Rollback(); MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } + finally + { + if (conn != null && conn.State != System.Data.ConnectionState.Closed) + conn.Close(); + } } } /// diff --git a/unimarc/unimarc/Main.cs b/unimarc/unimarc/Main.cs index 818b056..09c8ca8 100644 --- a/unimarc/unimarc/Main.cs +++ b/unimarc/unimarc/Main.cs @@ -97,6 +97,8 @@ namespace WindowsFormsApp1 catch (Exception ex) { MessageBox.Show(ex.ToString()); } UpdaterCheck(); + + this.Text += $" (Build {Application.ProductVersion})"; } @@ -172,7 +174,7 @@ namespace WindowsFormsApp1 }; Image[] source_Marc = { - Resources._3_1_1_마크작성, Resources._3_1_2_마크목록, Resources._3_1_3_소장자료검색, Resources._3_1_4_마크정리, Resources._3_1_5_복본조사, Resources._3_1_6_ISBN조회, + Resources._3_1_1_마크작성, Resources._3_1_2_마크목록, Resources._3_1_3_소장자료검색, Resources._3_1_4_마크정리, Resources._3_1_5_복본조사, Resources._3_1_5_복본조사, Resources._3_1_6_ISBN조회, Resources._3_2_1_목록, Resources._3_2_2_편목, Resources._3_2_1_반입, Resources._3_2_2_반출, Resources._3_3_1_전집관리, Resources._3_3_2_저자기호, @@ -185,7 +187,7 @@ namespace WindowsFormsApp1 }; string[] Marc = { - "마크 추가", "마크 목록", "소장자료검색", "마크 정리", "복본 조사", "ISBN 조회", + "마크 추가", "마크 목록", "소장자료검색", "마크 정리", "복본 조사","복본 조사(New)", "ISBN 조회", "DVD/CD/LP 목록", "DVD/CD/LP 편목", "반입", "반출", "전집관리", "저자기호", @@ -242,7 +244,7 @@ namespace WindowsFormsApp1 string[] Marc = { "마크 추가", "마크 목록", "소장자료검색", "마크 정리", "ISBN 조회", "DVD/CD/LP 목록", "DVD/CD/LP 편목", - "반입", "반출", "복본 조사", "DLS 복본 조사", "마크 수집", "전집관리", + "반입", "반출", "복본 조사", "복본 조사(New)","DLS 복본 조사", "마크 수집", "전집관리", "검수", "저자기호", "DLS 조회 입력", "서류작성", "마크통계", "장비관리" }; ToolStripMenuItem[] MarcT = { @@ -277,7 +279,7 @@ namespace WindowsFormsApp1 bool IsText = false; for(int b = 0; b < MenuTotal[a].Length; b++) { - if (MenuTotal[a][b] == btnText) { + if (MenuTotal[a][b].Trim().ToLower() == btnText.Trim().ToLower()) { IsText = true; count[1] = b; break; diff --git a/unimarc/unimarc/Properties/AssemblyInfo.cs b/unimarc/unimarc/Properties/AssemblyInfo.cs index 110bacd..8feda10 100644 --- a/unimarc/unimarc/Properties/AssemblyInfo.cs +++ b/unimarc/unimarc/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 // 기본값으로 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.187.4")] -[assembly: AssemblyFileVersion("1.0.187.4")] +[assembly: AssemblyVersion("2025.08.13.1200")] +[assembly: AssemblyFileVersion("2025.08.13.1200")] diff --git a/unimarc/unimarc/SearchModel/DLSSearcher.cs b/unimarc/unimarc/SearchModel/DLSSearcher.cs index 3ab9a21..c189f1f 100644 --- a/unimarc/unimarc/SearchModel/DLSSearcher.cs +++ b/unimarc/unimarc/SearchModel/DLSSearcher.cs @@ -249,32 +249,40 @@ namespace BokBonCheck var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15)); //초등학교명 일치 확인 - var selectSchool = wait.Until(t => t.FindElement(By.CssSelector("#current_school_select"))); - if (selectSchool == null) + try { - result.ErrorMessage = "학교선택칸없음"; - result.BookCount = -1; - result.IsSuccess = false; - return result; - } - else - { - Console.WriteLine($"학교명:{this.SCHOOL}"); - var select = new SelectElement(selectSchool); - - var curTxt = select.SelectedOption.Text; - var curVal = select.SelectedOption.GetAttribute("value"); - if (curTxt.Contains(this.SCHOOL) == false && this.SCHOOL.Contains(curTxt) == false) + var selectSchool = wait.Until(t => t.FindElement(By.CssSelector("#current_school_select"))); + if (selectSchool == null) { - select.SelectByText(this.SCHOOL); + result.ErrorMessage = "학교선택칸없음"; + result.BookCount = -1; + result.IsSuccess = false; + return result; } else { - //이름이 포함되어있다. - Console.WriteLine($"지정학교:{this.SCHOOL}, 현재선택학교:{curTxt}"); + Console.WriteLine($"학교명:{this.SCHOOL}"); + var select = new SelectElement(selectSchool); + + var curTxt = select.SelectedOption.Text; + var curVal = select.SelectedOption.GetAttribute("value"); + if (curTxt.Contains(this.SCHOOL) == false && this.SCHOOL.Contains(curTxt) == false) + { + select.SelectByText(this.SCHOOL); + } + else + { + //이름이 포함되어있다. + Console.WriteLine($"지정학교:{this.SCHOOL}, 현재선택학교:{curTxt}"); + } + } } + catch (Exception ex) + { + Console.WriteLine($"학교명일치확인 실패 {ex.Message}"); + } //검색방법(ISBN,서명) 확인 #search_field_first, title, ea_isbn var selectType = wait.Until(t => t.FindElement(By.CssSelector("#search_field_first"))); @@ -359,14 +367,32 @@ namespace BokBonCheck bool hasNoDataMessage = messageText.Contains("검색된 자료가 없습니다"); if (hasNoDataMessage) { - errmessage = "검색결과없음"; + //다이얼로를 닫아준다. + //< button type = "button" class="btn" name="msg_btn_1">닫기 + try + { + var buttomelm = driver.FindElement(By.CssSelector("button[name='msg_btn_1']")); + if (buttomelm != null) + { + SafeClick(buttomelm); + var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15)); + Thread.Sleep(200); + } + + } + catch + { + } + + + errmessage = "검색결과없음"; return 0; } } } catch (Exception ex) { - + } try { @@ -397,7 +423,7 @@ namespace BokBonCheck } - + errmessage = "결과확인실패"; diff --git a/unimarc/unimarc/납품관리/Commodity_Search.cs b/unimarc/unimarc/납품관리/Commodity_Search.cs index bb50cde..a98d6e5 100644 --- a/unimarc/unimarc/납품관리/Commodity_Search.cs +++ b/unimarc/unimarc/납품관리/Commodity_Search.cs @@ -190,6 +190,7 @@ namespace WindowsFormsApp1.Delivery dc.lbl_ID.Text = dataGridView1.Rows[idx].Cells["DLS_ID"].Value.ToString(); dc.lbl_PW.Text = dataGridView1.Rows[idx].Cells["DLS_PW"].Value.ToString(); dc.lbl_Area.Text = dataGridView1.Rows[idx].Cells["DLS_Area"].Value.ToString(); + dc.btn_Connect.PerformClick(); //dc.SetArea(dataGridView1.Rows[idx].Cells["DLS_Area"].Value.ToString(), true); } if (sl != null) { diff --git a/unimarc/unimarc/마크/DLS_Copy.Designer.cs b/unimarc/unimarc/마크/DLS_Copy.Designer.cs index 8f733c8..353529a 100644 --- a/unimarc/unimarc/마크/DLS_Copy.Designer.cs +++ b/unimarc/unimarc/마크/DLS_Copy.Designer.cs @@ -33,9 +33,6 @@ this.panel1 = new System.Windows.Forms.Panel(); this.panel8 = new System.Windows.Forms.Panel(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.Book_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ISBN = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Check = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel5 = new System.Windows.Forms.Panel(); this.chkShowBrowser = new System.Windows.Forms.CheckBox(); this.chk_RemoveBrit = new System.Windows.Forms.CheckBox(); @@ -58,6 +55,9 @@ this.tb_SearchClient = new System.Windows.Forms.TextBox(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.lblStatus = new System.Windows.Forms.ToolStripLabel(); + this.Book_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.ISBN = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Check = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel1.SuspendLayout(); this.panel8.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); @@ -118,25 +118,6 @@ this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint); this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); // - // Book_name - // - this.Book_name.HeaderText = "도서명"; - this.Book_name.Name = "Book_name"; - this.Book_name.Width = 140; - // - // ISBN - // - this.ISBN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; - this.ISBN.HeaderText = "ISBN"; - this.ISBN.Name = "ISBN"; - this.ISBN.Width = 140; - // - // Check - // - this.Check.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Check.HeaderText = "Y/N"; - this.Check.Name = "Check"; - // // panel5 // this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; @@ -351,6 +332,7 @@ // this.tb_SearchClient.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); + this.tb_SearchClient.ImeMode = System.Windows.Forms.ImeMode.Hangul; this.tb_SearchClient.Location = new System.Drawing.Point(76, 6); this.tb_SearchClient.Name = "tb_SearchClient"; this.tb_SearchClient.Size = new System.Drawing.Size(256, 21); @@ -372,6 +354,26 @@ this.lblStatus.Name = "lblStatus"; this.lblStatus.Size = new System.Drawing.Size(27, 20); this.lblStatus.Text = "WD"; + this.lblStatus.Click += new System.EventHandler(this.lblStatus_Click); + // + // Book_name + // + this.Book_name.HeaderText = "도서명"; + this.Book_name.Name = "Book_name"; + this.Book_name.Width = 140; + // + // ISBN + // + this.ISBN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None; + this.ISBN.HeaderText = "ISBN"; + this.ISBN.Name = "ISBN"; + this.ISBN.Width = 140; + // + // Check + // + this.Check.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Check.HeaderText = "권수"; + this.Check.Name = "Check"; // // DLS_Copy // @@ -417,18 +419,18 @@ private System.Windows.Forms.Button btn_Search; public System.Windows.Forms.Label lbl_Area; private System.Windows.Forms.Button btn_Reflesh008; - private System.Windows.Forms.Button btn_Connect; private System.Windows.Forms.CheckBox chk_RemoveBrit; private System.Windows.Forms.Button btn_ApplyFilter; private System.Windows.Forms.CheckBox chk_spChar; private System.Windows.Forms.Panel panel8; - private System.Windows.Forms.DataGridViewTextBoxColumn Book_name; - private System.Windows.Forms.DataGridViewTextBoxColumn ISBN; - private System.Windows.Forms.DataGridViewTextBoxColumn Check; private System.Windows.Forms.Button btnStop; private System.Windows.Forms.Button btn_SiteDenote; public System.Windows.Forms.CheckBox chkShowBrowser; private System.Windows.Forms.StatusStrip statusStrip1; private System.Windows.Forms.ToolStripLabel lblStatus; + public System.Windows.Forms.Button btn_Connect; + private System.Windows.Forms.DataGridViewTextBoxColumn Book_name; + private System.Windows.Forms.DataGridViewTextBoxColumn ISBN; + private System.Windows.Forms.DataGridViewTextBoxColumn Check; } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/DLS_Copy.cs b/unimarc/unimarc/마크/DLS_Copy.cs index c874e69..c509340 100644 --- a/unimarc/unimarc/마크/DLS_Copy.cs +++ b/unimarc/unimarc/마크/DLS_Copy.cs @@ -214,16 +214,17 @@ namespace WindowsFormsApp1.Mac var isbn = dr.Cells[1].Value?.ToString() ?? string.Empty; var search = rBtn_ISBN.Checked ? isbn : title; var rlt = await _searcher.SearchAsync(search); - if(rlt.IsSuccess==false) + if (rlt.IsSuccess == false) { dr.Cells[2].Value = rlt.ErrorMessage; - }else + } + else { - if (rlt.BookCount > 0) dr.Cells[2].Value = "Y"; - else dr.Cells[2].Value = "N"; + //if (rlt.BookCount > 0) dr.Cells[2].Value = "Y"; + dr.Cells[2].Value = $"{rlt.BookCount }"; } } - + MessageBox.Show("완료되었습니다."); } @@ -304,5 +305,29 @@ namespace WindowsFormsApp1.Mac { ClientSearch(); } + + private void lblStatus_Click(object sender, EventArgs e) + { + var lst = new string[]{ + "9791193110584", + "9791168672260", + "9788993858396", + "9791171200351", + "9791199239043", + "9791194828112", + "9791196026523", + "9791194368359", + "9791191744439", + "9791198843067", + "9788999712883", + "9788999729188", + "9788999729188"}; + + this.dataGridView1.Rows.Clear(); + foreach (var isbn in lst) + { + dataGridView1.Rows.Add(new object[] { "", isbn, "" }); + } + } } } diff --git a/unimarc/unimarc/편의기능/Quick_menu.cs b/unimarc/unimarc/편의기능/Quick_menu.cs index c4b54e7..5c5a176 100644 --- a/unimarc/unimarc/편의기능/Quick_menu.cs +++ b/unimarc/unimarc/편의기능/Quick_menu.cs @@ -227,7 +227,7 @@ namespace WindowsFormsApp1.Convenience "매출 조회", "매출 집계", "파트타임 관리" }; string[] Marc = { - "마크 추가", "마크 목록", "소장자료검색", "마크 정리", "복본 조사", "ISBN 조회", + "마크 추가", "마크 목록", "소장자료검색", "마크 정리", "복본 조사", "복본 조사(New)", "ISBN 조회", "DVD/CD/LP 목록", "DVD/CD/LP 편목", "반입", "반출", "전집관리", "저자기호", "DLS 복본 조사", "DLS 조회 입력",