* unimarc

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

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

-- 작업중 --
ISBN 체크 프로그램 => 본프로그램에 이식중.
ㄴ> 코드는 다 옮겼으나 기존 사용하던 방식과 조금 달라서 버그발생 가능성 있음.

-- 완료 --
1. 주문관리 팩스연동 완료
2. 전송된 팩스 확인 작업개시, 이메일 전송모듈 수정완료.
3. 주문관리에서 주문처와 목록 검색하는 폼 검색 모듈도 재수정 완료함.
This commit is contained in:
SeungHo Yang
2021-04-14 18:43:56 +09:00
parent 2fe9185eaa
commit 2ff6f4ed89
34 changed files with 1185 additions and 186 deletions

View File

@@ -90,6 +90,12 @@
<DesignTime>True</DesignTime>
<DependentUpon>Reference.svcmap</DependentUpon>
</Compile>
<Compile Include="마크\Check_ISBN_Sub.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Check_ISBN_Sub.Designer.cs">
<DependentUpon>Check_ISBN_Sub.cs</DependentUpon>
</Compile>
<Compile Include="마크\findNchange.cs">
<SubType>Form</SubType>
</Compile>
@@ -570,6 +576,9 @@
<Compile Include="작업일지\Work_Log.Designer.cs">
<DependentUpon>Work_Log.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="마크\Check_ISBN_Sub.resx">
<DependentUpon>Check_ISBN_Sub.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\findNchange.resx">
<DependentUpon>findNchange.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -1 +1 @@
aa9864755c2bc744993a65fd26bc34785dfa1fc7
2c2fdedd3db00438687298caebc6f66a078d1e50

View File

@@ -374,3 +374,4 @@ C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\Window
C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.exe
C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.pdb
C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\bin\Debug\System.Numerics.Vectors.dll
C:\Users\Administrator\Desktop\unimarc\unimarc\WindowsFormsApp1\obj\Debug\WindowsFormsApp1.마크.Check_ISBN_Sub.resources

View File

