=====* unimarc *=====
- 마크 목록 정리 - [ Marc_mkList.cs ] 기타 풀막을 시방서 마크 목록으로 넘기는 소스코드 정리중.
This commit is contained in:
		| @@ -14,10 +14,13 @@ namespace UniMarc.마크 | ||||
|     public partial class Marc_mkList : Form | ||||
|     { | ||||
|         Marc marc; | ||||
|         string compidx = Properties.Settings.Default.compidx; | ||||
|  | ||||
|         public Marc_mkList(Marc _marc) | ||||
|         { | ||||
|             InitializeComponent(); | ||||
|             marc = _marc; | ||||
|              | ||||
|         } | ||||
|  | ||||
|         private void Marc_mkList_Load(object sender, EventArgs e) | ||||
| @@ -25,6 +28,7 @@ namespace UniMarc.마크 | ||||
|             #region panel1 set | ||||
|             rb_basicNum.Checked = true; | ||||
|             rb_autoNum.Enabled = false; | ||||
|              | ||||
|  | ||||
|             string[] type = { "정리" }; | ||||
|             cb_listType.Items.AddRange(type); | ||||
| @@ -96,64 +100,79 @@ namespace UniMarc.마크 | ||||
|                 isAuthor = true; | ||||
|             if (cb_FirstBook.SelectedIndex == 0) | ||||
|                 isBook = true; | ||||
|  | ||||
|                  | ||||
|             if (listName == "") { | ||||
|                 MessageBox.Show("목록명을 입력해주세요!"); | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
|             string[] update_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" | ||||
|             }; | ||||
|             string[] update_data = { | ||||
|                 "", "", "", "", "", | ||||
|                 "", "", "", "", "", | ||||
|                 "", "", "", "", "", | ||||
|                 "" | ||||
|             }; | ||||
|  | ||||
|             int[] row = checkGridRow(); | ||||
|  | ||||
|             // TODO: 필터링하여 DB에 집어넣는 작업 필요. | ||||
|             for (int a = 0; a < row.Length; a++) | ||||
|             { | ||||
|                 #region 저자기호 | ||||
|                 string Author = Take_Tag(marc.List_Book.Rows[a].Cells["db_marc"].Value.ToString(), "245d"); | ||||
|                 string Book = Take_Tag(marc.List_Book.Rows[a].Cells["book_name"].Value.ToString(), "245a"); | ||||
|                 // 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" }; | ||||
|                 // string[] Search = { "245d", "245a" }; | ||||
|  | ||||
|                 string[] Marc = Take_Tag(marc.List_Book.Rows[row[a]].Cells["db_marc"].Value.ToString(), Search); | ||||
|                 // string Author = Take_Tag(marc.List_Book.Rows[a].Cells["db_marc"].Value.ToString(), "245d"); | ||||
|                 // string Book = Take_Tag(marc.List_Book.Rows[a].Cells["book_name"].Value.ToString(), "245a"); | ||||
|  | ||||
|                 char aut; | ||||
|                 if (Author.Length <= 1) | ||||
|                     aut = Author[0]; | ||||
|                 if (Marc[0].Length <= 1) | ||||
|                     aut = Marc[0][0]; | ||||
|                 else | ||||
|                     aut = Author[1]; | ||||
|                     aut = Marc[0][1]; | ||||
|  | ||||
|                 AuthorSymbol.Symbol sb = new AuthorSymbol.Symbol(); | ||||
|                 string res_Author = sb.Author_Fillter(Author[0], isAuthor); | ||||
|                 string res_Author = sb.Author_Fillter(Marc[0][0], isAuthor); | ||||
|  | ||||
|                 #region 콤보박스 선택 | ||||
|                 if (cb_authorType.SelectedIndex == 0)         // 이재철 1표 | ||||
|                     Author = sb.Symbol_1(aut); | ||||
|                     Marc[0] = sb.Symbol_1(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 1)         // 이재철 2표   | ||||
|                     Author = sb.Symbol_2(aut); | ||||
|                     Marc[0] = sb.Symbol_2(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 2)         // 이재철 3표   | ||||
|                     Author = sb.Symbol_3(aut); | ||||
|                     Marc[0] = sb.Symbol_3(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 3)         // 이재철 4표   | ||||
|                     Author = sb.Symbol_4(aut); | ||||
|                     Marc[0] = sb.Symbol_4(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 4)         // 이재철 5표   | ||||
|                     Author = sb.Symbol_5(aut); | ||||
|                     Marc[0] = sb.Symbol_5(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 5)         // 이재철 6표   | ||||
|                     Author = sb.Symbol_6(aut); | ||||
|                     Marc[0] = sb.Symbol_6(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 6)         // 이재철 7표   | ||||
|                     Author = sb.Symbol_7(aut); | ||||
|                     Marc[0] = sb.Symbol_7(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 7)         // 이재철 7표 (동양서저자기호표)  | ||||
|                     Author = sb.Symbol_7_동서(aut); | ||||
|                     Marc[0] = sb.Symbol_7_동서(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 8)         // 이재철 8표   | ||||
|                     Author = sb.Symbol_8(aut); | ||||
|                     Marc[0] = sb.Symbol_8(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 9)         // 이재철 8표 (동양서저자기호표) | ||||
|                     Author = sb.Symbol_8_동서(aut); | ||||
|                     Marc[0] = sb.Symbol_8_동서(aut); | ||||
|                 if (cb_authorType.SelectedIndex == 10)        // 장일세 | ||||
|                     Author = sb.Symbol_Jang(Author); | ||||
|                     Marc[0] = sb.Symbol_Jang(Marc[0]); | ||||
|                 if (cb_authorType.SelectedIndex == 11)        // 커터샌본 | ||||
|                     Author = sb.Cutter(Author); | ||||
|                     Marc[0] = sb.Cutter(Marc[0]); | ||||
|                 if (cb_authorType.SelectedIndex == 12)        // 엘러드 | ||||
|                     Author = sb.Elord(Author); | ||||
|                     Marc[0] = sb.Elord(Marc[0]); | ||||
|                 if (cb_authorType.SelectedIndex == 13)        // 동서양 저자기호표(국중) | ||||
|                     Author = sb.NLK(Author); | ||||
|  | ||||
|                 #endregion | ||||
|                 Author = Author.Replace("|", ""); | ||||
|                 res_Author += Author + sb.Book_Fillter(Book, isBook); | ||||
|                     Marc[0] = sb.NLK(Marc[0]); | ||||
|                 #endregion | ||||
|                 Marc[0] = Marc[0].Replace("|", ""); | ||||
|                 res_Author += Marc[0] + sb.Book_Fillter(Marc[1], isBook); | ||||
|  | ||||
|                 #region 분류기호 | ||||
|                 string res_Div = cb_divType.Text + cb_divNum.Text; | ||||
| @@ -162,40 +181,56 @@ namespace UniMarc.마크 | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         string Take_Tag(string marc, string search) | ||||
|         string[] Take_Tag(string marc, string[] search) | ||||
|         { | ||||
|             string[] ary = marc.Split(''); | ||||
|             string[] tag = res_dir(ary[0].Substring(24)); | ||||
|             (string[] jisi, string[] mrc) = jisi_Symbol(tag, ary); | ||||
|  | ||||
|             string s_tag = ""; | ||||
|             string scan = ""; | ||||
|             string[] s_tag = new string[search.Length]; | ||||
|             string[] scan = new string[search.Length]; | ||||
|             try | ||||
|             { | ||||
|                 s_tag = search.Substring(0, 3); | ||||
|                 scan = "" + search.Substring(3); | ||||
|                 for (int a = 0; a < search.Length; a++) | ||||
|                 { | ||||
|                     s_tag[a] = search[a].Substring(0, 3); | ||||
|                     scan[a] = "" + search[a].Substring(3); | ||||
|                 } | ||||
|             } | ||||
|             catch { } | ||||
|  | ||||
|             string result = string.Empty; | ||||
|             string[] result = new string[search.Length]; | ||||
|             string memo = string.Empty; | ||||
|  | ||||
|             for (int a = 0; a < tag.Length; a++) | ||||
|             { | ||||
|                 if (tag[a] == s_tag) | ||||
|                 for (int b = 0; b < s_tag.Length; b++) | ||||
|                 { | ||||
|                     string marc_s = mrc[a]; | ||||
|                     int start = marc_s.IndexOf(scan); | ||||
|  | ||||
|                     if (start < 0) | ||||
|                         result = ""; | ||||
|                     else | ||||
|                     if (tag[a] == s_tag[b]) | ||||
|                     { | ||||
|                         int end = marc_s.IndexOf("", start + 2); | ||||
|                         if (end < 0) | ||||
|                             result = marc_s.Substring(start); | ||||
|                         string tmp = mrc[a]; | ||||
|                         int start = tmp.IndexOf(scan[b]); | ||||
|  | ||||
|                         if (start < 0) | ||||
|                         { | ||||
|                             int tag_num = Convert.ToInt16(s_tag[b]); | ||||
|                             if (tag_num < 10) | ||||
|                                 result[b] = tmp; | ||||
|                             else | ||||
|                                 result[b] = ""; | ||||
|                         } | ||||
|                         else | ||||
|                             result = marc_s.Substring(start, end - start); | ||||
|                         break; | ||||
|                         { | ||||
|                             int end = tmp.IndexOf("", start + 2); | ||||
|                             if (memo == result[b]) | ||||
|                                 break; | ||||
|  | ||||
|                             if (end < 0) | ||||
|                                 result[b] = tmp.Substring(start); | ||||
|                             else | ||||
|                                 result[b] = tmp.Substring(start, end - start); | ||||
|                             memo = result[b]; | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 SeungHo Yang
					SeungHo Yang