* unimarc

a. 팩스전송 완료.
 b. 마크목록 폼 작성중
  1. 엑셀반출 기능 추가중 사용 작업중
  2. 마크편집 폼 수정 중 (마크 반출 test프로젝트 진행완료, 본 프로젝트에 적용중. / 저장기능활성화 작업완료)
   2-1. 기존의 칸채우기에서 예상되지 못한 버그가 발생하여 칸채우기 숨김.
   2-2. 008태크 재배치 => TextBox에 적용완료. 변경사항 메모장으로 넘기는 작업 진행해야함.
   2-3. 현재 TODO : 저장기능

TODOLIST
1. 팩스로 전송될 엑셀파일 밑작업마무리 (입력될 파라미터만 적용하면 실사용가능)
2. 알라딘API, 네이버 API연동중 자잘한 버그 수정작업 필요.
This commit is contained in:
SeungHo Yang
2021-03-30 18:42:33 +09:00
parent 7e802070bf
commit 9eeb4b5ad6
18 changed files with 210 additions and 141 deletions

View File

@@ -20,9 +20,7 @@ namespace ISBN_Check_test
private void Form1_Load(object sender, EventArgs e)
{
string[] api_list = { "알라딘", "네이버" };
string[] filter_list = { "제목+저자", "제목", "저자", "출판사" };
cb_api.Items.AddRange(api_list);
cb_filter.Items.AddRange(filter_list);
}
private void button2_Click(object sender, EventArgs e)
{
@@ -37,6 +35,7 @@ namespace ISBN_Check_test
private void button1_Click(object sender, EventArgs e)
{
if(cb_api.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
if(cb_filter.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
Stopwatch stopwatch = new Stopwatch();
stopwatch.Start();
@@ -52,7 +51,6 @@ namespace ISBN_Check_test
switch (cb_api.SelectedIndex)
{
case 0:
if(cb_filter.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
Aladin_API(dataGridView1, start, end);
break;
case 1:
@@ -120,6 +118,11 @@ namespace ISBN_Check_test
for(int a = start; a < end; 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[] ArrayValue = { gridview.Rows[a].Cells["book_name"].Value.ToString(),
gridview.Rows[a].Cells["author"].Value.ToString(),
gridview.Rows[a].Cells["book_comp"].Value.ToString() };
@@ -164,10 +167,10 @@ namespace ISBN_Check_test
string newstring = string.Empty;
if (data == "") { return; }
if (data == "") { return; }
// pubDate형 보기편하게 DateTime형으로 재정리
newstring = String.Format("{0:yyyy/MM/dd HH:mm}",
newstring = String.Format("{0:yyyy/MM/dd}",
DateTime.Parse(insert[5].Remove(insert[5].IndexOf(" G"))));
// 도서 분류 필요한 데이터로 재정리
@@ -196,36 +199,27 @@ namespace ISBN_Check_test
}
void insert_By_Naver(string value, int row)
{
value = value.Replace("<b>", "");
value = value.Replace("</b>", "");
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
dataGridView1.Rows[row].Selected = true;
if (value.Length > 0) {
dataGridView1.Rows[row].Cells["Column1"].Value = value;
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
}
if (value == "") return;
bool[] chk = { false, false, false };
string book_name = dataGridView1.Rows[row].Cells["book_name"].Value.ToString();
string author = dataGridView1.Rows[row].Cells["author"].Value.ToString();
string book_comp = dataGridView1.Rows[row].Cells["book_comp"].Value.ToString();
value = value.Replace("<b>", "");
value = value.Replace("</b>", "");
string[] sp_data = value.Split('\t');
if (sp_data.Length > 1) return;
/// TODO: 밑에 작업하세요
#region
// title author publisher isbn price pubdate / discount
// title author publisher isbn price pubdate discount
string[] grid = { "", "", "", "", "", "", "", "" };
for (int a = 0; a < sp_data.Length; a++)
#region
/* 0 : 도서명
* 1 : 저자
* 2 : 출판사
* 3 : ISBN
* 4 : 판매가
* 5 : 출간일
* 6 : 카테고리
* 7 : 품절/절판 */
for (int a = 0; a < sp_data.Length-1; a++)
{
string[] data = sp_data[a].Split('|');
int idx = data.Length - 2;
@@ -244,19 +238,43 @@ namespace ISBN_Check_test
else
grid[3] = data[idx - 3];
grid[5] = data[idx - 2];
grid[6] = data[idx - 1];
grid[4] = data[idx - 2];
grid[5] = data[idx - 1];
if (data[idx] == "")
grid[8] = "절판";
grid[7] = "절판";
else
grid[8] = "";
grid[7] = "";
for(int b = 0; b < 9; b++) {
grid[9] += grid[b];
}
dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", grid) + "|";
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
}
if (sp_data.Length > 1) return;
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
dataGridView1.Rows[row].Selected = true;
#endregion
bool[] chk = { false, false, false };
string book_name = dataGridView1.Rows[row].Cells["book_name"].Value.ToString();
string author = dataGridView1.Rows[row].Cells["author"].Value.ToString();
string book_comp = dataGridView1.Rows[row].Cells["book_comp"].Value.ToString();
string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd");
if (grid[0] == book_name) chk[0] = true;
if (grid[1] == author) chk[1] = true;
if (grid[2] == book_comp) chk[2] = true;
if (chk[0] == true && chk[1] == true && chk[2] == true)
{
dataGridView1.Rows[row].Cells["isbn"].Value = grid[3];
dataGridView1.Rows[row].Cells["price2"].Value = grid[4];
dataGridView1.Rows[row].Cells["pubDate"].Value = newstring;
dataGridView1.Rows[row].Cells["category"].Value = grid[6];
dataGridView1.Rows[row].Cells["sold_out"].Value = grid[7];
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.Yellow;
}
}
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
@@ -296,16 +314,19 @@ namespace ISBN_Check_test
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (!(char.IsDigit(e.KeyChar) || e.KeyChar == Convert.ToChar(Keys.Back)))
{
e.Handled = true;
}
}
private void cb_api_SelectedIndexChanged(object sender, EventArgs e)
{
if(cb_api.SelectedIndex == 1)
cb_filter.Enabled = false;
else cb_filter.Enabled = true;
cb_filter.Items.Clear();
if (cb_api.SelectedIndex == 0) {
string[] aladin = { "도서명+저자", "도서명", "저자", "출판사" };
cb_filter.Items.AddRange(aladin);
}
else if (cb_api.SelectedIndex == 1) {
string[] naver = { "도서명+출판사" };
cb_filter.Items.AddRange(naver);
}
}
}
}