@@ -28,10 +28,19 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.btn_lookup = new System.Windows.Forms.Button();
this.cb_filter = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.tb_list_name = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.btn_Save = new System.Windows.Forms.Button();
this.btn_Close = new System.Windows.Forms.Button();
this.label3 = new System.Windows.Forms.Label();
this.cb_api = new System.Windows.Forms.ComboBox();
this.num = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.isbn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -46,13 +55,9 @@
this.pubDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.persent = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.category = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.btn_lookup = new System.Windows.Forms.Button();
this.cb_filter = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.tb_list_name = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.btn_Save = new System.Windows.Forms.Button();
this.btn_Close = new System.Windows.Forms.Button();
this.sold_out = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.api_data = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
@@ -61,13 +66,13 @@
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.num,
@@ -83,24 +88,112 @@
this.etc,
this.pubDate,
this.persent,
this.category});
this.category,
this.sold_out,
this.api_data});
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dataGridView1.Location = new System.Drawing.Point(12, 55);
this.dataGridView1.Name = "dataGridView1";
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle8;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView1.RowHeadersWidth = 20;
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.dataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle3;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1212, 433);
this.dataGridView1.Size = new System.Drawing.Size(1309, 433);
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
//
// btn_lookup
//
this.btn_lookup.Location = new System.Drawing.Point(719, 15);
this.btn_lookup.Name = "btn_lookup";
this.btn_lookup.Size = new System.Drawing.Size(99, 23);
this.btn_lookup.TabIndex = 1;
this.btn_lookup.Text = "ISBN 자동 조회";
this.btn_lookup.UseVisualStyleBackColor = true;
this.btn_lookup.Click += new System.EventHandler(this.btn_lookup_Click);
//
// cb_filter
//
this.cb_filter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_filter.FormattingEnabled = true;
this.cb_filter.Location = new System.Drawing.Point(554, 16);
this.cb_filter.Name = "cb_filter";
this.cb_filter.Size = new System.Drawing.Size(121, 20);
this.cb_filter.TabIndex = 2;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 3;
this.label1.Text = "목록명";
//
// tb_list_name
//
this.tb_list_name.Enabled = false;
this.tb_list_name.Location = new System.Drawing.Point(59, 16);
this.tb_list_name.Name = "tb_list_name";
this.tb_list_name.Size = new System.Drawing.Size(199, 21);
this.tb_list_name.TabIndex = 4;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(495, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(57, 12);
this.label2.TabIndex = 3;
this.label2.Text = "검색 조건";
//
// btn_Save
//
this.btn_Save.Location = new System.Drawing.Point(829, 15);
this.btn_Save.Name = "btn_Save";
this.btn_Save.Size = new System.Drawing.Size(99, 23);
this.btn_Save.TabIndex = 1;
this.btn_Save.Text = "전 체 저 장";
this.btn_Save.UseVisualStyleBackColor = true;
this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click);
//
// btn_Close
//
this.btn_Close.Location = new System.Drawing.Point(939, 15);
this.btn_Close.Name = "btn_Close";
this.btn_Close.Size = new System.Drawing.Size(99, 23);
this.btn_Close.TabIndex = 1;
this.btn_Close.Text = "닫 기";
this.btn_Close.UseVisualStyleBackColor = true;
this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(297, 20);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(57, 12);
this.label3.TabIndex = 5;
this.label3.Text = "검색 엔진";
//
// cb_api
//
this.cb_api.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_api.FormattingEnabled = true;
this.cb_api.Location = new System.Drawing.Point(356, 16);
this.cb_api.Name = "cb_api";
this.cb_api.Size = new System.Drawing.Size(121, 20);
this.cb_api.TabIndex = 6;
this.cb_api.SelectedIndexChanged += new System.EventHandler(this.cb_api_SelectedIndexChanged);
//
// num
//
@@ -179,76 +272,32 @@
this.category.HeaderText = "도서분류";
this.category.Name = "category";
//
// btn_lookup
// sold_out
//
this.btn_lookup.Location = new System.Drawing.Point(512, 15);
this.btn_lookup.Name = "btn_lookup";
this.btn_lookup.Size = new System.Drawing.Size(99, 23);
this.btn_lookup.TabIndex = 1;
this.btn_lookup.Text = "ISBN 자동 조회";
this.btn_lookup.UseVisualStyleBackColor = true;
this.btn_lookup.Click += new System.EventHandler(this.btn_lookup_Click);
this.sold_out.HeaderText = "품절/절판";
this.sold_out.Name = "sold_out";
//
// cb_filter
// api_data
//
this.cb_filter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cb_filter.FormattingEnabled = true;
this.cb_filter.Location = new System.Drawing.Point(308, 16);
this.cb_filter.Name = "cb_filter";
this.cb_filter.Size = new System.Drawing.Size(121, 20);
this.cb_filter.TabIndex = 2;
this.api_data.HeaderText = "api_data";
this.api_data.Name = "api_data";
this.api_data.Visible = false;
//
// label1
// progressBar1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 20);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(45, 12);
this.label1.TabIndex = 3;
this.label1.Text = "목록 명";
//
// tb_list_name
//
this.tb_list_name.Enabled = false;
this.tb_list_name.Location = new System.Drawing.Point(63, 16);
this.tb_list_name.Name = "tb_list_name";
this.tb_list_name.Size = new System.Drawing.Size(149, 21);
this.tb_list_name.TabIndex = 4;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(249, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(57, 12);
this.label2.TabIndex = 3;
this.label2.Text = "검색 조건";
//
// btn_Save
//
this.btn_Save.Location = new System.Drawing.Point(622, 15);
this.btn_Save.Name = "btn_Save";
this.btn_Save.Size = new System.Drawing.Size(99, 23);
this.btn_Save.TabIndex = 1;
this.btn_Save.Text = "전 체 저 장";
this.btn_Save.UseVisualStyleBackColor = true;
this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click);
//
// btn_Close
//
this.btn_Close.Location = new System.Drawing.Point(732, 15);
this.btn_Close.Name = "btn_Close";
this.btn_Close.Size = new System.Drawing.Size(99, 23);
this.btn_Close.TabIndex = 1;
this.btn_Close.Text = "닫 기";
this.btn_Close.UseVisualStyleBackColor = true;
this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
this.progressBar1.Location = new System.Drawing.Point(1070, 15);
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(219, 23);
this.progressBar1.TabIndex = 7;
//
// Check_ISBN
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1236, 594);
this.ClientSize = new System.Drawing.Size(1333, 594);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.cb_api);
this.Controls.Add(this.label3);
this.Controls.Add(this.tb_list_name);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
@@ -267,10 +316,15 @@
}
#endregion
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.Button btn_lookup;
private System.Windows.Forms.ComboBox cb_filter;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_list_name;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btn_Save;
private System.Windows.Forms.Button btn_Close;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox cb_api;
private System.Windows.Forms.DataGridViewTextBoxColumn num;
private System.Windows.Forms.DataGridViewTextBoxColumn isbn;
private System.Windows.Forms.DataGridViewTextBoxColumn book_name;
@@ -285,10 +339,9 @@
private System.Windows.Forms.DataGridViewTextBoxColumn pubDate;
private System.Windows.Forms.DataGridViewTextBoxColumn persent;
private System.Windows.Forms.DataGridViewTextBoxColumn category;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_list_name;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Button btn_Save;
private System.Windows.Forms.Button btn_Close;
private System.Windows.Forms.DataGridViewTextBoxColumn sold_out;
private System.Windows.Forms.DataGridViewTextBoxColumn api_data;
private System.Windows.Forms.ProgressBar progressBar1;
public System.Windows.Forms.DataGridView dataGridView1;
}
}

