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

------------------------

=====* ISBN 체크 프로그램  *===== ★작업완료★
 a. 현재 마크팀 배포완료. - 추후 수정사항발생시 수정할 것.

------------------------

===== 작업중 =====
 b. 마크목록 폼 작성중
  1. 엑셀반출 기능 추가중 사용 작업중

===== 완료 =====
1. 주문관리 팩스연동 완료
2. 전송된 팩스 확인 작업개시, 이메일 전송모듈 수정완료.
3. 주문관리에서 주문처와 목록 검색하는 폼 검색 모듈도 재수정 완료함.

ISBN 체크 프로그램 => 본프로그램에 이식중.
ㄴ> 코드는 다 옮겼으나 기존 사용하던 방식과 조금 달라서 버그발생 가능성 있음.
ㄴ> 버그 체크 계속 해볼것. 21-04-15
ㄴ> 21_04_20 버그 없음.

2. 마크편집 폼 수정 중 (마크 반출 test프로젝트 진행완료, 본 프로젝트에 적용중. / 저장기능활성화 작업완료)
 2-1. 기존의 칸채우기에서 예상되지 못한 버그가 발생하여 칸채우기 숨김.
 2-2. 008태크 재배치 => TextBox에 적용완료. 변경사항 메모장으로 넘기는 작업 완료.
 2-3. 저장기능 완료. (04.14 체크해볼것)
This commit is contained in:
SeungHo Yang
2021-04-20 18:32:51 +09:00
parent 289ea93e11
commit 77d303c9dc
32 changed files with 520 additions and 489 deletions

View File

