diff --git a/unimarc/unimarc/CExt.cs b/unimarc/unimarc/CExt.cs index 41410be..e6ee5e1 100644 --- a/unimarc/unimarc/CExt.cs +++ b/unimarc/unimarc/CExt.cs @@ -121,5 +121,4 @@ namespace UniMarc catch { } } } - } diff --git a/unimarc/unimarc/DB_Utils.cs b/unimarc/unimarc/DB_Utils.cs new file mode 100644 index 0000000..53b0ec1 --- /dev/null +++ b/unimarc/unimarc/DB_Utils.cs @@ -0,0 +1,19 @@ +namespace UniMarc +{ + public static class DB_Utils + { + public static bool ExistISBN(string value) + { + Helper_DB db = new Helper_DB(); + // ISBN 중복체크 + string checkSql = string.Format("SELECT COUNT(*) FROM Marc WHERE isbn = '{0}' AND compidx = '{1}'", value, PUB.user.CompanyIdx); + string dupeCount = db.self_Made_Cmd(checkSql).Replace("|", ""); + if (dupeCount != "0" && !string.IsNullOrEmpty(dupeCount)) + { + return true; + } + return false; + + } + } +} diff --git a/unimarc/unimarc/PUB.cs b/unimarc/unimarc/PUB.cs index 5cc7c4d..58140be 100644 --- a/unimarc/unimarc/PUB.cs +++ b/unimarc/unimarc/PUB.cs @@ -1,4 +1,5 @@ -using System; +using AR; +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/unimarc/unimarc/UniMarc.csproj b/unimarc/unimarc/UniMarc.csproj index 54408c5..80a7faf 100644 --- a/unimarc/unimarc/UniMarc.csproj +++ b/unimarc/unimarc/UniMarc.csproj @@ -224,6 +224,7 @@ True Reference.svcmap + Form diff --git a/unimarc/unimarc/마크/Mac_List_Add2.cs b/unimarc/unimarc/마크/Mac_List_Add2.cs index 7957c26..0a48c7e 100644 --- a/unimarc/unimarc/마크/Mac_List_Add2.cs +++ b/unimarc/unimarc/마크/Mac_List_Add2.cs @@ -271,7 +271,75 @@ namespace UniMarc private void dataGridView1_KeyDown(object sender, KeyEventArgs e) { - sg.Excel_to_DataGridView(sender, e); + Excel_to_BindingSource(sender, e); + } + + private void Excel_to_BindingSource(object sender, KeyEventArgs e) + { + if ((e.Shift && e.KeyCode == Keys.Insert) || (e.Control && e.KeyCode == Keys.V)) + { + if (Clipboard.ContainsText() == false) return; + + string stringInClipboard = Clipboard.GetText(); + if (string.IsNullOrEmpty(stringInClipboard)) return; + + string[] rowSplitter = { "\r\n", "\r", "\n" }; + char[] columnSplitter = { '\t' }; + + List rowsInClipboard = stringInClipboard.Split(rowSplitter, StringSplitOptions.None).ToList(); + if (rowsInClipboard.Count > 0 && string.IsNullOrEmpty(rowsInClipboard.Last())) + { + rowsInClipboard.RemoveAt(rowsInClipboard.Count - 1); + } + + if (rowsInClipboard.Count == 0) return; + + int startRow = dataGridView1.SelectedCells.Count > 0 ? dataGridView1.SelectedCells[0].RowIndex : 0; + int startCol = dataGridView1.SelectedCells.Count > 0 ? dataGridView1.SelectedCells[0].ColumnIndex : 0; + + bookList.RaiseListChangedEvents = false; + + for (int iRow = 0; iRow < rowsInClipboard.Count; iRow++) + { + int targetRowIdx = startRow + iRow; + + // 필요한 경우 행 추가 + while (bookList.Count <= targetRowIdx) + { + bookList.Add(new BookGridItem()); + } + + BookGridItem item = bookList[targetRowIdx]; + string[] valuesInRow = rowsInClipboard[iRow].Split(columnSplitter); + + for (int iCol = 0; iCol < valuesInRow.Length; iCol++) + { + int targetColIdx = startCol + iCol; + + if (targetColIdx < dataGridView1.ColumnCount) + { + string val = valuesInRow[iCol]; + string colName = dataGridView1.Columns[targetColIdx].DataPropertyName; + + switch (colName) + { + case "header": item.header = val; break; + case "num": item.num = val; break; + case "BookName": item.BookName = val; break; + case "Author": item.Author = val; break; + case "BookComp": item.BookComp = val; break; + case "Count": item.Count = val; break; + case "Price": item.Price = val; break; + case "Total": item.Total = val; break; + case "ISBN": item.ISBN = val; break; + } + } + } + } + + bookList.RaiseListChangedEvents = true; + bookList.ResetBindings(); + } } private void label1_Click(object sender, EventArgs e) diff --git a/unimarc/unimarc/마크/Marc2.cs b/unimarc/unimarc/마크/Marc2.cs index c96b70e..a2f3593 100644 --- a/unimarc/unimarc/마크/Marc2.cs +++ b/unimarc/unimarc/마크/Marc2.cs @@ -41,7 +41,6 @@ namespace UniMarc Mac_List ml; public SortableBindingList dataList = new SortableBindingList(); MacListItem pItem = null; - protected override bool ProcessCmdKey(ref Message msg, Keys keyData) { // Alt 키 하나만 눌렸을 때 메뉴가 활성화되는 것을 방지 @@ -52,8 +51,6 @@ namespace UniMarc return base.ProcessCmdKey(ref msg, keyData); } - - private void MarcEditorControl1_NextButton(object sender, EventArgs e) { bs1.MoveNext(); @@ -474,7 +471,10 @@ namespace UniMarc if (combo == 0) { comboIdx = comboBox9.SelectedIndex; - this.bs1.Filter = $"Grade={comboIdx}"; + if (comboIdx == 0) //전체 + this.bs1.Filter = ""; + else + this.bs1.Filter = $"Grade={comboIdx}"; //Search_Filter("grade", comboIdx); } else @@ -996,5 +996,21 @@ namespace UniMarc //re load data input_list(); } + + private void btFindISBN_Click(object sender, EventArgs e) + { + string tSearchText = pItem.list_name; + string tSearchIDX = pItem.idx; + + var main = Application.OpenForms.OfType
().FirstOrDefault(); + if (main != null) + { + var isbn = main.OpenFormInTab(() => new Check_ISBN2(main, tSearchText, tSearchIDX)); + if (isbn != null) + { + isbn.tb_list_name.Enabled = true; + } + } + } } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/Marc2.designer.cs b/unimarc/unimarc/마크/Marc2.designer.cs index e8748ed..384a6bb 100644 --- a/unimarc/unimarc/마크/Marc2.designer.cs +++ b/unimarc/unimarc/마크/Marc2.designer.cs @@ -39,10 +39,10 @@ System.Windows.Forms.Label label25; System.Windows.Forms.Label label26; System.Windows.Forms.Label label27; - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Marc2)); this.List_Book = new System.Windows.Forms.DataGridView(); this.list_idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -74,6 +74,7 @@ this.lbCustIDX = new System.Windows.Forms.Label(); this.btCopy = new System.Windows.Forms.Button(); this.panel2 = new System.Windows.Forms.Panel(); + this.marcEditorControl1 = new UniMarc.MarcEditorControl(); this.panel3 = new System.Windows.Forms.Panel(); this.panel4 = new System.Windows.Forms.Panel(); this.lbl_BookList = new System.Windows.Forms.Label(); @@ -92,7 +93,7 @@ this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.lbListIdx = new System.Windows.Forms.ToolStripLabel(); - this.marcEditorControl1 = new UniMarc.MarcEditorControl(); + this.btFindISBN = new System.Windows.Forms.Button(); label31 = new System.Windows.Forms.Label(); label30 = new System.Windows.Forms.Label(); label33 = new System.Windows.Forms.Label(); @@ -190,14 +191,14 @@ this.List_Book.AllowUserToDeleteRows = false; this.List_Book.BackgroundColor = System.Drawing.Color.SkyBlue; this.List_Book.BorderStyle = System.Windows.Forms.BorderStyle.None; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.List_Book.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.List_Book.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; this.List_Book.ColumnHeadersHeight = 29; this.List_Book.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.list_idx, @@ -221,14 +222,14 @@ this.List_Book.MultiSelect = false; this.List_Book.Name = "List_Book"; this.List_Book.ReadOnly = true; - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.ControlDark; - dataGridViewCellStyle4.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.List_Book.RowHeadersDefaultCellStyle = dataGridViewCellStyle4; + dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; + dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.ControlDark; + dataGridViewCellStyle8.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.List_Book.RowHeadersDefaultCellStyle = dataGridViewCellStyle8; this.List_Book.RowHeadersWidth = 51; this.List_Book.RowTemplate.Height = 23; this.List_Book.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; @@ -354,9 +355,9 @@ // grade // this.grade.DataPropertyName = "Grade"; - dataGridViewCellStyle2.Format = "N0"; - dataGridViewCellStyle2.NullValue = null; - this.grade.DefaultCellStyle = dataGridViewCellStyle2; + dataGridViewCellStyle6.Format = "N0"; + dataGridViewCellStyle6.NullValue = null; + this.grade.DefaultCellStyle = dataGridViewCellStyle6; this.grade.HeaderText = "등급"; this.grade.MinimumWidth = 6; this.grade.Name = "grade"; @@ -367,8 +368,8 @@ // colCheck // this.colCheck.DataPropertyName = "ColCheck"; - dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - this.colCheck.DefaultCellStyle = dataGridViewCellStyle3; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + this.colCheck.DefaultCellStyle = dataGridViewCellStyle7; this.colCheck.HeaderText = "V"; this.colCheck.MinimumWidth = 6; this.colCheck.Name = "colCheck"; @@ -508,9 +509,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(163, 35); + this.tbCustName.Location = new System.Drawing.Point(140, 35); this.tbCustName.Name = "tbCustName"; - this.tbCustName.Size = new System.Drawing.Size(314, 27); + this.tbCustName.Size = new System.Drawing.Size(337, 27); this.tbCustName.TabIndex = 33; this.tbCustName.Text = " "; this.tbCustName.UseVisualStyleBackColor = false; @@ -548,6 +549,16 @@ this.panel2.Size = new System.Drawing.Size(1083, 658); this.panel2.TabIndex = 325; // + // 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(1083, 658); + this.marcEditorControl1.TabIndex = 0; + // // panel3 // this.panel3.BackColor = System.Drawing.Color.White; @@ -565,6 +576,7 @@ // // panel4 // + this.panel4.Controls.Add(this.btFindISBN); this.panel4.Controls.Add(this.lbl_BookList); this.panel4.Controls.Add(this.lbl_BookDate); this.panel4.Controls.Add(this.tbCustName); @@ -581,9 +593,9 @@ // this.lbl_BookList.BackColor = System.Drawing.Color.LightGray; this.lbl_BookList.Font = new System.Drawing.Font("굴림체", 14.25F, System.Drawing.FontStyle.Bold); - this.lbl_BookList.Location = new System.Drawing.Point(163, 6); + this.lbl_BookList.Location = new System.Drawing.Point(140, 6); this.lbl_BookList.Name = "lbl_BookList"; - this.lbl_BookList.Size = new System.Drawing.Size(383, 27); + this.lbl_BookList.Size = new System.Drawing.Size(337, 27); this.lbl_BookList.TabIndex = 326; this.lbl_BookList.Text = " "; // @@ -593,15 +605,16 @@ this.lbl_BookDate.Font = new System.Drawing.Font("굴림체", 14.25F, System.Drawing.FontStyle.Bold); this.lbl_BookDate.Location = new System.Drawing.Point(6, 6); this.lbl_BookDate.Name = "lbl_BookDate"; - this.lbl_BookDate.Size = new System.Drawing.Size(151, 27); + this.lbl_BookDate.Size = new System.Drawing.Size(128, 27); this.lbl_BookDate.TabIndex = 325; - this.lbl_BookDate.Text = " "; + this.lbl_BookDate.Text = "0000-00-00"; + this.lbl_BookDate.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // button1 // this.button1.Location = new System.Drawing.Point(6, 35); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(151, 27); + this.button1.Size = new System.Drawing.Size(128, 27); this.button1.TabIndex = 324; this.button1.Text = "다시불러오기"; this.button1.UseVisualStyleBackColor = true; @@ -672,6 +685,7 @@ // this.bindingNavigatorPositionItem.AccessibleName = "위치"; this.bindingNavigatorPositionItem.AutoSize = false; + this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("맑은 고딕", 9F); this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem"; this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23); this.bindingNavigatorPositionItem.Text = "0"; @@ -718,15 +732,15 @@ this.lbListIdx.Size = new System.Drawing.Size(14, 24); this.lbListIdx.Text = "0"; // - // marcEditorControl1 + // btFindISBN // - 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(1083, 658); - this.marcEditorControl1.TabIndex = 0; + this.btFindISBN.Location = new System.Drawing.Point(483, 6); + this.btFindISBN.Name = "btFindISBN"; + this.btFindISBN.Size = new System.Drawing.Size(66, 27); + this.btFindISBN.TabIndex = 327; + this.btFindISBN.Text = "ISBN조회"; + this.btFindISBN.UseVisualStyleBackColor = true; + this.btFindISBN.Click += new System.EventHandler(this.btFindISBN_Click); // // Marc2 // @@ -811,5 +825,6 @@ private System.Windows.Forms.ToolStripSeparator toolStripSeparator1; private System.Windows.Forms.ToolStripLabel toolStripLabel1; private System.Windows.Forms.ToolStripLabel lbListIdx; + private System.Windows.Forms.Button btFindISBN; } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/MarcEditorControl.Designer.cs b/unimarc/unimarc/마크/MarcEditorControl.Designer.cs index 72a4a11..9e43726 100644 --- a/unimarc/unimarc/마크/MarcEditorControl.Designer.cs +++ b/unimarc/unimarc/마크/MarcEditorControl.Designer.cs @@ -28,14 +28,14 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle17 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle18 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle19 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle20 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle21 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle22 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle23 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle24 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); this.label31 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label(); this.label33 = new System.Windows.Forms.Label(); @@ -894,8 +894,8 @@ this.GridView020.Name = "GridView020"; this.GridView020.RowHeadersVisible = false; this.GridView020.RowHeadersWidth = 30; - dataGridViewCellStyle17.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.GridView020.RowsDefaultCellStyle = dataGridViewCellStyle17; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.GridView020.RowsDefaultCellStyle = dataGridViewCellStyle1; this.GridView020.RowTemplate.Height = 23; this.GridView020.Size = new System.Drawing.Size(408, 80); this.GridView020.TabIndex = 0; @@ -969,8 +969,8 @@ this.GridView505.Name = "GridView505"; this.GridView505.RowHeadersVisible = false; this.GridView505.RowHeadersWidth = 30; - dataGridViewCellStyle18.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.GridView505.RowsDefaultCellStyle = dataGridViewCellStyle18; + dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.GridView505.RowsDefaultCellStyle = dataGridViewCellStyle2; this.GridView505.RowTemplate.Height = 23; this.GridView505.Size = new System.Drawing.Size(401, 71); this.GridView505.TabIndex = 2; @@ -1109,14 +1109,14 @@ this.GridView246.AllowDrop = true; this.GridView246.AllowUserToAddRows = false; this.GridView246.AllowUserToResizeRows = false; - dataGridViewCellStyle19.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle19.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle19.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle19.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle19.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle19.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle19.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.GridView246.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle19; + dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle3.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.GridView246.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3; this.GridView246.ColumnHeadersHeight = 29; this.GridView246.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.Text246Jisi, @@ -1129,8 +1129,8 @@ this.GridView246.Name = "GridView246"; this.GridView246.RowHeadersVisible = false; this.GridView246.RowHeadersWidth = 30; - dataGridViewCellStyle20.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.GridView246.RowsDefaultCellStyle = dataGridViewCellStyle20; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.GridView246.RowsDefaultCellStyle = dataGridViewCellStyle4; this.GridView246.RowTemplate.Height = 23; this.GridView246.Size = new System.Drawing.Size(493, 138); this.GridView246.TabIndex = 31; @@ -1289,14 +1289,14 @@ this.GridView440.AllowDrop = true; this.GridView440.AllowUserToAddRows = false; this.GridView440.AllowUserToResizeRows = false; - dataGridViewCellStyle21.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle21.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle21.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle21.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle21.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle21.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle21.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.GridView440.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle21; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle5.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.GridView440.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5; this.GridView440.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.GridView440.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.text440a, @@ -1309,8 +1309,8 @@ this.GridView440.Name = "GridView440"; this.GridView440.RowHeadersVisible = false; this.GridView440.RowHeadersWidth = 30; - dataGridViewCellStyle22.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.GridView440.RowsDefaultCellStyle = dataGridViewCellStyle22; + dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.GridView440.RowsDefaultCellStyle = dataGridViewCellStyle6; this.GridView440.RowTemplate.Height = 23; this.GridView440.Size = new System.Drawing.Size(597, 71); this.GridView440.TabIndex = 18; @@ -1418,14 +1418,14 @@ this.GridView490.AllowDrop = true; this.GridView490.AllowUserToAddRows = false; this.GridView490.AllowUserToResizeRows = false; - dataGridViewCellStyle23.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle23.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle23.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle23.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle23.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle23.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle23.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.GridView490.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle23; + dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control; + dataGridViewCellStyle7.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); + dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.GridView490.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7; this.GridView490.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.GridView490.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.text490a, @@ -1434,8 +1434,8 @@ this.GridView490.Name = "GridView490"; this.GridView490.RowHeadersVisible = false; this.GridView490.RowHeadersWidth = 30; - dataGridViewCellStyle24.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); - this.GridView490.RowsDefaultCellStyle = dataGridViewCellStyle24; + dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224))))); + this.GridView490.RowsDefaultCellStyle = dataGridViewCellStyle8; this.GridView490.RowTemplate.Height = 23; this.GridView490.Size = new System.Drawing.Size(321, 71); this.GridView490.TabIndex = 19; @@ -2236,7 +2236,7 @@ this.lbl_SaveData.AutoSize = true; this.lbl_SaveData.Font = new System.Drawing.Font("굴림체", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); this.lbl_SaveData.ForeColor = System.Drawing.Color.PaleTurquoise; - this.lbl_SaveData.Location = new System.Drawing.Point(416, 0); + this.lbl_SaveData.Location = new System.Drawing.Point(168, 0); this.lbl_SaveData.Name = "lbl_SaveData"; this.lbl_SaveData.Size = new System.Drawing.Size(64, 19); this.lbl_SaveData.TabIndex = 318; diff --git a/unimarc/unimarc/마크/MarcEditorControl.cs b/unimarc/unimarc/마크/MarcEditorControl.cs index 56680c3..e6d8368 100644 --- a/unimarc/unimarc/마크/MarcEditorControl.cs +++ b/unimarc/unimarc/마크/MarcEditorControl.cs @@ -370,7 +370,7 @@ namespace UniMarc } string BaseText = richTextBox1.Text.Replace("▲▲", "▲").Replace("▼▼", "▼"); - string lblisbn = Param.ISBN13; // lbl_ISBN.Text.Replace("[", "").Replace("]", ""); + string isbn = Param.ISBN13; // lbl_ISBN.Text.Replace("[", "").Replace("]", ""); if (!BaseText.EndsWith("\n")) BaseText += "\n"; @@ -382,12 +382,24 @@ namespace UniMarc } //ISBN이 변경되었다면 저장하지 못하게 한다 (경고 후 저장 가능하게 한다 26010?) - if (BaseText.IndexOf(lblisbn) < 0) + if (BaseText.IndexOf(isbn) < 0) { var dlg = UTIL.MsgQ("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다.\n그래도 저장 할까요?"); if (dlg != DialogResult.Yes) return; } + + // ISBN 중복체크 + var exist = DB_Utils.ExistISBN(isbn); + if (exist) + { + if (UTIL.MsgQ($"입력하신 ISBN({isbn})은 이미 등록된 데이터가 존재합니다.\n그래도 저장하시겠습니까?") != DialogResult.Yes) + { + return; + } + } + + string tag056 = Tag056(); string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string orimarc = st.made_Ori_marc(richTextBox1).Replace(@"\", "₩"); @@ -399,6 +411,8 @@ namespace UniMarc return; } + + this.Param.Grade = cb_grade.SelectedIndex.ToString(); this.Param.Remark1 = etc1.Text; this.Param.Remark2 = etc2.Text; @@ -2216,9 +2230,9 @@ namespace UniMarc if (i246 != "") result += "▼i" + i246; if (a246 != "") result += "▼a" + a246; - if (b246 != "") result += "▼b" + b246; if (n246 != "") result += "▼n" + n246; if (p246 != "") result += "▼p" + p246; + if (b246 != "") result += "▼b" + b246; result += "▲\n"; } @@ -2247,6 +2261,12 @@ namespace UniMarc else a440 = dgv.Rows[a].Cells["text440a"].Value.ToString(); + string x440; + if (dgv.Rows[a].Cells["text440x"].Value == null) + x440 = ""; + else + x440 = dgv.Rows[a].Cells["text440x"].Value.ToString(); + string n440; if (dgv.Rows[a].Cells["text440n"].Value == null) n440 = ""; @@ -2271,19 +2291,16 @@ namespace UniMarc else v440Txt = dgv.Rows[a].Cells["text440vTxt"].Value.ToString(); - string x440; - if (dgv.Rows[a].Cells["text440x"].Value == null) - x440 = ""; - else - x440 = dgv.Rows[a].Cells["text440x"].Value.ToString(); + result += string.Format("440\t \t▼a{0}", a440); + if (x440 != "") result += "▼x" + x440; if (n440 != "") result += "▼n" + n440; if (p440 != "") result += "▼p" + p440; if (v440Num != "") result += "▼v" + v440Num + v440Txt; - if (x440 != "") result += "▼x" + x440; + result += "▲\n"; } @@ -2513,16 +2530,16 @@ namespace UniMarc string result = "245\t \t"; if (boxText[0] != "") result += "▼a" + boxText[0]; + if (boxText[4] != "") result += "▼x" + boxText[4]; if (boxText[1] != "") result += "▼n" + boxText[1]; + if (boxText[2] != "") result += "▼p" + boxText[2]; if (boxText[3] != "") { string[] splitText245b = boxText[3].Split('▽'); foreach (string text in splitText245b) result += "▼b" + text; - } - if (boxText[2] != "") result += "▼p" + boxText[2]; - if (boxText[4] != "") result += "▼x" + boxText[4]; + if (boxText[5] != "") result += "▼d" + boxText[5]; if (boxText[6] != "") result += "▼e" + boxText[6].Replace("▽", "▼e"); @@ -3154,6 +3171,16 @@ namespace UniMarc { if (string.IsNullOrEmpty(value)) return; + // ISBN 중복체크 + var exist = DB_Utils.ExistISBN(value); + if (exist) + { + if (UTIL.MsgQ($"입력하신 ISBN({value})은 해당 기관에 이미 등록된 데이터가 존재합니다.\n그래도 변경하시겠습니까?") != DialogResult.Yes) + { + return; + } + } + string oldIsbn = lbl_ISBN.Text; lbl_ISBN.Text = value; Param.ISBN13 = value;