View File

@@ -10,6 +10,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using WindowsFormsApp1.Delivery;
using WindowsFormsApp1.;
namespace WindowsFormsApp1.Mac
{
@@ -25,6 +26,7 @@ namespace WindowsFormsApp1.Mac
Helper_DB db = new Helper_DB();
public string compidx;
public string list_name = string.Empty;
private int rowidx;
public Check_ISBN(Main _main)
{
InitializeComponent();
@@ -42,9 +44,8 @@ namespace WindowsFormsApp1.Mac
{
tb_list_name.Text = compidx + " " + list_name;
string[] list_combo = { "도서명 + 저자", "도서명", "저자", "출판사" };
cb_filter.Items.AddRange(list_combo);
cb_filter.SelectedIndex = 0;
string[] list_combo = { "알라딘", "네이버", "다음" };
cb_api.Items.AddRange(list_combo);
db.DBcon();
string[] search_tbl = { "compidx", "list_name" };
@@ -59,38 +60,225 @@ namespace WindowsFormsApp1.Mac
}
private void btn_lookup_Click(object sender, EventArgs e)
{
if (cb_api.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
if (cb_filter.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
progressBar1.Style = ProgressBarStyle.Continuous;
progressBar1.Minimum = 0;
progressBar1.Maximum = dataGridView1.Rows.Count;
progressBar1.Step = 1;
progressBar1.Value = 0;
switch (cb_api.SelectedIndex)
{
case 0:
Aladin_API(dataGridView1);
break;
case 1:
Naver_API(dataGridView1);
break;
case 2:
Daum_API(dataGridView1);
break;
}
// 총 검색 횟수, 일치, 중복
MessageBox.Show("검색이 완료되었습니다!");
dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells[0];
this.ActiveControl = dataGridView1;
rowidx = 0;
}
private void Aladin_API(DataGridView gridview)
{
string temp = string.Empty;
string type = string.Empty;
string query = string.Empty;
// 도서명 / 저자 / 출판사 / isbn / 정가 / 발행일 / 도서분류
string[] param = { "title", "author", "publisher", "isbn13", "priceStandard", "pubDate", "categoryName" };
API_Aladdin api = new API_Aladdin();
// 도서명 / 저자 / 출판사 / isbn / 정가
// 발행일 / 도서분류 / 재고
string[] param = { "title", "author", "publisher", "isbn13", "priceStandard",
"pubDate", "categoryName", "stockStatus" };
API api = new API();
switch (cb_filter.SelectedIndex)
{
case 0:
type = "Keyword";
break;
case 1:
type = "Title";
break;
case 2:
type = "Author";
break;
case 3:
type = "Publisher";
break;
}
for (int a = 0; a < dataGridView1.Rows.Count - 1; a++)
{
// int a = 1;
query = dataGridView1.Rows[a].Cells["book_name"].Value.ToString();
insert_API(api.Find(query, type, param), a);
Thread.Sleep(300);
progressBar1.PerformStep();
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;
query = Aladin_Set_query(type, a);
insert_Aladin(api.Aladin(query, type, param), a);
}
}
void insert_API(string data, int row)
string Aladin_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;
}
private void Naver_API(DataGridView gridview)
{
// 도서명 / 저자 / 출판사 / isbn / 정가
// 발행일 / 도서분류 / 재고
string[] param = { "title", "author", "publisher", "isbn", "price",
"pubdate", "discount"};
API api = new API();
List<string> L_type = new List<string>();
List<string> L_Array = new List<string>();
for(int a = 0; a < gridview.Rows.Count; a++)
{
L_type.Clear();
L_Array.Clear();
progressBar1.PerformStep();
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;
#region
switch (cb_filter.SelectedIndex)
{
case 0:
L_type.Add("d_titl");
L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString());
break;
case 1:
L_type.Add("d_auth");
L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString());
break;
case 2:
L_type.Add("d_publ");
L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString());
break;
case 3:
L_type.Add("d_titl");
L_type.Add("d_auth");
L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString());
L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString());
break;
case 4:
L_type.Add("d_titl");
L_type.Add("d_publ");
L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString());
L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString());
break;
case 5:
L_type.Add("d_auth");
L_type.Add("d_publ");
L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString());
L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString());
break;
case 6:
L_type.Add("d_titl");
L_type.Add("d_auth");
L_type.Add("d_publ");
L_Array.Add(gridview.Rows[a].Cells["book_name"].Value.ToString());
L_Array.Add(gridview.Rows[a].Cells["author"].Value.ToString());
L_Array.Add(gridview.Rows[a].Cells["book_comp"].Value.ToString());
break;
}
#endregion
string[] arrayType = L_type.ToArray();
string[] arrayValue = L_Array.ToArray();
string result = api.Naver(arrayValue, arrayType, param);
insert_Naver(result, a);
Thread.Sleep(700);
}
}
private void Daum_API(DataGridView gridview)
{
string[] param = { "title", "authors", "publisher", "isbn", "price",
"datetime", "status" };
string type = string.Empty;
string query = string.Empty;
API api = new API();
for(int a = 0; a < gridview.Rows.Count; a++)
{
progressBar1.PerformStep();
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;
switch (cb_filter.SelectedIndex)
{
case 0:
type = "title";
query = gridview.Rows[a].Cells["book_name"].Value.ToString();
break;
case 1:
type = "person";
query = gridview.Rows[a].Cells["author"].Value.ToString();
break;
case 2:
type = "publisher";
query = gridview.Rows[a].Cells["book_comp"].Value.ToString();
break;
}
string result = api.Daum(query, type, param);
insert_Daum(result, a);
}
}
void insert_Aladin(string data, int row)
{
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
dataGridView1.Rows[row].Selected = true;
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();
if (data.Length > 0) {
dataGridView1.Rows[row].Cells["api_data"].Value.ToString();
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
}
string[] insert = data.Split('|');
string newstring = string.Empty;
if (data == "") { return; }
// pubDate형 보기편하게 DateTime형으로 재정리
newstring = String.Format("{0:yyyy/MM/dd HH:mm}",
string newstring = String.Format("{0:yyyy/MM/dd HH:mm}",
DateTime.Parse(insert[5].Remove(insert[5].IndexOf(" G"))));
// 도서 분류 필요한 데이터로 재정리
@@ -101,18 +289,141 @@ namespace WindowsFormsApp1.Mac
else { insert[6] = insert[6].Substring(top + 1, bot - top - 1); }
if (insert.Length > 10) {
// 값이 2개 이상일 경우 따로 저장할수 있는 폼이 구축되어야함.
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; }
input_api(insert, row, newstring);
}
void insert_Naver(string value, int row)
{
if (row > 0) dataGridView1.Rows[row - 1].Selected = false;
dataGridView1.Rows[row].Selected = true;
if (value == "") return;
value = value.Replace("<b>", "");
value = value.Replace("</b>", "");
string[] sp_data = value.Split('\t');
string[] grid = { "", "", "", "", "", "", "", "" };
#region
for (int a = 0; a < sp_data.Length - 1; a++)
{
string[] data = sp_data[a].Split('|');
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[7] = "절판";
else
grid[7] = "";
dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", grid) + "|";
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
}
#endregion
if (sp_data.Length > 10) return;
if (row > 0) dataGridView1.Rows[row - 1].Selected = false;
dataGridView1.Rows[row].Selected = true;
string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd");
input_api(grid, row, newstring);
}
void insert_Daum(string value, int row)
{
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
dataGridView1.Rows[row].Selected = true;
if (value == "") return;
string[] sp_data = value.Split('\n');
string[] grid = { "", "", "", "", "", "", "", "" };
for (int a = 0; a < sp_data.Length - 1; a++)
{
string[] data = sp_data[a].Split('|');
grid[0] = data[0];
grid[1] = data[1];
grid[2] = data[2];
string[] tmp_isbn = data[3].Split(' ');
if (tmp_isbn.Length < 2)
grid[3] = data[3].Replace(" ", "");
else
grid[3] = tmp_isbn[1];
grid[4] = data[4];
grid[5] = data[5].Substring(0, 10);
grid[7] = data[6];
dataGridView1.Rows[row].Cells["Column1"].Value += string.Join("|", grid) + "|";
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
}
if (sp_data.Length > 10) return;
if (row > 0) dataGridView1.Rows[row - 1].Selected = false;
dataGridView1.Rows[row].Selected = true;
bool[] chk = { false, false, false };
// string newstring = DateTime.ParseExact(grid[5], "yyyyMMdd", null).ToString("yyyy-MM-dd");
string newstring = grid[5];
input_api(grid, row, newstring);
}
/// <summary>
/// API에서 가져온 데이터가 요구한 데이터와 일치하는지 알아보는 함수
/// </summary>
/// <param name="value">데이터</param>
/// <param name="idx">Grid의 row인덱스 번호</param>
/// <param name="date">날짜</param>
void input_api(string[] value, int idx, string date)
{
bool[] chk = { false, false, false };
string book_name = dataGridView1.Rows[idx].Cells["book_name"].Value.ToString();
string author = dataGridView1.Rows[idx].Cells["author"].Value.ToString();
string book_comp = dataGridView1.Rows[idx].Cells["book_comp"].Value.ToString();
if (value[0] == book_name) chk[0] = true;
if (value[1].Contains(author) == true) chk[1] = true;
else if (author.Contains(value[1]) == true) chk[1] = true;
else if (value[1] == author) chk[1] = true;
if (value[2].Contains(book_comp) == true) chk[2] = true;
else if (book_comp.Contains(value[2]) == true) chk[2] = true;
else if (value[2] == book_comp) chk[2] = true;
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["pubDate"].Value = newstring;
dataGridView1.Rows[row].Cells["category"].Value = insert[6];
dataGridView1.Rows[idx].Cells["isbn"].Value = value[3];
dataGridView1.Rows[idx].Cells["price"].Value = value[4];
dataGridView1.Rows[idx].Cells["pubDate"].Value = date;
dataGridView1.Rows[idx].Cells["category"].Value = value[6];
dataGridView1.Rows[idx].Cells["sold_out"].Value = value[7];
dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow;
}
}
void made_Grid(string[] data)
@@ -122,7 +433,7 @@ namespace WindowsFormsApp1.Mac
* 비고 발행일 % 도서분류 */
string[] grid = { "", "", "", "", "",
"", "", "", "", "",
"", "", "", "" };
"", "", "", "", "" };
int sdc = 15; // search_data_count
for (int a = 0; a < data.Length; a++)
@@ -150,8 +461,7 @@ namespace WindowsFormsApp1.Mac
{
if (dataGridView1.Rows[a].Cells["isbn"].Value.ToString() == "" ||
dataGridView1.Rows[a].Cells["price"].Value.ToString() == "" ||
dataGridView1.Rows[a].Cells["pubDate"].Value.ToString() == "" ||
dataGridView1.Rows[a].Cells["category"].Value.ToString() == "") { continue; }
dataGridView1.Rows[a].Cells["pubDate"].Value.ToString() == "") { continue; }
string[] Edit_tbl = { "isbn", "price", "pubDate", "category" };
string[] Edit_Col = { dataGridView1.Rows[a].Cells["isbn"].Value.ToString(),
dataGridView1.Rows[a].Cells["price"].Value.ToString(),
@@ -169,5 +479,50 @@ namespace WindowsFormsApp1.Mac
{
this.Close();
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (dataGridView1.Rows[rowidx].Cells["api_data"].Value == null ||
dataGridView1.Rows[rowidx].Cells["api_data"].Value.ToString() == "") {
return;
}
Check_ISBN_Sub sub = new Check_ISBN_Sub(this);
sub.row = rowidx;
sub.Call_API = cb_api.Text;
sub.Show();
}
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter) { dataGridView1_CellDoubleClick(null, null); rowidx++; }
if (e.KeyCode == Keys.Up)
{
rowidx--;
if (rowidx < 0)
rowidx = 0;
}
if (e.KeyCode == Keys.Down)
{
rowidx++;
if (rowidx > dataGridView1.Rows.Count - 1)
rowidx = dataGridView1.Rows.Count - 1;
}
}
private void cb_api_SelectedIndexChanged(object sender, EventArgs e)
{
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);
}
else if (cb_api.SelectedIndex == 2) {
string[] daum = { "도서명", "저자", "출판사" };
cb_filter.Items.AddRange(daum);
}
}
}
}

