diff --git a/unimarc/unimarc/Properties/AssemblyInfo.cs b/unimarc/unimarc/Properties/AssemblyInfo.cs index 5f1ffc0..7c8d023 100644 --- a/unimarc/unimarc/Properties/AssemblyInfo.cs +++ b/unimarc/unimarc/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를 // 기본값으로 할 수 있습니다. // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2026.01.09.2120")] -[assembly: AssemblyFileVersion("2026.01.09.2120")] +[assembly: AssemblyVersion("2026.01.15.2015")] +[assembly: AssemblyFileVersion("2026.01.15.2015")] diff --git a/unimarc/unimarc/마크/Marc.cs b/unimarc/unimarc/마크/Marc.cs index d3f2e74..82650a6 100644 --- a/unimarc/unimarc/마크/Marc.cs +++ b/unimarc/unimarc/마크/Marc.cs @@ -435,11 +435,11 @@ namespace ExcelTest MessageBox.Show("[칸채우기]가 아닌 [마크 편집] 탭에서 저장해주세요!"); return; } - if (grade == 3) - { - MessageBox.Show("등급을 설정해주세요. (C 이상)"); - return; - } + //if (grade == 3) + //{ + // MessageBox.Show("등급을 설정해주세요. (C 이상)"); + // return; + //} string table_name = "Marc"; string BaseText = richTextBox1.Text; string lblisbn = lbl_ISBN.Text.Replace("[", "").Replace("]", ""); @@ -455,9 +455,11 @@ namespace ExcelTest if (BaseText.IndexOf(lblisbn) < 0) { - MessageBox.Show("ISBN 상태를 확인해주세요."); + var dlg = UTIL.MsgQ("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다\n그래도 저장 할까요?"); + if (dlg != DialogResult.Yes) return; return; } + string tag056 = Tag056(); string[] grid_data = { List_Book.Rows[SaveRowIdx].Cells["ISBN13"].Value.ToString(), @@ -469,6 +471,7 @@ namespace ExcelTest string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string orimarc = st.made_Ori_marc(richTextBox1).Replace(@"\", "₩"); string Midx = List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value.ToString(); + // 필수태그 확인 if (!isMustTag(orimarc)) { @@ -485,24 +488,11 @@ namespace ExcelTest // 마지막 수정일로부터 2일이 지났는지, 마지막 저장자가 사용자인지 확인 TimeSpan sp = spspsp(SaveDate, date); IsCoverDate = IsCoverData(sp.Days, SaveUser); - - // if (IsCoverDate) { - // etc2.Text = etc2.Text.Replace(SaveDate, date); - // } - // else { - // etc2.Text += string.Format("{0}\t{1}\n", date, mUserName); - // } } - //else - //{ - // etc2.Text += string.Format("{0}\t{1}\n", date, mUserName); - //} // true일 경우 INSERT, false일 경우 UPDATE - bool isNewData = true; + bool isNewData = Midx != "" ? false : true; - if (Midx != "") - isNewData = false; if (List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor == Color.Orange || List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor == Color.Red) @@ -540,36 +530,7 @@ namespace ExcelTest MessageBox.Show("ISBN 데이터가 없습니다."); return; } - //if (grid_data[0] != null && grid_data[0] != "") - //{ - // int marcChk = Sub_marc_chk(grid_data[0]); - // if (IsCoverDate) - // marcChk--; - // switch (marcChk) - // { - // case 0: - // Edit_tbl[1] = "marc1"; - // Edit_tbl[2] = "marc_chk1"; - // Edit_tbl[3] = "marc_chk"; - // break; - // case 1: - // Edit_tbl[1] = "marc2"; - // Edit_tbl[2] = "marc_chk2"; - // Edit_tbl[3] = "marc_chk1"; - // break; - // case 2: - // Edit_tbl[1] = "marc"; - // Edit_tbl[2] = "marc_chk"; - // Edit_tbl[3] = "marc_chk2"; - // break; - // default: - // Edit_tbl[1] = "marc"; - // Edit_tbl[2] = "marc_chk"; - // Edit_tbl[3] = "marc_chk2"; - // break; - // } - //} 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, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " "))); db.DB_Send_CMD_reVoid(U_cmd); @@ -2266,6 +2227,7 @@ namespace ExcelTest str = str.Trim(); if (TagNum == "300a") { + //gu = new char[] { ',', '=', ':', ';', '/', '+', ' ' }; gu = new char[] { '.', ',', '=', ':', ';', '/', '+', ' ' }; for (int i = 0; i < gu.Length; i++) { diff --git a/unimarc/unimarc/마크/Marc2.cs b/unimarc/unimarc/마크/Marc2.cs index b01a002..0d96b32 100644 --- a/unimarc/unimarc/마크/Marc2.cs +++ b/unimarc/unimarc/마크/Marc2.cs @@ -1,6 +1,7 @@ //using Microsoft.Office.Interop.Excel; using AR; using OpenQA.Selenium.DevTools.V136.Animation; +using Org.BouncyCastle.Asn1.CryptoPro; using System; using System.Collections.Generic; using System.Drawing; @@ -44,6 +45,13 @@ namespace ExcelTest String_Text st = new String_Text(); Mac_List ml; + //목록다시불러오기를 위해서 임시로 추가 + string p_lidx = ""; + string p_value = ""; + string p_cidx = ""; + string p_cust = ""; + string p_name = ""; + public Marc2() { InitializeComponent(); @@ -74,6 +82,15 @@ namespace ExcelTest comboBox8.SelectedIndex = 0; } + public void input_list() + { + var dlg = UTIL.MsgQ("데이터베이스 내용을 다시 불러옵니다\n저장되지 않은 사항은 손실됩니다.다시 불러올까요?"); + if (dlg != DialogResult.Yes) return; + input_list(p_lidx, p_value, p_cidx, p_cust, p_name); + } + + + /// /// 가져온 목록을 책목록과 연동하여 Grid에 집어넣음. /// @@ -81,7 +98,14 @@ namespace ExcelTest /// 목록명 public void input_list(string l_idx, string value, string C_idx, string custidx, string custname) { + p_lidx = l_idx; + p_value = value; + p_cidx = C_idx; + p_cust = custidx; + p_name = custname; + db.DBcon(); + this.List_Book.Rows.Clear(); if (value.isEmpty() == false) { if (value.IndexOf("]") != -1) @@ -330,7 +354,7 @@ namespace ExcelTest marcEditorControl1.LoadBookData(isbn13, bookName, author, publisher, price, url, marcIdx, dbMarc, grade, user, saveDate, listIdx); } - + bool check_V(int row, int col) { string name = List_Book.Columns[col].Name; @@ -457,24 +481,132 @@ namespace ExcelTest private void MarcEditorControl_BookSaved(object sender, ExcelTest.MarcEditorControl.BookSavedEventArgs e) { - if (SaveRowIdx >= 0 && SaveRowIdx < List_Book.Rows.Count) - { - string currentListIdx = List_Book.Rows[SaveRowIdx].Cells["list_idx"].Value?.ToString(); - // If list_idx column name differs, check input_list. Assuming "list_idx" or "idx". - // In input_list: grid[0] = db_data[a]; (idx). - // And MarcEditorControl uses "list_idx" passed from List_Book_SelectionChanged. - // We need to match what we passed. + string table_name = "Marc"; - // Just update based on SaveRowIdx for now, assuming modal blocking or single user interaction. - List_Book.Rows[SaveRowIdx].Cells["grade"].Value = e.Grade; - List_Book.Rows[SaveRowIdx].Cells["SaveDate"].Value = e.SaveDate; - List_Book.Rows[SaveRowIdx].Cells["user"].Value = e.User; - List_Book.Rows[SaveRowIdx].Cells["db_marc"].Value = e.DBMarc; - List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value = e.MarcIdx; - List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor = SetGradeColor(e.Grade); + //string[] grid_data = { + // e.griddata[0],// List_Book.Rows[SaveRowIdx].Cells["ISBN13"].Value.ToString(), + // e.griddata[1],//List_Book.Rows[SaveRowIdx].Cells["book_name"].Value.ToString(), + // e.griddata[2],//List_Book.Rows[SaveRowIdx].Cells["author"].Value.ToString(), + // e.griddata[3],//List_Book.Rows[SaveRowIdx].Cells["book_comp"].Value.ToString(), + // e.griddata[4],//List_Book.Rows[SaveRowIdx].Cells["pay"].Value.ToString(), + // e.griddata[5]//List_Book.Rows[SaveRowIdx].Cells["url"].Value.ToString() + //}; + string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + string orimarc = e.DBMarc;// st.made_Ori_marc(richTextBox1).Replace(@"\", "₩"); + string Midx = List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value.ToString(); + + string SaveDate = List_Book.Rows[SaveRowIdx].Cells["SaveDate"].Value.ToString(); + string SaveUser = List_Book.Rows[SaveRowIdx].Cells["user"].Value.ToString(); + bool IsCoverDate = false; + + + if (SaveDate != "") + { + // 마지막 수정일로부터 2일이 지났는지, 마지막 저장자가 사용자인지 확인 + TimeSpan sp = spspsp(SaveDate, date); + IsCoverDate = IsCoverData(sp.Days, SaveUser); } + + // true일 경우 INSERT, false일 경우 UPDATE + bool isNewData = Midx != "" ? false : true; + + + if (List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor == Color.Orange || + List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor == Color.Red) + { + string[] Insert_tbl = { + "ISBN", "서명", "저자", "출판사", + "가격", "marc", "비고1", "비고2", "url", + "grade", "marc_chk", "user", "division", "008tag", + "date", "compidx" }; + string[] Insert_col = { + e.griddata[0], e.griddata[1], e.griddata[2], e.griddata[3], + e.griddata[4], orimarc, e.etc1, e.etc2, e.griddata[5], + e.Grade, "1", mUserName, e.tag056, e.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, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, Incmd)); + db.DB_Send_CMD_reVoid(Incmd); + isNewData = true; + } + else + { + string[] Edit_tbl = { + "compidx", "marc", "marc_chk", "marc1", "marc_chk1", "비고1", + "비고2", "url", "division", "008tag", "date", + "user", "grade" }; + string[] Edit_col = { + mCompidx, orimarc, "1", mOldMarc , "0", e.etc1, + e.etc2, e.griddata[5], e.tag056,e.text008, date, + mUserName, e.Grade }; + string[] Sear_tbl = { "idx", "compidx" }; + string[] Sear_col = { Midx, mCompidx }; + if (e.griddata[0] == null || e.griddata[0] == "") + { + 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, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " "))); + db.DB_Send_CMD_reVoid(U_cmd); + isNewData = false; + } + + List_Book.Rows[SaveRowIdx].Cells["grade"].Value = e.Grade; + List_Book.Rows[SaveRowIdx].Cells["SaveDate"].Value = e.SaveDate; + List_Book.Rows[SaveRowIdx].Cells["user"].Value = e.User; + List_Book.Rows[SaveRowIdx].Cells["db_marc"].Value = e.DBMarc; + + List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor = SetGradeColor(grade.ToString()); + + if (isNewData) + { + string MidxQuery = string.Format("SELECT `idx` FROM Marc WHERE isbn = {0} AND `compidx` = {1};", e.griddata[0], mCompidx); + PUB.log.Add("MarcInsert", string.Format("{0}({1}) : {2}", mUserName, mCompidx, MidxQuery)); + Midx = db.DB_Send_CMD_Search(MidxQuery).Replace("|", ""); + List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value = Midx; + } + + string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND 'compidx' ={2};", + Midx, List_Book.Rows[SaveRowIdx].Cells["list_idx"].Value.ToString(), mCompidx); + PUB.log.Add("MarcUpdate", string.Format("{0}({1}) : {2}", mUserName, mCompidx, UpdateListIndex)); + db.DB_Send_CMD_reVoid(UpdateListIndex); + MessageBox.Show("저장되었습니다!"); + + } + #region Save_Click_Sub + + /// + /// 마크 저장시 사용하며, 마지막 수정일과 수정자를 가져와 덮어씌울지 백업데이터를 만들지 구분 + /// + /// 저장할 마크의 마지막 수정일 + /// 저장할 마크의 마지막 수정자 + /// 마지막 수정일로부터 2일이 지나지않고, 마지막 수정자와 해당 유저가 동일 할 경우 true 반환 + private bool IsCoverData(int TimeSpanDaysValue, string user) + { + if (TimeSpanDaysValue < -1) + return false; + if (user != mUserName) + return false; + + return true; + } + + private TimeSpan spspsp(string LastDate, string SaveDate) + { + DateTime date1 = Convert.ToDateTime(LastDate); + DateTime date2 = Convert.ToDateTime(SaveDate); + + TimeSpan result = date1 - date2; + return result; + } + + #endregion + private void MarcEditorControl_FillBlankClicked(object sender, EventArgs e) { if (List_Book.CurrentRow == null) return; @@ -509,9 +641,9 @@ namespace ExcelTest fb.Show(); } - - + + private void btn_mk_marcList_Click(object sender, EventArgs e) { @@ -652,7 +784,7 @@ namespace ExcelTest return true; } - + private void btn_FilterReturn_Click(object sender, EventArgs e) { rb_Filter.Checked = false; @@ -747,7 +879,7 @@ namespace ExcelTest private void Marc2_SizeChanged(object sender, EventArgs e) { - // this.toolStripStatusLabel1.Text = $"{this.Size}"; + // this.toolStripStatusLabel1.Text = $"{this.Size}"; } private void rb_Sort_CheckedChanged(object sender, EventArgs e) @@ -777,6 +909,15 @@ namespace ExcelTest comboBox9.Enabled = false; } - + private void marcEditorControl1_Load(object sender, EventArgs e) + { + + } + + private void button1_Click_1(object sender, EventArgs e) + { + //re load data + input_list(); + } } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/Marc2.designer.cs b/unimarc/unimarc/마크/Marc2.designer.cs index 68b75f6..8cbe6a6 100644 --- a/unimarc/unimarc/마크/Marc2.designer.cs +++ b/unimarc/unimarc/마크/Marc2.designer.cs @@ -73,10 +73,10 @@ this.btCopy = new System.Windows.Forms.Button(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.lbl_BookList = new System.Windows.Forms.ToolStripStatusLabel(); - this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.btClose = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); + this.button1 = new System.Windows.Forms.Button(); this.marcEditorControl1 = new ExcelTest.MarcEditorControl(); label31 = new System.Windows.Forms.Label(); label30 = new System.Windows.Forms.Label(); @@ -170,7 +170,6 @@ this.List_Book.AllowDrop = true; this.List_Book.AllowUserToAddRows = false; this.List_Book.AllowUserToDeleteRows = false; - this.List_Book.AllowUserToResizeColumns = false; this.List_Book.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); @@ -477,9 +476,9 @@ // this.tbCustName.BackColor = System.Drawing.Color.LightGray; this.tbCustName.Font = new System.Drawing.Font("굴림체", 14.25F, System.Drawing.FontStyle.Bold); - this.tbCustName.Location = new System.Drawing.Point(5, 6); + this.tbCustName.Location = new System.Drawing.Point(115, 6); this.tbCustName.Name = "tbCustName"; - this.tbCustName.Size = new System.Drawing.Size(385, 26); + this.tbCustName.Size = new System.Drawing.Size(275, 26); this.tbCustName.TabIndex = 33; this.tbCustName.Text = " "; this.tbCustName.UseVisualStyleBackColor = false; @@ -514,8 +513,7 @@ this.statusStrip1.Font = new System.Drawing.Font("굴림체", 14.25F, System.Drawing.FontStyle.Bold); this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.lbl_BookList, - this.toolStripStatusLabel1}); + this.lbl_BookList}); this.statusStrip1.Location = new System.Drawing.Point(0, 634); this.statusStrip1.Name = "statusStrip1"; this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 12, 0); @@ -529,12 +527,6 @@ this.lbl_BookList.Size = new System.Drawing.Size(119, 19); this.lbl_BookList.Text = "{booklist}"; // - // toolStripStatusLabel1 - // - this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; - this.toolStripStatusLabel1.Size = new System.Drawing.Size(240, 19); - this.toolStripStatusLabel1.Text = "toolStripStatusLabel1"; - // // btClose // this.btClose.Location = new System.Drawing.Point(460, 6); @@ -558,6 +550,7 @@ // panel3 // this.panel3.BackColor = System.Drawing.Color.White; + this.panel3.Controls.Add(this.button1); this.panel3.Controls.Add(this.checkBox3); this.panel3.Controls.Add(this.tbCustName); this.panel3.Controls.Add(this.panel1); @@ -571,6 +564,16 @@ this.panel3.Size = new System.Drawing.Size(555, 634); this.panel3.TabIndex = 325; // + // button1 + // + this.button1.Location = new System.Drawing.Point(9, 7); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(100, 23); + this.button1.TabIndex = 324; + this.button1.Text = "다시불러오기"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click_1); + // // marcEditorControl1 // this.marcEditorControl1.BackColor = System.Drawing.Color.Gray; @@ -592,6 +595,7 @@ 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); // // Marc2 // @@ -661,6 +665,6 @@ private System.Windows.Forms.Button btClose; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Panel panel3; - private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1; + private System.Windows.Forms.Button button1; } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/MarcEditorControl.cs b/unimarc/unimarc/마크/MarcEditorControl.cs index 7123e1c..66fdfe8 100644 --- a/unimarc/unimarc/마크/MarcEditorControl.cs +++ b/unimarc/unimarc/마크/MarcEditorControl.cs @@ -1,5 +1,6 @@ //using Microsoft.Office.Interop.Excel; using AR; +using Microsoft.VisualBasic.ApplicationServices; using System; using System.Collections.Generic; using System.Drawing; @@ -50,7 +51,7 @@ namespace ExcelTest public string CurrentUser { get; set; } public string CurrentSaveDate { get; set; } public string CurrentListIdx { get; set; } - + public MarcEditorControl() { InitializeComponent(); @@ -220,11 +221,12 @@ namespace ExcelTest CurrentSaveDate = saveDate; CurrentListIdx = listIdx; + lbl_SaveData.Text = $"[{user}] [{saveDate}]"; lbl_ISBN.Text = $"[{CurrentISBN13}]"; - + // Update data_book for Create_008 or Empty logic data_book[0] = CurrentISBN13; - data_book[1] = CurrentBookName; + data_book[1] = CurrentBookName; data_book[2] = CurrentAuthor; data_book[3] = CurrentPublisher; data_book[4] = CurrentPrice; @@ -252,7 +254,7 @@ namespace ExcelTest else IsMyData = CheckOwner(CurrentMarcIdx); - + } private bool CheckOwner(string marcIdx) @@ -419,6 +421,11 @@ namespace ExcelTest public string User { get; set; } public string DBMarc { get; set; } public string MarcIdx { get; set; } + public string etc1 { get; set; } //remark1 + public string etc2 { get; set; } //remark2 + public string tag056 { get; set; } + public string text008 { get; set; } + public string[] griddata { get; set; } } public event EventHandler BookSaved; @@ -438,11 +445,11 @@ namespace ExcelTest MessageBox.Show("[칸채우기]가 아닌 [마크 편집] 탭에서 저장해주세요!"); return; } - if (grade == 3) - { - MessageBox.Show("등급을 설정해주세요. (C 이상)"); - return; - } + //if (grade == 3) + //{ + // MessageBox.Show("등급을 설정해주세요. (C 이상)"); + // return; + //} string table_name = "Marc"; string BaseText = richTextBox1.Text; string lblisbn = CurrentISBN13; // lbl_ISBN.Text.Replace("[", "").Replace("]", ""); @@ -456,10 +463,12 @@ namespace ExcelTest return; } + //ISBN이 변경되었다면 저장하지 못하게 한다 if (BaseText.IndexOf(lblisbn) < 0) { - MessageBox.Show("ISBN 상태를 확인해주세요."); - return; + var dlg = UTIL.MsgQ("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다\n그래도 저장 할까요?"); + if (dlg != DialogResult.Yes) return; + //return; } string tag056 = Tag056(); string[] grid_data = { @@ -491,67 +500,64 @@ namespace ExcelTest } // true일 경우 INSERT, false일 경우 UPDATE - bool isNewData = true; + bool isNewData = Midx != "" ? false : true; - if (Midx != "") - isNewData = false; + //// If not my data, or no data (implied by Midx check but explicit check helps), force Insert (Copy) + //if (!IsMyData) + //{ + // string[] Insert_tbl = { + // "ISBN", "서명", "저자", "출판사", + // "가격", "marc", "비고1", "비고2", "url", + // "grade", "marc_chk", "user", "division", "008tag", + // "date", "compidx" }; + // string[] Insert_col = { + // grid_data[0], grid_data[1], grid_data[2], grid_data[3], + // grid_data[4], orimarc, etc1.Text, etc2.Text, grid_data[5], + // grade.ToString(), "1", mUserName, tag056, text008.Text, + // date, mCompidx }; - // If not my data, or no data (implied by Midx check but explicit check helps), force Insert (Copy) - if (!IsMyData) - { - string[] Insert_tbl = { - "ISBN", "서명", "저자", "출판사", - "가격", "marc", "비고1", "비고2", "url", - "grade", "marc_chk", "user", "division", "008tag", - "date", "compidx" }; - string[] Insert_col = { - grid_data[0], grid_data[1], grid_data[2], grid_data[3], - grid_data[4], orimarc, etc1.Text, etc2.Text, grid_data[5], - grade.ToString(), "1", mUserName, tag056, text008.Text, - date, mCompidx }; + // string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col); + // PUB.log.Add("INSERT", string.Format("{0}({1}) : {2}", mUserName, mCompidx, Incmd)); + // db.DB_Send_CMD_reVoid(Incmd); + // isNewData = true; + //} + //else + //{ + // string[] Edit_tbl = { + // "compidx", "marc", "marc_chk", "marc1", "marc_chk1", "비고1", + // "비고2", "url", "division", "008tag", "date", + // "user", "grade" }; + // string[] Edit_col = { + // mCompidx, orimarc, "1", CurrentDBMarc , "0", etc1.Text, + // etc2.Text, grid_data[5], tag056, text008.Text, date, + // mUserName, grade.ToString() }; + // string[] Sear_tbl = { "idx", "compidx" }; + // string[] Sear_col = { Midx, mCompidx }; + // if (grid_data[0] == null || grid_data[0] == "") + // { + // MessageBox.Show("ISBN 데이터가 없습니다."); + // return; + // } - string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col); - PUB.log.Add("INSERT", string.Format("{0}({1}) : {2}", mUserName, mCompidx, Incmd)); - db.DB_Send_CMD_reVoid(Incmd); - isNewData = true; - } - else - { - string[] Edit_tbl = { - "compidx", "marc", "marc_chk", "marc1", "marc_chk1", "비고1", - "비고2", "url", "division", "008tag", "date", - "user", "grade" }; - string[] Edit_col = { - mCompidx, orimarc, "1", CurrentDBMarc , "0", etc1.Text, - etc2.Text, grid_data[5], tag056, text008.Text, date, - mUserName, grade.ToString() }; - string[] Sear_tbl = { "idx", "compidx" }; - string[] Sear_col = { Midx, mCompidx }; - if (grid_data[0] == null || grid_data[0] == "") - { - 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}", mUserName, mCompidx, U_cmd.Replace("\r", " ").Replace("\n", " "))); - db.DB_Send_CMD_reVoid(U_cmd); - isNewData = false; - } + // 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}", mUserName, mCompidx, U_cmd.Replace("\r", " ").Replace("\n", " "))); + // db.DB_Send_CMD_reVoid(U_cmd); + // isNewData = false; + //} - if (isNewData) - { - string MidxQuery = string.Format("SELECT `idx` FROM Marc WHERE isbn = {0} AND `compidx` = {1};", grid_data[0], mCompidx); - PUB.log.Add("MarcInsert", string.Format("{0}({1}) : {2}", mUserName, mCompidx, MidxQuery)); - Midx = db.DB_Send_CMD_Search(MidxQuery).Replace("|", ""); - CurrentMarcIdx = Midx; // Update local - } + //if (isNewData) + //{ + // string MidxQuery = string.Format("SELECT `idx` FROM Marc WHERE isbn = {0} AND `compidx` = {1};", grid_data[0], mCompidx); + // PUB.log.Add("MarcInsert", string.Format("{0}({1}) : {2}", mUserName, mCompidx, MidxQuery)); + // Midx = db.DB_Send_CMD_Search(MidxQuery).Replace("|", ""); + // CurrentMarcIdx = Midx; // Update local + //} + + //string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND 'compidx' ={2};", + // Midx, CurrentListIdx, mCompidx); + //PUB.log.Add("MarcUpdate", string.Format("{0}({1}) : {2}", mUserName, mCompidx, UpdateListIndex)); + //db.DB_Send_CMD_reVoid(UpdateListIndex); - string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND 'compidx' ={2};", - Midx, CurrentListIdx, mCompidx); - PUB.log.Add("MarcUpdate", string.Format("{0}({1}) : {2}", mUserName, mCompidx, UpdateListIndex)); - db.DB_Send_CMD_reVoid(UpdateListIndex); - // Raise Event to Update List_Book in Parent BookSaved?.Invoke(this, new BookSavedEventArgs { @@ -560,10 +566,15 @@ namespace ExcelTest SaveDate = date, User = mUserName, DBMarc = orimarc, - MarcIdx = Midx + MarcIdx = Midx, + etc1 = etc1.Text, + etc2 = etc2.Text, + tag056 = tag056, + text008 = text008.Text, + griddata = grid_data }); - MessageBox.Show("저장되었습니다!"); + } #region Save_Click_Sub @@ -871,7 +882,7 @@ namespace ExcelTest void OnSaveData(int row) { - + } void ReadRemark() { @@ -962,10 +973,10 @@ namespace ExcelTest void Save_data() { data_book[0] = CurrentISBN13; - data_book[1] = CurrentBookName; + data_book[1] = CurrentBookName; data_book[2] = CurrentAuthor; data_book[3] = CurrentPublisher; - data_book[4] = CurrentPrice; + data_book[4] = CurrentPrice; } void input_picture() { @@ -2025,7 +2036,8 @@ namespace ExcelTest str = str.Trim(); if (TagNum == "300a") { - gu = new char[] { '.', ',', '=', ':', ';', '/', '+', ' ' }; + gu = new char[] { ',', '=', ':', ';', '/', '+', ' ' }; + //gu = new char[] { '.', ',', '=', ':', ';', '/', '+', ' ' }; for (int i = 0; i < gu.Length; i++) { str = str.TrimEnd(gu[i]); @@ -2784,19 +2796,19 @@ namespace ExcelTest string result = Text; if (result.IndexOf(", ") > -1) - return result + " p."; + return result + "p."; if (result.IndexOf("p.p.") > -1 || result.IndexOf("p. p.") > -1) return result.Replace("p.p.", "p.").Replace("p. p.", "p."); if (Regex.IsMatch(result, @"^[0-9]+$")) - return result + " p."; + return result + "p."; if (!result.StartsWith("[") && !result.EndsWith("]")) return result; else if (Regex.IsMatch(GetMiddelString(result, "[", "]"), @"^[0-9]+$")) { string tTest = GetMiddelString(result, "[", "]"); - return result.Replace("p", "").Trim() + " p."; ; + return result.Replace("p", "").Trim() + "p."; ; } diff --git a/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs b/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs index 82c3879..9efa10f 100644 --- a/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs +++ b/unimarc/unimarc/마크/Marc_FillBlank.Designer.cs @@ -301,6 +301,7 @@ namespace UniMarc this.Controls.Add(this.panel2); this.Name = "Marc_FillBlank"; this.Text = "칸채우기"; + this.WindowState = System.Windows.Forms.FormWindowState.Maximized; this.Load += new System.EventHandler(this.Marc_FillBlank_Load); this.panel6.ResumeLayout(false); this.panel6.PerformLayout(); diff --git a/unimarc/unimarc/마크/Zoom_Picture.cs b/unimarc/unimarc/마크/Zoom_Picture.cs index e0e3ffc..7565f4d 100644 --- a/unimarc/unimarc/마크/Zoom_Picture.cs +++ b/unimarc/unimarc/마크/Zoom_Picture.cs @@ -28,6 +28,7 @@ namespace UniMarc.마크 string.Format("http://preview.kyobobook.co.kr/preview.jsp?siteGb=INK&ejkGb=KOR&barcode={0}&loginYn=N&orderClick=JAW", ISBN); + webBrowser1.ScriptErrorsSuppressed = true; webBrowser1.Navigate(PreViewURL); }