diff --git a/unimarc/unimarc/마크/MacEditorParameter.cs b/unimarc/unimarc/마크/MacEditorParameter.cs
index 2a13ce4..3f2d51b 100644
--- a/unimarc/unimarc/마크/MacEditorParameter.cs
+++ b/unimarc/unimarc/마크/MacEditorParameter.cs
@@ -1,25 +1,25 @@
//using Microsoft.Office.Interop.Excel;
namespace ExcelTest
{
-
- public class MacEditorParameter
- {
- public string ISBN13 { get; set; }
- public string URL { get; set; }
- public string MarcIdx { get; set; }
- public string Grade { get; set; }
- public string User { get; set; }
- public string SaveDate { get; set; }
- public string ListIdx { get; set; }
- public string BookName { get; set; }
- public string Author { get; set; }
- public string Publisher { get; set; }
- public string Price { get; set; }
+ public class MacEditorParameter
+ {
+ public string ISBN13 { get; set; }
+ public string URL { get; set; }
+ public string MarcIdx { get; set; }
+ public string Grade { get; set; }
+ public string User { get; set; }
+ public string SaveDate { get; set; }
+ public string ListIdx { get; set; }
+
+ public string BookName { get; set; }
+ public string Author { get; set; }
+ public string Publisher { get; set; }
+ public string Price { get; set; }
public string Remark1 { get; set; }
- public string Remark2 { get; set; }
+ public string Remark2 { get; set; }
}
-
+
}
\ No newline at end of file
diff --git a/unimarc/unimarc/마크/Marc2.cs b/unimarc/unimarc/마크/Marc2.cs
index e14cf9f..60d5d4d 100644
--- a/unimarc/unimarc/마크/Marc2.cs
+++ b/unimarc/unimarc/마크/Marc2.cs
@@ -982,10 +982,6 @@ namespace ExcelTest
comboBox9.Enabled = false;
}
- private void marcEditorControl1_Load(object sender, EventArgs e)
- {
-
- }
private void button1_Click_1(object sender, EventArgs e)
{
diff --git a/unimarc/unimarc/마크/Marc2.designer.cs b/unimarc/unimarc/마크/Marc2.designer.cs
index a2efe6e..fd194ce 100644
--- a/unimarc/unimarc/마크/Marc2.designer.cs
+++ b/unimarc/unimarc/마크/Marc2.designer.cs
@@ -593,7 +593,6 @@
this.marcEditorControl1.Name = "marcEditorControl1";
this.marcEditorControl1.Size = new System.Drawing.Size(1083, 634);
this.marcEditorControl1.TabIndex = 0;
- this.marcEditorControl1.Load += new System.EventHandler(this.marcEditorControl1_Load);
//
// panel3
//
diff --git a/unimarc/unimarc/마크/MarcEditorControl.Designer.cs b/unimarc/unimarc/마크/MarcEditorControl.Designer.cs
index c093068..9c4592d 100644
--- a/unimarc/unimarc/마크/MarcEditorControl.Designer.cs
+++ b/unimarc/unimarc/마크/MarcEditorControl.Designer.cs
@@ -2377,7 +2377,6 @@
this.Font = new System.Drawing.Font("돋움", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.Name = "MarcEditorControl";
this.Size = new System.Drawing.Size(1341, 878);
- this.Load += new System.EventHandler(this.Marc_Load);
this.SizeChanged += new System.EventHandler(this.MarcEditorControl_SizeChanged);
this.panel3.ResumeLayout(false);
this.tabControl1.ResumeLayout(false);
diff --git a/unimarc/unimarc/마크/MarcEditorControl.cs b/unimarc/unimarc/마크/MarcEditorControl.cs
index 6dbf231..25d84af 100644
--- a/unimarc/unimarc/마크/MarcEditorControl.cs
+++ b/unimarc/unimarc/마크/MarcEditorControl.cs
@@ -59,9 +59,10 @@ namespace ExcelTest
public MarcEditorControl()
{
InitializeComponent();
+ Marc_Load();
}
- private void Marc_Load(object sender, EventArgs e)
+ private void Marc_Load()
{
#region ComboBox Item Setting
// 이용자 9
@@ -109,11 +110,11 @@ namespace ExcelTest
///
///
///
- public void LoadBookData(string dbMarc,MacEditorParameter _param)
+ public void LoadBookData(string dbMarc, MacEditorParameter _param)
{
mLoadCompleted = false;
Param = _param;
-
+
lbl_SaveData.Text = $"[{Param.User}] [{Param.SaveDate}]";
lbl_ISBN.Text = $"[{Param.ISBN13}]";
@@ -138,6 +139,10 @@ namespace ExcelTest
pictureBox1.Tag = _param.URL;
}
+ //그레이드값이 없다면 비활성화.
+ cb_grade.Enabled = Param.Grade != null;
+ label6.Enabled = cb_grade.Enabled;
+
richTextBox1.Text = "";
@@ -146,14 +151,14 @@ namespace ExcelTest
if (!check_Marc)
{
richTextBox1.Text = Make_Empty();
- }
+ }
else
{
etc1.Text = Param.Remark1;
etc2.Text = Param.Remark2;
//ReadRemark();
}
-
+
Create_008();
st.Color_change("▼", richTextBox1);
@@ -295,7 +300,7 @@ namespace ExcelTest
return;
}
int TabIndex = tabControl1.SelectedIndex;
-
+
if (TabIndex == 1)
{
MessageBox.Show("[칸채우기]가 아닌 [마크 편집] 탭에서 저장해주세요!");
@@ -323,7 +328,7 @@ namespace ExcelTest
string tag056 = Tag056();
string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string orimarc = st.made_Ori_marc(richTextBox1).Replace(@"\", "₩");
-
+
// 필수태그 확인
if (!isMustTag(orimarc))
{
@@ -347,7 +352,7 @@ namespace ExcelTest
#region Save_Click_Sub
-
+
///
/// 마크 오류체크 (형식체크)
///
diff --git a/unimarc/unimarc/마크/Marc_Plan.cs b/unimarc/unimarc/마크/Marc_Plan.cs
index 221e90d..2680e1c 100644
--- a/unimarc/unimarc/마크/Marc_Plan.cs
+++ b/unimarc/unimarc/마크/Marc_Plan.cs
@@ -62,9 +62,24 @@ namespace WindowsFormsApp1.Mac
{
tb_ISBN.Text = "";
- Marc_Plan_Sub_SelectList sub = new Marc_Plan_Sub_SelectList(this);
+ Marc_Plan_Sub_SelectList sub = new Marc_Plan_Sub_SelectList();
sub.TopMost = true;
- sub.Show();
+ if (sub.ShowDialog() == DialogResult.OK)
+ {
+ if (sub.ResultFileRows != null && sub.ResultFileRows.Count > 0)
+ {
+ this.dataGridView1.Rows.Clear();
+ foreach (var row in sub.ResultFileRows)
+ {
+ this.dataGridView1.Rows.Add(row);
+ }
+ }
+ else if (!string.IsNullOrEmpty(sub.ResultIdx))
+ {
+ mk_Grid(sub.ResultListName, sub.ResultDate);
+ mk_Panel(sub.ResultIdx, sub.ResultListName, sub.ResultDate);
+ }
+ }
dataGridView1.CellValueChanged += new DataGridViewCellEventHandler(dataGridView1_CellValueChanged);
}
@@ -205,6 +220,47 @@ namespace WindowsFormsApp1.Mac
}
}
+ private (string marc, MacEditorParameter p) GetBookData(int row)
+ {
+ string bookName = dataGridView1.Rows[row].Cells["book_name"].Value.ToString();
+ string author = dataGridView1.Rows[row].Cells["author"].Value.ToString();
+ string publisher = dataGridView1.Rows[row].Cells["book_comp"].Value.ToString();
+ string price = dataGridView1.Rows[row].Cells["price"].Value.ToString();
+ string isbn = dataGridView1.Rows[row].Cells["ISBN"].Value.ToString();
+ string idx = dataGridView1.Rows[row].Cells["idx"].Value.ToString();
+ string midx = dataGridView1.Rows[row].Cells["midx"].Value.ToString();
+ string marc = dataGridView1.Rows[row].Cells["marc"].Value.ToString();
+
+ string cmd = string.Format("SELECT `user`, `editDate`, `etc1`, `etc2` FROM `Specs_Marc` WHERE `idx` = \"{0}\"", midx);
+ string res = db.DB_Send_CMD_Search(cmd);
+ string[] aryResultData = res.Split('|');
+ string remark1 = "";
+ string remark2 = "";
+
+ if (aryResultData.Length > 1) {
+ // lbl_SaveData.Text = string.Format("[{0}] [{1}]", aryResultData[0], aryResultData[1]);
+ remark1 = aryResultData[2];
+ remark2 = aryResultData[3];
+ }
+
+ var p = new MacEditorParameter
+ {
+ ISBN13 = isbn,
+ ListIdx = idx,
+ MarcIdx = midx,
+ SaveDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), // temporary
+ User = main.botUserLabel.Text,
+ BookName = bookName,
+ Author = author,
+ Publisher = publisher,
+ Price = price,
+ Remark1 = remark1,
+ Remark2 = remark2,
+ Grade = null,
+ };
+ return (marc, p);
+ }
+
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
int row = e.RowIndex;
@@ -214,20 +270,19 @@ namespace WindowsFormsApp1.Mac
if (dataGridView1.Rows[row].Cells[col].ReadOnly)
{
- string[] Marc = {
- dataGridView1.Rows[row].Cells["marc"].Value.ToString(),
- dataGridView1.Rows[row].Cells["midx"].Value.ToString(),
- dataGridView1.Rows[row].Cells["num"].Value.ToString(),
- dataGridView1.Rows[row].Cells["idx"].Value.ToString(),
- dataGridView1.Rows[row].Cells["ISBN"].Value.ToString()
- };
- string[] symbol_Type = {
- cb_FirstAuthor.Text, cb_authorTypeK.Text, cb_authorTypeE.Text, cb_FirstBook.Text,
- cb_divType.Text, cb_divNum.Text
- };
-
if (chkEditorTest.Checked)
{
+ string[] Marc = {
+ dataGridView1.Rows[row].Cells["marc"].Value.ToString(),
+ dataGridView1.Rows[row].Cells["midx"].Value.ToString(),
+ dataGridView1.Rows[row].Cells["num"].Value.ToString(),
+ dataGridView1.Rows[row].Cells["idx"].Value.ToString(),
+ dataGridView1.Rows[row].Cells["ISBN"].Value.ToString()
+ };
+ string[] symbol_Type = {
+ cb_FirstAuthor.Text, cb_authorTypeK.Text, cb_authorTypeE.Text, cb_FirstBook.Text,
+ cb_divType.Text, cb_divNum.Text
+ };
Marc_Plan_Sub_MarcEdit me = new Marc_Plan_Sub_MarcEdit(this);
me.row = row;
me.UserName = main.botUserLabel.Text;
@@ -237,11 +292,81 @@ namespace WindowsFormsApp1.Mac
}
else
{
- UTIL.MsgE("test version");
- var f = new Marc_Plan_Sub_MarcEdit2("","");
+ int currentEditorRow = row;
+ string isbn = dataGridView1.Rows[row].Cells["ISBN"].Value.ToString();
+ string marcData = dataGridView1.Rows[row].Cells["marc"].Value.ToString();
+
+ var f = new Marc_Plan_Sub_MarcEdit2(isbn, marcData);
+ var data = GetBookData(currentEditorRow);
+ f.LoadBook(data.marc, data.p);
+
+ f.RequestNext += (s, args) =>
+ {
+ if (currentEditorRow < dataGridView1.RowCount - 1)
+ {
+ currentEditorRow++;
+ var nextData = GetBookData(currentEditorRow);
+ f.LoadBook(nextData.marc, nextData.p);
+
+ // Optional: Sync grid selection
+ dataGridView1.ClearSelection();
+ dataGridView1.Rows[currentEditorRow].Selected = true;
+ // Ensure visible
+ dataGridView1.FirstDisplayedScrollingRowIndex = currentEditorRow;
+ }
+ };
+
+ f.RequestPrev += (s, args) =>
+ {
+ if (currentEditorRow > 0)
+ {
+ currentEditorRow--;
+ var prevData = GetBookData(currentEditorRow);
+ f.LoadBook(prevData.marc, prevData.p);
+
+ // Optional: Sync grid selection
+ dataGridView1.ClearSelection();
+ dataGridView1.Rows[currentEditorRow].Selected = true;
+ // Ensure visible
+ dataGridView1.FirstDisplayedScrollingRowIndex = currentEditorRow;
+ }
+ };
+
+ f.BookUpdated += (s, args) =>
+ {
+ dataGridView1.Rows[currentEditorRow].Cells["book_name"].Value = args.BookName;
+ dataGridView1.Rows[currentEditorRow].Cells["marc"].Value = args.Marc;
+ };
+
+ f.RequestFillBlankData += (s, args) =>
+ {
+ var dataList = new List();
+ string currentIsbn = dataGridView1.Rows[currentEditorRow].Cells["ISBN"].Value.ToString();
+
+ for (int a = 0; a < dataGridView1.Rows.Count; a++)
+ {
+ // Criteria for "Fill Blank" candidates.
+ // Original legacy logic used Red color. Here we check if db_marc (marc column) is empty or too short.
+ string mData = dataGridView1.Rows[a].Cells["marc"].Value?.ToString() ?? "";
+ if (mData.Length < 10) // Assuming usage of "Red" roughly equates to invalid/missing MARC
+ {
+ string[] rowData = {
+ a.ToString(),
+ dataGridView1.Rows[a].Cells["ISBN"].Value?.ToString() ?? "",
+ dataGridView1.Rows[a].Cells["book_name"].Value?.ToString() ?? "",
+ dataGridView1.Rows[a].Cells["author"].Value?.ToString() ?? "",
+ dataGridView1.Rows[a].Cells["book_comp"].Value?.ToString() ?? "",
+ dataGridView1.Rows[a].Cells["price"].Value?.ToString() ?? "", // 'pay' in Marc2 might be 'price' here? Checked GetBookData: yes, price.
+ ""
+ };
+ dataList.Add(rowData);
+ }
+ }
+ f.OpenFillBlank(dataList, currentIsbn);
+ };
+
f.Show();
}
-
}
}
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.Designer.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.Designer.cs
index 30af000..89c8217 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.Designer.cs
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.Designer.cs
@@ -29,33 +29,20 @@ namespace UniMarc.마크
///
private void InitializeComponent()
{
- this.marcEditorControl1 = new ExcelTest.MarcEditorControl();
this.SuspendLayout();
//
- // marcEditorControl1
- //
- this.marcEditorControl1.BackColor = System.Drawing.Color.Gray;
- this.marcEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill;
- this.marcEditorControl1.Font = new System.Drawing.Font("돋움", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
- this.marcEditorControl1.Location = new System.Drawing.Point(0, 0);
- this.marcEditorControl1.Name = "marcEditorControl1";
- this.marcEditorControl1.Size = new System.Drawing.Size(1337, 768);
- this.marcEditorControl1.TabIndex = 1;
- //
// Marc_Plan_Sub_MarcEdit2
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1337, 768);
- this.Controls.Add(this.marcEditorControl1);
this.Name = "Marc_Plan_Sub_MarcEdit2";
this.Text = "마크편집";
+ this.Load += new System.EventHandler(this.Marc_Plan_Sub_MarcEdit2_Load);
this.ResumeLayout(false);
}
#endregion
-
- public ExcelTest.MarcEditorControl marcEditorControl1;
}
}
\ No newline at end of file
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs
index 0665a06..3f3b081 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_MarcEdit2.cs
@@ -24,11 +24,148 @@ namespace UniMarc.마크
String_Text st = new String_Text();
Search_Infor si;
Help008Tag tag008 = new Help008Tag();
+ MarcEditorControl marcEditorControl1;
public Marc_Plan_Sub_MarcEdit2(string isbn,string marcstring)
{
InitializeComponent();
db.DBcon();
+ marcEditorControl1 = new MarcEditorControl();
+ marcEditorControl1.db = this.db;
+ marcEditorControl1.FillBlankClicked += MarcEditorControl_FillBlankClicked;
+ marcEditorControl1.BookSaved += MarcEditorControl_BookSaved;
+ marcEditorControl1.NextButton += MarcEditorControl1_NextButton;
+ marcEditorControl1.PrevButton += MarcEditorControl1_PrevButton;
+ marcEditorControl1.Dock = DockStyle.Fill;
+ this.StartPosition = FormStartPosition.CenterScreen;
+ this.Controls.Add(marcEditorControl1);
+ this.KeyPreview = true;
+ this.KeyDown += (s1, e1) => {
+ if(e1.KeyCode == Keys.Escape)
+ {
+ this.Close();
+ }
+ };
+ }
+
+ public event EventHandler RequestNext;
+ public event EventHandler RequestPrev;
+
+ public class BookUpdatedEventArgs : EventArgs
+ {
+ public string BookName { get; set; }
+ public string Marc { get; set; }
+ }
+
+ public event EventHandler RequestFillBlankData;
+
+ public void OpenFillBlank(List gridData, string currentIsbn)
+ {
+ var fb = new UniMarc.Marc_FillBlank(this);
+ foreach (var rowData in gridData)
+ {
+ fb.InitFillBlank(rowData);
+ }
+ fb.ISBN = currentIsbn;
+ fb.Show();
+ }
+
+ private void MarcEditorControl_FillBlankClicked(object sender, EventArgs e)
+ {
+ RequestFillBlankData?.Invoke(this, EventArgs.Empty);
+ }
+
+
+
+ public event EventHandler BookUpdated;
+
+ private void MarcEditorControl_BookSaved(object sender, ExcelTest.MarcEditorControl.BookSavedEventArgs e)
+ {
+ // Update Specs_Marc table
+ string oriMarc = e.DBMarc;
+ string etc1 = e.griddata.Remark1 ?? "";
+ string etc2 = e.griddata.Remark2 ?? "";
+ string tag008 = e.text008;
+
+ // 등록번호 분류기호 저자기호 볼륨 복본
+ // 별치 총서명 총서번호 저자 출판사
+ // 정가 ISBN
+ string[] Search_Tag = {
+ "049l", "090a", "090b", "049v", "049c",
+ "049f", "440a", "440v", "245d", "260b",
+ "950b", "020a"
+ };
+ string[] SearchBookTag = st.Take_Tag(oriMarc, Search_Tag);
+
+ // 도서명 (본서명 = 대등서명 : 부서명)
+ string[] BookTag = { "245a", "245x", "245b" };
+ string[] BookNameTag = st.Take_Tag(oriMarc, BookTag);
+ string BookName = mk_BookName(BookNameTag);
+
+ string Table = "Specs_Marc";
+ string[] Search_Col = { "idx" };
+
+ // Current ListIdx (Wait, idx in Marc_Plan corresponds to ListIdx in Parameter?)
+ // In Marc_Plan: ListIdx = idx.
+ string listIdx = e.griddata.ListIdx;
+ string[] Search_data = { listIdx };
+
+ string[] Update_Col = {
+ "marc", "book_name", "etc1", "etc2",
+ "r_num", "class_symbol", "author_symbol", "prefix", "s_book_name1",
+ "s_book_num1", "author", "book_comp", "price", "ISBN", "tag008"
+ };
+ string[] Update_data = {
+ oriMarc, BookName, etc1, etc2,
+ SearchBookTag[0], SearchBookTag[1], SearchBookTag[2], SearchBookTag[5], SearchBookTag[6],
+ SearchBookTag[7], SearchBookTag[8], SearchBookTag[9], SearchBookTag[10], SearchBookTag[11], tag008
+ };
+
+ string cmd = db.More_Update(Table, Update_Col, Update_data, Search_Col, Search_data);
+ db.DB_Send_CMD_reVoid(cmd);
+
+ // Notify Parent
+ BookUpdated?.Invoke(this, new BookUpdatedEventArgs { BookName = BookName, Marc = oriMarc });
+
+ MessageBox.Show("저장되었습니다!");
+ }
+
+ private string mk_BookName(string[] book_name)
+ {
+ string a245 = book_name[0]; // 도서명
+ string x245 = book_name[1]; // 대동서명
+ string b245 = book_name[2]; // 부서명
+
+ string result = a245;
+
+ if (x245 != "")
+ result += " = " + x245;
+
+ if (b245 != "")
+ result += " : " + b245;
+
+ return result;
+ }
+
+ private void MarcEditorControl1_PrevButton(object sender, EventArgs e)
+ {
+ RequestPrev?.Invoke(this, EventArgs.Empty);
+ }
+
+ private void MarcEditorControl1_NextButton(object sender, EventArgs e)
+ {
+ RequestNext?.Invoke(this, EventArgs.Empty);
+ }
+
+ public void LoadBook(string dbMarc, MacEditorParameter p)
+ {
+ this.Text = $"마크편집({p.ISBN13})-{p.BookName}";
+ marcEditorControl1.LoadBookData(dbMarc, p);
+ }
+
+ private void Marc_Plan_Sub_MarcEdit2_Load(object sender, EventArgs e)
+ {
+ this.Show();
+ Application.DoEvents();
}
-
}
}
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs
index 697a539..ef5af7e 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs
@@ -219,37 +219,37 @@ namespace UniMarc.마크
//
// idx
//
- this.idx.HeaderText = "idx";
this.idx.DataPropertyName = "Idx";
+ this.idx.HeaderText = "idx";
this.idx.Name = "idx";
this.idx.Visible = false;
//
// list_name
//
- this.list_name.HeaderText = "목록명";
this.list_name.DataPropertyName = "ListName";
+ this.list_name.HeaderText = "목록명";
this.list_name.Name = "list_name";
this.list_name.Width = 500;
//
// date
//
- this.date.HeaderText = "등록일시";
this.date.DataPropertyName = "Date";
+ this.date.HeaderText = "등록일시";
this.date.Name = "date";
this.date.Width = 130;
//
// user
//
- this.user.HeaderText = "등록자";
this.user.DataPropertyName = "User";
+ this.user.HeaderText = "등록자";
this.user.Name = "user";
this.user.Width = 80;
//
// colCheck
//
+ this.colCheck.DataPropertyName = "ColCheck";
this.colCheck.FalseValue = "F";
this.colCheck.HeaderText = "V";
- this.colCheck.DataPropertyName = "ColCheck";
this.colCheck.IndeterminateValue = "F";
this.colCheck.Name = "colCheck";
this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True;
@@ -431,6 +431,7 @@ namespace UniMarc.마크
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Marc_Plan_Sub_SelectList";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "마크정리_목록선택";
this.Load += new System.EventHandler(this.Marc_Plan_Sub_SelectList_Load);
this.panel1.ResumeLayout(false);
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs
index 22e12c6..7b6cb47 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs
@@ -16,11 +16,15 @@ namespace UniMarc.마크
{
Helper_DB db = new Helper_DB();
string compidx;
- Marc_Plan mp;
- public Marc_Plan_Sub_SelectList(Marc_Plan _mp)
+
+ public string ResultIdx { get; private set; }
+ public string ResultListName { get; private set; }
+ public string ResultDate { get; private set; }
+ public List ResultFileRows { get; private set; }
+
+ public Marc_Plan_Sub_SelectList()
{
InitializeComponent();
- mp = _mp;
compidx = Properties.Settings.Default.compidx;
}
@@ -75,12 +79,13 @@ namespace UniMarc.마크
{
List dataList = new List();
string[] grid = { "", "", "", "", "F" };
- for(int a = 0; a < ary.Length; a++)
+ for (int a = 0; a < ary.Length; a++)
{
if (a % 4 == 0) grid[0] = ary[a];
if (a % 4 == 1) grid[1] = ary[a];
if (a % 4 == 2) grid[2] = ary[a];
- if (a % 4 == 3) {
+ if (a % 4 == 3)
+ {
grid[3] = ary[a];
MarcPlanItem item = new MarcPlanItem
@@ -106,7 +111,8 @@ namespace UniMarc.마크
string name = ((Button)sender).Text;
int[] CheckRow = CheckIndex();
- if (CheckRow.Length != 1) {
+ if (CheckRow.Length != 1)
+ {
MessageBox.Show("처리할 목록 [1]개 선택하여 주세요.");
return;
}
@@ -116,7 +122,7 @@ namespace UniMarc.마크
string msg = string.Format("【{0}】을(를) {1} 하시겠습니까?", dataGridView1.Rows[row].Cells["list_name"].Value.ToString(), name);
if (MessageBox.Show(msg, name, MessageBoxButtons.OKCancel) == DialogResult.Cancel)
return;
-
+
string[] search_col = { "idx", "work_list", "date" };
string[] update_col = { "state" };
string[] search_data = {
@@ -140,7 +146,8 @@ namespace UniMarc.마크
{
int[] CheckRow = CheckIndex();
- if (CheckRow.Length != 1) {
+ if (CheckRow.Length != 1)
+ {
MessageBox.Show("수정할 목록 [1]개 선택하여 주세요.");
return;
}
@@ -158,7 +165,8 @@ namespace UniMarc.마크
{
int[] CheckRow = CheckIndex();
- if (CheckRow.Length < 2) {
+ if (CheckRow.Length < 2)
+ {
MessageBox.Show("병합할 목록 [2]개이상 선택하여 주세요.");
return;
}
@@ -186,7 +194,8 @@ namespace UniMarc.마크
{
int[] CheckRow = CheckIndex();
- if (CheckRow.Length != 1) {
+ if (CheckRow.Length != 1)
+ {
MessageBox.Show("삭제할 목록 [1]개 선택하여 주세요.");
return;
}
@@ -240,27 +249,29 @@ namespace UniMarc.마크
OpenFileDialog OpenFileDialog = new OpenFileDialog();
if (OpenFileDialog.ShowDialog() == DialogResult.OK)
{
- mp.dataGridView1.Rows.Clear();
- string filePath = OpenFileDialog.FileName;
- try
+ if (OpenFileDialog.ShowDialog() == DialogResult.OK)
{
- System.IO.StreamReader r = new System.IO.StreamReader(filePath, Encoding.Default);
- InputGridByFileData(r.ReadToEnd());
- r.Close();
- }
- catch (Exception ex)
- {
- MessageBox.Show(ex.ToString());
+ //mp.dataGridView1.Rows.Clear(); // Decoupled
+ string filePath = OpenFileDialog.FileName;
+ try
+ {
+ System.IO.StreamReader r = new System.IO.StreamReader(filePath, Encoding.Default);
+ InputGridByFileData(r.ReadToEnd());
+ r.Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
}
}
}
-
#region OpenFileSub
void InputGridByFileData(string text)
{
String_Text st = new String_Text();
-
+
string[] grid = text.Split('');
for (int a = 0; a < grid.Length - 1; a++)
{
@@ -270,14 +281,15 @@ namespace UniMarc.마크
// ISBN, 도서명, 총서명1, 총서번호1, 총서명2, 총서번호2, 출판사, 정가, 저자
"020a", "245a", "440a", "440v", "490a", "490v", "260b", "950b", "245d" };
string[] Search_Res = st.Take_Tag(grid[a], Search);
-
+
string[] Author_Search = { "100a", "110a", "111a" };
string[] Author_Res = st.Take_Tag(grid[a], Author_Search);
string author_Fin = Search_Res[14];
foreach (string author in Author_Res)
{
- if (author != "") {
+ if (author != "")
+ {
author_Fin = author;
break;
}
@@ -294,10 +306,13 @@ namespace UniMarc.마크
author_Fin, Search_Res[12], Search_Res[13], "", grid[a],
// 검색태그
"", "T" };
- mp.dataGridView1.Rows.Add(AddGrid);
- this.Close();
+ if (ResultFileRows == null) ResultFileRows = new List();
+ ResultFileRows.Add(AddGrid);
+ //mp.dataGridView1.Rows.Add(AddGrid);
}
+ this.DialogResult = DialogResult.OK;
}
+
#endregion
private void btn_Close_Click(object sender, EventArgs e)
@@ -307,12 +322,14 @@ namespace UniMarc.마크
private void cb_gu_SelectedIndexChanged(object sender, EventArgs e)
{
- if (cb_gu.SelectedIndex == 0) {
+ if (cb_gu.SelectedIndex == 0)
+ {
btn_Progress.Enabled = false;
btn_Complite.Enabled = true;
btn_Search_Click(null, e);
}
- else {
+ else
+ {
btn_Complite.Enabled = false;
btn_Progress.Enabled = true;
btn_Search_Click(null, e);
@@ -331,8 +348,13 @@ namespace UniMarc.마크
string list_name = dataGridView1.Rows[row].Cells["list_name"].Value.ToString();
string date = dataGridView1.Rows[row].Cells["date"].Value.ToString();
- mp.mk_Grid(list_name, date);
- mp.mk_Panel(idx, list_name, date);
+ ResultIdx = idx;
+ ResultListName = list_name;
+ ResultDate = date;
+ this.DialogResult = DialogResult.OK;
+
+ //mp.mk_Grid(list_name, date);
+ //mp.mk_Panel(idx, list_name, date);
this.Close();
}
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.resx b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.resx
index ad4ad3d..83cb40e 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.resx
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.resx
@@ -139,7 +139,7 @@
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
- vQAADr0BR/uQrQAAAVdJREFUOE/Nz0tLAmEUBmB3kWRoCUVEISFUJGb1OywiKrDsIpZdkJAkDUvD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