View File

@@ -159,4 +159,10 @@
<metadata name="category.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="sold_out.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="api_data.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>

View File

@@ -0,0 +1,291 @@

namespace WindowsFormsApp1.
{
partial class Check_ISBN_Sub
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.btn_Close = new System.Windows.Forms.Button();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.tb_price = new System.Windows.Forms.TextBox();
this.tb_isbn = new System.Windows.Forms.TextBox();
this.tb_book_comp = new System.Windows.Forms.TextBox();
this.tb_author = new System.Windows.Forms.TextBox();
this.tb_book_name = new System.Windows.Forms.TextBox();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.author = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.book_comp = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.isbn = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.price = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.pubDate = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.category = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.sold_out = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.SuspendLayout();
//
// btn_Close
//
this.btn_Close.Location = new System.Drawing.Point(735, 14);
this.btn_Close.Name = "btn_Close";
this.btn_Close.Size = new System.Drawing.Size(75, 23);
this.btn_Close.TabIndex = 18;
this.btn_Close.Text = "닫 기";
this.btn_Close.UseVisualStyleBackColor = true;
this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(676, 9);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(29, 12);
this.label5.TabIndex = 13;
this.label5.Text = "정가";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(586, 9);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(33, 12);
this.label4.TabIndex = 14;
this.label4.Text = "ISBN";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(455, 9);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(41, 12);
this.label3.TabIndex = 15;
this.label3.Text = "출판사";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(337, 9);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(29, 12);
this.label2.TabIndex = 16;
this.label2.Text = "저자";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(148, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 12);
this.label1.TabIndex = 17;
this.label1.Text = "도서명";
//
// tb_price
//
this.tb_price.Location = new System.Drawing.Point(663, 24);
this.tb_price.Name = "tb_price";
this.tb_price.Size = new System.Drawing.Size(55, 21);
this.tb_price.TabIndex = 8;
//
// tb_isbn
//
this.tb_isbn.Location = new System.Drawing.Point(548, 24);
this.tb_isbn.Name = "tb_isbn";
this.tb_isbn.Size = new System.Drawing.Size(109, 21);
this.tb_isbn.TabIndex = 9;
//
// tb_book_comp
//
this.tb_book_comp.Location = new System.Drawing.Point(408, 24);
this.tb_book_comp.Name = "tb_book_comp";
this.tb_book_comp.Size = new System.Drawing.Size(134, 21);
this.tb_book_comp.TabIndex = 10;
//
// tb_author
//
this.tb_author.Location = new System.Drawing.Point(301, 24);
this.tb_author.Name = "tb_author";
this.tb_author.Size = new System.Drawing.Size(101, 21);
this.tb_author.TabIndex = 11;
//
// tb_book_name
//
this.tb_book_name.Location = new System.Drawing.Point(41, 24);
this.tb_book_name.Name = "tb_book_name";
this.tb_book_name.Size = new System.Drawing.Size(254, 21);
this.tb_book_name.TabIndex = 12;
//
// dataGridView1
//
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.book_name,
this.author,
this.book_comp,
this.isbn,
this.price,
this.pubDate,
this.category,
this.sold_out,
this.Column1});
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;
this.dataGridView1.Location = new System.Drawing.Point(0, 51);
this.dataGridView1.Name = "dataGridView1";
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
this.dataGridView1.Size = new System.Drawing.Size(834, 361);
this.dataGridView1.TabIndex = 19;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
//
// book_name
//
this.book_name.HeaderText = "도서명";
this.book_name.Name = "book_name";
this.book_name.Width = 200;
//
// author
//
this.author.HeaderText = "저자";
this.author.Name = "author";
//
// book_comp
//
this.book_comp.HeaderText = "출판사";
this.book_comp.Name = "book_comp";
//
// isbn
//
this.isbn.HeaderText = "ISBN";
this.isbn.Name = "isbn";
this.isbn.Width = 70;
//
// price
//
this.price.HeaderText = "정가";
this.price.Name = "price";
this.price.Width = 60;
//
// pubDate
//
this.pubDate.HeaderText = "출간일";
this.pubDate.Name = "pubDate";
this.pubDate.Width = 70;
//
// category
//
this.category.HeaderText = "카테고리";
this.category.Name = "category";
//
// sold_out
//
this.sold_out.HeaderText = "품절여부";
this.sold_out.Name = "sold_out";
this.sold_out.Width = 70;
//
// Column1
//
this.Column1.HeaderText = "Column1";
this.Column1.Name = "Column1";
this.Column1.Visible = false;
//
// Check_ISBN_Sub
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(834, 412);
this.Controls.Add(this.dataGridView1);
this.Controls.Add(this.btn_Close);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.tb_price);
this.Controls.Add(this.tb_isbn);
this.Controls.Add(this.tb_book_comp);
this.Controls.Add(this.tb_author);
this.Controls.Add(this.tb_book_name);
this.Name = "Check_ISBN_Sub";
this.Text = "Check_ISBN_Sub";
this.Load += new System.EventHandler(this.Check_ISBN_Sub_Load);
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button btn_Close;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox tb_price;
private System.Windows.Forms.TextBox tb_isbn;
private System.Windows.Forms.TextBox tb_book_comp;
private System.Windows.Forms.TextBox tb_author;
private System.Windows.Forms.TextBox tb_book_name;
private System.Windows.Forms.DataGridView dataGridView1;
private System.Windows.Forms.DataGridViewTextBoxColumn book_name;
private System.Windows.Forms.DataGridViewTextBoxColumn author;
private System.Windows.Forms.DataGridViewTextBoxColumn book_comp;
private System.Windows.Forms.DataGridViewTextBoxColumn isbn;
private System.Windows.Forms.DataGridViewTextBoxColumn price;
private System.Windows.Forms.DataGridViewTextBoxColumn pubDate;
private System.Windows.Forms.DataGridViewTextBoxColumn category;
private System.Windows.Forms.DataGridViewTextBoxColumn sold_out;
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
}
}

