=====* unimarc [0.0104] 버전관리 시작 *=====

1. 인쇄 오류 수정
2. DLS복본조사 추가
This commit is contained in:
SeungHo Yang
2021-12-21 17:43:36 +09:00
parent d3ad66cf1f
commit 43625b5e62
91 changed files with 7119 additions and 4951 deletions

View File

@@ -86,20 +86,6 @@ namespace ISBN_Check_test
dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells[0];
this.ActiveControl = dataGridView1;
}
#region
private void count_res()
{
String_Text st = new String_Text();
int count = dataGridView1.Rows.Count;
for(int a= 0; a < count; a++)
{
string search_data = dataGridView1.Rows[a].Cells["Column1"].Value.ToString();
int tmp_count = st.Char_count(search_data, '|');
int lcount = tmp_count / 8;
dataGridView1.Rows[a].Cells["count"].Value = lcount.ToString();
}
}
#endregion
/// <summary>
/// 알라딘 API
/// </summary>
@@ -109,18 +95,42 @@ namespace ISBN_Check_test
// 도서명 / 저자 / 출판사 / isbn / 정가
// 발행일 / 도서분류 / 재고
string[] param = { "title", "author", "publisher", "isbn13", "priceStandard",
"pubDate", "categoryName" };
"pubDate", "categoryName", "stockStatus", };
API api = new API();
for (int a = start; a < end; a++)
{
process_Sub();
string query = dataGridView1.Rows[a].Cells["isbn"].Value.ToString();
string type;
switch (cb_filter.SelectedIndex)
{
case 0:
type = "Keyword";
break;
case 1:
type = "Title";
break;
case 2:
type = "Author";
break;
case 3:
type = "Publisher";
break;
case 4:
type = "ISBN13";
break;
default:
type = "";
break;
}
// string query = dataGridView1.Rows[a].Cells["isbn"].Value.ToString();
string query = Set_query(type, a);
if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.Yellow)
continue;
else if (gridview.Rows[a].DefaultCellStyle.BackColor == Color.LightGray)
gridview.Rows[a].DefaultCellStyle.BackColor = Color.Empty;
string aladin = api.Aladin(query, "ISBN13", param);
// string aladin = api.Aladin(query, "ISBN13", param);
string aladin = api.Aladin(query, type, param);
insert_By_Aladin(aladin, a);
try
{
@@ -129,6 +139,28 @@ namespace ISBN_Check_test
catch { }
}
}
string Set_query(string type, int idx)
{
string result = string.Empty;
if (type == "Keyword")
result = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString() +
dataGridView1.Rows[idx].Cells["author"].Value.ToString();
if (type == "Title")
result = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString();
if (type == "Author")
result = dataGridView1.Rows[idx].Cells["author"].Value.ToString();
if (type == "Publisher")
result = dataGridView1.Rows[idx].Cells["book_comp"].Value.ToString();
if (type == "ISBN13")
result = dataGridView1.Rows[idx].Cells["isbn"].Value.ToString();
return result;
}
private void Naver_API(DataGridView gridview, int start, int end)
{
// 도서명 / 저자 / 출판사 / isbn / 정가
@@ -139,7 +171,7 @@ namespace ISBN_Check_test
List<string> L_type = new List<string>();
List<string> L_Array = new List<string>();
for(int a = start; a < end; a++)
for (int a = start; a < end; a++)
{
L_type.Clear();
L_Array.Clear();
@@ -248,35 +280,11 @@ namespace ISBN_Check_test
{
progressBar1.PerformStep();
}
string Set_query(string type, int idx)
{
string result = string.Empty;
if(type == "Keyword")
result = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString() +
dataGridView1.Rows[idx].Cells["author"].Value.ToString();
if (type == "Title")
result = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString();
if (type == "Author")
result = dataGridView1.Rows[idx].Cells["author"].Value.ToString();
if (type == "Publisher")
result = dataGridView1.Rows[idx].Cells["book_comp"].Value.ToString();
return result;
}
void insert_By_Aladin(string data, int row)
{
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
dataGridView1.Rows[row].Selected = true;
if (data.Length > 0) {
dataGridView1.Rows[row].Cells["Column1"].Value = data;
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
}
string[] insert = data.Split('|');
if (data == "") { return; }
@@ -290,14 +298,28 @@ namespace ISBN_Check_test
}
catch(Exception ex) { MessageBox.Show(data); }
// 도서 분류 필요한 데이터로 재정리
int top = insert[6].IndexOf('>');
int mid = insert[6].IndexOf('>', top + 1);
int bot = insert[6].IndexOf('>', mid + 1);
if (bot < 0) { insert[6] = insert[6].Substring(top + 1); }
else { insert[6] = insert[6].Substring(top + 1, bot - top - 1); }
for (int a = 0; a < insert.Length; a++)
{
if (a % 8 == 6) { insert[a] = Aladin_CategorySort(insert[a]); }
}
input_api_aladin(insert, row, newstring);
dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", insert) + "|";
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
if (cb_filter.SelectedItem.ToString() == "별치조사")
input_api_aladin(insert, row, newstring);
input_api(insert, row, newstring);
}
string Aladin_CategorySort(string insert)
{
// 도서 분류 필요한 데이터로 재정리
int top = insert.IndexOf('>');
int mid = insert.IndexOf('>', top + 1);
int bot = insert.IndexOf('>', mid + 1);
if (bot < 0) { insert = insert.Substring(top + 1); }
else { insert = insert.Substring(top + 1, bot - top - 1); }
return insert;
}
void input_api_aladin(string[] data, int row, string date)
{
@@ -450,12 +472,27 @@ namespace ISBN_Check_test
dataGridView1.Rows[idx].Cells["isbn"].Value = value[3];
dataGridView1.Rows[idx].Cells["price2"].Value = value[4];
dataGridView1.Rows[idx].Cells["pubDate"].Value = date;
// dataGridView1.Rows[idx].Cells["category"].Value = value[6];
//if (cb_api.SelectedIndex == 2)
dataGridView1.Rows[idx].Cells["category"].Value = value[6];
dataGridView1.Rows[idx].Cells["sold_out"].Value = value[7];
dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow;
}
count_res();
}
#region
private void count_res()
{
String_Text st = new String_Text();
int count = dataGridView1.Rows.Count;
for (int a = 0; a < count; a++)
{
string search_data = dataGridView1.Rows[a].Cells["Column1"].Value.ToString();
int tmp_count = st.Char_count(search_data, '|');
int lcount = tmp_count / 8;
dataGridView1.Rows[a].Cells["count"].Value = lcount.ToString();
}
}
#endregion
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
Skill_Grid sg = new Skill_Grid();
@@ -488,7 +525,8 @@ namespace ISBN_Check_test
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
rowidx = e.RowIndex;
if(dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value == null)
if (rowidx < 0) return;
if (dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value == null)
dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value = "";
richTextBox1.Text = dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value.ToString();
@@ -522,27 +560,20 @@ namespace ISBN_Check_test
cb_filter.Items.AddRange(naver);
}
else if (cb_api.SelectedIndex == 2) {
string[] aladin = { "별치 조사" };
string[] aladin = { "도서명 + 저자", "도서명", "저자", "출판사", "별치조사" };
cb_filter.Items.AddRange(aladin);
}
Must_Col(cb_api.SelectedIndex);
}
private void Must_Col(int cb_idx)
{
if (cb_idx == 0 || cb_idx == 1)
if (cb_idx == 0 || cb_idx == 1 || cb_idx == 2)
{
dataGridView1.Columns["isbn"].DefaultCellStyle.BackColor = Color.Empty;
dataGridView1.Columns["book_name"].DefaultCellStyle.BackColor = Color.FromArgb(234, 226, 202);
dataGridView1.Columns["author"].DefaultCellStyle.BackColor = Color.FromArgb(234, 226, 202);
dataGridView1.Columns["book_comp"].DefaultCellStyle.BackColor = Color.FromArgb(234, 226, 202);
}
else if (cb_idx == 2)
{
dataGridView1.Columns["isbn"].DefaultCellStyle.BackColor = Color.FromArgb(234, 226, 202);
dataGridView1.Columns["book_name"].DefaultCellStyle.BackColor = Color.Empty;
dataGridView1.Columns["author"].DefaultCellStyle.BackColor = Color.Empty;
dataGridView1.Columns["book_comp"].DefaultCellStyle.BackColor = Color.Empty;
}
else {
return;
}
@@ -552,5 +583,17 @@ namespace ISBN_Check_test
Yes24 yes24 = new Yes24(this);
yes24.Show();
}
private void cb_filter_SelectedIndexChanged(object sender, EventArgs e)
{
if (cb_filter.SelectedItem.ToString() == "별치조사")
{
dataGridView1.Columns["isbn"].DefaultCellStyle.BackColor = Color.FromArgb(234, 226, 202);
dataGridView1.Columns["book_name"].DefaultCellStyle.BackColor = Color.Empty;
dataGridView1.Columns["author"].DefaultCellStyle.BackColor = Color.Empty;
dataGridView1.Columns["book_comp"].DefaultCellStyle.BackColor = Color.Empty;
}
}
}
}