diff --git a/unimarc/unimarc/마크/AddMarc2.Designer.cs b/unimarc/unimarc/마크/AddMarc2.Designer.cs index 67fe282..33593b7 100644 --- a/unimarc/unimarc/마크/AddMarc2.Designer.cs +++ b/unimarc/unimarc/마크/AddMarc2.Designer.cs @@ -42,6 +42,7 @@ namespace UniMarc this.rtEtc1 = new System.Windows.Forms.RichTextBox(); this.rtEtc2 = new System.Windows.Forms.RichTextBox(); this.panel6 = new System.Windows.Forms.Panel(); + this.btSave = new System.Windows.Forms.Button(); this.panel1 = new System.Windows.Forms.Panel(); this.lbl_Midx = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); @@ -53,7 +54,6 @@ namespace UniMarc this.radA = new System.Windows.Forms.RadioButton(); this.label6 = new System.Windows.Forms.Label(); this.lbl_SaveData = new System.Windows.Forms.TextBox(); - this.btSave = new System.Windows.Forms.Button(); this.marcEditorControl1 = new UniMarc.MarcEditorControl(); this.panel2.SuspendLayout(); this.groupBox1.SuspendLayout(); @@ -186,6 +186,7 @@ namespace UniMarc this.rtEtc1.Size = new System.Drawing.Size(262, 236); this.rtEtc1.TabIndex = 32; this.rtEtc1.Text = "Remark1"; + this.rtEtc1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.rtEtc1_KeyDown); // // rtEtc2 // @@ -197,6 +198,7 @@ namespace UniMarc this.rtEtc2.Size = new System.Drawing.Size(262, 236); this.rtEtc2.TabIndex = 32; this.rtEtc2.Text = "Remark2"; + this.rtEtc2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.rtEtc1_KeyDown); // // panel6 // @@ -218,6 +220,16 @@ namespace UniMarc this.panel6.Size = new System.Drawing.Size(268, 455); this.panel6.TabIndex = 1; // + // btSave + // + this.btSave.Location = new System.Drawing.Point(6, 8); + this.btSave.Name = "btSave"; + this.btSave.Size = new System.Drawing.Size(84, 33); + this.btSave.TabIndex = 411; + this.btSave.Text = "수정"; + this.btSave.UseVisualStyleBackColor = true; + this.btSave.Click += new System.EventHandler(this.btSave_Click); + // // panel1 // this.panel1.Controls.Add(this.lbl_Midx); @@ -344,16 +356,6 @@ namespace UniMarc this.lbl_SaveData.TabIndex = 319; this.lbl_SaveData.Text = "[] []"; // - // btSave - // - this.btSave.Location = new System.Drawing.Point(6, 8); - this.btSave.Name = "btSave"; - this.btSave.Size = new System.Drawing.Size(84, 33); - this.btSave.TabIndex = 411; - this.btSave.Text = "수정"; - this.btSave.UseVisualStyleBackColor = true; - this.btSave.Click += new System.EventHandler(this.btSave_Click); - // // marcEditorControl1 // this.marcEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill; diff --git a/unimarc/unimarc/마크/AddMarc2.cs b/unimarc/unimarc/마크/AddMarc2.cs index dd1870b..92b0a84 100644 --- a/unimarc/unimarc/마크/AddMarc2.cs +++ b/unimarc/unimarc/마크/AddMarc2.cs @@ -233,8 +233,12 @@ namespace UniMarc v_title = tag_245?.Value ?? string.Empty; //출판사 - var tag_300b = parser.GetTag("300b").FirstOrDefault(); - v_publisher = tag_300b?.Value ?? string.Empty; + var tag_264b = parser.GetTag("264b").FirstOrDefault(); + var tag_260b = parser.GetTag("260b").FirstOrDefault(); + if(tag_264b != null) + v_publisher = tag_264b?.Value ?? string.Empty; + else if (tag_260b != null) + v_publisher = tag_260b?.Value ?? string.Empty; //056a var v_056 = parser.GetTag("056a").FirstOrDefault() ?? string.Empty; @@ -404,5 +408,14 @@ namespace UniMarc } + private void rtEtc1_KeyDown(object sender, KeyEventArgs e) + { + var rt = sender as RichTextBox; + if (rt == null) return; + if (e.KeyCode == Keys.F5) + { + rt.AppendText("["+DateTime.Now.ToString("yy-MM-dd")+"]"); + } + } } } diff --git a/unimarc/unimarc/마크/Marc2.cs b/unimarc/unimarc/마크/Marc2.cs index 87fdbdd..72ba320 100644 --- a/unimarc/unimarc/마크/Marc2.cs +++ b/unimarc/unimarc/마크/Marc2.cs @@ -1086,5 +1086,15 @@ namespace UniMarc { this.Close(); } + + private void etc1_KeyDown(object sender, KeyEventArgs e) + { + var rt = sender as RichTextBox; + if (rt == null) return; + if (e.KeyCode == Keys.F5) + { + rt.AppendText("[" + DateTime.Now.ToString("yy-MM-dd") + "]"); + } + } } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/Marc2.designer.cs b/unimarc/unimarc/마크/Marc2.designer.cs index 6dc9892..58e2bb7 100644 --- a/unimarc/unimarc/마크/Marc2.designer.cs +++ b/unimarc/unimarc/마크/Marc2.designer.cs @@ -765,6 +765,7 @@ this.etc1.Size = new System.Drawing.Size(260, 169); this.etc1.TabIndex = 32; this.etc1.Text = "Remark1"; + this.etc1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.etc1_KeyDown); // // etc2 // @@ -776,6 +777,7 @@ this.etc2.Size = new System.Drawing.Size(260, 169); this.etc2.TabIndex = 32; this.etc2.Text = "Remark2"; + this.etc2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.etc1_KeyDown); // // panel6 // diff --git a/unimarc/unimarc/마크/Marc_CopyForm.cs b/unimarc/unimarc/마크/Marc_CopyForm.cs index caac48c..4ed9ae7 100644 --- a/unimarc/unimarc/마크/Marc_CopyForm.cs +++ b/unimarc/unimarc/마크/Marc_CopyForm.cs @@ -16,12 +16,22 @@ namespace UniMarc MarcEditorControl marcEditorControl1; Helper_DB db = new Helper_DB(); String_Text st = new String_Text(); - private ToolStrip toolStrip1; - private ToolStripButton btSave; private StatusStrip statusStrip1; + private Panel panel5; + private TableLayoutPanel tableLayoutPanel1; + public RichTextBox etc1; + public RichTextBox etc2; + private Panel panel6; + private Button button3; + private RadioButton radD; + private RadioButton radC; + private RadioButton radB; + private RadioButton radA; + private Button btn_Save; + private Label label6; string base_midx = ""; - public Marc_CopyForm(string marcstring,string m_idx = "0") + public Marc_CopyForm(string marcstring, string m_idx = "0") { InitializeComponent(); base_midx = m_idx; @@ -36,44 +46,38 @@ namespace UniMarc this.Controls.Add(marcEditorControl1); marcEditorControl1.BringToFront(); this.StartPosition = FormStartPosition.CenterScreen; - + marcEditorControl1.LoadBookData(marcstring, null); var tags = st.Take_Tag(marcstring, new string[] { "245a" }); var BookName = tags.Length > 0 ? tags[0] : ""; this.Text = $"마크 복제 - {BookName}"; + + this.radC.Checked = true; + this.etc1.Text = string.Empty; + this.etc2.Text = string.Empty; } private void InitializeComponent() { - System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Marc_CopyForm)); - this.toolStrip1 = new System.Windows.Forms.ToolStrip(); - this.btSave = new System.Windows.Forms.ToolStripButton(); this.statusStrip1 = new System.Windows.Forms.StatusStrip(); - this.toolStrip1.SuspendLayout(); + this.panel5 = new System.Windows.Forms.Panel(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.etc1 = new System.Windows.Forms.RichTextBox(); + this.etc2 = new System.Windows.Forms.RichTextBox(); + this.panel6 = new System.Windows.Forms.Panel(); + this.button3 = new System.Windows.Forms.Button(); + this.radD = new System.Windows.Forms.RadioButton(); + this.radC = new System.Windows.Forms.RadioButton(); + this.radB = new System.Windows.Forms.RadioButton(); + this.radA = new System.Windows.Forms.RadioButton(); + this.btn_Save = new System.Windows.Forms.Button(); + this.label6 = new System.Windows.Forms.Label(); + this.panel5.SuspendLayout(); + this.tableLayoutPanel1.SuspendLayout(); + this.panel6.SuspendLayout(); this.SuspendLayout(); // - // toolStrip1 - // - this.toolStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); - this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.btSave}); - this.toolStrip1.Location = new System.Drawing.Point(0, 0); - this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(1316, 27); - this.toolStrip1.TabIndex = 0; - this.toolStrip1.Text = "toolStrip1"; - // - // btSave - // - this.btSave.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; - this.btSave.Image = ((System.Drawing.Image)(resources.GetObject("btSave.Image"))); - this.btSave.ImageTransparentColor = System.Drawing.Color.Magenta; - this.btSave.Name = "btSave"; - this.btSave.Size = new System.Drawing.Size(55, 24); - this.btSave.Text = "저장"; - this.btSave.Click += new System.EventHandler(this.btSave_Click); - // // statusStrip1 // this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20); @@ -83,16 +87,160 @@ namespace UniMarc this.statusStrip1.TabIndex = 1; this.statusStrip1.Text = "statusStrip1"; // + // panel5 + // + this.panel5.Controls.Add(this.tableLayoutPanel1); + this.panel5.Controls.Add(this.panel6); + this.panel5.Dock = System.Windows.Forms.DockStyle.Right; + this.panel5.Location = new System.Drawing.Point(1050, 0); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(266, 893); + this.panel5.TabIndex = 327; + // + // tableLayoutPanel1 + // + this.tableLayoutPanel1.ColumnCount = 1; + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Controls.Add(this.etc1, 0, 0); + this.tableLayoutPanel1.Controls.Add(this.etc2, 0, 1); + this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; + this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 86); + this.tableLayoutPanel1.Name = "tableLayoutPanel1"; + this.tableLayoutPanel1.RowCount = 2; + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + this.tableLayoutPanel1.Size = new System.Drawing.Size(266, 807); + this.tableLayoutPanel1.TabIndex = 0; + // + // etc1 + // + this.etc1.BackColor = System.Drawing.SystemColors.ScrollBar; + this.etc1.Dock = System.Windows.Forms.DockStyle.Fill; + this.etc1.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.etc1.Location = new System.Drawing.Point(3, 3); + this.etc1.Name = "etc1"; + this.etc1.Size = new System.Drawing.Size(260, 397); + this.etc1.TabIndex = 32; + this.etc1.Text = "Remark1"; + this.etc1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.etc1_KeyDown); + // + // etc2 + // + this.etc2.BackColor = System.Drawing.SystemColors.ScrollBar; + this.etc2.Dock = System.Windows.Forms.DockStyle.Fill; + this.etc2.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.etc2.Location = new System.Drawing.Point(3, 406); + this.etc2.Name = "etc2"; + this.etc2.Size = new System.Drawing.Size(260, 398); + this.etc2.TabIndex = 32; + this.etc2.Text = "Remark2"; + this.etc2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.etc1_KeyDown); + // + // panel6 + // + this.panel6.Controls.Add(this.button3); + this.panel6.Controls.Add(this.radD); + this.panel6.Controls.Add(this.radC); + this.panel6.Controls.Add(this.radB); + this.panel6.Controls.Add(this.radA); + this.panel6.Controls.Add(this.btn_Save); + this.panel6.Controls.Add(this.label6); + this.panel6.Dock = System.Windows.Forms.DockStyle.Top; + this.panel6.Location = new System.Drawing.Point(0, 0); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(266, 86); + this.panel6.TabIndex = 1; + // + // button3 + // + this.button3.Location = new System.Drawing.Point(147, 6); + this.button3.Name = "button3"; + this.button3.Size = new System.Drawing.Size(107, 33); + this.button3.TabIndex = 405; + this.button3.Text = "닫기"; + this.button3.UseVisualStyleBackColor = true; + this.button3.Click += new System.EventHandler(this.button3_Click); + // + // radD + // + this.radD.AutoSize = true; + this.radD.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.radD.Location = new System.Drawing.Point(196, 46); + this.radD.Name = "radD"; + this.radD.Size = new System.Drawing.Size(42, 27); + this.radD.TabIndex = 323; + this.radD.TabStop = true; + this.radD.Text = "D"; + this.radD.UseVisualStyleBackColor = true; + // + // radC + // + this.radC.AutoSize = true; + this.radC.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.radC.Location = new System.Drawing.Point(149, 46); + this.radC.Name = "radC"; + this.radC.Size = new System.Drawing.Size(41, 27); + this.radC.TabIndex = 322; + this.radC.TabStop = true; + this.radC.Text = "C"; + this.radC.UseVisualStyleBackColor = true; + // + // radB + // + this.radB.AutoSize = true; + this.radB.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.radB.Location = new System.Drawing.Point(102, 46); + this.radB.Name = "radB"; + this.radB.Size = new System.Drawing.Size(41, 27); + this.radB.TabIndex = 321; + this.radB.TabStop = true; + this.radB.Text = "B"; + this.radB.UseVisualStyleBackColor = true; + // + // radA + // + this.radA.AutoSize = true; + this.radA.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.radA.Location = new System.Drawing.Point(55, 46); + this.radA.Name = "radA"; + this.radA.Size = new System.Drawing.Size(41, 27); + this.radA.TabIndex = 320; + this.radA.TabStop = true; + this.radA.Text = "A"; + this.radA.UseVisualStyleBackColor = true; + // + // btn_Save + // + this.btn_Save.Location = new System.Drawing.Point(11, 6); + this.btn_Save.Name = "btn_Save"; + this.btn_Save.Size = new System.Drawing.Size(107, 33); + this.btn_Save.TabIndex = 215; + this.btn_Save.Text = "저장(F9)"; + this.btn_Save.UseVisualStyleBackColor = true; + this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click); + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + this.label6.Location = new System.Drawing.Point(14, 56); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(31, 12); + this.label6.TabIndex = 223; + this.label6.Text = "등급"; + // // Marc_CopyForm // this.ClientSize = new System.Drawing.Size(1316, 915); + this.Controls.Add(this.panel5); this.Controls.Add(this.statusStrip1); - this.Controls.Add(this.toolStrip1); this.Name = "Marc_CopyForm"; this.Text = "마크 복제"; this.Load += new System.EventHandler(this.Marc_CopyForm_Load); - this.toolStrip1.ResumeLayout(false); - this.toolStrip1.PerformLayout(); + this.panel5.ResumeLayout(false); + this.tableLayoutPanel1.ResumeLayout(false); + this.panel6.ResumeLayout(false); + this.panel6.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -104,6 +252,11 @@ namespace UniMarc } private void btSave_Click(object sender, EventArgs e) + { + + } + + private void btn_Save_Click(object sender, EventArgs e) { string errMsg = string.Empty; bool isbnWarning = false; @@ -132,19 +285,77 @@ namespace UniMarc } } + //등급추가 + string v_grade = "2"; + if (radA.Checked) v_grade = "0"; + else if (radB.Checked) v_grade = "1"; + else if (radC.Checked) v_grade = "2"; + else if (radD.Checked) v_grade = "3"; + + var v_remark1 = this.etc1.Text.Trim(); + var v_remark2 = this.etc2.Text.Trim(); + // 008 태그 최신화 및 056 추출 string tag056 = marcEditorControl1.Tag056(out string with008fullstring); var savedMarc = this.marcEditorControl1.MakeMarcString(); var date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); - var v_008 = this.marcEditorControl1.text008.Text; + + + //도서정보추출 + var v_isbn = ""; + var v_price = ""; + var v_author = ""; + var v_title = ""; + var v_publisher = ""; + var v_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + + //파서를 사용해서 변경한다 + var parser = new UniMarc.MarcParser(); + parser.ParseFullMarc(savedMarc); + + //ISBN와 가격 (처음나오는 020태그의 값을 적용) + var tag_020 = parser.GetTag("020").FirstOrDefault(); + if (tag_020 != null) + { + v_isbn = tag_020.GetSubfieldValue('a'); + v_price = tag_020.GetSubfieldValue('c'); + } + + //저자(100 -> 110 -> 111 순으로 적용) + var tag_100 = parser.GetTag("100").FirstOrDefault(); + var tag_110 = parser.GetTag("110").FirstOrDefault(); + var tag_111 = parser.GetTag("111").FirstOrDefault(); + if (tag_111 != null) + v_author = tag_111.GetSubfieldValue('a'); + else if (tag_110 != null) + v_author = tag_110.GetSubfieldValue('a'); + else if (tag_100 != null) + v_author = tag_100.GetSubfieldValue('a'); + + //서명 + var tag_245 = parser.GetTag("245a").FirstOrDefault(); + v_title = tag_245?.Value ?? string.Empty; + + //출판사 + var tag_264b = parser.GetTag("264b").FirstOrDefault(); + var tag_260b = parser.GetTag("260b").FirstOrDefault(); + if (tag_264b != null) + v_publisher = tag_264b?.Value ?? string.Empty; + else if (tag_260b != null) + v_publisher = tag_260b?.Value ?? string.Empty; + + //056a + var v_056 = parser.GetTag("056a").FirstOrDefault() ?? string.Empty; + var v_008 = parser.GetTag("008").FirstOrDefault() ?? string.Empty; + string[] insert_col = { "ISBN", "compidx", "marc", "marc_chk", - "grade", "008tag", "user", "date","비고1", "division" + "grade", "008tag", "user", "date","비고1", "비고2", "division","서명","저자","출판사","가격" }; string[] insert_data = { v_ISBN, PUB.user.CompanyIdx.ToString(), savedMarc, "1", - "3", v_008, PUB.user.UserName, date,$"복제(m_idx:{this.base_midx})", tag056 + v_grade, v_008, PUB.user.UserName, date,v_remark1, v_remark2, tag056,v_title, v_author, v_publisher, v_price }; string cmd = db.DB_INSERT("Marc", insert_col, insert_data); @@ -160,5 +371,20 @@ namespace UniMarc UTIL.MsgE(rlt.errorMessage); } } + + private void button3_Click(object sender, EventArgs e) + { + this.Close(); + } + + private void etc1_KeyDown(object sender, KeyEventArgs e) + { + var rt = sender as RichTextBox; + if(rt == null) return; + if (e.KeyCode == Keys.F5) + { + rt.AppendText("[" + DateTime.Now.ToString("yy-MM-dd") + "]"); + } + } } } diff --git a/unimarc/unimarc/마크/Marc_CopyForm.resx b/unimarc/unimarc/마크/Marc_CopyForm.resx index 24945e2..a586ce1 100644 --- a/unimarc/unimarc/마크/Marc_CopyForm.resx +++ b/unimarc/unimarc/마크/Marc_CopyForm.resx @@ -117,25 +117,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - 17, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIFSURBVDhPpZLtS1NhGMbPPxJmmlYSgqHiKzGU1EDxg4iK - YKyG2WBogqMYJQOtCEVRFBGdTBCJfRnkS4VaaWNT5sqx1BUxRXxDHYxAJLvkusEeBaPAB+5z4Jzn+t3X - /aLhnEfjo8m+dCoa+7/C3O2Hqe0zDC+8KG+cRZHZhdzaaWTVTCLDMIY0vfM04Nfh77/G/sEhwpEDbO3t - I7TxE8urEVy99fT/AL5gWDLrTB/hnF4XsW0khCu5ln8DmJliT2AXrcNBsU1gj/MH4nMeKwBrPktM28xM - cX79DFKrHHD5d9D26hvicx4pABt2lpg10zYzU0zr7+e3xXGcrkEB2O2TNec9nJFwB3alZn5jZorfeDZh - 6Q3g8s06BeCoKF4MRURoH1+BY2oNCbeb0TIclIYxOhzf8frTOuo7FxCbbVIAzpni0iceEc8vhzEwGkJD - lx83ymxifejdKjRNk/8PWnyIyTQqAJek0jqHwfEVscu31baIu8+90sTE4nY025dQ2/5FIPpnXlzKuK8A - HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb - 1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC - nOccAdABIDXXE1nzAAAAAElFTkSuQmCC - - 124, 17