View File

@@ -0,0 +1,169 @@
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;
using WindowsFormsApp1.Mac;
namespace WindowsFormsApp1.
{
public partial class Check_ISBN_Sub : Form
{
Check_ISBN ci;
public int row;
public string Call_API = string.Empty;
int rowidx;
public Check_ISBN_Sub(Check_ISBN _ci)
{
InitializeComponent();
ci = _ci;
}
private void btn_Close_Click(object sender, EventArgs e)
{
this.Close();
}
private void Check_ISBN_Sub_Load(object sender, EventArgs e)
{
Sort_data();
same_chk(); // 비슷한거 색깔표시
}
private void Sort_data()
{
tb_book_name.Text = ci.dataGridView1.Rows[row].Cells["book_name"].Value.ToString();
tb_author.Text = ci.dataGridView1.Rows[row].Cells["author"].Value.ToString();
tb_book_comp.Text = ci.dataGridView1.Rows[row].Cells["book_comp"].Value.ToString();
if (ci.dataGridView1.Rows[row].Cells["price"].Value != null)
tb_price.Text = ci.dataGridView1.Rows[row].Cells["price"].Value.ToString();
else tb_price.Text = "";
string data = ci.dataGridView1.Rows[row].Cells["api_data"].Value.ToString();
// 도서명 / 저자 / 출판사 / isbn / 출간일 / 카테고리 / 품절여부
string[] tmp = data.Split('|');
string[] grid = { "", "", "", "", "", "", "", "" };
int idx = 8;
for(int a= 0; a < tmp.Length; a++)
{
if (a % idx == 0) grid[0] = tmp[a];
if (a % idx == 1) grid[1] = tmp[a];
if (a % idx == 2) grid[2] = tmp[a];
if (a % idx == 3) grid[3] = tmp[a];
if (a % idx == 4) grid[4] = tmp[a];
if (a % idx == 5) grid[5] = change_Date_type(tmp[a]);
if (a % idx == 6) grid[6] = tmp[a];
if (a % idx == 7) { grid[7] = tmp[a]; dataGridView1.Rows.Add(grid); }
}
}
private string change_Date_type(string date)
{
if (Call_API == "알라딘")
return String.Format("{0:yyyy/MM/dd}", DateTime.Parse(date.Remove(date.IndexOf(" G"))));
else if (Call_API == "네이버")
return DateTime.ParseExact(date, "yyyyMMdd", null).ToString("yyyy-MM-dd");
else
return date;
}
private void same_chk()
{
// 도서명, 저자, 출판사, ISBN, 정가
string[] ori_data = { tb_book_name.Text,
tb_author.Text,
tb_book_comp.Text,
tb_isbn.Text,
tb_price.Text.Replace(",", "") };
for (int a = 0; a < dataGridView1.Rows.Count; a++)
{
int chk_idx = 0;
if (dataGridView1.Rows[a].Cells["book_name"].Value.ToString() == ori_data[0])
{
chk_idx++;
}
if (dataGridView1.Rows[a].Cells["author"].Value.ToString().Contains(ori_data[1]) == true)
{
chk_idx++;
}
if (dataGridView1.Rows[a].Cells["book_comp"].Value.ToString() == ori_data[2])
{
chk_idx++;
}
if (chk_idx >= 2)
{
int pay = Convert.ToInt32(dataGridView1.Rows[a].Cells["price"].Value.ToString());
int price = 0;
if (ori_data[4] != "")
price = Convert.ToInt32(ori_data[4]);
if (price - 5000 <= pay && pay <= price + 5000)
dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Yellow;
else
dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.LightGray;
}
}
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
rowidx = e.RowIndex;
}
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
{
if (e != null) { rowidx = e.RowIndex; }
string book_name = dataGridView1.Rows[rowidx].Cells["book_name"].Value.ToString();
string author = dataGridView1.Rows[rowidx].Cells["author"].Value.ToString();
string book_comp = dataGridView1.Rows[rowidx].Cells["book_comp"].Value.ToString();
string isbn = dataGridView1.Rows[rowidx].Cells["isbn"].Value.ToString();
string price = dataGridView1.Rows[rowidx].Cells["price"].Value.ToString();
string Date = dataGridView1.Rows[rowidx].Cells["pubDate"].Value.ToString();
string category = dataGridView1.Rows[rowidx].Cells["category"].Value.ToString();
string sold = dataGridView1.Rows[rowidx].Cells["sold_out"].Value.ToString();
ci.dataGridView1.Rows[row].Cells["book_name"].Value = book_name;
ci.dataGridView1.Rows[row].Cells["author"].Value = author;
ci.dataGridView1.Rows[row].Cells["book_comp"].Value = book_comp;
ci.dataGridView1.Rows[row].Cells["isbn"].Value = isbn;
ci.dataGridView1.Rows[row].Cells["price2"].Value = price;
ci.dataGridView1.Rows[row].Cells["pubDate"].Value = Date;
ci.dataGridView1.Rows[row].Cells["category"].Value = category;
ci.dataGridView1.Rows[row].Cells["sold_out"].Value = sold;
ci.dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.Yellow;
this.Close();
}
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Enter) { dataGridView1_CellDoubleClick(null, null); }
if (e.KeyCode == Keys.Up)
{
rowidx--;
if (rowidx < 0)
rowidx = 0;
}
if (e.KeyCode == Keys.Down)
{
rowidx++;
if (rowidx > dataGridView1.Rows.Count - 1)
rowidx = dataGridView1.Rows.Count - 1;
}
if (e.KeyCode == Keys.Escape)
{
this.Close();
}
}
}
}

View File

@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="book_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="author.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="book_comp.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="isbn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="price.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="pubDate.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="category.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="sold_out.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>