=====* unimarc *=====

기능 작업 완료
테스트 작업 진행예정.
This commit is contained in:
SeungHo Yang
2021-11-02 18:38:08 +09:00
parent a70a396a2c
commit 9466ca0a1e
40 changed files with 2582 additions and 663 deletions

View File

@@ -44,31 +44,18 @@ namespace UniMarc.마크
#region panel2 set // 분류기호
AuthorSymbol.Symbol symbol = new AuthorSymbol.Symbol();
// 저자기호
string[] First = { "첫음", "초성" };
string[] First = symbol.authorBook;
cb_FirstAuthor.Items.AddRange(First);
cb_FirstAuthor.SelectedIndex = 0;
string[] authorType = {
/* 00 */ "이재철 1표",
/* 01 */ "이재철 2표",
/* 02 */ "이재철 3표(실용형 가표)",
/* 03 */ "이재철 4표(실용형 까표)",
/* 04 */ "이재철 5표(완전형 가표)",
/* 05 */ "이재철 6표(완전형 가표)",
/* 06 */ "이재철 7표(실용형 하표)",
/* 07 */ "이재철 7표(동서저자기호표)",
/* 08 */ "이재철 8표(완전형 하표)",
/* 09 */ "이재철 8표(동서저자기호표)",
/* 10 */ "장일세 저자기호표",
/* 11 */ "커터 샌본 저자기호표",
/* 12 */ "엘러드 저자기호법",
/* 13 */ "동서양 저자기호법 (국중)"
};
string[] authorType = symbol.authorType;
cb_authorType.Items.AddRange(authorType);
cb_authorType.SelectedIndex = 0;
string[] Book = { "첫음", "초성", "중성" };
string[] Book = symbol.authorBook;
cb_FirstBook.Items.AddRange(Book);
cb_FirstBook.SelectedIndex = 0;
@@ -98,8 +85,19 @@ namespace UniMarc.마크
private void btn_mkList_Click(object sender, EventArgs e)
{
String_Text st = new String_Text();
if (tb_listName.Text == "") {
MessageBox.Show("목록명을 입력해주세요!");
return;
}
if (tb_outnum.Text == "") {
MessageBox.Show("차수가 비어있습니다.");
return;
}
string listName = tb_listName.Text;
string Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string outnum = tb_outnum.Text + "차";
bool isAuthor = false;
bool isBook = false;
@@ -107,11 +105,8 @@ namespace UniMarc.마크
isAuthor = true;
if (cb_FirstBook.SelectedIndex == 0)
isBook = true;
if (listName == "") {
MessageBox.Show("목록명을 입력해주세요!");
return;
}
bool[] isType = { isAuthor, isBook };
// 시방서 목록 DB에 들어갈 것들.
string[] insert_list_col = {
"compidx", "work_list", "date", "state", "gu",
@@ -124,36 +119,42 @@ namespace UniMarc.마크
rtb_etc.Text
};
string cmdByList = db.DB_INSERT("Specs_List", insert_list_col, insert_list_data);
db.DB_Send_CMD_reVoid(cmdByList);
// 시방서 마크 DB에 들어갈 것들.
string[] insert_marc_col = {
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"
"price", "tag008", "class_symbol", "author_symbol", "marc",
"imageURL", "count", "num", "out_num", "midx"
};
string[] insert_marc_data = {
compidx, listName, Time, "", "",
"", "", "", "", "",
"", "", "", "", "",
""
"", "", "", "", ""
}; // 마크에서 추출 ( 3 ~ 12 )
int[] row = checkGridRow();
int num = 0;
progressBar1.Maximum = row.Length;
string cmdByMarc = string.Format("INSERT INTO {0} {1}", "Specs_Marc", db.DB_INSERT_SUB("", insert_marc_col));
// TODO: 필터링하여 DB에 집어넣는 작업 필요.
// 필터링하여 DB에 집어넣는 작업
for (int a = 0; a < row.Length; a++)
{
num += 1;
// 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" };
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] = marc.List_Book.Rows[row[a]].Cells["count"].Value.ToString();
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();
string[] Marc = Take_Tag(insert_marc_data[14], Search);
string[] Marc = st.Take_Tag(insert_marc_data[14], Search);
string[] Author = { Marc[4], Marc[1] };
for (int b = 0; b < Marc.Length; b++)
{
@@ -162,34 +163,39 @@ namespace UniMarc.마크
Author[0] = Regex.Replace(Author[0], @"[^a-zA-Z0-9가-힣_]", "", RegexOptions.Singleline);
Author[1] = Regex.Replace(Author[1], @"[^a-zA-Z0-9가-힣_]", "", RegexOptions.Singleline);
Author[1] = st.RemoveWordInBracket(Author[1]);
AuthorSymbol.Symbol sb = new AuthorSymbol.Symbol();
string authorType = cb_authorType.SelectedItem.ToString();
string res_Author = sb.SymbolAuthor(Author[0], Author[1], authorType, isType);
/*
char aut;
if (Author[0].Length <= 1)
aut = Author[0][0];
else
aut = Author[0][1];
AuthorSymbol.Symbol sb = new AuthorSymbol.Symbol();
string res_Author = sb.Author_Fillter(Author[0][0], isAuthor);
#region 콤보박스 선택
if (cb_authorType.SelectedIndex == 0) // 이재철 1표
Author[0] = sb.Symbol_1(aut);
if (cb_authorType.SelectedIndex == 1) // 이재철 2표
if (cb_authorType.SelectedIndex == 1) // 이재철 2표
Author[0] = sb.Symbol_2(aut);
if (cb_authorType.SelectedIndex == 2) // 이재철 3표
if (cb_authorType.SelectedIndex == 2) // 이재철 3표
Author[0] = sb.Symbol_3(aut);
if (cb_authorType.SelectedIndex == 3) // 이재철 4표
if (cb_authorType.SelectedIndex == 3) // 이재철 4표
Author[0] = sb.Symbol_4(aut);
if (cb_authorType.SelectedIndex == 4) // 이재철 5표
if (cb_authorType.SelectedIndex == 4) // 이재철 5표
Author[0] = sb.Symbol_5(aut);
if (cb_authorType.SelectedIndex == 5) // 이재철 6표
if (cb_authorType.SelectedIndex == 5) // 이재철 6표
Author[0] = sb.Symbol_6(aut);
if (cb_authorType.SelectedIndex == 6) // 이재철 7표
if (cb_authorType.SelectedIndex == 6) // 이재철 7표
Author[0] = sb.Symbol_7(aut);
if (cb_authorType.SelectedIndex == 7) // 이재철 7표 (동양서저자기호표)
if (cb_authorType.SelectedIndex == 7) // 이재철 7표 (동양서저자기호표)
Author[0] = sb.Symbol_7_동서(aut);
if (cb_authorType.SelectedIndex == 8) // 이재철 8표
if (cb_authorType.SelectedIndex == 8) // 이재철 8표
Author[0] = sb.Symbol_8(aut);
if (cb_authorType.SelectedIndex == 9) // 이재철 8표 (동양서저자기호표)
Author[0] = sb.Symbol_8_동서(aut);
@@ -204,162 +210,37 @@ namespace UniMarc.마크
#endregion
Author[0] = Author[0].Replace("|", "");
res_Author += Author[0] + sb.Book_Fillter(Author[1], isBook);
*/
insert_marc_data[13] = res_Author;
string cmdByMarc = db.DB_INSERT("Specs_Marc", insert_marc_col, insert_marc_data);
if (a == row.Length - 1)
cmdByMarc += db.DB_INSERT_SUB("value", insert_marc_data) + ";";
else
cmdByMarc += "value" + db.DB_INSERT_SUB("value", insert_marc_data) + ", ";
progressBar1.PerformStep();
}
if (progressBar1.Value == progressBar1.Maximum) {
label2.Text = "완료되었습니다!";
db.DB_Send_CMD_reVoid(cmdByList);
db.DB_Send_CMD_reVoid(cmdByMarc);
}
}
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 = new string[search.Length];
string[] scan = new string[search.Length];
try
{
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 = new string[search.Length];
string memo = string.Empty;
for (int a = 0; a < tag.Length; a++)
{
for (int b = 0; b < s_tag.Length; b++)
{
if (tag[a] == s_tag[b])
{
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
{
start += 2;
int end = tmp.IndexOf("", start);
if (memo == result[b])
break;
if (end < 0)
result[b] = tmp.Substring(start);
else
result[b] = tmp.Substring(start, end - start);
memo = result[b];
}
}
}
}
for (int a = 0; a < result.Length; a++)
{
if (result[a] == null)
{
result[a] = "";
}
}
return result;
}
#region Take_Tag_Sub
string[] res_dir(string dir)
{
List<string> tmp = new List<string>();
for (int a = 0; a < dir.Length; a++)
{
if (a % 12 == 0)
tmp.Add(dir.Substring(a, 3));
}
return tmp.ToArray();
}
(string[], string[]) jisi_Symbol(string[] dir, string[] marc)
{
List<string> res = new List<string>();
List<string> tmp = new List<string>();
for (int a = 0; a < dir.Length; a++)
{
if (dir[a].Length < 1)
break;
if (marc[a + 1].Contains(""))
{
res.Add(marc[a + 1].Substring(0, 2));
tmp.Add(marc[a + 1].Substring(2));
}
else
{
res.Add("");
tmp.Add(marc[a + 1]);
}
}
return (res.ToArray(), tmp.ToArray());
}
#endregion
#region mkList_Sub
int[] checkGridRow()
{
List<int> GridRow = new List<int>();
for (int a = 0; a < marc.List_Book.Rows.Count; a++)
{
if (marc.List_Book.Rows[a].Cells["colCheck"].Value.ToString() == "V")
bool isSuccess = true;
if (!marc.Check_BackColor(a) && marc.Check_List_V(a))
isSuccess = false;
if (isSuccess)
GridRow.Add(a);
}
int[] Result = GridRow.ToArray();
return Result;
}
string Author_Symbol()
{
string result = "";
// 저자 첫음
// 저자 코드
// 도서 첫음
return result;
}
/* TODO: 마크 데이터 추출이후 작업
#region Author_Symbol_Sub
string First_Author()
{
int idx = cb_FirstAuthor.SelectedIndex;
RadioButton rb = new RadioButton();
if (idx == 0)
rb.Checked = true;
else
rb.Checked = false;
}
string Author_Type()
{
int idx = cb_cb_authorType.SelectedIndex;
}
string First_Book()
{
int idx = cb_FirstBook.SelectedIndex;
}
#endregion
*/
#endregion
private void btn_Close_Click(object sender, EventArgs e)