diff --git a/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo b/ISBN_Check_test/.vs/ISBN_Check_test/v16/.suo index 67f9e0c..4ce1391 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/Form1.cs b/ISBN_Check_test/Form1.cs index bd9b5d3..188df2f 100644 --- a/ISBN_Check_test/Form1.cs +++ b/ISBN_Check_test/Form1.cs @@ -23,7 +23,6 @@ namespace ISBN_Check_test { string[] api_list = { "알라딘", "네이버", "다음" }; cb_api.Items.AddRange(api_list); - } private void button2_Click(object sender, EventArgs e) { @@ -140,11 +139,13 @@ namespace ISBN_Check_test { L_type.Clear(); L_Array.Clear(); + process_Sub(); if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.Yellow) continue; else if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.LightGray) gridview.Rows[a].DefaultCellStyle.BackColor = Color.Empty; + #region 필터적용 switch (cb_filter.SelectedIndex) { case 0: @@ -191,13 +192,13 @@ namespace ISBN_Check_test L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString()); L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString()); break; - } // 필터 적용 + } + #endregion string[] arrayType = L_type.ToArray(); string[] arrayValue = L_Array.ToArray(); string result = api.Naver(arrayValue, arrayType, param); insert_By_Naver(result, a); - process_Sub(); Thread.Sleep(700); } } @@ -211,6 +212,7 @@ namespace ISBN_Check_test for(int a = start; a < end; a++) { + process_Sub(); if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.Yellow) continue; else if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.LightGray) @@ -235,7 +237,6 @@ namespace ISBN_Check_test string result = api.Daum(query, type, param); richTextBox1.Text = result; insert_By_Daum(result, a); - process_Sub(); } } private void process_Sub() @@ -271,7 +272,6 @@ namespace ISBN_Check_test dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray; } - bool[] chk = { false, false, false }; // 도서명 저자 출판사 체크. string[] insert = data.Split('|'); if (data == "") { return; } @@ -290,7 +290,7 @@ namespace ISBN_Check_test if (insert.Length > 10) return; - input_marc(insert, row, newstring); + input_api(insert, row, newstring); } void insert_By_Naver(string value, int row) { @@ -346,14 +346,14 @@ namespace ISBN_Check_test } #endregion - if (sp_data.Length > 1) return; + if (sp_data.Length > 10) return; if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; } dataGridView1.Rows[row].Selected = true; string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd"); - input_marc(grid, row, newstring); + input_api(grid, row, newstring); } void insert_By_Daum(string value, int row) { @@ -379,22 +379,23 @@ namespace ISBN_Check_test grid[3] = tmp_isbn[1]; grid[4] = data[4]; - grid[5] = data[5].Substring(0, data[5].IndexOf('T')); + grid[5] = data[5].Substring(0, 10); grid[7] = data[6]; dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", grid) + "|"; dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray; } - if (sp_data.Length > 1) return; + if (sp_data.Length > 10) return; if (row > 0) dataGridView1.Rows[row - 1].Selected = false; dataGridView1.Rows[row].Selected = true; bool[] chk = { false, false, false }; - string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd"); + // string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd"); + string newstring = grid[5]; - input_marc(grid, row, newstring); + input_api(grid, row, newstring); } /// /// API에서 가져온 데이터가 요구한 데이터와 일치하는지 알아보는 함수 @@ -402,7 +403,7 @@ namespace ISBN_Check_test /// 데이터 /// Grid의 row인덱스번호 /// 날짜 - void input_marc(string[] value, int idx, string date) + void input_api(string[] value, int idx, string date) { bool[] chk = { false, false, false }; @@ -420,8 +421,8 @@ namespace ISBN_Check_test else if (book_comp.Contains(value[2]) == true) chk[2] = true; else if (value[2] == book_comp) chk[2] = true; - if (chk[0] == true && chk[1] == true && chk[2] == true) - { + if (chk[0] == true && chk[1] == true && chk[2] == true) { + dataGridView1.Rows[idx].Cells["isbn"].Value = value[3]; dataGridView1.Rows[idx].Cells["price2"].Value = value[4]; dataGridView1.Rows[idx].Cells["pubDate"].Value = date; diff --git a/ISBN_Check_test/Form2.Designer.cs b/ISBN_Check_test/Form2.Designer.cs index 38530aa..eda81e2 100644 --- a/ISBN_Check_test/Form2.Designer.cs +++ b/ISBN_Check_test/Form2.Designer.cs @@ -91,7 +91,7 @@ namespace ISBN_Check_test this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; - this.dataGridView1.Size = new System.Drawing.Size(834, 589); + this.dataGridView1.Size = new System.Drawing.Size(834, 324); this.dataGridView1.TabIndex = 4; this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); @@ -242,7 +242,7 @@ namespace ISBN_Check_test // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(834, 644); + this.ClientSize = new System.Drawing.Size(834, 379); this.Controls.Add(this.button1); this.Controls.Add(this.label5); this.Controls.Add(this.label4); diff --git a/ISBN_Check_test/Form2.cs b/ISBN_Check_test/Form2.cs index c1aa65c..3c4d6ac 100644 --- a/ISBN_Check_test/Form2.cs +++ b/ISBN_Check_test/Form2.cs @@ -28,37 +28,6 @@ namespace ISBN_Check_test // 비슷한거 색깔표시 same_chk(); } - #region KEEP - private void Aladin() - { - tb_book_name.Text = f1.dataGridView1.Rows[row].Cells["book_name"].Value.ToString(); - tb_author.Text = f1.dataGridView1.Rows[row].Cells["author"].Value.ToString(); - tb_book_comp.Text = f1.dataGridView1.Rows[row].Cells["book_comp"].Value.ToString(); - - if(f1.dataGridView1.Rows[row].Cells["price"].Value != null) { - tb_price.Text = f1.dataGridView1.Rows[row].Cells["price"].Value.ToString(); - } - else { tb_price.Text = ""; } - - string data = f1.dataGridView1.Rows[row].Cells["Column1"].Value.ToString(); - - // 도서명 / 저자 / 출판사 / isbn / 출간일 / 카테고리 / 품절여부 - string[] tmp = data.Split('|'); - string[] grid = { "", "", "", "", "", "", "", "" }; - - for(int a = 0; a < tmp.Length; a++) - { - if (a % 8 == 0) { grid[0] = tmp[a]; } - if (a % 8 == 1) { grid[1] = tmp[a]; } - if (a % 8 == 2) { grid[2] = tmp[a]; } - if (a % 8 == 3) { grid[3] = tmp[a]; } - if (a % 8 == 4) { grid[4] = tmp[a]; } - if (a % 8 == 5) { grid[5] = tmp[a]; } - if (a % 8 == 6) { grid[6] = tmp[a]; } - if (a % 8 == 7) { grid[7] = tmp[a]; dataGridView1.Rows.Add(grid); } - } - } - #endregion private void Sort_data() { tb_book_name.Text = f1.dataGridView1.Rows[row].Cells["book_name"].Value.ToString(); @@ -105,7 +74,6 @@ namespace ISBN_Check_test tb_book_comp.Text, tb_isbn.Text, tb_price.Text.Replace(",","") }; - for(int a= 0; a < dataGridView1.Rows.Count; a++) { @@ -131,7 +99,6 @@ namespace ISBN_Check_test else dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.LightGray; - } } } diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.application b/ISBN_Check_test/bin/Debug/ISBN_Check_test.application index 669f859..722187b 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 @@ - BprzJ5PCVu5aSrCy6lyc8o2A1tjLSfXOtP1/TI95rHM= + p/8+mV8YlxrwyLlcWvj9n6b9mL7rQTkpRvbI/T5huPg= diff --git a/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe b/ISBN_Check_test/bin/Debug/ISBN_Check_test.exe index fec4644..74cb251 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 270121e..3fca3da 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 @@ - + - stzHcifpPhqkwUOTrlsIYPoH0AQvHydDZp7ZZczJhpk= + zjvRlunNW73xa4PGNpIH7X3GQ1vGHrUDWZycVhU9Sb8= @@ -80,7 +80,7 @@ - xynw3Nbvs3kZvoiRFHpODME9jYRpL6OxWToRCRPmUZg= + a3hCM2zE7EusOows2VdWMoHAICsIRva0zyZEIdHfe3g= \ 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 d3fc88e..3e68412 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 8f00f6a..9930dfb 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 669f859..722187b 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 @@ - BprzJ5PCVu5aSrCy6lyc8o2A1tjLSfXOtP1/TI95rHM= + p/8+mV8YlxrwyLlcWvj9n6b9mL7rQTkpRvbI/T5huPg= 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 4928608..ccf2831 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 fec4644..74cb251 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 270121e..3fca3da 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 @@ - + - stzHcifpPhqkwUOTrlsIYPoH0AQvHydDZp7ZZczJhpk= + zjvRlunNW73xa4PGNpIH7X3GQ1vGHrUDWZycVhU9Sb8= @@ -80,7 +80,7 @@ - xynw3Nbvs3kZvoiRFHpODME9jYRpL6OxWToRCRPmUZg= + a3hCM2zE7EusOows2VdWMoHAICsIRva0zyZEIdHfe3g= \ 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 d3fc88e..3e68412 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 24da94c..88d04ff 100644 Binary files a/unimarc/.vs/WindowsFormsApp1/v16/.suo and b/unimarc/.vs/WindowsFormsApp1/v16/.suo differ diff --git a/unimarc/WindowsFormsApp1/WindowsFormsApp1.csproj b/unimarc/WindowsFormsApp1/WindowsFormsApp1.csproj index 261b109..35e2b55 100644 --- a/unimarc/WindowsFormsApp1/WindowsFormsApp1.csproj +++ b/unimarc/WindowsFormsApp1/WindowsFormsApp1.csproj @@ -90,6 +90,12 @@ True Reference.svcmap + + Form + + + Check_ISBN_Sub.cs + Form @@ -570,6 +576,9 @@ Work_Log.cs + + Check_ISBN_Sub.cs + findNchange.cs diff --git a/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe b/unimarc/WindowsFormsApp1/bin/Debug/WindowsFormsApp1.exe index 3bf70f6..39d498e 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 3a7571e..88a5c93 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 bafa395..c244ce0 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/DesignTimeResolveAssemblyReferencesInput.cache b/unimarc/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 3396e5d..8289da1 100644 Binary files a/unimarc/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/unimarc/WindowsFormsApp1/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache index cbe42a8..5585e92 100644 --- a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache +++ b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.CoreCompileInputs.cache @@ -1 +1 @@ -aa9864755c2bc744993a65fd26bc34785dfa1fc7 +2c2fdedd3db00438687298caebc6f66a078d1e50 diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt index 22f99d8..9a00d27 100644 --- a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt +++ b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.FileListAbsolute.txt @@ -374,3 +374,4 @@ C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\Window C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\bin\Debug\System.Numerics.Vectors.dll +C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.마크.Check_ISBN_Sub.resources diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache index 382ab2f..99056ff 100644 Binary files a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache and b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csproj.GenerateResource.cache differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.csprojAssemblyReference.cache index 26b92fc..75461d6 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 3bf70f6..39d498e 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 3a7571e..88a5c93 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/WindowsFormsApp1.마크.Check_ISBN_Sub.resources b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.마크.Check_ISBN_Sub.resources new file mode 100644 index 0000000..6c05a97 Binary files /dev/null and b/unimarc/WindowsFormsApp1/obj/Debug/WindowsFormsApp1.마크.Check_ISBN_Sub.resources differ diff --git a/unimarc/WindowsFormsApp1/obj/Debug/ko/WindowsFormsApp1.resources.dll b/unimarc/WindowsFormsApp1/obj/Debug/ko/WindowsFormsApp1.resources.dll index bafa395..c244ce0 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/마크/Check_ISBN.Designer.cs b/unimarc/WindowsFormsApp1/마크/Check_ISBN.Designer.cs index 085eba1..1dc3135 100644 --- a/unimarc/WindowsFormsApp1/마크/Check_ISBN.Designer.cs +++ b/unimarc/WindowsFormsApp1/마크/Check_ISBN.Designer.cs @@ -28,10 +28,19 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle(); + 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(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.btn_lookup = new System.Windows.Forms.Button(); + this.cb_filter = new System.Windows.Forms.ComboBox(); + this.label1 = new System.Windows.Forms.Label(); + this.tb_list_name = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.btn_Save = new System.Windows.Forms.Button(); + this.btn_Close = new System.Windows.Forms.Button(); + this.label3 = new System.Windows.Forms.Label(); + this.cb_api = new System.Windows.Forms.ComboBox(); this.num = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.isbn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -46,13 +55,9 @@ this.pubDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.persent = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.category = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.btn_lookup = new System.Windows.Forms.Button(); - this.cb_filter = new System.Windows.Forms.ComboBox(); - this.label1 = new System.Windows.Forms.Label(); - this.tb_list_name = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.btn_Save = new System.Windows.Forms.Button(); - this.btn_Close = new System.Windows.Forms.Button(); + this.sold_out = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.api_data = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.progressBar1 = new System.Windows.Forms.ProgressBar(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // @@ -61,13 +66,13 @@ this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle7.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; + 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; + this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.num, @@ -83,24 +88,112 @@ this.etc, this.pubDate, this.persent, - this.category}); + this.category, + this.sold_out, + this.api_data}); this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; this.dataGridView1.Location = new System.Drawing.Point(12, 55); this.dataGridView1.Name = "dataGridView1"; - dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle8.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + 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; this.dataGridView1.RowHeadersWidth = 20; - dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle9; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3; this.dataGridView1.RowTemplate.Height = 23; - this.dataGridView1.Size = new System.Drawing.Size(1212, 433); + this.dataGridView1.Size = new System.Drawing.Size(1309, 433); this.dataGridView1.TabIndex = 0; + this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); + this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); + // + // btn_lookup + // + this.btn_lookup.Location = new System.Drawing.Point(719, 15); + this.btn_lookup.Name = "btn_lookup"; + this.btn_lookup.Size = new System.Drawing.Size(99, 23); + this.btn_lookup.TabIndex = 1; + this.btn_lookup.Text = "ISBN 자동 조회"; + this.btn_lookup.UseVisualStyleBackColor = true; + this.btn_lookup.Click += new System.EventHandler(this.btn_lookup_Click); + // + // cb_filter + // + this.cb_filter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_filter.FormattingEnabled = true; + this.cb_filter.Location = new System.Drawing.Point(554, 16); + this.cb_filter.Name = "cb_filter"; + this.cb_filter.Size = new System.Drawing.Size(121, 20); + this.cb_filter.TabIndex = 2; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(16, 20); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(41, 12); + this.label1.TabIndex = 3; + this.label1.Text = "목록명"; + // + // tb_list_name + // + this.tb_list_name.Enabled = false; + this.tb_list_name.Location = new System.Drawing.Point(59, 16); + this.tb_list_name.Name = "tb_list_name"; + this.tb_list_name.Size = new System.Drawing.Size(199, 21); + this.tb_list_name.TabIndex = 4; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(495, 20); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(57, 12); + this.label2.TabIndex = 3; + this.label2.Text = "검색 조건"; + // + // btn_Save + // + this.btn_Save.Location = new System.Drawing.Point(829, 15); + this.btn_Save.Name = "btn_Save"; + this.btn_Save.Size = new System.Drawing.Size(99, 23); + this.btn_Save.TabIndex = 1; + this.btn_Save.Text = "전 체 저 장"; + this.btn_Save.UseVisualStyleBackColor = true; + this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click); + // + // btn_Close + // + this.btn_Close.Location = new System.Drawing.Point(939, 15); + this.btn_Close.Name = "btn_Close"; + this.btn_Close.Size = new System.Drawing.Size(99, 23); + this.btn_Close.TabIndex = 1; + this.btn_Close.Text = "닫 기"; + this.btn_Close.UseVisualStyleBackColor = true; + this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(297, 20); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(57, 12); + this.label3.TabIndex = 5; + this.label3.Text = "검색 엔진"; + // + // cb_api + // + this.cb_api.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_api.FormattingEnabled = true; + this.cb_api.Location = new System.Drawing.Point(356, 16); + this.cb_api.Name = "cb_api"; + this.cb_api.Size = new System.Drawing.Size(121, 20); + this.cb_api.TabIndex = 6; + this.cb_api.SelectedIndexChanged += new System.EventHandler(this.cb_api_SelectedIndexChanged); // // num // @@ -179,76 +272,32 @@ this.category.HeaderText = "도서분류"; this.category.Name = "category"; // - // btn_lookup + // sold_out // - this.btn_lookup.Location = new System.Drawing.Point(512, 15); - this.btn_lookup.Name = "btn_lookup"; - this.btn_lookup.Size = new System.Drawing.Size(99, 23); - this.btn_lookup.TabIndex = 1; - this.btn_lookup.Text = "ISBN 자동 조회"; - this.btn_lookup.UseVisualStyleBackColor = true; - this.btn_lookup.Click += new System.EventHandler(this.btn_lookup_Click); + this.sold_out.HeaderText = "품절/절판"; + this.sold_out.Name = "sold_out"; // - // cb_filter + // api_data // - this.cb_filter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cb_filter.FormattingEnabled = true; - this.cb_filter.Location = new System.Drawing.Point(308, 16); - this.cb_filter.Name = "cb_filter"; - this.cb_filter.Size = new System.Drawing.Size(121, 20); - this.cb_filter.TabIndex = 2; + this.api_data.HeaderText = "api_data"; + this.api_data.Name = "api_data"; + this.api_data.Visible = false; // - // label1 + // progressBar1 // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(16, 20); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(45, 12); - this.label1.TabIndex = 3; - this.label1.Text = "목록 명"; - // - // tb_list_name - // - this.tb_list_name.Enabled = false; - this.tb_list_name.Location = new System.Drawing.Point(63, 16); - this.tb_list_name.Name = "tb_list_name"; - this.tb_list_name.Size = new System.Drawing.Size(149, 21); - this.tb_list_name.TabIndex = 4; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(249, 20); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(57, 12); - this.label2.TabIndex = 3; - this.label2.Text = "검색 조건"; - // - // btn_Save - // - this.btn_Save.Location = new System.Drawing.Point(622, 15); - this.btn_Save.Name = "btn_Save"; - this.btn_Save.Size = new System.Drawing.Size(99, 23); - this.btn_Save.TabIndex = 1; - this.btn_Save.Text = "전 체 저 장"; - this.btn_Save.UseVisualStyleBackColor = true; - this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click); - // - // btn_Close - // - this.btn_Close.Location = new System.Drawing.Point(732, 15); - this.btn_Close.Name = "btn_Close"; - this.btn_Close.Size = new System.Drawing.Size(99, 23); - this.btn_Close.TabIndex = 1; - this.btn_Close.Text = "닫 기"; - this.btn_Close.UseVisualStyleBackColor = true; - this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click); + this.progressBar1.Location = new System.Drawing.Point(1070, 15); + this.progressBar1.Name = "progressBar1"; + this.progressBar1.Size = new System.Drawing.Size(219, 23); + this.progressBar1.TabIndex = 7; // // Check_ISBN // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1236, 594); + this.ClientSize = new System.Drawing.Size(1333, 594); + this.Controls.Add(this.progressBar1); + this.Controls.Add(this.cb_api); + this.Controls.Add(this.label3); this.Controls.Add(this.tb_list_name); this.Controls.Add(this.label2); this.Controls.Add(this.label1); @@ -267,10 +316,15 @@ } #endregion - - private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.Button btn_lookup; private System.Windows.Forms.ComboBox cb_filter; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tb_list_name; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Button btn_Save; + private System.Windows.Forms.Button btn_Close; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox cb_api; private System.Windows.Forms.DataGridViewTextBoxColumn num; private System.Windows.Forms.DataGridViewTextBoxColumn isbn; private System.Windows.Forms.DataGridViewTextBoxColumn book_name; @@ -285,10 +339,9 @@ private System.Windows.Forms.DataGridViewTextBoxColumn pubDate; private System.Windows.Forms.DataGridViewTextBoxColumn persent; private System.Windows.Forms.DataGridViewTextBoxColumn category; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.TextBox tb_list_name; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Button btn_Save; - private System.Windows.Forms.Button btn_Close; + private System.Windows.Forms.DataGridViewTextBoxColumn sold_out; + private System.Windows.Forms.DataGridViewTextBoxColumn api_data; + private System.Windows.Forms.ProgressBar progressBar1; + public System.Windows.Forms.DataGridView dataGridView1; } } \ No newline at end of file diff --git a/unimarc/WindowsFormsApp1/마크/Check_ISBN.cs b/unimarc/WindowsFormsApp1/마크/Check_ISBN.cs index 675c401..5359aac 100644 --- a/unimarc/WindowsFormsApp1/마크/Check_ISBN.cs +++ b/unimarc/WindowsFormsApp1/마크/Check_ISBN.cs @@ -10,6 +10,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using WindowsFormsApp1.Delivery; +using WindowsFormsApp1.마크; namespace WindowsFormsApp1.Mac { @@ -25,6 +26,7 @@ namespace WindowsFormsApp1.Mac Helper_DB db = new Helper_DB(); public string compidx; public string list_name = string.Empty; + private int rowidx; public Check_ISBN(Main _main) { InitializeComponent(); @@ -42,9 +44,8 @@ namespace WindowsFormsApp1.Mac { tb_list_name.Text = compidx + " " + list_name; - string[] list_combo = { "도서명 + 저자", "도서명", "저자", "출판사" }; - cb_filter.Items.AddRange(list_combo); - cb_filter.SelectedIndex = 0; + string[] list_combo = { "알라딘", "네이버", "다음" }; + cb_api.Items.AddRange(list_combo); db.DBcon(); string[] search_tbl = { "compidx", "list_name" }; @@ -59,38 +60,225 @@ namespace WindowsFormsApp1.Mac } private void btn_lookup_Click(object sender, EventArgs e) + { + if (cb_api.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; } + if (cb_filter.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; } + + progressBar1.Style = ProgressBarStyle.Continuous; + progressBar1.Minimum = 0; + progressBar1.Maximum = dataGridView1.Rows.Count; + progressBar1.Step = 1; + progressBar1.Value = 0; + + switch (cb_api.SelectedIndex) + { + case 0: + Aladin_API(dataGridView1); + break; + case 1: + Naver_API(dataGridView1); + break; + case 2: + Daum_API(dataGridView1); + break; + } + + // 총 검색 횟수, 일치, 중복 + MessageBox.Show("검색이 완료되었습니다!"); + + dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells[0]; + this.ActiveControl = dataGridView1; + rowidx = 0; + } + private void Aladin_API(DataGridView gridview) { string temp = string.Empty; string type = string.Empty; string query = string.Empty; - // 도서명 / 저자 / 출판사 / isbn / 정가 / 발행일 / 도서분류 - string[] param = { "title", "author", "publisher", "isbn13", "priceStandard", "pubDate", "categoryName" }; - API_Aladdin api = new API_Aladdin(); + + // 도서명 / 저자 / 출판사 / isbn / 정가 + // 발행일 / 도서분류 / 재고 + string[] param = { "title", "author", "publisher", "isbn13", "priceStandard", + "pubDate", "categoryName", "stockStatus" }; + API api = new API(); + + switch (cb_filter.SelectedIndex) + { + case 0: + type = "Keyword"; + break; + case 1: + type = "Title"; + break; + case 2: + type = "Author"; + break; + case 3: + type = "Publisher"; + break; + } for (int a = 0; a < dataGridView1.Rows.Count - 1; a++) { - // int a = 1; - query = dataGridView1.Rows[a].Cells["book_name"].Value.ToString(); - insert_API(api.Find(query, type, param), a); - Thread.Sleep(300); + progressBar1.PerformStep(); + if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.Yellow) + continue; + + else if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.LightGray) + gridview.Rows[a].DefaultCellStyle.BackColor = Color.Empty; + + + query = Aladin_Set_query(type, a); + insert_Aladin(api.Aladin(query, type, param), a); } } - void insert_API(string data, int row) + string Aladin_Set_query(string type, int idx) + { + string result = string.Empty; + + if (type == "Keyword") + result = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString() + + dataGridView1.Rows[idx].Cells["author"].Value.ToString(); + + if (type == "Title") + result = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString(); + + if (type == "Author") + result = dataGridView1.Rows[idx].Cells["author"].Value.ToString(); + + if (type == "Publisher") + result = dataGridView1.Rows[idx].Cells["book_comp"].Value.ToString(); + + return result; + } + private void Naver_API(DataGridView gridview) + { + // 도서명 / 저자 / 출판사 / isbn / 정가 + // 발행일 / 도서분류 / 재고 + string[] param = { "title", "author", "publisher", "isbn", "price", + "pubdate", "discount"}; + API api = new API(); + List L_type = new List(); + List L_Array = new List(); + + for(int a = 0; a < gridview.Rows.Count; a++) + { + L_type.Clear(); + L_Array.Clear(); + progressBar1.PerformStep(); + + if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.Yellow) + continue; + else if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.LightGray) + gridview.Rows[a].DefaultCellStyle.BackColor = Color.Empty; + + + #region 필터적용 + switch (cb_filter.SelectedIndex) + { + case 0: + L_type.Add("d_titl"); + L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString()); + break; + + case 1: + L_type.Add("d_auth"); + L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString()); + break; + + case 2: + L_type.Add("d_publ"); + L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString()); + break; + + case 3: + L_type.Add("d_titl"); + L_type.Add("d_auth"); + L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString()); + L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString()); + break; + + case 4: + L_type.Add("d_titl"); + L_type.Add("d_publ"); + L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString()); + L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString()); + break; + + case 5: + L_type.Add("d_auth"); + L_type.Add("d_publ"); + L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString()); + L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString()); + break; + + case 6: + L_type.Add("d_titl"); + L_type.Add("d_auth"); + L_type.Add("d_publ"); + L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString()); + L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString()); + L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString()); + break; + } + #endregion + + string[] arrayType = L_type.ToArray(); + string[] arrayValue = L_Array.ToArray(); + string result = api.Naver(arrayValue, arrayType, param); + insert_Naver(result, a); + Thread.Sleep(700); + } + } + private void Daum_API(DataGridView gridview) + { + string[] param = { "title", "authors", "publisher", "isbn", "price", + "datetime", "status" }; + string type = string.Empty; + string query = string.Empty; + API api = new API(); + + for(int a = 0; a < gridview.Rows.Count; a++) + { + progressBar1.PerformStep(); + if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.Yellow) + continue; + else if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.LightGray) + gridview.Rows[a].DefaultCellStyle.BackColor = Color.Empty; + + switch (cb_filter.SelectedIndex) + { + case 0: + type = "title"; + query = gridview.Rows[a].Cells["book_name"].Value.ToString(); + break; + case 1: + type = "person"; + query = gridview.Rows[a].Cells["author"].Value.ToString(); + break; + case 2: + type = "publisher"; + query = gridview.Rows[a].Cells["book_comp"].Value.ToString(); + break; + } + string result = api.Daum(query, type, param); + insert_Daum(result, a); + } + } + void insert_Aladin(string data, int row) { if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; } dataGridView1.Rows[row].Selected = true; - bool[] chk = { false, false, false }; // 도서명 저자 출판사 체크. - string book_name = dataGridView1.Rows[row].Cells["book_name"].Value.ToString(); - string author = dataGridView1.Rows[row].Cells["author"].Value.ToString(); - string book_comp = dataGridView1.Rows[row].Cells["book_comp"].Value.ToString(); + if (data.Length > 0) { + dataGridView1.Rows[row].Cells["api_data"].Value.ToString(); + dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray; + } string[] insert = data.Split('|'); - string newstring = string.Empty; - if (data == "") { return; } // pubDate형 보기편하게 DateTime형으로 재정리 - newstring = String.Format("{0:yyyy/MM/dd HH:mm}", + string newstring = String.Format("{0:yyyy/MM/dd HH:mm}", DateTime.Parse(insert[5].Remove(insert[5].IndexOf(" G")))); // 도서 분류 필요한 데이터로 재정리 @@ -101,18 +289,141 @@ namespace WindowsFormsApp1.Mac else { insert[6] = insert[6].Substring(top + 1, bot - top - 1); } if (insert.Length > 10) { - // 값이 2개 이상일 경우 따로 저장할수 있는 폼이 구축되어야함. return; } - if (insert[0] == book_name) { chk[0] = true; } - if (insert[1].Contains(author) == true) { chk[1] = true; } - if (insert[2] == book_comp) { chk[2] = true; } + input_api(insert, row, newstring); + } + void insert_Naver(string value, int row) + { + if (row > 0) dataGridView1.Rows[row - 1].Selected = false; + + dataGridView1.Rows[row].Selected = true; + + if (value == "") return; + + value = value.Replace("", ""); + value = value.Replace("", ""); + + string[] sp_data = value.Split('\t'); + string[] grid = { "", "", "", "", "", "", "", "" }; + + #region 분류작업 + for (int a = 0; a < sp_data.Length - 1; a++) + { + string[] data = sp_data[a].Split('|'); + int idx = data.Length - 2; + grid[0] = data[0]; + grid[1] = data[1]; + for (int b = 2; b < idx - 4; b++) + { + grid[1] += ", " + data[b]; + } + grid[2] = data[idx - 4]; + if (data[idx - 3].Contains(" ") == true) + { + string[] isbn = data[idx - 3].Split(' '); + grid[3] = isbn[1]; + } + else + grid[3] = data[idx - 3]; + + grid[4] = data[idx - 2]; + grid[5] = data[idx - 1]; + + if (data[idx] == "") + grid[7] = "절판"; + else + grid[7] = ""; + + dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", grid) + "|"; + dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray; + } + #endregion + + if (sp_data.Length > 10) return; + + if (row > 0) dataGridView1.Rows[row - 1].Selected = false; + + dataGridView1.Rows[row].Selected = true; + + string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd"); + + input_api(grid, row, newstring); + } + void insert_Daum(string value, int row) + { + if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; } + dataGridView1.Rows[row].Selected = true; + + if (value == "") return; + + string[] sp_data = value.Split('\n'); + string[] grid = { "", "", "", "", "", "", "", "" }; + + for (int a = 0; a < sp_data.Length - 1; a++) + { + string[] data = sp_data[a].Split('|'); + grid[0] = data[0]; + grid[1] = data[1]; + grid[2] = data[2]; + string[] tmp_isbn = data[3].Split(' '); + if (tmp_isbn.Length < 2) + grid[3] = data[3].Replace(" ", ""); + + else + grid[3] = tmp_isbn[1]; + + grid[4] = data[4]; + grid[5] = data[5].Substring(0, 10); + grid[7] = data[6]; + + dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", grid) + "|"; + dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray; + } + + if (sp_data.Length > 10) return; + + if (row > 0) dataGridView1.Rows[row - 1].Selected = false; + dataGridView1.Rows[row].Selected = true; + + bool[] chk = { false, false, false }; + // string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd"); + string newstring = grid[5]; + + input_api(grid, row, newstring); + } + /// + /// API에서 가져온 데이터가 요구한 데이터와 일치하는지 알아보는 함수 + /// + /// 데이터 + /// Grid의 row인덱스 번호 + /// 날짜 + void input_api(string[] value, int idx, string date) + { + bool[] chk = { false, false, false }; + + string book_name = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString(); + string author = dataGridView1.Rows[idx].Cells["author"].Value.ToString(); + string book_comp = dataGridView1.Rows[idx].Cells["book_comp"].Value.ToString(); + + if (value[0] == book_name) chk[0] = true; + + if (value[1].Contains(author) == true) chk[1] = true; + else if (author.Contains(value[1]) == true) chk[1] = true; + else if (value[1] == author) chk[1] = true; + + if (value[2].Contains(book_comp) == true) chk[2] = true; + else if (book_comp.Contains(value[2]) == true) chk[2] = true; + else if (value[2] == book_comp) chk[2] = true; if (chk[0] == true && chk[1] == true && chk[2] == true) { - dataGridView1.Rows[row].Cells["isbn"].Value = insert[3]; - dataGridView1.Rows[row].Cells["price"].Value = insert[4]; - dataGridView1.Rows[row].Cells["pubDate"].Value = newstring; - dataGridView1.Rows[row].Cells["category"].Value = insert[6]; + + dataGridView1.Rows[idx].Cells["isbn"].Value = value[3]; + dataGridView1.Rows[idx].Cells["price"].Value = value[4]; + dataGridView1.Rows[idx].Cells["pubDate"].Value = date; + dataGridView1.Rows[idx].Cells["category"].Value = value[6]; + dataGridView1.Rows[idx].Cells["sold_out"].Value = value[7]; + dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow; } } void made_Grid(string[] data) @@ -122,7 +433,7 @@ namespace WindowsFormsApp1.Mac * 비고 발행일 % 도서분류 */ string[] grid = { "", "", "", "", "", "", "", "", "", "", - "", "", "", "" }; + "", "", "", "", "" }; int sdc = 15; // search_data_count for (int a = 0; a < data.Length; a++) @@ -150,8 +461,7 @@ namespace WindowsFormsApp1.Mac { if (dataGridView1.Rows[a].Cells["isbn"].Value.ToString() == "" || dataGridView1.Rows[a].Cells["price"].Value.ToString() == "" || - dataGridView1.Rows[a].Cells["pubDate"].Value.ToString() == "" || - dataGridView1.Rows[a].Cells["category"].Value.ToString() == "") { continue; } + dataGridView1.Rows[a].Cells["pubDate"].Value.ToString() == "") { continue; } string[] Edit_tbl = { "isbn", "price", "pubDate", "category" }; string[] Edit_Col = { dataGridView1.Rows[a].Cells["isbn"].Value.ToString(), dataGridView1.Rows[a].Cells["price"].Value.ToString(), @@ -169,5 +479,50 @@ namespace WindowsFormsApp1.Mac { this.Close(); } + private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + if (dataGridView1.Rows[rowidx].Cells["api_data"].Value == null || + dataGridView1.Rows[rowidx].Cells["api_data"].Value.ToString() == "") { + return; + } + Check_ISBN_Sub sub = new Check_ISBN_Sub(this); + sub.row = rowidx; + sub.Call_API = cb_api.Text; + sub.Show(); + } + private void dataGridView1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) { dataGridView1_CellDoubleClick(null, null); rowidx++; } + if (e.KeyCode == Keys.Up) + { + rowidx--; + if (rowidx < 0) + rowidx = 0; + } + if (e.KeyCode == Keys.Down) + { + rowidx++; + if (rowidx > dataGridView1.Rows.Count - 1) + rowidx = dataGridView1.Rows.Count - 1; + } + } + private void cb_api_SelectedIndexChanged(object sender, EventArgs e) + { + cb_filter.Items.Clear(); + if (cb_api.SelectedIndex == 0) { + string[] aladin = { "도서명 + 저자", "도서명", "저자", "출판사" }; + cb_filter.Items.AddRange(aladin); + } + else if (cb_api.SelectedIndex == 1) { + string[] naver = { "도서명", "저자", "출판사", + "도서명 + 저자", "도서명 + 출판사", "저자 + 출판사", + "도서명 + 저자 + 출판사" }; + cb_filter.Items.AddRange(naver); + } + else if (cb_api.SelectedIndex == 2) { + string[] daum = { "도서명", "저자", "출판사" }; + cb_filter.Items.AddRange(daum); + } + } } } \ No newline at end of file diff --git a/unimarc/WindowsFormsApp1/마크/Check_ISBN.resx b/unimarc/WindowsFormsApp1/마크/Check_ISBN.resx index b03fa52..f4993f0 100644 --- a/unimarc/WindowsFormsApp1/마크/Check_ISBN.resx +++ b/unimarc/WindowsFormsApp1/마크/Check_ISBN.resx @@ -159,4 +159,10 @@ True + + True + + + True + \ No newline at end of file diff --git a/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.Designer.cs b/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.Designer.cs new file mode 100644 index 0000000..5c1d7fe --- /dev/null +++ b/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.Designer.cs @@ -0,0 +1,291 @@ + +namespace WindowsFormsApp1.마크 +{ + partial class Check_ISBN_Sub + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + this.btn_Close = new System.Windows.Forms.Button(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); + this.tb_price = new System.Windows.Forms.TextBox(); + this.tb_isbn = new System.Windows.Forms.TextBox(); + this.tb_book_comp = new System.Windows.Forms.TextBox(); + this.tb_author = new System.Windows.Forms.TextBox(); + this.tb_book_name = new System.Windows.Forms.TextBox(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.author = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.book_comp = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.isbn = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.price = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.pubDate = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.category = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.sold_out = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + this.SuspendLayout(); + // + // btn_Close + // + this.btn_Close.Location = new System.Drawing.Point(735, 14); + this.btn_Close.Name = "btn_Close"; + this.btn_Close.Size = new System.Drawing.Size(75, 23); + this.btn_Close.TabIndex = 18; + this.btn_Close.Text = "닫 기"; + this.btn_Close.UseVisualStyleBackColor = true; + this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click); + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(676, 9); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(29, 12); + this.label5.TabIndex = 13; + this.label5.Text = "정가"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(586, 9); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(33, 12); + this.label4.TabIndex = 14; + this.label4.Text = "ISBN"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(455, 9); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(41, 12); + this.label3.TabIndex = 15; + this.label3.Text = "출판사"; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(337, 9); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(29, 12); + this.label2.TabIndex = 16; + this.label2.Text = "저자"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(148, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(41, 12); + this.label1.TabIndex = 17; + this.label1.Text = "도서명"; + // + // tb_price + // + this.tb_price.Location = new System.Drawing.Point(663, 24); + this.tb_price.Name = "tb_price"; + this.tb_price.Size = new System.Drawing.Size(55, 21); + this.tb_price.TabIndex = 8; + // + // tb_isbn + // + this.tb_isbn.Location = new System.Drawing.Point(548, 24); + this.tb_isbn.Name = "tb_isbn"; + this.tb_isbn.Size = new System.Drawing.Size(109, 21); + this.tb_isbn.TabIndex = 9; + // + // tb_book_comp + // + this.tb_book_comp.Location = new System.Drawing.Point(408, 24); + this.tb_book_comp.Name = "tb_book_comp"; + this.tb_book_comp.Size = new System.Drawing.Size(134, 21); + this.tb_book_comp.TabIndex = 10; + // + // tb_author + // + this.tb_author.Location = new System.Drawing.Point(301, 24); + this.tb_author.Name = "tb_author"; + this.tb_author.Size = new System.Drawing.Size(101, 21); + this.tb_author.TabIndex = 11; + // + // tb_book_name + // + this.tb_book_name.Location = new System.Drawing.Point(41, 24); + this.tb_book_name.Name = "tb_book_name"; + this.tb_book_name.Size = new System.Drawing.Size(254, 21); + this.tb_book_name.TabIndex = 12; + // + // dataGridView1 + // + 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; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.book_name, + this.author, + this.book_comp, + this.isbn, + this.price, + this.pubDate, + this.category, + this.sold_out, + this.Column1}); + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Bottom; + this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically; + this.dataGridView1.Location = new System.Drawing.Point(0, 51); + this.dataGridView1.Name = "dataGridView1"; + dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; + 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; + this.dataGridView1.RowTemplate.Height = 23; + this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect; + this.dataGridView1.Size = new System.Drawing.Size(834, 361); + this.dataGridView1.TabIndex = 19; + this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); + this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); + 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 = 200; + // + // author + // + this.author.HeaderText = "저자"; + this.author.Name = "author"; + // + // book_comp + // + this.book_comp.HeaderText = "출판사"; + this.book_comp.Name = "book_comp"; + // + // isbn + // + this.isbn.HeaderText = "ISBN"; + this.isbn.Name = "isbn"; + this.isbn.Width = 70; + // + // price + // + this.price.HeaderText = "정가"; + this.price.Name = "price"; + this.price.Width = 60; + // + // pubDate + // + this.pubDate.HeaderText = "출간일"; + this.pubDate.Name = "pubDate"; + this.pubDate.Width = 70; + // + // category + // + this.category.HeaderText = "카테고리"; + this.category.Name = "category"; + // + // sold_out + // + this.sold_out.HeaderText = "품절여부"; + this.sold_out.Name = "sold_out"; + this.sold_out.Width = 70; + // + // Column1 + // + this.Column1.HeaderText = "Column1"; + this.Column1.Name = "Column1"; + this.Column1.Visible = false; + // + // Check_ISBN_Sub + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(834, 412); + this.Controls.Add(this.dataGridView1); + this.Controls.Add(this.btn_Close); + this.Controls.Add(this.label5); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Controls.Add(this.label1); + this.Controls.Add(this.tb_price); + this.Controls.Add(this.tb_isbn); + this.Controls.Add(this.tb_book_comp); + this.Controls.Add(this.tb_author); + this.Controls.Add(this.tb_book_name); + this.Name = "Check_ISBN_Sub"; + this.Text = "Check_ISBN_Sub"; + this.Load += new System.EventHandler(this.Check_ISBN_Sub_Load); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btn_Close; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tb_price; + private System.Windows.Forms.TextBox tb_isbn; + private System.Windows.Forms.TextBox tb_book_comp; + private System.Windows.Forms.TextBox tb_author; + private System.Windows.Forms.TextBox tb_book_name; + private System.Windows.Forms.DataGridView dataGridView1; + private System.Windows.Forms.DataGridViewTextBoxColumn book_name; + private System.Windows.Forms.DataGridViewTextBoxColumn author; + private System.Windows.Forms.DataGridViewTextBoxColumn book_comp; + private System.Windows.Forms.DataGridViewTextBoxColumn isbn; + private System.Windows.Forms.DataGridViewTextBoxColumn price; + private System.Windows.Forms.DataGridViewTextBoxColumn pubDate; + private System.Windows.Forms.DataGridViewTextBoxColumn category; + private System.Windows.Forms.DataGridViewTextBoxColumn sold_out; + private System.Windows.Forms.DataGridViewTextBoxColumn Column1; + } +} \ No newline at end of file diff --git a/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.cs b/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.cs new file mode 100644 index 0000000..b5ef46d --- /dev/null +++ b/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.cs @@ -0,0 +1,169 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using WindowsFormsApp1.Mac; + +namespace WindowsFormsApp1.마크 +{ + public partial class Check_ISBN_Sub : Form + { + Check_ISBN ci; + public int row; + public string Call_API = string.Empty; + int rowidx; + public Check_ISBN_Sub(Check_ISBN _ci) + { + InitializeComponent(); + ci = _ci; + } + + private void btn_Close_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void Check_ISBN_Sub_Load(object sender, EventArgs e) + { + Sort_data(); + same_chk(); // 비슷한거 색깔표시 + } + private void Sort_data() + { + tb_book_name.Text = ci.dataGridView1.Rows[row].Cells["book_name"].Value.ToString(); + tb_author.Text = ci.dataGridView1.Rows[row].Cells["author"].Value.ToString(); + tb_book_comp.Text = ci.dataGridView1.Rows[row].Cells["book_comp"].Value.ToString(); + + if (ci.dataGridView1.Rows[row].Cells["price"].Value != null) + tb_price.Text = ci.dataGridView1.Rows[row].Cells["price"].Value.ToString(); + + else tb_price.Text = ""; + + string data = ci.dataGridView1.Rows[row].Cells["api_data"].Value.ToString(); + + // 도서명 / 저자 / 출판사 / isbn / 출간일 / 카테고리 / 품절여부 + string[] tmp = data.Split('|'); + string[] grid = { "", "", "", "", "", "", "", "" }; + + int idx = 8; + for(int a= 0; a < tmp.Length; a++) + { + if (a % idx == 0) grid[0] = tmp[a]; + if (a % idx == 1) grid[1] = tmp[a]; + if (a % idx == 2) grid[2] = tmp[a]; + if (a % idx == 3) grid[3] = tmp[a]; + if (a % idx == 4) grid[4] = tmp[a]; + if (a % idx == 5) grid[5] = change_Date_type(tmp[a]); + if (a % idx == 6) grid[6] = tmp[a]; + if (a % idx == 7) { grid[7] = tmp[a]; dataGridView1.Rows.Add(grid); } + } + } + private string change_Date_type(string date) + { + if (Call_API == "알라딘") + return String.Format("{0:yyyy/MM/dd}", DateTime.Parse(date.Remove(date.IndexOf(" G")))); + else if (Call_API == "네이버") + return DateTime.ParseExact(date, "yyyyMMdd", null).ToString("yyyy-MM-dd"); + else + return date; + } + private void same_chk() + { + // 도서명, 저자, 출판사, ISBN, 정가 + string[] ori_data = { tb_book_name.Text, + tb_author.Text, + tb_book_comp.Text, + tb_isbn.Text, + tb_price.Text.Replace(",", "") }; + + for (int a = 0; a < dataGridView1.Rows.Count; a++) + { + int chk_idx = 0; + + if (dataGridView1.Rows[a].Cells["book_name"].Value.ToString() == ori_data[0]) + { + chk_idx++; + } + if (dataGridView1.Rows[a].Cells["author"].Value.ToString().Contains(ori_data[1]) == true) + { + chk_idx++; + } + if (dataGridView1.Rows[a].Cells["book_comp"].Value.ToString() == ori_data[2]) + { + chk_idx++; + } + if (chk_idx >= 2) + { + int pay = Convert.ToInt32(dataGridView1.Rows[a].Cells["price"].Value.ToString()); + int price = 0; + if (ori_data[4] != "") + price = Convert.ToInt32(ori_data[4]); + + if (price - 5000 <= pay && pay <= price + 5000) + dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Yellow; + + else + dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.LightGray; + } + } + } + + private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) + { + rowidx = e.RowIndex; + } + + private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e) + { + + if (e != null) { rowidx = e.RowIndex; } + string book_name = dataGridView1.Rows[rowidx].Cells["book_name"].Value.ToString(); + string author = dataGridView1.Rows[rowidx].Cells["author"].Value.ToString(); + string book_comp = dataGridView1.Rows[rowidx].Cells["book_comp"].Value.ToString(); + string isbn = dataGridView1.Rows[rowidx].Cells["isbn"].Value.ToString(); + string price = dataGridView1.Rows[rowidx].Cells["price"].Value.ToString(); + string Date = dataGridView1.Rows[rowidx].Cells["pubDate"].Value.ToString(); + string category = dataGridView1.Rows[rowidx].Cells["category"].Value.ToString(); + string sold = dataGridView1.Rows[rowidx].Cells["sold_out"].Value.ToString(); + + ci.dataGridView1.Rows[row].Cells["book_name"].Value = book_name; + ci.dataGridView1.Rows[row].Cells["author"].Value = author; + ci.dataGridView1.Rows[row].Cells["book_comp"].Value = book_comp; + ci.dataGridView1.Rows[row].Cells["isbn"].Value = isbn; + ci.dataGridView1.Rows[row].Cells["price2"].Value = price; + ci.dataGridView1.Rows[row].Cells["pubDate"].Value = Date; + ci.dataGridView1.Rows[row].Cells["category"].Value = category; + ci.dataGridView1.Rows[row].Cells["sold_out"].Value = sold; + + ci.dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.Yellow; + + this.Close(); + } + + private void dataGridView1_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) { dataGridView1_CellDoubleClick(null, null); } + if (e.KeyCode == Keys.Up) + { + rowidx--; + if (rowidx < 0) + rowidx = 0; + } + if (e.KeyCode == Keys.Down) + { + rowidx++; + if (rowidx > dataGridView1.Rows.Count - 1) + rowidx = dataGridView1.Rows.Count - 1; + } + if (e.KeyCode == Keys.Escape) + { + this.Close(); + } + } + } +} diff --git a/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.resx b/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.resx new file mode 100644 index 0000000..4b43b6a --- /dev/null +++ b/unimarc/WindowsFormsApp1/마크/Check_ISBN_Sub.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + \ No newline at end of file