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

TODOLIST
1. 팩스로 전송될 엑셀파일 밑작업마무리 (입력될 파라미터만 적용하면 실사용가능)
2. 알라딘API, 네이버 API연동중 자잘한 버그 수정작업 필요.
2021-03-29 18:56:10 +09:00

91 lines
2.8 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ISBN_Check_test
{
public partial class Form3 : Form
{
public Form3()
{
InitializeComponent();
}
private void Form3_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
dataGridView1.Rows.Clear();
API api = new API();
// 도서명, 저자, 출판사
string[] ArrayValue = { tb_book_name.Text, tb_author.Text, tb_book_comp.Text };
// 도서명 / 저자 / 출판사 / isbn / 정가
// 발행일 / 도서분류 / 재고
string[] param = { "title", "author", "publisher", "isbn", "price",
"pubdate", "discount" };
string result = api.Naver(ArrayValue, param);
richTextBox1.Text = result;
input_Grid(result);
}
private void input_Grid(string value)
{
value = value.Replace("<b>", "");
value = value.Replace("</b>", "");
string[] sp_data = value.Split('\t');
string[] grid = { "", "", "", "", "", "", "" };
for (int a = 0; a < sp_data.Length; a++)
{
string[] data = sp_data[a].Split('|');
label3.Text = data.Length.ToString();
if (data.Length > 8) {
int idx = data.Length - 2;
grid[0] = data[0];
grid[1] = data[1];
for (int b = 2; b < idx - 4; b++) {
grid[1] += ", " + data[b];
}
grid[2] = data[idx-4];
if(data[idx-3].Contains(" ") == true) {
string[] isbn = data[idx - 3].Split(' ');
grid[3] = isbn[1];
}
else
grid[3] = data[idx -3];
grid[4] = data[idx - 2];
grid[5] = data[idx - 1];
if(data[idx] == "")
grid[6] = "절판";
else
grid[6] = data[idx];
dataGridView1.Rows.Add(grid);
}
else if (data.Length > 3) {
dataGridView1.Rows.Add(data);
}
}
}
private void tb_book_name_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter) {
button1_Click(null, null);
}
}
}
}