diff --git a/unimarc/unimarc/마크/Marc.cs b/unimarc/unimarc/마크/Marc.cs index 980522e..5da9660 100644 --- a/unimarc/unimarc/마크/Marc.cs +++ b/unimarc/unimarc/마크/Marc.cs @@ -1582,29 +1582,17 @@ namespace UniMarc if (fb.ShowDialog() == DialogResult.OK) { String_Text st = new String_Text(); - if (fb.BulkMarcResults.Count > 0) + if (fb.FillBlankItems.Any(t => !string.IsNullOrEmpty(t.BookMarc))) { - foreach (var kvp in fb.BulkMarcResults) + foreach (var fbItem in fb.FillBlankItems) { - int targetListIdx = kvp.Key; - foreach (DataGridViewRow r in List_Book.Rows) - { - // In legacy Marc.cs, finding row by index logic might be similar? - // Marc_FillBlank used 'idx' from 'List_idx' column in legacy logic too? - // Legacy code: int idx = Convert.ToInt32(dataGridView1.Rows[a].Cells["List_idx"].Value.ToString()); - // And then: this.marc.List_Book.Rows[idx].Cells["db_marc"].Value = ... - // Wait, legacy used `Rows[idx]`. This implies `idx` IS the row index in List_Book? - // Let's assume it matches if we use the same index logic. - // In my refactor, I passed 'a' as first element of GridData if 'List_idx' col missing? - // In Marc.cs line 1579: `a.ToString()` is passed as first element. - // So `idx` in `BulkMarcResults` IS `a` (the row index). - // So we can directly access `List_Book.Rows[targetListIdx]`. + if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; - if (targetListIdx >= 0 && targetListIdx < List_Book.Rows.Count) - { - List_Book.Rows[targetListIdx].Cells["db_marc"].Value = kvp.Value; - List_Book.Rows[targetListIdx].DefaultCellStyle.ForeColor = Color.Blue; - } + int targetListIdx = int.Parse(fbItem.Idx); + if (targetListIdx >= 0 && targetListIdx < List_Book.Rows.Count) + { + List_Book.Rows[targetListIdx].Cells["db_marc"].Value = fbItem.BookMarc; + List_Book.Rows[targetListIdx].DefaultCellStyle.ForeColor = Color.Blue; } } } diff --git a/unimarc/unimarc/마크/Marc2.cs b/unimarc/unimarc/마크/Marc2.cs index a2f3593..5af4604 100644 --- a/unimarc/unimarc/마크/Marc2.cs +++ b/unimarc/unimarc/마크/Marc2.cs @@ -233,17 +233,23 @@ namespace UniMarc if (Chk_Arr.Length < 2) //마크DB에서 데이터가 없다면? { dr.Grade = "3"; //List_Book.Rows[a].Cells["grade"].Value = "3"; - dr.ForeColor = Color.Red;//List_Book.Rows[a].DefaultCellStyle.ForeColor = Color.Red; + dr.Status = MarcRecordStatus.None; continue; } if (Chk_Arr[1] != mCompidx) + { isMyData = false; + dr.Status = MarcRecordStatus.OtherCompany; + } + else + { + dr.Status = MarcRecordStatus.MyCompany; + } string[] MarcData = { Chk_Arr[2], Chk_Arr[4], Chk_Arr[6] }; string[] CheckData = { Chk_Arr[3], Chk_Arr[5], Chk_Arr[7] }; - dr.ForeColor = SetGradeColor(Chk_Arr[8], isMyData); // Temporary, chk_Marc updates item below dr.MarcIdx = Chk_Arr[0]; //List_Book.Rows[a].Cells["marc_idx"].Value = Chk_Arr[0]; dr.DbMarc = MarcData[0];// List_Book.Rows[a].Cells["db_marc"].Value = MarcData[0];//NewestMarc(MarcData, CheckData); dr.Grade = Chk_Arr[8];// List_Book.Rows[a].Cells["grade"].Value = Chk_Arr[8]; @@ -251,12 +257,6 @@ namespace UniMarc dr.User = Chk_Arr[10];// List_Book.Rows[a].Cells["user"].Value = Chk_Arr[10]; dr.SaveDate = Chk_Arr[11];// List_Book.Rows[a].Cells["SaveDate"].Value = Chk_Arr[11]; - //var item = List_Book.Rows[a].DataBoundItem as MarcBookItem; - Color gradeColor = SetGradeColor(Chk_Arr[8], isMyData); - dr.ForeColor = gradeColor; - //if (item != null) item.ForeColor = gradeColor; - //List_Book.Rows[a].DefaultCellStyle.ForeColor = gradeColor; - if (isMyData) { Color saveColor = GetSaveDateColor(Chk_Arr[11]); @@ -285,30 +285,6 @@ namespace UniMarc return result; } - private Color SetGradeColor(string Grade, bool isMyData = true) - { - if (!isMyData) - return Color.Orange; - - switch (Grade) - { - case "0": // A - return Color.Blue; - - case "1": // B - return Color.Black; - - case "2": // C - return Color.Gray; - - case "3": // D - return Color.DarkViolet; - - default: - return Color.Black; - } - } - /// /// 마지막 저장시각 14일이전일 경우 배경 색 변경 /// @@ -549,7 +525,7 @@ namespace UniMarc row.DbMarc = GridData[6]; mOldMarc = GridData[6]; - row.ForeColor = SetGradeColor(row.Grade); + // row.ForeColor = SetGradeColor(row.Grade); // Handled by MarcBookItem automatically row.BackColor = Color.Yellow; var currentitem = this.bs1.Current as MarcBookItem; @@ -570,14 +546,14 @@ namespace UniMarc string newsavedMarc = e.DBMarc; //string Midx = item.MarcIdx; - // 1. DB 작업 (저장 전략 결정: Foreground 색상 기준) - if (item.ForeColor == Color.Orange || item.ForeColor == Color.Red) + // 1. DB 작업 (저장 전략 결정: Status 기준) + if (item.Status == MarcRecordStatus.OtherCompany || item.Status == MarcRecordStatus.None) { string[] Insert_tbl = { "ISBN", "서명", "저자", "출판사", "가격", "marc", "비고1", "비고2", "url", "grade", "marc_chk", "user", "division", "008tag", "date", "compidx" }; string[] Insert_col = { e.Param.ISBN13, e.Param.BookName, e.Param.Author, e.Param.Publisher, e.Param.Price, newsavedMarc, e.Param.Remark1, e.Param.Remark2, e.Param.URL, e.Param.Grade, "1", mUserName, e.Param.tag056, e.Param.text008, date, mCompidx }; string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col); - PUB.log.Add("INSERT", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, item.ForeColor, Incmd)); + PUB.log.Add("INSERT", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, item.Status, Incmd)); long newIdx = db.DB_Send_CMD_Insert_GetIdx(Incmd); if (newIdx > 0) @@ -595,16 +571,12 @@ namespace UniMarc if (string.IsNullOrEmpty(e.Param.ISBN13)) { MessageBox.Show("ISBN 데이터가 없습니다."); return; } string U_cmd = db.More_Update(table_name, Edit_tbl, Edit_col, Sear_tbl, Sear_col); - PUB.log.Add("Update", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, item.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " "))); + PUB.log.Add("Update", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, item.Status, U_cmd.Replace("\r", " ").Replace("\n", " "))); Helper_DB.ExcuteNonQuery(U_cmd); } // 2. 객체 데이터 업데이트 및 시각적 상태 계산 - item.Grade = e.Param.Grade; - item.SaveDate = date; - item.User = mUserName; - item.DbMarc = e.DBMarc; - item.ForeColor = SetGradeColor(item.Grade); + item.Status = MarcRecordStatus.MyCompany; item.BackColor = GetSaveDateColor(date); // 3. 목록 인덱스 연동 업데이트 (Obj_List_Book) @@ -658,47 +630,40 @@ namespace UniMarc } var fb = new Marc_FillBlank(); - for (int a = 0; a < List_Book.Rows.Count; a++) + for (int a = 0; a < bs1.Count; a++) { - if (List_Book.Rows[a].DefaultCellStyle.ForeColor == Color.Red) + var item = bs1.List[a] as MarcBookItem; + if (item != null && item.Status == MarcRecordStatus.None) { - var item = new FillBlankItem + var fbItem = new FillBlankItem { - Idx = a.ToString(), - Isbn = List_Book.Rows[a].Cells["ISBN13"].Value?.ToString() ?? "", - BookName = List_Book.Rows[a].Cells["book_name"].Value?.ToString() ?? "", - Author = List_Book.Rows[a].Cells["author"].Value?.ToString() ?? "", - Publisher = List_Book.Rows[a].Cells["book_comp"].Value?.ToString() ?? "", - Price = List_Book.Rows[a].Cells["pay"].Value?.ToString() ?? "" + Idx = item.ListIdx, + Isbn = item.ISBN13 ?? "", + BookName = item.BookName ?? "", + Author = item.Author ?? "", + Publisher = item.BookComp ?? "", + Price = item.Pay ?? "" }; - fb.InitFillBlank(item); + fb.InitFillBlank(fbItem); } } fb.ISBN = ISBN; if (fb.ShowDialog() == DialogResult.OK) { String_Text st = new String_Text(); - if (fb.BulkMarcResults.Count > 0) + if (fb.FillBlankItems.Any(t => !string.IsNullOrEmpty(t.BookMarc))) { - foreach (var kvp in fb.BulkMarcResults) + foreach (var fbItem in fb.FillBlankItems) { - // Use list_idx to find row? Or assume key matches? - // Marc_FillBlank used 'idx' from 'List_idx' column. - // We need to iterate List_Book to find matching List_idx or if key is row index? - // In Marc_FillBlank, I stored 'idx' which was from 'List_idx'. - // Key = List_idx. - int targetListIdx = kvp.Key; - // Find row with this list_idx - foreach (DataGridViewRow r in List_Book.Rows) + if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; + + int targetListIdx = int.Parse(fbItem.Idx); + foreach (MarcBookItem item in this.dataList) { - if (r.Cells["List_idx"].Value != null && Convert.ToInt32(r.Cells["List_idx"].Value) == targetListIdx) + if (item.ListIdx != null && Convert.ToInt32(item.ListIdx) == targetListIdx) { - r.Cells["db_marc"].Value = kvp.Value; - // Update color etc? - r.DefaultCellStyle.ForeColor = Color.Blue; - // Need to update 'item' too if bound - var item = r.DataBoundItem as MarcBookItem; - if (item != null) item.ForeColor = Color.Blue; + item.DbMarc = fbItem.BookMarc; + item.Status = MarcRecordStatus.NewFetched; break; } } @@ -731,7 +696,8 @@ namespace UniMarc /// public bool Check_BackColor(int row) { - if (List_Book.Rows[row].DefaultCellStyle.ForeColor != Color.Red) + var item = bs1.List[row] as MarcBookItem; + if (item != null && item.Status != MarcRecordStatus.None) return true; return false; diff --git a/unimarc/unimarc/마크/MarcBookItem.cs b/unimarc/unimarc/마크/MarcBookItem.cs index f2839fc..5324769 100644 --- a/unimarc/unimarc/마크/MarcBookItem.cs +++ b/unimarc/unimarc/마크/MarcBookItem.cs @@ -5,6 +5,14 @@ using System.Text; namespace UniMarc { + public enum MarcRecordStatus + { + None, // No record in DB (Red) + OtherCompany, // Found but not ours (Orange) + MyCompany, // Found and ours (Black/Blue etc.) + NewFetched // Temporary status after external search (Blue) + } + public class MarcBookItem { public string ListIdx { get; set; } @@ -18,12 +26,62 @@ namespace UniMarc public string Url { get; set; } public string MarcIdx { get; set; } public string DbMarc { get; set; } - public string Grade { get; set; } + private MarcRecordStatus _status = MarcRecordStatus.None; + public MarcRecordStatus Status + { + get => _status; + set { _status = value; ApplySyncColor(); } + } + + private string _grade = ""; + public string Grade + { + get => _grade; + set { _grade = value; ApplySyncColor(); } + } + public string ColCheck { get; set; } = "V"; public string User { get; set; } public string SaveDate { get; set; } public System.Drawing.Color ForeColor { get; set; } = System.Drawing.Color.Black; public System.Drawing.Color BackColor { get; set; } = System.Drawing.Color.White; + + private void ApplySyncColor() + { + if (Status == MarcRecordStatus.None) + { + ForeColor = System.Drawing.Color.Red; + } + else if (Status == MarcRecordStatus.OtherCompany) + { + ForeColor = System.Drawing.Color.Orange; + } + else if (Status == MarcRecordStatus.NewFetched) + { + ForeColor = System.Drawing.Color.Blue; + } + else if (Status == MarcRecordStatus.MyCompany) + { + switch (Grade) + { + case "0": // A + ForeColor = System.Drawing.Color.Blue; + break; + case "1": // B + ForeColor = System.Drawing.Color.Black; + break; + case "2": // C + ForeColor = System.Drawing.Color.Gray; + break; + case "3": // D + ForeColor = System.Drawing.Color.DarkViolet; + break; + default: + ForeColor = System.Drawing.Color.Black; + break; + } + } + } } } diff --git a/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs b/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs index 0392fbe..dde8312 100644 --- a/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs +++ b/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs @@ -54,10 +54,9 @@ namespace UniMarc this.BookComp = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Price = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.BookMarc = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.panel2 = new System.Windows.Forms.Panel(); - this.bs1 = new System.Windows.Forms.BindingSource(this.components); this.bn1 = new System.Windows.Forms.BindingNavigator(this.components); this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton(); + this.bs1 = new System.Windows.Forms.BindingSource(this.components); this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel(); this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton(); @@ -68,16 +67,17 @@ namespace UniMarc this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton(); this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator(); + this.panel2 = new System.Windows.Forms.Panel(); this.panel6.SuspendLayout(); this.panel3.SuspendLayout(); this.panel4.SuspendLayout(); this.panel7.SuspendLayout(); this.panel5.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); - this.panel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.bs1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bn1)).BeginInit(); this.bn1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bs1)).BeginInit(); + this.panel2.SuspendLayout(); this.SuspendLayout(); // // panel6 @@ -249,7 +249,7 @@ namespace UniMarc this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.ReadOnly = true; this.dataGridView1.RowTemplate.Height = 23; - this.dataGridView1.Size = new System.Drawing.Size(531, 677); + this.dataGridView1.Size = new System.Drawing.Size(425, 542); this.dataGridView1.TabIndex = 0; this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); // @@ -301,17 +301,6 @@ namespace UniMarc this.BookMarc.ReadOnly = true; this.BookMarc.Visible = false; // - // panel2 - // - this.panel2.Controls.Add(this.panel4); - this.panel2.Controls.Add(this.panel3); - this.panel2.Controls.Add(this.panel6); - this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(1316, 733); - this.panel2.TabIndex = 311; - // // bn1 // this.bn1.AddNewItem = this.bindingNavigatorAddNewItem; @@ -351,6 +340,10 @@ namespace UniMarc this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(23, 22); this.bindingNavigatorAddNewItem.Text = "새로 추가"; // + // bs1 + // + this.bs1.CurrentChanged += new System.EventHandler(this.bs1_CurrentChanged); + // // bindingNavigatorCountItem // this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem"; @@ -428,6 +421,17 @@ namespace UniMarc this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2"; this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 25); // + // panel2 + // + this.panel2.Controls.Add(this.panel4); + this.panel2.Controls.Add(this.panel3); + this.panel2.Controls.Add(this.panel6); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(1316, 733); + this.panel2.TabIndex = 311; + // // Marc_FillBlank // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -446,11 +450,11 @@ namespace UniMarc this.panel5.ResumeLayout(false); this.panel5.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); - this.panel2.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.bs1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bn1)).EndInit(); this.bn1.ResumeLayout(false); this.bn1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bs1)).EndInit(); + this.panel2.ResumeLayout(false); this.ResumeLayout(false); } diff --git a/unimarc/unimarc/마크/Marc_FillBlank.cs b/unimarc/unimarc/마크/Marc_FillBlank.cs index c6adc08..c0c1dac 100644 --- a/unimarc/unimarc/마크/Marc_FillBlank.cs +++ b/unimarc/unimarc/마크/Marc_FillBlank.cs @@ -15,7 +15,7 @@ namespace UniMarc { public string ISBN; public string SingleMarcResult { get; private set; } - public Dictionary BulkMarcResults { get; private set; } = new Dictionary(); + public List FillBlankItems => _items; bool isAll; bool isBreak; List _items = new List(); @@ -207,7 +207,7 @@ namespace UniMarc if (tb_URL.Text.Contains(isbn)) { - item.BookMarc = SplitText(Text); + item.BookMarc = st.made_Ori_marc(MakeMarc(SplitText(Text))); bs1.ResetBindings(false); // Update grid view isBreak = true; } @@ -279,7 +279,6 @@ namespace UniMarc progressBar1.Maximum = dataGridView1.Rows.Count; isAll = true; - BulkMarcResults.Clear(); for (int a = 0; a < bs1.Count; a++) { @@ -306,18 +305,14 @@ namespace UniMarc // 검색이 다 될때까지 기다림 while (!isBreak) { - Delay(300); + Delay(500); } - string marc = item.BookMarc; - if (string.IsNullOrEmpty(marc)) + if (string.IsNullOrEmpty(item.BookMarc)) dataGridView1.Rows[a].DefaultCellStyle.ForeColor = Color.Red; else { dataGridView1.Rows[a].DefaultCellStyle.ForeColor = Color.Blue; - string processedMarc = st.made_Ori_marc(MakeMarc(marc)); - if (!BulkMarcResults.ContainsKey(idx)) - BulkMarcResults.Add(idx, processedMarc); } dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.White; @@ -368,13 +363,19 @@ namespace UniMarc private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { - if (e.RowIndex < 0) - return; + } - int row = e.RowIndex; - - var item = (FillBlankItem)bs1.Current; - richTextBox1.Text = item.BookMarc; + private void bs1_CurrentChanged(object sender, EventArgs e) + { + //bookmark 데이터를 tbBookMark 에 표시 + if (bs1.Current is FillBlankItem item) + { + richTextBox1.Text = item.BookMarc; + } + else + { + richTextBox1.Text = ""; + } } } } diff --git a/unimarc/unimarc/마크/Marc_FillBlank.resx b/unimarc/unimarc/마크/Marc_FillBlank.resx index 331cc7c..01f8608 100644 --- a/unimarc/unimarc/마크/Marc_FillBlank.resx +++ b/unimarc/unimarc/마크/Marc_FillBlank.resx @@ -145,7 +145,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAAVdJREFUOE/Nz0tLAmEUBmB3kWRoCUVEISFUJGb1OywiKrDsIpZdkJAkDUvDQkij + vgAADr4B6kKxwAAAAVdJREFUOE/Nz0tLAmEUBmB3kWRoCUVEISFUJGb1OywiKrDsIpZdkJAkDUvDQkij UKSbVIvatKhNi9oERRAGEQXhjJdp7Hd83/eGs2jhLGQ20QtndTgP71Gp/m0KZ1XInlTjM6XG+4EG5fuK yaTUIN8bIMUQ0gmtcuBtX/MLPMT0yoHnuA6kuA4iruI20lAZ+DiswWuyFum4Dk+7dbiP6kHEFVDBg+tQ My4DLbjwG3DqbcORxygHXxJakGIQRFwDEf0gwjKI4AYtzIHmHaA5Oxg/CsYPIb7YIQced+qluvTLCyIs @@ -160,7 +160,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAAWtJREFUOE+1kE0ow2Ecx/9X5a2UiwtKOSCTmJBMhuQlMo3IvCUHDouEXHZwIOVC + vgAADr4B6kKxwAAAAWtJREFUOE+1kE0ow2Ecx/9X5a2UiwtKOSCTmJBMhuQlMo3IvCUHDouEXHZwIOVC DrhIDiQl5USy07zNa2tKf2laaRf84/J8xBCetab4XL/f76fn+SnKX4DrGLqrwbHDzywkWJlHdJYjLEbY Wg8q4eYKlma+d1hbgF4TotWIaC+FuYmAktcXCksx2HrknBOHX1KbiTDngrXhW0kMdSBM2TA5Io+/wuI0 oiz5TcRwB7hPYazfLx3rDz7+gCsXNBb4v1SdgajTQ19TaOMP2NtFmPSIilSo0v1y7FHBnAdZMWi6aO51 @@ -172,7 +172,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAATFJREFUOE9jYBg0oHDW8/9NC57/z5z4+D+6HAyEtz/AKceQO/PZ/1VH3v/HpSi+ + vgAADr4B6kKxwAAAATFJREFUOE9jYBg0oHDW8/9NC57/z5z4+D+6HAyEtz/AKceQO/PZ/1VH3v/HpSi+ +8H/4IZrWOXAIGPK0/8L933Aqii+5+H/pfv///evvoAhBwcJPU/+T9vyHkNRRPt9sObMWf//e5WewG1A ZNej/72rP6AoCm29B9bcuu7/f//Ov/9d8g/gNiCw+eH/uvnv4IqCW+7+X7T3//+Odf//Z8z5+d+u7ud/ +4ztuA3wqLr/P3/aGxRFdsW3/6fP+f3fv+vbf53Cd/8tEtbjNsC+9O7/7MmvMRTpp5z/b1L04r9K1qf/ @@ -183,7 +183,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAALtJREFUOE9jYBgyILz9wX90MaJBfPeD/8EN18gzIL7n4f+l+///96++QLoBEe33 + vgAADr4B6kKxwAAAALtJREFUOE9jYBgyILz9wX90MaJBfPeD/8EN18gzIL7n4f+l+///96++QLoBEe33 wZozZ/3/71V6gjQDQlvvgTW3rvv/37/z73+X/APEGxDccvf/or3//3es+/8/Y87P/3Z1P//bZ2wn3gAQ sCu+/T99zu///l3f/usUvvtvkbCeNANAQD/l/H+Tohf/VbI+/TeOXEa6ASBgkHTiv2za1/+6wfPIMwAE 9FMv/9fwnUa+ASCg4jGBMgMGLwAA0BRgmCws/7cAAAAASUVORK5CYII= @@ -192,7 +192,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5 + vgAADr4B6kKxwAAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5 8n/2vl//O7f+/e9Wepl0QyK7Hv2fsu3X/5Klf/8nTP/73yb3LGmGBDY//N+69j1Ys3HJl//S0df+G0cu I94Qj6r7/0vmvoNrVnTpIV4zCNiX3v0f2PKMPM0gYJF3579NwRXyNIOAYdZt8jWDgE7aDfI1D00AAKB+ X6Bjq5qXAAAAAElFTkSuQmCC @@ -201,7 +201,7 @@ iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO - wAAADsABataJCQAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe + vgAADr4B6kKxwAAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe /w9vf4BVHgwypjz9P2//7/8JXXcwFIHkFu778D+44RqGHBwk9Dz5P3vfr/+dW//+dyu9jKIQJDdty/v/ /tUXcBsQ2fXo/5Rtv/6XLP37P2H63/82uWfhikFyvas//PcqPYHbgMDmh/9b174HazYu+fJfOvraf+PI ZWANILm6+e/+u+QfwG2AR9X9/yVz38E1K7r0wBWD5PKnvflvn7EdtwH2pXf/B7Y8w9AMk8ue/Pq/RcJ6 diff --git a/unimarc/unimarc/마크/Marc_Plan.cs b/unimarc/unimarc/마크/Marc_Plan.cs index 3fc4c03..101e402 100644 --- a/unimarc/unimarc/마크/Marc_Plan.cs +++ b/unimarc/unimarc/마크/Marc_Plan.cs @@ -413,17 +413,15 @@ namespace UniMarc f.BulkBooksUpdated += (s, args) => { - foreach (var kvp in args.Updates) + foreach (var fbItem in args.Updates) { - int rowIdx = kvp.Key; - string newMarc = kvp.Value; - - // Ensure rowIdx is valid + if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; + + int rowIdx = int.Parse(fbItem.Idx); if (rowIdx >= 0 && rowIdx < bs1.Count) { var mItem = (MarcPlanItem)bs1.List[rowIdx]; - mItem.Marc = newMarc; - // We might want to refresh specific rows or all, simpler to reset item or all + mItem.Marc = fbItem.BookMarc; } } bs1.ResetBindings(false); // Refresh all to reflect changes diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs index 0c7f4ca..aa3491e 100644 --- a/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs +++ b/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs @@ -76,23 +76,13 @@ namespace UniMarc if (fb.ShowDialog() == DialogResult.OK) { - // Handle results - // We don't have direct access to 'BulkMarcResults' here easily unless we iterate. - // But wait, BookUpdated event is for single update. - // Marc_Plan expects 'RequestFillBlankData' to handle the *opening*, but it doesn't handle the *return* logic for bulk updates within Marc_Plan. - // The current architecture: Marc_Plan_Sub_MarcEdit2 raises RequestFillBlankData -> Marc_Plan calls OpenFillBlank. - // So now OpenFillBlank is running. When it returns, we have data. - // We need to pass this data BACK to Marc_Plan. - // I will add a 'BulkBooksUpdated' event or reuse 'BookUpdated' (but BookUpdated is single). - // Let's create 'BulkBooksUpdated'. - - BulkBooksUpdated?.Invoke(this, new BulkBookUpdatedEventArgs { Updates = fb.BulkMarcResults }); + BulkBooksUpdated?.Invoke(this, new BulkBookUpdatedEventArgs { Updates = fb.FillBlankItems }); } } public class BulkBookUpdatedEventArgs : EventArgs { - public Dictionary Updates { get; set; } + public List Updates { get; set; } } public event EventHandler BulkBooksUpdated; diff --git a/unimarc/unimarc/마크/Marc_mkList2.cs b/unimarc/unimarc/마크/Marc_mkList2.cs index 63d8fdb..1f0ad00 100644 --- a/unimarc/unimarc/마크/Marc_mkList2.cs +++ b/unimarc/unimarc/마크/Marc_mkList2.cs @@ -382,7 +382,7 @@ namespace UniMarc foreach (MarcBookItem item in marc2.dataList) // for (int a = 0; a < marc2.List_Book.Rows.Count; a++) { bool isSuccess = true; - if (item.ForeColor == Color.Red && item.ColCheck=="V")// marc2.Check_List_V(a)) //빨간색이고 체크된거는 제외? + if (item.Status == MarcRecordStatus.None && item.ColCheck == "V") isSuccess = false; if (isSuccess) diff --git a/unimarc/unimarc/마크/Search_Infor2.cs b/unimarc/unimarc/마크/Search_Infor2.cs index 6475f5a..eb156a3 100644 --- a/unimarc/unimarc/마크/Search_Infor2.cs +++ b/unimarc/unimarc/마크/Search_Infor2.cs @@ -437,15 +437,15 @@ namespace UniMarc me.BulkBooksUpdated += (s, args) => { - foreach (var kvp in args.Updates) + foreach (var fbItem in args.Updates) { - int rowIdx = kvp.Key; - string newMarc = kvp.Value; + if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; + int rowIdx = int.Parse(fbItem.Idx); if (rowIdx >= 0 && rowIdx < bs1.Count) { var mItem = (SearchInforItem)bs1.List[rowIdx]; - mItem.Marc = newMarc; + mItem.Marc = fbItem.BookMarc; } } bs1.ResetBindings(false); @@ -675,15 +675,15 @@ namespace UniMarc me.BulkBooksUpdated += (s, args) => { - foreach (var kvp in args.Updates) + foreach (var fbItem in args.Updates) { - int rowIdx = kvp.Key; - string newMarc = kvp.Value; + if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; + int rowIdx = int.Parse(fbItem.Idx); if (rowIdx >= 0 && rowIdx < bs1.Count) { var mItem = (SearchInforItem)bs1.List[rowIdx]; - mItem.marc2 = newMarc; + mItem.marc2 = fbItem.BookMarc; } } bs1.ResetBindings(false);