@@ -124,11 +124,8 @@ namespace ExcelTest
{
for(int a= 0; a < List_Book.Rows.Count; a++)
{
string[] sear_tbl = { "ISBN", "서명", "저자", "출판사" };
string[] sear_col = { List_Book.Rows[a].Cells["ISBN13"].Value.ToString(),
List_Book.Rows[a].Cells["book_name"].Value.ToString(),
List_Book.Rows[a].Cells["author"].Value.ToString(),
List_Book.Rows[a].Cells["book_comp"].Value.ToString() };
string[] sear_tbl = { "ISBN" };
string[] sear_col = { List_Book.Rows[a].Cells["ISBN13"].Value.ToString() };
string Marc = db.More_DB_Search("Marc", sear_tbl, sear_col, "`idx`, `marc`, `grade`");
string[] db_data = Marc.Split('|');
if (db_data.Length < 2) { List_Book.Rows[a].DefaultCellStyle.BackColor = Color.LightGray; }
@@ -814,8 +811,7 @@ namespace ExcelTest
break;
case 88: // TODO: 입력시 코드값?이 출력됨 X쪽의 문제인지 아스키코드의 문제인지 확인 불가.
richTextBox1.SelectionColor = Color.Blue;
richTextBox1.SelectedText = "▼";
richTextBox1.SelectedText = "x";
richTextBox1.SelectedText = "▼x";
richTextBox1.SelectionColor = Color.Black;
break;
case 89:
@@ -1030,7 +1026,6 @@ namespace ExcelTest
else { richTextBox1.SelectionBackColor = Color.Empty; }
}
}
private void Btn_interlock_Click(object sender, EventArgs e)
{
// 언어 36
@@ -1169,6 +1164,151 @@ namespace ExcelTest
db.DB_INSERT(table_name, Insert_col, Insert_tbl);
}
}
private void List_Book_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1) { return; }
int row_idx = e.RowIndex;
richTextBox1.Text = "";
if (!click_Marc(row_idx)) { richTextBox1.Text = Make_Empty(); }
Create_008();
Color_change("▼");
Color_change("▲");
}
private string Make_Empty()
{
// 입력일자 (00-05)
// 발행년유형 (6)
// 발행년1 (07-10)
// 발행년2 (11-14)
// 발행국 (15-17)
// 삽화표시 (18-21)
// 이용대상자수준 (22) v
// 개별자료형태 (23) v
// 내용형식1 (24) v
// 내용형식2 (25) v
// 한국대학부호 (26-27)
// 수정레코드 (28)
// 회의간행물 (29) c
// 기념논문집 (30) c
// 색인 (31)
// 목록전거 (32)
// 문학형식 (33) v
// 전기 (34) v
// 언어 (35-37) v
// 한국정부기관부호 (38-39)
string yyMMdd = DateTime.Now.ToString("yyMMdd");
string yyyy = DateTime.Now.ToString("yyyy");
string Empty_008 = yyMMdd + "s" + yyyy + " 000 kor ▲";
text008.Text = Empty_008.Replace("▲", "");
data008 = text008.Text;
string Empty_text = "008\t \t" + Empty_008 + "\n020\t \t▲\n" + "056\t \t▲\n" + "100\t \t▲\n" +
"245\t \t▲\n" + "260\t \t▲\n" + "300\t \t▲\n" +
"653\t \t▲\n" + "700\t \t▲\n" + "950\t \t▲\n";
return Empty_text;
}
bool click_Marc(int row)
{
string Marc_data = List_Book.Rows[row].Cells["db_marc"].Value.ToString();
if (Marc_data.Length < 3) { return false; }
List<string> TagNum = new List<string>();
List<string> field = new List<string>();
Marc_data = Marc_data.Replace("", "▼");
Marc_data = Marc_data.Replace("", "▲");
// string leader = Marc_data.Substring(0, 24);
int startidx = 0;
string[] data = Marc_data.Substring(24).Split('▲');
// List에 필요한 데이터 집어넣는 작업.
for (int a = 1; a < data.Length - 1; a++)
{
TagNum.Add(data[0].Substring(startidx, 12));
startidx += 12;
field.Add(data[a] + "▲");
}
// List에 들어간 데이터를 메모장에 출력시키는 작업.
for (int a = 0; a < TagNum.Count; a++)
{
string result = TagNum[a].Substring(0, 3);
if (TagNum[a].Substring(0,3) == "008") {
text008.Text = field[a].Replace("▲", "");
data008 = text008.Text;
}
else {
}
if (field[a].IndexOf("▼") == -1) {
result += "\t \t" + field[a];
}
else {
string temp = field[a].Insert(2, "\t");
result += "\t" + temp;
}
richTextBox1.Text += result + "\n";
}
return true;
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (text008.Text.Length < 3) { return; }
string text = text008.Text;
string comboName = ((ComboBox)sender).Name;
int comboIdx = ((ComboBox)sender).SelectedIndex;
text008.Text = tag008.Combo_Change(text, comboName, comboIdx);
Apply_Main_marc();
}
/// <summary>
/// 008text가 메인 텍스트박스에 적용됨.
/// </summary>
private void Apply_Main_marc()
{
string text = text008.Text;
richTextBox1.Text = richTextBox1.Text.Replace(data008, text);
data008 = text;
}
private void col008res_TextChanged(object sender, EventArgs e)
{
if (text008.Text.Length < 3) { return; }
string text = text008.Text;
string iText = ((Label)sender).Text;
if (iText.Length < 1) { return; }
char[] textArray = text.ToCharArray();
char[] inputArray = iText.ToCharArray();
switch (((Label)sender).Name)
{
case "col008res":
textArray[26] = inputArray[0];
textArray[27] = inputArray[1];
break;
case "gov008res":
textArray[38] = inputArray[0];
textArray[39] = inputArray[1];
break;
}
text = new string(textArray);
text008.Text = text;
Apply_Main_marc();
}
private void input_date_ValueChanged(object sender, EventArgs e)
{
if (text008.Text.Length < 3) { return; }
string date = input_date.Value.ToString();
date = date.Substring(0, 10);
date = date.Replace("-", "");
date = date.Remove(0, 2);
text008.Text = text008.Text.Remove(0, 6);
text008.Text = date + text008.Text;
Apply_Main_marc();
}
private void Btn_Close_Click(object sender, EventArgs e)
{
this.Close();
@@ -1290,8 +1430,6 @@ namespace ExcelTest
/// <returns></returns>
public void Create_008()
{
//210219s2021 ulk 000 kor ▼
//0123456789012345678901234567890123456789
string data = text008.Text;
if (data == "" || data == null) { return; }
@@ -1306,7 +1444,14 @@ namespace ExcelTest
* 목록전거 문학형식 전기 언어 한국정부기관부호 */
// 사전에 선언된 string배열에 맞는 데이터를 배정.
Tag008[0] = "20" + data.Substring(0, 6); // 입력일자 (00-05)
int tmp_years = Convert.ToInt32(data.Substring(0, 2));
int now_years = Convert.ToInt32(DateTime.Now.ToString("yy"));
string century = "20";
if (tmp_years > now_years)
century = "19";
Tag008[0] = century + data.Substring(0, 6); // 입력일자 (00-05)
Tag008[1] = data.Substring(6, 1); // 발행년유형 (6)
Tag008[2] = data.Substring(7, 4); // 발행년1 (07-10)
Tag008[3] = data.Substring(11, 4); // 발행년2 (11-14)
@@ -1340,96 +1485,19 @@ namespace ExcelTest
comboBox2.SelectedIndex = tag008.DataType_008(Tag008[7]); // 개별자료형태
comboBox3.SelectedIndex = tag008.Format_008(Tag008[8]); // 내용형식1
comboBox7.SelectedIndex = tag008.Format_008(Tag008[9]); // 내용형식2
comboBox4.SelectedIndex = tag008.Literary_008(Tag008[16]); // 문학형식
comboBox5.SelectedIndex = tag008.Biography_008(Tag008[17]); // 전기
comboBox6.SelectedIndex = tag008.Language_008(Tag008[18]); // 언어
checkBox1.Checked = tag008.checkBox_008(Tag008[12]); // 회의간행물
checkBox2.Checked = tag008.checkBox_008(Tag008[13]); // 기념논문집
checkBox1.Checked = tag008.CheckBox_008(Tag008[12]); // 회의간행물
checkBox2.Checked = tag008.CheckBox_008(Tag008[13]); // 기념논문집
col008res.Text = Tag008[10];
gov008res.Text = Tag008[19];
return;
}
/*
/// <summary>
/// 008 만드는 함수
/// </summary>
/// <param name="strValue"></param>
/// <returns></returns>
public string Create_008(string strValue)
{
richTextBox2.Text = richTextBox1.Text;
char[] six = { ' ',' ' }; // TODO: 발행년유형 구하는 로직 다시 짜야함.
if (richTextBox1.Text.IndexOf("008") > 0)
{
int cout = richTextBox1.Text.IndexOf("008") + 11; // 발행년유형
int cc = cout + 26; // 목록전거
six[0] = richTextBox1.Text[cout];
six[1] = richTextBox1.Text[cc];
}
string result = "008\t \t";
string[] combo1_res = {" ", "a", "j", "b", "c",
"d", "e", "f", "z" };
string[] combo2_res = { " ", "d", "f" };
string[] combo3_res = { " ", "6", "d", "e", "o",
"s", "r", "y", "j", "z",
"m", "g", "l", "v", "w",
"2", "5", "k", "q", "a",
"b", "c", "f", "i", "n",
"t", "p", "u" };
string[] combo4_res = { " ", "f", "k", "j", "p",
"e", "d", "v", "m", "u",
"l", "s", "t", "w", "h",
"i" };
string[] combo5_res = { " ", "a", "b", "c", "d" };
string[] combo6_res = { "kor", "eng", "jpn", "chi", "ger",
"fre", "rus", "spa", "ita", "dut",
"fin", "swe", "por", "nor", "grc",
"cze", "pol", "mul", "may", "mon",
"bur", "vie", "slv", "ara", "afr",
"est", "uzb", "ukr", "mar", "cam",
"tha", "tur", "tuk", "tib", "tag",
"hun" };
string timenow = DateTime.Now.ToString("yy/MM/dd");
timenow = timenow.Replace("-", "");
result += timenow.Replace(" ", ""); // 입력일자(00-05)
if (six[0] == 's' || six[0] == 'm') { // 발행년유형(6) 발행년1(07-10) 발행년2(11-14)
string tempStr = Regex.Replace(text260c.Text, @"[^0-9]", "");
if (tempStr.Length == 4) { result += "s" + tempStr + "\t"; }
else if (tempStr.Length == 8) { result += "m" + tempStr; }
}
else { result += six[0]; }
result += tag008.Country_008(text260a.Text); // 발행국(15-17)
result += tag008.Picture_008(text300b.Text); // 삽화표시(18-21)
int Sel = comboBox1.SelectedIndex;
result += combo1_res[Sel]; // 이용대상자수준(22)
Sel = comboBox2.SelectedIndex;
result += combo2_res[Sel]; // 개별자료형태(23)
Sel = comboBox3.SelectedIndex;
result += combo3_res[Sel]; // 내용형식1(24)
Sel = comboBox7.SelectedIndex;
result += combo3_res[Sel]; // 내용형식2(25)
result += col008res.Text + " "; // 한국대학부호(26-27) 수정레코드(28)
if (checkBox1.Checked == true) { result += "1"; } else { result += "0"; } // 회의간행물(29)
if (checkBox2.Checked == true) { result += "1"; } else { result += "0"; } // 기념논문집(30)
if (text504a.Text.Contains("색인") == true) { result += "1"; } else { result += "0"; } // 색인(31)
if (six[1] == ' ' || six[1] == 'a' || six[1] == 'c' || six[1] == 'd') { result += six[1]; } // 목록전거(32)
else { result += "u"; }
Sel = comboBox4.SelectedIndex;
result += combo4_res[Sel]; // 문학형식(33)
Sel = comboBox5.SelectedIndex;
result += combo5_res[Sel]; // 전기(34)
Sel = comboBox6.SelectedIndex;
result += combo6_res[Sel]; // 언어(35-37)
result += gov008res.Text + "▲\n"; // 한국정부기관부호(38-39)
return result;
}
*/
/// <summary>
/// GridView에 다시 집어넣는거
/// </summary>
@@ -1955,135 +2023,5 @@ namespace ExcelTest
GridView505.CurrentCell = null;
}
private void List_Book_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex == -1) { return; }
int row_idx = e.RowIndex;
int col_idx = e.ColumnIndex;
richTextBox1.Text = "";
click_Marc(row_idx);
Create_008();
// button3_Click(null, null);
}
void click_Marc(int row)
{
string Marc_data = List_Book.Rows[row].Cells["db_marc"].Value.ToString();
if (Marc_data.Length < 3) { return; }
List<string> TagNum = new List<string>();
List<string> field = new List<string>();
Marc_data = Marc_data.Replace("", "▼");
Marc_data = Marc_data.Replace("", "▲");
// string leader = Marc_data.Substring(0, 24);
int startidx = 0;
string[] data = Marc_data.Substring(24).Split('▲');
// List에 필요한 데이터 집어넣는 작업.
for (int a = 1; a < data.Length - 1; a++)
{
TagNum.Add(data[0].Substring(startidx, 12));
startidx += 12;
field.Add(data[a] + "▲");
}
// List에 들어간 데이터를 메모장에 출력시키는 작업.
for (int a = 0; a < TagNum.Count; a++)
{
string result = TagNum[a].Substring(0, 3);
if (TagNum[a].Substring(0,3) == "008") {
text008.Text = field[a].Replace("▲", "");
data008 = text008.Text;
}
else {
}
if (field[a].IndexOf("▼") == -1) {
result += "\t \t" + field[a];
}
else {
string temp = field[a].Insert(2, "\t");
result += "\t" + temp;
}
richTextBox1.Text += result + "\n";
}
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
if (text008.Text.Length < 3) { return; }
string text = text008.Text;
string comboName = ((ComboBox)sender).Name;
int comboIdx = ((ComboBox)sender).SelectedIndex;
text008.Text = tag008.combo_Change(text, comboName, comboIdx);
Apply_Main_marc();
// 입력일자 (00-05)
// 발행년유형 (6)
// 발행년1 (07-10)
// 발행년2 (11-14)
// 발행국 (15-17)
// 삽화표시 (18-21)
// 이용대상자수준 (22) v
// 개별자료형태 (23) v
// 내용형식1 (24) v
// 내용형식2 (25) v
// 한국대학부호 (26-27)
// 수정레코드 (28)
// 회의간행물 (29) c
// 기념논문집 (30) c
// 색인 (31)
// 목록전거 (32)
// 문학형식 (33) v
// 전기 (34) v
// 언어 (35-37) v
// 한국정부기관부호 (38-39)
}
private void Apply_Main_marc()
{
string text = text008.Text;
richTextBox1.Text = richTextBox1.Text.Replace(data008, text);
data008 = text;
}
private void col008res_TextChanged(object sender, EventArgs e)
{
if (text008.Text.Length < 3) { return; }
string text = text008.Text;
string iText = ((Label)sender).Text;
if (iText.Length < 1) { return; }
char[] textArray = text.ToCharArray();
char[] inputArray = iText.ToCharArray();
switch (((Label)sender).Name)
{
case "col008res":
textArray[26] = inputArray[0];
textArray[27] = inputArray[1];
break;
case "gov008res":
textArray[38] = inputArray[0];
textArray[39] = inputArray[1];
break;
}
text = new string(textArray);
text008.Text = text;
Apply_Main_marc();
}
private void input_date_ValueChanged(object sender, EventArgs e)
{
string date = input_date.Value.ToString();
date = date.Substring(0, 10);
date = date.Replace("-", "");
date = date.Remove(0, 2);
text008.Text = text008.Text.Remove(0, 6);
text008.Text = date + text008.Text;
Apply_Main_marc();
}
}
}