diff --git a/unimarc/unimarc/마크/Helper008.cs b/unimarc/unimarc/마크/Helper008.cs index e6e3d2b..704d457 100644 --- a/unimarc/unimarc/마크/Helper008.cs +++ b/unimarc/unimarc/마크/Helper008.cs @@ -17,18 +17,12 @@ namespace UniMarc public string call = ""; Marc mac; Marc_Plan_Sub_MarcEdit me; - Marc2 mae; MarcEditorControl mec; public Helper008(MarcEditorControl _mae) { InitializeComponent(); mec = _mae; } - public Helper008(Marc2 _mae) - { - InitializeComponent(); - mae = _mae; - } public Helper008(Marc _mac) { InitializeComponent(); diff --git a/unimarc/unimarc/마크/MarcCopySelect.cs b/unimarc/unimarc/마크/MarcCopySelect.cs index 8078cd9..7009efe 100644 --- a/unimarc/unimarc/마크/MarcCopySelect.cs +++ b/unimarc/unimarc/마크/MarcCopySelect.cs @@ -425,6 +425,10 @@ namespace UniMarc if (m != null) m.SelectMarc_Sub(MarcFormRowIndex, GridData); + + if(m2 != null) + m2.SelectMarc_Sub(MarcFormRowIndex, GridData); + if (am != null) { string Marc = richTextBox1.Text; diff --git a/unimarc/unimarc/마크/MarcEditorControl.cs b/unimarc/unimarc/마크/MarcEditorControl.cs index f6eef12..af10c6c 100644 --- a/unimarc/unimarc/마크/MarcEditorControl.cs +++ b/unimarc/unimarc/마크/MarcEditorControl.cs @@ -1145,15 +1145,26 @@ namespace UniMarc { TextBox tb = sender as TextBox; - + if (e.Alt && e.KeyCode >= Keys.A && e.KeyCode <= Keys.Z) + { + var letter = e.KeyCode.ToString().ToLower(); + tb.InvokeInsertText("▽" + letter); + e.SuppressKeyPress = true; + return; + } if (e.KeyCode == Keys.F3) { - tb.InvokeInsertText("▼"); + tb.InvokeInsertText(";"); + } + else if(e.KeyCode == Keys.OemSemicolon) + { + tb.InvokeInsertText("▽"); + e.SuppressKeyPress = true; } else if (e.KeyCode == Keys.F4) { - tb.InvokeInsertText("▲"); + tb.InvokeInsertText("△"); } } diff --git a/unimarc/unimarc/마크/Marc_memo.cs b/unimarc/unimarc/마크/Marc_memo.cs index f9400b5..ff001fc 100644 --- a/unimarc/unimarc/마크/Marc_memo.cs +++ b/unimarc/unimarc/마크/Marc_memo.cs @@ -14,19 +14,13 @@ namespace UniMarc { Marc marc; AddMarc am; - Marc2 mae; MarcEditorControl mae2; - AddMarc2 am2; public Marc_memo(MarcEditorControl _mae) { InitializeComponent(); mae2 = _mae; } - public Marc_memo(Marc2 _mae) - { - InitializeComponent(); - mae = _mae; - } + public Marc_memo(Marc _marc) { InitializeComponent(); @@ -37,11 +31,7 @@ namespace UniMarc InitializeComponent(); am = _am; } - public Marc_memo(AddMarc2 _am) - { - InitializeComponent(); - am2 = _am; - } + private void Marc_memo_Load(object sender, EventArgs e) { string[] com_List = @@ -78,6 +68,8 @@ namespace UniMarc if (marc != null) marc.richTextBox1.Text = result.Replace("↔", ""); + else if(mae2 != null) + mae2.richTextBox1.Text = result.Replace("↔", ""); else if (am != null) am.richTextBox1.Text = result.Replace("↔", ""); } diff --git a/unimarc/unimarc/마크/Marc_mkList.cs b/unimarc/unimarc/마크/Marc_mkList.cs index 26cbe8e..6bcdefd 100644 --- a/unimarc/unimarc/마크/Marc_mkList.cs +++ b/unimarc/unimarc/마크/Marc_mkList.cs @@ -1,4 +1,5 @@ using AR; +using Org.BouncyCastle.Pkcs; using System; using System.Collections.Generic; using System.ComponentModel; @@ -17,11 +18,11 @@ namespace UniMarc Marc marc; CD_LP cp; Helper_DB db = new Helper_DB(); - Marc2 mae; + Marc2 marc2; public Marc_mkList(Marc2 _mae) { InitializeComponent(); - mae = _mae; + marc2 = _mae; } public Marc_mkList(Marc _marc) @@ -188,7 +189,7 @@ namespace UniMarc private void btn_mkList_Click(object sender, EventArgs e) { - String_Text st = new String_Text(); + if (tb_listName.Text == "") { UTIL.MsgE("목록명을 입력해주세요!"); @@ -199,7 +200,195 @@ namespace UniMarc UTIL.MsgE("차수가 비어있습니다."); return; } - if((this.marc.List_Book?.RowCount ?? 0) <1 ) + + if (marc != null) + ExportOld(); + else if (marc2 != null) + ExportNew(); + } + void ExportNew() + { + String_Text st = new String_Text(); + var marccnt1 = marc2?.List_Book.RowCount ?? 0; + + if (marccnt1 < 1) + { + UTIL.MsgE("마크데이터 목록이 존재하지 않습니다"); + return; + } + + string listName = tb_listName.Text; + string Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); + string outnum = tb_outnum.Text + "차"; + string user = PUB.user.UserName;// Properties.Settings.Default.User; + + var marc = this.marc2; + + bool isAuthor = false; + bool isBook = false; + if (cb_FirstAuthor.SelectedIndex == 0) + isAuthor = true; + if (cb_FirstBook.SelectedIndex == 0) + isBook = true; + bool[] isType = { isAuthor, isBook }; + + // 시방서 목록 DB에 들어갈 것들. + string[] insert_list_col = { + "compidx", "work_list", "date", "state", "gu", + "first_Author", "symbol_Author","symbol_AuthorE", "book_Author", "divType", "divNum", + "etc", "user" + }; + string[] insert_list_data = { + PUB.user.CompanyIdx, listName, Time, "진행", cb_listType.Text, + cb_FirstAuthor.Text, cb_authorTypeK.Text, cb_authorTypeE.Text, cb_FirstBook.Text, cb_divType.Text, cb_divNum.Text, + rtb_etc.Text, user + }; + string cmdByList = db.DB_INSERT("Specs_List", insert_list_col, insert_list_data); + + // 시방서 마크 DB에 들어갈 것들. + string[] insert_marc_col = { + "compidx", "work_list", "date", "ISBN", "book_name", + "s_book_name1", "s_book_num1", "author", "book_comp", "pubdate", + "price", "tag008", "class_symbol", "author_symbol", "marc", + "imageURL", "count", "num", "out_num", "midx", + "editDate", "user" + }; + + string[] insert_marc_data = { + PUB.user.CompanyIdx, listName, Time, "", "", + "", "", "", "", "", + "", "", "", "", "", + "", "", "", "", "", + Time, user + }; // 마크에서 추출 ( 3 ~ 12 ) + + int[] row = checkGridRow(); + int num = 0; + progressBar1.Maximum = row.Length + 1; + string cmdByMarc = string.Format("INSERT INTO {0} {1} value", "Specs_Marc", db.DB_INSERT_SUB("", insert_marc_col)); + + bool CountSplit = chk_countSplit.Checked; + int listCount = 1; + int addCount = 1; + + // 필터링하여 DB에 집어넣는 작업 + for (int a = 0; a < row.Length; a++) + { + if (marc.List_Book.Rows[row[a]].Cells["db_marc"].Value.ToString() == "") + continue; + + num += 1; + listCount = Convert.ToInt32(marc.List_Book.Rows[row[a]].Cells["count"].Value.ToString()); + + // ISBN, book_name, s_book_name1, s_book_num1, author, book_comp, pubdate, price, tag008, class_symbol + string[] Search = { "020a", "245a", "440a", "440v", "245d", "260b", "260c", "950b", "008", "056a" }; + + insert_marc_data[14] = marc.List_Book.Rows[row[a]].Cells["db_marc"].Value.ToString(); + insert_marc_data[15] = marc.List_Book.Rows[row[a]].Cells["url"].Value.ToString(); + insert_marc_data[16] = addCount.ToString(); + if (rb_basicNum.Checked) + insert_marc_data[17] = marc.List_Book.Rows[row[a]].Cells["num"].Value.ToString(); + else + insert_marc_data[17] = num.ToString(); + insert_marc_data[18] = outnum; + insert_marc_data[19] = marc.List_Book.Rows[row[a]].Cells["marc_idx"].Value.ToString(); + insert_marc_data[20] = marc.List_Book.Rows[row[a]].Cells["SaveDate"].Value.ToString(); + insert_marc_data[21] = marc.List_Book.Rows[row[a]].Cells["user"].Value.ToString(); + + string[] Marc = st.Take_Tag(insert_marc_data[14], Search); + string[] Author = { "", Marc[1] }; // 저자, 도서명 + + // 100, 110, 111태그중 한개라도 있으면 저자로 인식. + string[] Author_Search = { "100a", "110a", "111a", "245d" }; + string[] Author_res = st.Take_Tag(insert_marc_data[14], Author_Search); + + if (Author_res[0].Length > 1) Author[0] = Author_res[0]; + if (Author_res[1].Length > 1) Author[0] = Author_res[1]; + if (Author_res[2].Length > 1) Author[0] = Author_res[2]; + + if (chk_CompSymbol.Checked) + if (Author_res[3].IndexOf("[외]") > -1) + Author[0] = Marc[5]; + + string tmp_ViewMarc = st.ConvertMarcType(insert_marc_data[14], out string errmessage); + + // 마크에서 추출한 데이터 DB에 적용하기 위한 반복문 + for (int b = 0; b < Marc.Length; b++) + { + insert_marc_data[b + 3] = Marc[b]; + + // 분류기호 설정값적용대로 가져오기. + if (b == 9) + { + string class_symbol = st.TakeTag_ConditionContent(tmp_ViewMarc, "056a", "056" + cb_divNum.Text); + if (class_symbol != "") + insert_marc_data[b + 3] = class_symbol; + } + } + + // 22.10.24 740태그 삭제 + tmp_ViewMarc = st.RemoveTagNumber(tmp_ViewMarc, "740"); + + // 마크 분류기호 설정값대로 적용 + tmp_ViewMarc = st.RemoveTagNumber(tmp_ViewMarc, "056"); + tmp_ViewMarc = st.AddTagInMarc(string.Format("056\t \t▼a{0}▼2{1}▲", insert_marc_data[12], cb_divNum.Text), tmp_ViewMarc); + insert_marc_data[14] = st.made_Ori_marc(tmp_ViewMarc); + + if (Author[0].Length < 1) + { + MessageBox.Show(row[a] + "번째의 저자를 확인해주세요. \n (100a, 110a, 111a 중 1개 필수)"); + return; + } + + Author[0] = Regex.Replace(Author[0], @"[^a-zA-Z0-9가-힣_]", "", RegexOptions.Singleline); + Author[1] = st.RemoveWordInBracket(Author[1]); + Author[1] = Regex.Replace(Author[1], @"[^a-zA-Z0-9가-힣_]", "", RegexOptions.Singleline); + + AuthorSymbol.Symbol sb = new AuthorSymbol.Symbol(); + string authorTypeK = cb_authorTypeK.SelectedItem.ToString(); + string authorTypeE = cb_authorTypeE.SelectedItem.ToString(); + + string res_Author = ""; + if (chk_CompSymbol.Checked == false || cmb_author_four.Text == "출판사+서명") + res_Author = sb.SymbolAuthor(Author[0], Author[1], authorTypeK, authorTypeE, isType); + else //서명+출판사는 뒤집어서 입력한다 251110 + res_Author = sb.SymbolAuthor(Author[1], Author[0], authorTypeK, authorTypeE, isType); + + insert_marc_data[13] = res_Author; + + cmdByMarc += db.DB_INSERT_SUB("value", insert_marc_data) + ","; + + if (CountSplit && listCount > addCount) + { + a--; + addCount++; + continue; + } + else + { + addCount = 1; + progressBar1.PerformStep(); + } + } + + cmdByMarc = cmdByMarc.TrimEnd(','); + cmdByMarc += ";"; + + Helper_DB.ExcuteNonQuery(cmdByList); + Helper_DB.ExcuteNonQuery(cmdByMarc); + progressBar1.PerformStep(); + + if (progressBar1.Value == progressBar1.Maximum) + { + label2.Text = "완료되었습니다!"; + } + } + void ExportOld() + { + String_Text st = new String_Text(); + var marccnt2 = marc?.List_Book.RowCount ?? 0; + + if ( marccnt2 < 1) { UTIL.MsgE("마크데이터 목록이 존재하지 않습니다"); return; @@ -369,18 +558,36 @@ namespace UniMarc label2.Text = "완료되었습니다!"; } } + #region mkList_Sub int[] checkGridRow() { List GridRow = new List(); - for (int a = 0; a < marc.List_Book.Rows.Count; a++) - { - bool isSuccess = true; - if (!marc.Check_BackColor(a) && marc.Check_List_V(a)) - isSuccess = false; - if (isSuccess) - GridRow.Add(a); + if(marc != null) + { + for (int a = 0; a < marc.List_Book.Rows.Count; a++) + { + bool isSuccess = true; + if (!marc.Check_BackColor(a) && marc.Check_List_V(a)) + isSuccess = false; + + if (isSuccess) + GridRow.Add(a); + } + + } + else if(marc2 != null) + { + for (int a = 0; a < marc2.List_Book.Rows.Count; a++) + { + bool isSuccess = true; + if (!marc2.Check_BackColor(a) && marc2.Check_List_V(a)) + isSuccess = false; + + if (isSuccess) + GridRow.Add(a); + } } int[] Result = GridRow.ToArray(); @@ -395,7 +602,7 @@ namespace UniMarc private void chk_CompSymbol_CheckedChanged(object sender, EventArgs e) { - cmb_author_four.Enabled = chk_CompSymbol.Checked; + cmb_author_four.Enabled = chk_CompSymbol.Checked; } } } diff --git a/unimarc/unimarc/마크/findNchange.cs b/unimarc/unimarc/마크/findNchange.cs index ba8fddb..0fd9629 100644 --- a/unimarc/unimarc/마크/findNchange.cs +++ b/unimarc/unimarc/마크/findNchange.cs @@ -18,10 +18,9 @@ namespace UniMarc string find = ""; string change = ""; String_Text st = new String_Text(); - AddMarc am; AddMarc2 am2; + AddMarc am; Marc mac; Marc_memo mmm; - Marc2 mae; MarcEditorControl mec; public findNchange(MarcEditorControl _mac) { @@ -29,17 +28,6 @@ namespace UniMarc mec = _mac; } - - public findNchange(Marc2 _mae) - { - InitializeComponent(); - mae = _mae; - } - public findNchange(AddMarc2 _am) - { - InitializeComponent(); - am2 = _am; - } public findNchange(AddMarc _am) { InitializeComponent(); @@ -82,6 +70,11 @@ namespace UniMarc st.Color_change("▼", mac.richTextBox1); st.Color_change("▲", mac.richTextBox1); } + if (mec != null) + { + st.Color_change("▼", mec.richTextBox1); + st.Color_change("▲", mec.richTextBox1); + } if (am != null) { st.Color_change("▼", am.richTextBox1); st.Color_change("▲", am.richTextBox1); @@ -98,6 +91,7 @@ namespace UniMarc public void textChange(string ftext, string ctext) { if (mac != null) mac.richTextBox1.Text = mac.richTextBox1.Text.Replace(ftext, ctext); + if (mec != null) mec.richTextBox1.Text = mec.richTextBox1.Text.Replace(ftext, ctext); if (mmm != null) mmm.richTextBox1.Text = mmm.richTextBox1.Text.Replace(ftext, ctext); if (am != null) am.richTextBox1.Text = am.richTextBox1.Text.Replace(ftext, ctext);