* unimarc
a. 팩스전송 완료. b. 마크목록 폼 작성중 1. 엑셀반출 기능 추가중 사용 작업중 2. 마크편집 폼 수정 중 (마크 반출 test프로젝트 진행완료, 본 프로젝트에 적용중. / 저장기능활성화 작업완료) 2-1. 기존의 칸채우기에서 예상되지 못한 버그가 발생하여 칸채우기 숨김. 2-2. 008태크 재배치 => TextBox에 적용완료. 변경사항 메모장으로 넘기는 작업 진행해야함. 2-3. 현재 TODO : 저장기능 TODOLIST 1. 팩스로 전송될 엑셀파일 밑작업마무리 (입력될 파라미터만 적용하면 실사용가능) 2. 알라딘API로 ISBN조회 프로젝트 새로 작업할 것 => 대부분의 작업 완료. 자동 업데이트쪽만 알아보면 될것같음.
This commit is contained in:
@@ -22,8 +22,28 @@ namespace ISBN_Check_test
|
||||
string[] com_list = { "제목+저자", "제목", "저자", "출판사" };
|
||||
comboBox1.Items.AddRange(com_list);
|
||||
}
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
for(int a = 0; a < dataGridView1.Rows.Count - 1; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].DefaultCellStyle.BackColor != Color.Yellow) {
|
||||
dataGridView1.Rows[a].Cells["Column1"].Value = "";
|
||||
dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
if(comboBox1.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
|
||||
|
||||
int start = Convert.ToInt32(start_idx.Text) - 1;
|
||||
int end = Convert.ToInt32(end_idx.Text) - 1;
|
||||
|
||||
if(start_idx.Text!="1" || end_idx.Text != dataGridView1.Rows.Count.ToString()) {
|
||||
start = Convert.ToInt32(start_idx.Text) - 1;
|
||||
end = Convert.ToInt32(end_idx.Text) - 1;
|
||||
}
|
||||
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
|
||||
@@ -35,10 +55,30 @@ namespace ISBN_Check_test
|
||||
string[] param = { "title", "author", "publisher", "isbn13", "priceStandard",
|
||||
"pubDate", "categoryName", "stockStatus" };
|
||||
Aladin_API api = new Aladin_API();
|
||||
for (int a = 0; a < dataGridView1.Rows.Count - 1; a++)
|
||||
switch (comboBox1.SelectedIndex)
|
||||
{
|
||||
// int a = 1;
|
||||
query = dataGridView1.Rows[a].Cells["book_name"].Value.ToString();
|
||||
case 0: // 제목+저자
|
||||
type = "Keyword";
|
||||
break;
|
||||
case 1: // 제목
|
||||
type = "Title";
|
||||
break;
|
||||
case 2: // 저자
|
||||
type = "Author";
|
||||
break;
|
||||
case 3: // 출판사
|
||||
type = "Publisher";
|
||||
break;
|
||||
}
|
||||
for (int a = start; a < end; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].DefaultCellStyle.BackColor == Color.Yellow)
|
||||
continue;
|
||||
else if (dataGridView1.Rows[a].DefaultCellStyle.BackColor == Color.LightGray){
|
||||
dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Empty;
|
||||
}
|
||||
|
||||
query = Set_query(type, a);
|
||||
insert_API(api.Find(query, type, param), a);
|
||||
}
|
||||
stopwatch.Stop();
|
||||
@@ -47,13 +87,38 @@ namespace ISBN_Check_test
|
||||
string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}",
|
||||
ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
|
||||
label1.Text = elapsedTime;
|
||||
|
||||
// 총 검색 횟수, 일치, 중복
|
||||
MessageBox.Show("검색이 완료되었습니다!");
|
||||
}
|
||||
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_API(string data, int row)
|
||||
{
|
||||
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
|
||||
dataGridView1.Rows[row].Selected = true;
|
||||
|
||||
dataGridView1.Rows[row].Cells["Column1"].Value = data;
|
||||
if (data.Length > 0) {
|
||||
dataGridView1.Rows[row].Cells["Column1"].Value = data;
|
||||
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
}
|
||||
|
||||
bool[] chk = { false, false, false }; // 도서명 저자 출판사 체크.
|
||||
string book_name = dataGridView1.Rows[row].Cells["book_name"].Value.ToString();
|
||||
@@ -77,10 +142,8 @@ namespace ISBN_Check_test
|
||||
else { insert[6] = insert[6].Substring(top + 1, bot - top - 1); }
|
||||
|
||||
if (insert.Length > 10)
|
||||
{
|
||||
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
return;
|
||||
}
|
||||
|
||||
if (insert[0] == book_name) { chk[0] = true; }
|
||||
if (insert[1].Contains(author) == true) { chk[1] = true; }
|
||||
if (insert[2] == book_comp) { chk[2] = true; }
|
||||
@@ -88,7 +151,7 @@ namespace ISBN_Check_test
|
||||
if (chk[0] == true && chk[1] == true && chk[2] == true)
|
||||
{
|
||||
dataGridView1.Rows[row].Cells["isbn"].Value = insert[3];
|
||||
dataGridView1.Rows[row].Cells["price"].Value = insert[4];
|
||||
dataGridView1.Rows[row].Cells["price2"].Value = insert[4];
|
||||
dataGridView1.Rows[row].Cells["pubDate"].Value = newstring;
|
||||
dataGridView1.Rows[row].Cells["category"].Value = insert[6];
|
||||
dataGridView1.Rows[row].Cells["sold_out"].Value = insert[7];
|
||||
@@ -105,6 +168,7 @@ namespace ISBN_Check_test
|
||||
else if (e.KeyCode == Keys.Delete) {
|
||||
sg.DataGrid_to_Delete(sender, e);
|
||||
}
|
||||
end_idx.Text = dataGridView1.Rows.Count.ToString();
|
||||
}
|
||||
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
@@ -122,10 +186,18 @@ namespace ISBN_Check_test
|
||||
}
|
||||
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if(dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value.ToString() == "") { return; }
|
||||
if(dataGridView1.Rows[e.RowIndex].Cells["Column1"].Value == null) { return; }
|
||||
Form2 f2 = new Form2(this);
|
||||
f2.row = e.RowIndex;
|
||||
f2.Show();
|
||||
}
|
||||
|
||||
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
|
||||
{
|
||||
if (!(char.IsDigit(e.KeyChar) || e.KeyChar == Convert.ToChar(Keys.Back)))
|
||||
{
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user