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

- 주문처 관리 -
마크관리 / 장비관리 Grid 정비중.
ㄴ> 현재 값이 입력되면 자동으로 날짜출력하는 기능 추가중

- 마크탭 전체 재정비중 -

기타 소스코드 함수 정리
This commit is contained in:
SeungHo Yang
2021-10-08 18:45:17 +09:00
parent a01a14d34e
commit 74108e9d1b
25 changed files with 785 additions and 230 deletions

View File

@@ -1,4 +1,5 @@
using System;
using ExcelTest;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
@@ -12,9 +13,292 @@ namespace UniMarc.마크
{
public partial class Marc_mkList : Form
{
public Marc_mkList()
Marc marc;
public Marc_mkList(Marc _marc)
{
InitializeComponent();
marc = _marc;
}
private void Marc_mkList_Load(object sender, EventArgs e)
{
#region panel1 set
rb_basicNum.Checked = true;
rb_autoNum.Enabled = false;
string[] type = { "정리" };
cb_listType.Items.AddRange(type);
cb_listType.SelectedIndex = 0;
#endregion
#region panel2 set // 분류기호
// 저자기호
string[] First = { "첫음", "초성" };
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 */ "동서양 저자기호법 (국중)"
};
cb_authorType.Items.AddRange(authorType);
cb_authorType.SelectedIndex = 0;
string[] Book = { "첫음", "초성", "중성" };
cb_FirstBook.Items.AddRange(Book);
cb_FirstBook.SelectedIndex = 0;
// 분류기호
string[] divType = { "KDC", "DDC" };
cb_divType.Items.AddRange(divType);
cb_divType.SelectedIndex = 0;
string[] divNum = { "4", "5", "6" };
cb_divNum.Items.AddRange(divNum);
cb_divNum.SelectedIndex = 0;
#endregion
}
private void cb_divType_SelectedIndexChanged(object sender, EventArgs e)
{
cb_divNum.Items.Clear();
if (((ComboBox)sender).SelectedIndex == 0) {
string[] divNum = { "4", "5", "6" };
cb_divNum.Items.AddRange(divNum);
}
else {
string[] divNum = { "21", "22", "23" };
cb_divNum.Items.AddRange(divNum);
}
}
private void btn_mkList_Click(object sender, EventArgs e)
{
string listName = tb_listName.Text;
string Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
bool isAuthor = false;
bool isBook = false;
if (cb_FirstAuthor.SelectedIndex == 0)
isAuthor = true;
if (cb_FirstBook.SelectedIndex == 0)
isBook = true;
if (listName == "") {
MessageBox.Show("목록명을 입력해주세요!");
return;
}
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");
char aut;
if (Author.Length <= 1)
aut = Author[0];
else
aut = Author[1];
AuthorSymbol.Symbol sb = new AuthorSymbol.Symbol();
string res_Author = sb.Author_Fillter(Author[0], isAuthor);
#region
if (cb_authorType.SelectedIndex == 0) // 이재철 1표
Author = sb.Symbol_1(aut);
if (cb_authorType.SelectedIndex == 1) // 이재철 2표
Author = sb.Symbol_2(aut);
if (cb_authorType.SelectedIndex == 2) // 이재철 3표
Author = sb.Symbol_3(aut);
if (cb_authorType.SelectedIndex == 3) // 이재철 4표
Author = sb.Symbol_4(aut);
if (cb_authorType.SelectedIndex == 4) // 이재철 5표
Author = sb.Symbol_5(aut);
if (cb_authorType.SelectedIndex == 5) // 이재철 6표
Author = sb.Symbol_6(aut);
if (cb_authorType.SelectedIndex == 6) // 이재철 7표
Author = sb.Symbol_7(aut);
if (cb_authorType.SelectedIndex == 7) // 이재철 7표 (동양서저자기호표)
Author = sb.Symbol_7_동서(aut);
if (cb_authorType.SelectedIndex == 8) // 이재철 8표
Author = sb.Symbol_8(aut);
if (cb_authorType.SelectedIndex == 9) // 이재철 8표 (동양서저자기호표)
Author = sb.Symbol_8_동서(aut);
if (cb_authorType.SelectedIndex == 10) // 장일세
Author = sb.Symbol_Jang(Author);
if (cb_authorType.SelectedIndex == 11) // 커터샌본
Author = sb.Cutter(Author);
if (cb_authorType.SelectedIndex == 12) // 엘러드
Author = sb.Elord(Author);
if (cb_authorType.SelectedIndex == 13) // 동서양 저자기호표(국중)
Author = sb.NLK(Author);
#endregion
Author = Author.Replace("|", "");
res_Author += Author + sb.Book_Fillter(Book, isBook);
#endregion
#region
string res_Div = cb_divType.Text + cb_divNum.Text;
#endregion
// DB_UPDATE 수량 체크
}
}
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 = "";
try
{
s_tag = search.Substring(0, 3);
scan = "" + search.Substring(3);
}
catch { }
string result = string.Empty;
for (int a = 0; a < tag.Length; a++)
{
if (tag[a] == s_tag)
{
string marc_s = mrc[a];
int start = marc_s.IndexOf(scan);
if (start < 0)
result = "";
else
{
int end = marc_s.IndexOf("", start + 2);
if (end < 0)
result = marc_s.Substring(start);
else
result = marc_s.Substring(start, end - start);
break;
}
}
}
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")
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)
{
this.Close();
}
private void chk_countSplit_Click(object sender, EventArgs e)
{
if (chk_countSplit.Checked)
chk_countSplit.Checked = false;
else
chk_countSplit.Checked = true;
}
}
}