diff --git a/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo b/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo index 8604139..5ed219e 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/unimarc/.vs/unimarc/v16/.suo b/unimarc/.vs/unimarc/v16/.suo index dd83e83..bd1ef4a 100644 Binary files a/unimarc/.vs/unimarc/v16/.suo and b/unimarc/.vs/unimarc/v16/.suo differ diff --git a/unimarc/unimarc/bin/Debug/UniMarc.exe b/unimarc/unimarc/bin/Debug/UniMarc.exe index 99f06b8..8ae86d4 100644 Binary files a/unimarc/unimarc/bin/Debug/UniMarc.exe and b/unimarc/unimarc/bin/Debug/UniMarc.exe differ diff --git a/unimarc/unimarc/bin/Debug/UniMarc.pdb b/unimarc/unimarc/bin/Debug/UniMarc.pdb index ca8c754..6e4b814 100644 Binary files a/unimarc/unimarc/bin/Debug/UniMarc.pdb and b/unimarc/unimarc/bin/Debug/UniMarc.pdb differ diff --git a/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll b/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll index 9acf7a1..3079f2e 100644 Binary files a/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll and b/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll differ diff --git a/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache b/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache index 0257fc5..801e866 100644 Binary files a/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache and b/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache differ diff --git a/unimarc/unimarc/obj/Debug/UniMarc.exe b/unimarc/unimarc/obj/Debug/UniMarc.exe index 99f06b8..8ae86d4 100644 Binary files a/unimarc/unimarc/obj/Debug/UniMarc.exe and b/unimarc/unimarc/obj/Debug/UniMarc.exe differ diff --git a/unimarc/unimarc/obj/Debug/UniMarc.pdb b/unimarc/unimarc/obj/Debug/UniMarc.pdb index ca8c754..6e4b814 100644 Binary files a/unimarc/unimarc/obj/Debug/UniMarc.pdb and b/unimarc/unimarc/obj/Debug/UniMarc.pdb differ diff --git a/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll b/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll index 9acf7a1..3079f2e 100644 Binary files a/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll and b/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll differ diff --git a/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs b/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs index de2380a..360ca15 100644 --- a/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs +++ b/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs @@ -57,8 +57,8 @@ namespace UniMarc.마크 { if (e.KeyCode == Keys.Enter) { + if (dataGridView1.Rows.Count < 0) return; int row = dataGridView1.CurrentRow.Index; - if (row < 0) return; SetCode(row); this.Close(); } diff --git a/unimarc/unimarc/마크/Check_copy.cs b/unimarc/unimarc/마크/Check_copy.cs index dd14ca6..c3b4590 100644 --- a/unimarc/unimarc/마크/Check_copy.cs +++ b/unimarc/unimarc/마크/Check_copy.cs @@ -94,7 +94,12 @@ namespace WindowsFormsApp1.Mac } else { - webBrowser1.Navigate(URL); + if (URL.IndexOf("218.157.123.2:9996/kcms/Main") > -1) + webBrowser1.Navigate(URL + "/" + Code); + + else + webBrowser1.Navigate(URL); + webBrowser1.DocumentCompleted += this.webBrowser1_DocumentCompleted; return; } @@ -184,7 +189,7 @@ namespace WindowsFormsApp1.Mac // 전남 도립 TODO: 오류발생 (원인불명) [한번에 3개씩 검색결과가 표출됨] else if (URL.IndexOf("lib.jeonnam.go.kr") > -1) { - Delay(300); + Delay(500); if (URL.IndexOf("value") > -1) BookCount = 전남도립결과(); @@ -201,9 +206,9 @@ namespace WindowsFormsApp1.Mac } // 전남 여수 (쌍봉, 현암, 환경, 돌산 등 총 31개 도서관) - else if (URL.IndexOf("yslib.yeosu.go.kr") > -1) + else if (URL.IndexOf("218.157.123.2:9996/kcms") > -1) { - if (URL.IndexOf("searchWord") > -1) + if (URL.IndexOf("KBookSearch") > -1) BookCount = 전남여수결과(); 전남여수입력(text); @@ -216,7 +221,6 @@ namespace WindowsFormsApp1.Mac BookCount = 전남무안입력(text); } - int tmp = RowCount - 1; if (tmp < 0) tmp = 0; @@ -596,18 +600,26 @@ namespace WindowsFormsApp1.Mac void 전남도립입력(string text) { - HtmlElementCollection hInput = webBrowser1.Document.GetElementsByTagName("input"); - foreach (HtmlElement Input in hInput) - { - if (Input.GetAttribute("className").IndexOf("search_main") > -1) - Input.SetAttribute("value", text); - } - HtmlElementCollection hBtn = webBrowser1.Document.GetElementsByTagName("button"); - foreach (HtmlElement Btn in hBtn) + HtmlElementCollection div = webBrowser1.Document.GetElementsByTagName("div"); + foreach (HtmlElement SearchDiv in div) { - if (Btn.InnerText == "검색") - Btn.InvokeMember("click"); + if (SearchDiv.GetAttribute("className") == "booksearch") + { + HtmlElementCollection hInput = SearchDiv.GetElementsByTagName("input"); + foreach (HtmlElement Input in hInput) + { + if (Input.GetAttribute("className").IndexOf("search_main") > -1) + Input.SetAttribute("value", text); + } + + HtmlElementCollection hBtn = SearchDiv.GetElementsByTagName("button"); + foreach (HtmlElement Btn in hBtn) + { + if (Btn.InnerText == "검색") + Btn.InvokeMember("click"); + } + } } } @@ -625,8 +637,11 @@ namespace WindowsFormsApp1.Mac HtmlElementCollection hecLi = heDiv.GetElementsByTagName("font"); foreach (HtmlElement heLi in hecLi) { - result = Regex.Replace(heLi.InnerText, @"\D", ""); - break; + if (heLi.InnerText.IndexOf("전체") > -1) + { + result = Regex.Replace(heLi.InnerText, @"\D", ""); + break; + } } } } @@ -676,25 +691,20 @@ namespace WindowsFormsApp1.Mac #region 전남 여수 void 전남여수입력(string text) { - foreach (HtmlElement DIV in webBrowser1.Document.GetElementsByTagName("div")) + HtmlElementCollection FindInput = webBrowser1.Document.GetElementsByTagName("input"); + foreach (HtmlElement input in FindInput) { - if (DIV.GetAttribute("className").IndexOf("search") > -1) + if (input.Name.IndexOf("search_txt") > -1) { - HtmlElementCollection FindInput = DIV.GetElementsByTagName("input"); - foreach (HtmlElement input in FindInput) - { - if (input.Name.IndexOf("searchWord") > -1) - { - input.SetAttribute("value", text); - } - } - foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input")) - { - if (he.GetAttribute("className").IndexOf("btn-search") > -1) - { - he.InvokeMember("click"); - } - } + input.SetAttribute("value", text); + } + } + + foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("a")) + { + if (he.GetAttribute("className").IndexOf("btn_search") > -1) + { + he.InvokeMember("click"); } } } @@ -703,16 +713,11 @@ namespace WindowsFormsApp1.Mac { string result = ""; - foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("ul")) + foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("span")) { - if (he.Id != null && he.Id.IndexOf("multiChk1") > -1) + if (he.InnerText != null && he.InnerText.IndexOf("검색되었습니다.") > -1) { - HtmlElementCollection FindLib = he.GetElementsByTagName("a"); - foreach (HtmlElement Lib in FindLib) - { - if (Lib.GetAttribute("href").IndexOf(string.Format("ManageCode={0}", Code)) > -1) - result = Regex.Replace(Lib.InnerText, @"\D", ""); - } + result = Regex.Replace(he.InnerText, @"[^0-9]", ""); } } diff --git a/unimarc/unimarc/홈/Transaction_manage.Designer.cs b/unimarc/unimarc/홈/Transaction_manage.Designer.cs index d7ded69..e4c3be0 100644 --- a/unimarc/unimarc/홈/Transaction_manage.Designer.cs +++ b/unimarc/unimarc/홈/Transaction_manage.Designer.cs @@ -28,14 +28,14 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle41 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle42 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle43 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle44 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle45 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle46 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle47 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle48 = new System.Windows.Forms.DataGridViewCellStyle(); this.NameLabel = new System.Windows.Forms.Label(); this.tb_sangho = new System.Windows.Forms.TextBox(); this.tb_addr = new System.Windows.Forms.TextBox(); @@ -46,7 +46,6 @@ this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.btn_delete = new System.Windows.Forms.Button(); - this.btn_edit = new System.Windows.Forms.Button(); this.btn_save = new System.Windows.Forms.Button(); this.btn_add = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); @@ -216,33 +215,21 @@ // this.btn_delete.DialogResult = System.Windows.Forms.DialogResult.Abort; this.btn_delete.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btn_delete.Location = new System.Drawing.Point(852, 155); + this.btn_delete.Location = new System.Drawing.Point(852, 129); this.btn_delete.Name = "btn_delete"; - this.btn_delete.Size = new System.Drawing.Size(75, 23); + this.btn_delete.Size = new System.Drawing.Size(75, 34); this.btn_delete.TabIndex = 42; this.btn_delete.Text = "삭 제"; this.btn_delete.UseVisualStyleBackColor = true; this.btn_delete.Click += new System.EventHandler(this.btn_delete_Click); // - // btn_edit - // - this.btn_edit.DialogResult = System.Windows.Forms.DialogResult.Abort; - this.btn_edit.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btn_edit.Location = new System.Drawing.Point(852, 105); - this.btn_edit.Name = "btn_edit"; - this.btn_edit.Size = new System.Drawing.Size(75, 23); - this.btn_edit.TabIndex = 41; - this.btn_edit.Text = "수 정"; - this.btn_edit.UseVisualStyleBackColor = true; - this.btn_edit.Click += new System.EventHandler(this.btn_edit_Click); - // // btn_save // this.btn_save.DialogResult = System.Windows.Forms.DialogResult.Abort; this.btn_save.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btn_save.Location = new System.Drawing.Point(852, 55); + this.btn_save.Location = new System.Drawing.Point(852, 67); this.btn_save.Name = "btn_save"; - this.btn_save.Size = new System.Drawing.Size(75, 23); + this.btn_save.Size = new System.Drawing.Size(75, 34); this.btn_save.TabIndex = 40; this.btn_save.Text = "저 장"; this.btn_save.UseVisualStyleBackColor = true; @@ -254,7 +241,7 @@ this.btn_add.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.btn_add.Location = new System.Drawing.Point(852, 5); this.btn_add.Name = "btn_add"; - this.btn_add.Size = new System.Drawing.Size(75, 23); + this.btn_add.Size = new System.Drawing.Size(75, 34); this.btn_add.TabIndex = 39; this.btn_add.Text = "추 가"; this.btn_add.UseVisualStyleBackColor = true; @@ -309,14 +296,14 @@ // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, 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; + dataGridViewCellStyle41.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle41.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle41.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle41.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle41.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle41.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle41.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle41; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.idx, @@ -347,21 +334,20 @@ this.dataGridView1.MultiSelect = false; this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; - dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.ControlDark; - dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, 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.RowHeadersDefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle42.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle42.BackColor = System.Drawing.SystemColors.ControlDark; + dataGridViewCellStyle42.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle42.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle42.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle42.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle42.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle42; this.dataGridView1.RowHeadersWidth = 21; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.dataGridView1.Size = new System.Drawing.Size(967, 306); this.dataGridView1.TabIndex = 44; this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); - this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); // // idx // @@ -707,9 +693,9 @@ // // btn_close // - this.btn_close.Location = new System.Drawing.Point(852, 205); + this.btn_close.Location = new System.Drawing.Point(852, 191); this.btn_close.Name = "btn_close"; - this.btn_close.Size = new System.Drawing.Size(75, 23); + this.btn_close.Size = new System.Drawing.Size(75, 34); this.btn_close.TabIndex = 43; this.btn_close.Text = "닫 기"; this.btn_close.UseVisualStyleBackColor = true; @@ -766,7 +752,6 @@ this.panel2.Controls.Add(this.btn_marc_expand); this.panel2.Controls.Add(this.label5); this.panel2.Controls.Add(this.label1); - this.panel2.Controls.Add(this.btn_edit); this.panel2.Controls.Add(this.cb_gubun1); this.panel2.Controls.Add(this.label13); this.panel2.Controls.Add(this.label2); @@ -834,14 +819,14 @@ // this.marcGrid.AllowUserToAddRows = false; this.marcGrid.AllowUserToDeleteRows = false; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle3.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.marcGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle43.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle43.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle43.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle43.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle43.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle43.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle43.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.marcGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle43; this.marcGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.marcGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Column1, @@ -859,8 +844,8 @@ // // Column1 // - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Column1.DefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle44.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Column1.DefaultCellStyle = dataGridViewCellStyle44; this.Column1.HeaderText = "날짜"; this.Column1.Name = "Column1"; // @@ -872,8 +857,8 @@ // // Column3 // - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.Column3.DefaultCellStyle = dataGridViewCellStyle5; + dataGridViewCellStyle45.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.Column3.DefaultCellStyle = dataGridViewCellStyle45; this.Column3.HeaderText = "작성자"; this.Column3.Name = "Column3"; // @@ -903,14 +888,14 @@ // this.gearGrid.AllowUserToAddRows = false; this.gearGrid.AllowUserToDeleteRows = false; - dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle6.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.gearGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle6; + dataGridViewCellStyle46.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle46.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle46.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle46.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle46.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle46.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle46.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.gearGrid.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle46; this.gearGrid.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.gearGrid.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.dataGridViewTextBoxColumn1, @@ -928,8 +913,8 @@ // // dataGridViewTextBoxColumn1 // - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle7; + dataGridViewCellStyle47.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dataGridViewTextBoxColumn1.DefaultCellStyle = dataGridViewCellStyle47; this.dataGridViewTextBoxColumn1.HeaderText = "날짜"; this.dataGridViewTextBoxColumn1.Name = "dataGridViewTextBoxColumn1"; // @@ -941,8 +926,8 @@ // // dataGridViewTextBoxColumn3 // - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle48.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dataGridViewTextBoxColumn3.DefaultCellStyle = dataGridViewCellStyle48; this.dataGridViewTextBoxColumn3.HeaderText = "작성자"; this.dataGridViewTextBoxColumn3.Name = "dataGridViewTextBoxColumn3"; // @@ -1022,7 +1007,6 @@ private System.Windows.Forms.Label label6; private System.Windows.Forms.Label label7; private System.Windows.Forms.Button btn_delete; - private System.Windows.Forms.Button btn_edit; private System.Windows.Forms.Button btn_save; private System.Windows.Forms.Button btn_add; private System.Windows.Forms.Label label1; diff --git a/unimarc/unimarc/홈/Transaction_manage.cs b/unimarc/unimarc/홈/Transaction_manage.cs index 2b85237..cbd497c 100644 --- a/unimarc/unimarc/홈/Transaction_manage.cs +++ b/unimarc/unimarc/홈/Transaction_manage.cs @@ -15,7 +15,6 @@ namespace WindowsFormsApp1.Home { Helper_DB db = new Helper_DB(); public string compidx; - int grididx = -1; Main main; public Transaction_manage(Main _main) { @@ -117,106 +116,117 @@ namespace WindowsFormsApp1.Home MessageBox.Show("구분을 선택해주세요."); return; } - if (cb_gubun2.SelectedItem.ToString() == "학교" && cb_dlsArea.SelectedIndex < 0) + if (cb_gubun2.SelectedItem.ToString() == "학교" && cb_dlsArea.SelectedIndex < 0 && tb_id.Text != "") { MessageBox.Show("DLS 지역을 선택해주세요."); return; } - string[] tmpdb = { "`c_sangho`, `c_gu`, `c_boss`, `c_bubin`, `c_uptae`, " + - "`c_jongmok`, `c_tel`, `c_fax`, `c_email`, `c_man`, " + - "`c_mantel`, `c_user`, `c_zip`, `c_addr`, `c_dlsID`, " + - "`c_dlsPW`, `c_division`, `c_label`, `c_program`, `c_etc`, " + - "`campanyidx`", "`c_dlsArea`" }; - string[] tmpdb1 = { tb_sangho.Text, cb_gubun2.Text, tb_boss.Text, tb_bubin.Text, tb_uptae.Text, - tb_jongmok.Text, tb_tel.Text, tb_fax.Text, tb_mail.Text, tb_man.Text, - tb_man1.Text, tb_user.Text, tb_zip.Text, tb_addr.Text, tb_id.Text, - tb_pw.Text, tb_division.Text, tb_label.Text, tb_program.Text, rtb_etc.Text, - compidx, cb_dlsArea.Text }; - string Incmd = db.DB_INSERT("Client", tmpdb, tmpdb1); - db.DB_Send_CMD_reVoid(Incmd); - MessageBox.Show(tb_sangho.Text + "가 성공적으로 저장되었습니다."); - Made_Grid(); - } - private void btn_edit_Click(object sender, EventArgs e) - { - string[] editcol = { "c_sangho", "c_gu", "c_boss", "c_bubin", "c_uptae", - "c_jongmok", "c_tel", "c_fax", "c_email", "c_man", - "c_mantel", "c_user", "c_zip", "c_addr", "c_dlsID", - "c_dlsPW", "c_division", "c_label", "c_program", "c_etc", - "c_dlsArea" - }; - string[] editname = { tb_sangho.Text, cb_gubun2.Text, tb_boss.Text, tb_bubin.Text, tb_uptae.Text, - tb_jongmok.Text, tb_tel.Text, tb_fax.Text, tb_mail.Text, tb_man.Text, - tb_man1.Text, tb_user.Text, tb_zip.Text, tb_addr.Text, tb_id.Text, - tb_pw.Text, tb_division.Text, tb_label.Text, tb_program.Text, rtb_etc.Text, - cb_dlsArea.Text - }; - string[] searchcol = { "idx", "campanyidx" }; - string[] searchname = { dataGridView1.Rows[grididx].Cells["idx"].Value.ToString(), compidx }; - string U_cmd = db.More_Update("Client", editcol, editname, searchcol, searchname); - db.DB_Send_CMD_reVoid(U_cmd); - MessageBox.Show(tb_sangho.Text + "가 성공적으로 저장되었습니다."); + string CopyCheckCMD = string.Format("SELECT {0} FROM {1} WHERE {0} = \"{2}\";", "`c_sangho`", "`Client`", tb_sangho.Text); + string CopyCheck = db.DB_Send_CMD_Search(CopyCheckCMD); + + bool isCopy = false; + + if (CopyCheck.Length > 0) + isCopy = true; + + if (isCopy) // 중복 데이터가 있을 경우 + { + int RowIndex = dataGridView1.CurrentCell.RowIndex; + + if (RowIndex < 0) { + MessageBox.Show("중복된 상호명이 존재합니다!"); + return; + } + + string[] editcol = { "c_sangho", "c_gu", "c_boss", "c_bubin", "c_uptae", + "c_jongmok", "c_tel", "c_fax", "c_email", "c_man", + "c_mantel", "c_user", "c_zip", "c_addr", "c_dlsID", + "c_dlsPW", "c_division", "c_label", "c_program", "c_etc", + "c_dlsArea" }; + + string[] editname = { tb_sangho.Text, cb_gubun2.Text, tb_boss.Text, tb_bubin.Text, tb_uptae.Text, + tb_jongmok.Text, tb_tel.Text, tb_fax.Text, tb_mail.Text, tb_man.Text, + tb_man1.Text, tb_user.Text, tb_zip.Text, tb_addr.Text, tb_id.Text, + tb_pw.Text, tb_division.Text, tb_label.Text, tb_program.Text, rtb_etc.Text, + cb_dlsArea.Text }; + + string[] searchcol = { "idx", "campanyidx" }; + string[] searchname = { dataGridView1.Rows[RowIndex].Cells["idx"].Value.ToString(), compidx }; + + string U_cmd = db.More_Update("Client", editcol, editname, searchcol, searchname); + + db.DB_Send_CMD_reVoid(U_cmd); + + MessageBox.Show(tb_sangho.Text + "가 성공적으로 수정되었습니다."); + } + else + { + string[] tmpdb = { "c_sangho", "c_gu", "c_boss", "c_bubin", "c_uptae", + "c_jongmok", "c_tel", "c_fax", "c_email", "c_man", + "c_mantel", "c_user", "c_zip", "c_addr", "c_dlsID", + "c_dlsPW", "c_division", "c_label", "c_program", "c_etc", + "campanyidx", "c_dlsArea" }; + + string[] tmpdb1 = { tb_sangho.Text, cb_gubun2.Text, tb_boss.Text, tb_bubin.Text, tb_uptae.Text, + tb_jongmok.Text, tb_tel.Text, tb_fax.Text, tb_mail.Text, tb_man.Text, + tb_man1.Text, tb_user.Text, tb_zip.Text, tb_addr.Text, tb_id.Text, + tb_pw.Text, tb_division.Text, tb_label.Text, tb_program.Text, rtb_etc.Text, + compidx, cb_dlsArea.Text }; + + string Incmd = db.DB_INSERT("Client", tmpdb, tmpdb1); + + db.DB_Send_CMD_reVoid(Incmd); + + MessageBox.Show(tb_sangho.Text + "가 성공적으로 저장되었습니다."); + } Made_Grid(); } + private void btn_delete_Click(object sender, EventArgs e) { - string D_cmd = db.DB_Delete("Client", "idx", dataGridView1.Rows[grididx].Cells["idx"].Value.ToString(), "c_sangho", tb_sangho.Text); + int RowIndex = dataGridView1.CurrentCell.RowIndex; + + if (RowIndex < 0) + return; + + string D_cmd = db.DB_Delete("Client", "idx", dataGridView1.Rows[RowIndex].Cells["idx"].Value.ToString(), "c_sangho", tb_sangho.Text); db.DB_Send_CMD_reVoid(D_cmd); Made_Grid(); } - string updown = ""; - private void dataGridView1_KeyDown(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Up) - { - updown = "UP"; - dataGridView1_CellClick(sender, null); - } - if (e.KeyCode == Keys.Down) - { - updown = "DOWN"; - dataGridView1_CellClick(sender, null); - } - } + private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { - if (e.RowIndex < 0) return; + int RowIndex = e.RowIndex; - if (e == null) { - if (updown == "UP") - { - if (grididx < 1) return; - grididx--; - } - else if (updown == "DOWN") - { - if (grididx > dataGridView1.Rows.Count) return; - grididx++; - } - } - else if (e != null) { grididx = e.RowIndex; } + if (RowIndex < 0) + return; - if (e.RowIndex < 0) { return; } + Infor_Client(RowIndex); - string[] tmp_man = dataGridView1.Rows[grididx].Cells["man"].Value.ToString().Split('|'); - tb_boss.Text = dataGridView1.Rows[grididx].Cells["boss"].Value.ToString(); - tb_bubin.Text = dataGridView1.Rows[grididx].Cells["bubin"].Value.ToString(); - tb_division.Text = dataGridView1.Rows[grididx].Cells["division"].Value.ToString(); - tb_jongmok.Text = dataGridView1.Rows[grididx].Cells["jongmok"].Value.ToString(); - tb_label.Text = dataGridView1.Rows[grididx].Cells["label"].Value.ToString(); - tb_mail.Text = dataGridView1.Rows[grididx].Cells["mail"].Value.ToString(); - tb_program.Text = dataGridView1.Rows[grididx].Cells["program"].Value.ToString(); - tb_id.Text = dataGridView1.Rows[grididx].Cells["DLSid"].Value.ToString(); - tb_pw.Text = dataGridView1.Rows[grididx].Cells["DLSpw"].Value.ToString(); - tb_uptae.Text = dataGridView1.Rows[grididx].Cells["uptae"].Value.ToString(); - tb_zip.Text = dataGridView1.Rows[grididx].Cells["post_num"].Value.ToString(); - tb_user.Text = dataGridView1.Rows[grididx].Cells["assumer"].Value.ToString(); - tb_sangho.Text = dataGridView1.Rows[grididx].Cells["sangho"].Value.ToString(); - tb_tel.Text = dataGridView1.Rows[grididx].Cells["tel"].Value.ToString(); - tb_fax.Text = dataGridView1.Rows[grididx].Cells["fax"].Value.ToString(); + lookup(panel4.Visible); + } - cb_dlsArea.Text = dataGridView1.Rows[grididx].Cells["dlsArea"].Value.ToString(); + void Infor_Client(int RowIndex) + { + string[] tmp_man = dataGridView1.Rows[RowIndex].Cells["man"].Value.ToString().Split('|'); + tb_boss.Text = dataGridView1.Rows[RowIndex].Cells["boss"].Value.ToString(); + tb_bubin.Text = dataGridView1.Rows[RowIndex].Cells["bubin"].Value.ToString(); + tb_division.Text = dataGridView1.Rows[RowIndex].Cells["division"].Value.ToString(); + tb_jongmok.Text = dataGridView1.Rows[RowIndex].Cells["jongmok"].Value.ToString(); + tb_label.Text = dataGridView1.Rows[RowIndex].Cells["label"].Value.ToString(); + tb_mail.Text = dataGridView1.Rows[RowIndex].Cells["mail"].Value.ToString(); + tb_program.Text = dataGridView1.Rows[RowIndex].Cells["program"].Value.ToString(); + tb_id.Text = dataGridView1.Rows[RowIndex].Cells["DLSid"].Value.ToString(); + tb_pw.Text = dataGridView1.Rows[RowIndex].Cells["DLSpw"].Value.ToString(); + tb_uptae.Text = dataGridView1.Rows[RowIndex].Cells["uptae"].Value.ToString(); + tb_zip.Text = dataGridView1.Rows[RowIndex].Cells["post_num"].Value.ToString(); + tb_user.Text = dataGridView1.Rows[RowIndex].Cells["assumer"].Value.ToString(); + tb_sangho.Text = dataGridView1.Rows[RowIndex].Cells["sangho"].Value.ToString(); + tb_tel.Text = dataGridView1.Rows[RowIndex].Cells["tel"].Value.ToString(); + tb_fax.Text = dataGridView1.Rows[RowIndex].Cells["fax"].Value.ToString(); + + cb_dlsArea.Text = dataGridView1.Rows[RowIndex].Cells["dlsArea"].Value.ToString(); if (tmp_man.Length > 1) { @@ -224,10 +234,10 @@ namespace WindowsFormsApp1.Home if (tmp_man[1] != "") { tb_man1.Text = tmp_man[1]; } } - tb_addr.Text = dataGridView1.Rows[grididx].Cells["addr"].Value.ToString(); - rtb_etc.Text = dataGridView1.Rows[grididx].Cells["bigo"].Value.ToString(); + tb_addr.Text = dataGridView1.Rows[RowIndex].Cells["addr"].Value.ToString(); + rtb_etc.Text = dataGridView1.Rows[RowIndex].Cells["bigo"].Value.ToString(); - if(dataGridView1.Rows[grididx].Cells["gubun"].Value.ToString() == "학교") + if (dataGridView1.Rows[RowIndex].Cells["gubun"].Value.ToString() == "학교") { cb_gubun1.SelectedIndex = 1; cb_gubun2.Items.Clear(); @@ -235,7 +245,7 @@ namespace WindowsFormsApp1.Home cb_gubun2.Items.AddRange(gubun2); cb_gubun2.SelectedIndex = 1; } - if(dataGridView1.Rows[grididx].Cells["gubun"].Value.ToString() == "도서관") + if (dataGridView1.Rows[RowIndex].Cells["gubun"].Value.ToString() == "도서관") { cb_gubun1.SelectedIndex = 1; cb_gubun2.Items.Clear(); @@ -243,7 +253,7 @@ namespace WindowsFormsApp1.Home cb_gubun2.Items.AddRange(gubun2); cb_gubun2.SelectedIndex = 2; } - if(dataGridView1.Rows[grididx].Cells["gubun"].Value.ToString() == "서점") + if (dataGridView1.Rows[RowIndex].Cells["gubun"].Value.ToString() == "서점") { cb_gubun1.SelectedIndex = 2; cb_gubun2.Items.Clear(); @@ -251,7 +261,7 @@ namespace WindowsFormsApp1.Home cb_gubun2.Items.AddRange(gubun2); cb_gubun2.SelectedIndex = 1; } - if(dataGridView1.Rows[grididx].Cells["gubun"].Value.ToString() == "기타") + if (dataGridView1.Rows[RowIndex].Cells["gubun"].Value.ToString() == "기타") { cb_gubun1.SelectedIndex = 2; cb_gubun2.Items.Clear(); @@ -259,8 +269,8 @@ namespace WindowsFormsApp1.Home cb_gubun2.Items.AddRange(gubun2); cb_gubun2.SelectedIndex = 2; } - lookup(panel4.Visible); } + private void tb_sangho_KeyDown(object sender, KeyEventArgs e) { if(e.KeyCode == Keys.Enter) @@ -323,7 +333,6 @@ namespace WindowsFormsApp1.Home string[] gubun2 = { "전체", "학교", "도서관" }; cb_gubun2.Items.AddRange(gubun2); cb_gubun2.SelectedIndex = 0; - Made_gubun_Grid("학교", "도서관"); } if (cb_gubun1.SelectedIndex == 2) { @@ -331,57 +340,14 @@ namespace WindowsFormsApp1.Home string[] gubun2 = { "전체", "서점", "기타" }; cb_gubun2.Items.AddRange(gubun2); cb_gubun2.SelectedIndex = 0; - Made_gubun_Grid("서점", "기타"); - } - } - private void Made_gubun_Grid(string strValue1, string strValue2) - { - string seartempdb = "`idx`, `c_sangho`, `c_gu`, `c_boss`, `c_bubin`, " + - "`c_uptae`, `c_jongmok`, `c_tel`, `c_fax`, `c_email`, " + - "`c_man`, `c_mantel`, `c_user`, `c_zip`, `c_addr`, " + - "`c_dlsArea`, `c_dlsID`, `c_dlsPW`, `c_division`, `c_label`," + - " `c_program`, `c_etc`"; - - string cmd = "SELECT " + seartempdb + " FROM Client " + - "WHERE `c_gu` = '" + strValue1 + "' OR `c_gu` = '" + strValue2 + "';"; - string tmpdb = db.self_Made_Cmd(cmd); - dataGridView1.Rows.Clear(); - string[] data = tmpdb.Split('|'); - string[] result = { "", "", "", "", "", - "", "", "", "", "", - "", "", "", "", "", - "", "", "", "", "", - "", "" }; - for (int a = 0; a < data.Length; a++) - { - if (a % 22 == 00) { result[00] = data[a]; } // idx - if (a % 22 == 01) { result[01] = data[a]; } // 거래처명 - if (a % 22 == 02) { result[02] = data[a]; } // 구분 - if (a % 22 == 03) { result[03] = data[a]; } // 대표자명 - if (a % 22 == 04) { result[04] = data[a]; } // 등록번호 - if (a % 22 == 05) { result[05] = data[a]; } // 업태 - if (a % 22 == 06) { result[06] = data[a]; } // 종목 - if (a % 22 == 07) { result[07] = data[a]; } // 전화번호 - if (a % 22 == 08) { result[08] = data[a]; } // 팩스 - if (a % 22 == 09) { result[09] = data[a]; } // 메일 - if (a % 22 == 10) { result[10] = data[a]; } // 담당자정보1 - if (a % 22 == 11) { result[11] = data[a]; } // 담당자정보2 - if (a % 22 == 12) { result[12] = data[a]; } // 담당직원 - if (a % 22 == 13) { result[13] = data[a]; } // 우편번호 - if (a % 22 == 14) { result[14] = data[a]; } // 주소 - if (a % 22 == 15) { result[15] = data[a]; } // DLS지역 - if (a % 22 == 16) { result[16] = data[a]; } // 아이디 - if (a % 22 == 17) { result[17] = data[a]; } // 비밀번호 - if (a % 22 == 18) { result[18] = data[a]; } // 용지칸수 - if (a % 22 == 19) { result[19] = data[a]; } // 띠라벨 - if (a % 22 == 20) { result[20] = data[a]; } // 사용프로그램 - if (a % 22 == 21) { result[21] = data[a]; dataGridView1.Rows.Add(result); } // 비고 } } private void btn_marc_expand_Click(object sender, EventArgs e) { - if (grididx < 0) + int RowIndex = dataGridView1.CurrentCell.RowIndex; + + if (RowIndex < 0) return; if (!panel4.Visible) @@ -400,6 +366,11 @@ namespace WindowsFormsApp1.Home private void lookup(bool chk) { + int RowIndex = dataGridView1.CurrentCell.RowIndex; + + if (RowIndex < 0) + return; + if (!chk) return; marcGrid.Rows.Clear(); @@ -408,7 +379,7 @@ namespace WindowsFormsApp1.Home marcGrid.Columns[0].ReadOnly = true; gearGrid.Columns[0].ReadOnly = true; - string idx = dataGridView1.Rows[grididx].Cells["idx"].Value.ToString(); + string idx = dataGridView1.Rows[RowIndex].Cells["idx"].Value.ToString(); string Area = "`c_marc`, `c_gear`"; string cmd = db.DB_Select_Search(Area, "Client", "idx", idx); @@ -446,10 +417,15 @@ namespace WindowsFormsApp1.Home private void tb_marcSave_Click(object sender, EventArgs e) { + int RowIndex = dataGridView1.CurrentCell.RowIndex; + + if (RowIndex < 0) + return; + string[] Edit_col = { "c_marc", "c_gear" }; string[] Edit_data = { Griddata_ToString(marcGrid), Griddata_ToString(gearGrid) }; string[] Search_col = { "idx" }; - string[] Search_data = { dataGridView1.Rows[grididx].Cells["idx"].Value.ToString() }; + string[] Search_data = { dataGridView1.Rows[RowIndex].Cells["idx"].Value.ToString() }; string cmd = db.More_Update("Client", Edit_col, Edit_data, Search_col, Search_data); db.DB_Send_CMD_reVoid(cmd);