Compare commits
36 Commits
d3d4b977e6
...
chi202506
| Author | SHA1 | Date | |
|---|---|---|---|
| eee6aeb514 | |||
| 23cf444cba | |||
| aa5f33eedb | |||
| d5aa0fe59d | |||
| 66e4392d7c | |||
| 6574a84c24 | |||
| 2bc502d7db | |||
| d75585cf26 | |||
| d48440f8bd | |||
| e14fb633fb | |||
|
|
ef2f8537fb | ||
| cdecb76faf | |||
| d9223c4e61 | |||
| 40c2acd7de | |||
| c2e1ed7246 | |||
| e989c5aac8 | |||
| 241cf656b4 | |||
| f516deaf69 | |||
| 77646f0e66 | |||
| 0a034954ff | |||
| e4b8ead056 | |||
| a36372b17c | |||
| 7d1286b7a7 | |||
| 2835f8d14e | |||
| bbc47c50db | |||
| 12f190a0b8 | |||
| 1ae2b93490 | |||
| 216311b558 | |||
|
|
c0e6c9039e | ||
|
|
65065442a1 | ||
| 8e7df6f68d | |||
| 8f74fb5557 | |||
|
|
0cc71611d0 | ||
| 405c1d9c46 | |||
|
|
e815c02feb | ||
|
|
e2ae5d2937 |
@@ -2,7 +2,16 @@
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git add:*)",
|
||||
"WebFetch(domain:jnelib.jne.go.kr)"
|
||||
"WebFetch(domain:jnelib.jne.go.kr)",
|
||||
"Bash(node:*)",
|
||||
"Bash(npm --version)",
|
||||
"Bash(echo $OS)",
|
||||
"Bash(claude mcp:*)",
|
||||
"WebSearch",
|
||||
"WebSearch",
|
||||
"Bash(git commit:*)",
|
||||
"Bash(git config:*)",
|
||||
"Bash(git push:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
||||
Binary file not shown.
Binary file not shown.
3
ISBN_Check/.vscode/settings.json
vendored
Normal file
3
ISBN_Check/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"dotnet.preferCSharpExtension": true
|
||||
}
|
||||
3
ISBN_Check/Main/.vscode/settings.json
vendored
Normal file
3
ISBN_Check/Main/.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"dotnet.preferCSharpExtension": true
|
||||
}
|
||||
390
ISBN_Check/Main/Form1.Designer.cs
generated
390
ISBN_Check/Main/Form1.Designer.cs
generated
@@ -29,12 +29,29 @@ namespace ISBN_Check_test
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.cb_filter = new System.Windows.Forms.ComboBox();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.start_idx = new System.Windows.Forms.TextBox();
|
||||
this.end_idx = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.cb_api = new System.Windows.Forms.ComboBox();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.btn_Yes24 = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.button3 = new System.Windows.Forms.Button();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.button4 = new System.Windows.Forms.Button();
|
||||
this.tbDelay = new System.Windows.Forms.TextBox();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.author = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.book_comp = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -46,18 +63,8 @@ namespace ISBN_Check_test
|
||||
this.sold_out = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.richTextBox1 = new System.Windows.Forms.RichTextBox();
|
||||
this.start_idx = new System.Windows.Forms.TextBox();
|
||||
this.end_idx = new System.Windows.Forms.TextBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.button2 = new System.Windows.Forms.Button();
|
||||
this.cb_api = new System.Windows.Forms.ComboBox();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.btn_Yes24 = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.dvc_link = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
@@ -76,7 +83,7 @@ namespace ISBN_Check_test
|
||||
//
|
||||
// button1
|
||||
//
|
||||
this.button1.Location = new System.Drawing.Point(416, 10);
|
||||
this.button1.Location = new System.Drawing.Point(530, 11);
|
||||
this.button1.Name = "button1";
|
||||
this.button1.Size = new System.Drawing.Size(75, 23);
|
||||
this.button1.TabIndex = 2;
|
||||
@@ -86,14 +93,14 @@ namespace ISBN_Check_test
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle4.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
|
||||
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,
|
||||
@@ -105,28 +112,203 @@ namespace ISBN_Check_test
|
||||
this.category,
|
||||
this.sold_out,
|
||||
this.Column1,
|
||||
this.count});
|
||||
this.count,
|
||||
this.dvc_link,
|
||||
this.dvc_remark});
|
||||
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnF2;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle6.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
|
||||
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle3.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle3.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle3.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle3.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.CellSelect;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1001, 471);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1309, 471);
|
||||
this.dataGridView1.TabIndex = 3;
|
||||
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);
|
||||
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
|
||||
this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(1046, 16);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(65, 12);
|
||||
this.label1.TabIndex = 4;
|
||||
this.label1.Text = "00:00:00.00";
|
||||
this.label1.Click += new System.EventHandler(this.label1_Click);
|
||||
//
|
||||
// richTextBox1
|
||||
//
|
||||
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.Size = new System.Drawing.Size(1309, 100);
|
||||
this.richTextBox1.TabIndex = 5;
|
||||
this.richTextBox1.Text = "";
|
||||
//
|
||||
// start_idx
|
||||
//
|
||||
this.start_idx.Location = new System.Drawing.Point(272, 11);
|
||||
this.start_idx.Name = "start_idx";
|
||||
this.start_idx.Size = new System.Drawing.Size(42, 21);
|
||||
this.start_idx.TabIndex = 6;
|
||||
this.start_idx.Text = "1";
|
||||
this.start_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
|
||||
//
|
||||
// end_idx
|
||||
//
|
||||
this.end_idx.Location = new System.Drawing.Point(340, 11);
|
||||
this.end_idx.Name = "end_idx";
|
||||
this.end_idx.Size = new System.Drawing.Size(42, 21);
|
||||
this.end_idx.TabIndex = 6;
|
||||
this.end_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(320, 15);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(14, 12);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "~";
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(609, 11);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "리 셋";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// cb_api
|
||||
//
|
||||
this.cb_api.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cb_api.FormattingEnabled = true;
|
||||
this.cb_api.Location = new System.Drawing.Point(12, 10);
|
||||
this.cb_api.Name = "cb_api";
|
||||
this.cb_api.Size = new System.Drawing.Size(121, 20);
|
||||
this.cb_api.TabIndex = 0;
|
||||
this.cb_api.SelectedIndexChanged += new System.EventHandler(this.cb_api_SelectedIndexChanged);
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.progressBar1.Location = new System.Drawing.Point(1113, 10);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(184, 23);
|
||||
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.progressBar1.TabIndex = 7;
|
||||
//
|
||||
// btn_Yes24
|
||||
//
|
||||
this.btn_Yes24.Location = new System.Drawing.Point(767, 11);
|
||||
this.btn_Yes24.Name = "btn_Yes24";
|
||||
this.btn_Yes24.Size = new System.Drawing.Size(75, 23);
|
||||
this.btn_Yes24.TabIndex = 8;
|
||||
this.btn_Yes24.Text = "Yes반출";
|
||||
this.btn_Yes24.UseVisualStyleBackColor = true;
|
||||
this.btn_Yes24.Click += new System.EventHandler(this.btn_Yes24_Click);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.label4);
|
||||
this.panel1.Controls.Add(this.tbDelay);
|
||||
this.panel1.Controls.Add(this.label3);
|
||||
this.panel1.Controls.Add(this.button4);
|
||||
this.panel1.Controls.Add(this.button3);
|
||||
this.panel1.Controls.Add(this.cb_api);
|
||||
this.panel1.Controls.Add(this.btn_Yes24);
|
||||
this.panel1.Controls.Add(this.cb_filter);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.button1);
|
||||
this.panel1.Controls.Add(this.progressBar1);
|
||||
this.panel1.Controls.Add(this.button2);
|
||||
this.panel1.Controls.Add(this.end_idx);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.start_idx);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(1309, 47);
|
||||
this.panel1.TabIndex = 9;
|
||||
//
|
||||
// button3
|
||||
//
|
||||
this.button3.Location = new System.Drawing.Point(688, 11);
|
||||
this.button3.Name = "button3";
|
||||
this.button3.Size = new System.Drawing.Size(75, 23);
|
||||
this.button3.TabIndex = 9;
|
||||
this.button3.Text = "리셋(전체)";
|
||||
this.button3.UseVisualStyleBackColor = true;
|
||||
this.button3.Click += new System.EventHandler(this.button3_Click);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.richTextBox1);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 518);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(1309, 100);
|
||||
this.panel2.TabIndex = 10;
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.dataGridView1);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 47);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(1309, 471);
|
||||
this.panel3.TabIndex = 11;
|
||||
//
|
||||
// button4
|
||||
//
|
||||
this.button4.Location = new System.Drawing.Point(848, 11);
|
||||
this.button4.Name = "button4";
|
||||
this.button4.Size = new System.Drawing.Size(75, 23);
|
||||
this.button4.TabIndex = 10;
|
||||
this.button4.Text = "목록초기화";
|
||||
this.button4.UseVisualStyleBackColor = true;
|
||||
this.button4.Click += new System.EventHandler(this.button4_Click);
|
||||
//
|
||||
// tbDelay
|
||||
//
|
||||
this.tbDelay.Location = new System.Drawing.Point(454, 12);
|
||||
this.tbDelay.Name = "tbDelay";
|
||||
this.tbDelay.Size = new System.Drawing.Size(42, 21);
|
||||
this.tbDelay.TabIndex = 12;
|
||||
this.tbDelay.Text = "500";
|
||||
this.tbDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(398, 17);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 12);
|
||||
this.label3.TabIndex = 11;
|
||||
this.label3.Text = "지연시간";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(502, 17);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(23, 12);
|
||||
this.label4.TabIndex = 13;
|
||||
this.label4.Text = "ms";
|
||||
//
|
||||
// book_name
|
||||
//
|
||||
this.book_name.HeaderText = "도서명";
|
||||
@@ -186,136 +368,27 @@ namespace ISBN_Check_test
|
||||
//
|
||||
// count
|
||||
//
|
||||
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.count.DefaultCellStyle = dataGridViewCellStyle5;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.count.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.count.HeaderText = "검색갯수";
|
||||
this.count.Name = "count";
|
||||
this.count.Width = 80;
|
||||
//
|
||||
// label1
|
||||
// dvc_link
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(719, 16);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(65, 12);
|
||||
this.label1.TabIndex = 4;
|
||||
this.label1.Text = "00:00:00.00";
|
||||
this.label1.Click += new System.EventHandler(this.label1_Click);
|
||||
this.dvc_link.HeaderText = "URL";
|
||||
this.dvc_link.Name = "dvc_link";
|
||||
//
|
||||
// richTextBox1
|
||||
// dvc_remark
|
||||
//
|
||||
this.richTextBox1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
|
||||
this.richTextBox1.Name = "richTextBox1";
|
||||
this.richTextBox1.Size = new System.Drawing.Size(1001, 100);
|
||||
this.richTextBox1.TabIndex = 5;
|
||||
this.richTextBox1.Text = "";
|
||||
//
|
||||
// start_idx
|
||||
//
|
||||
this.start_idx.Location = new System.Drawing.Point(272, 11);
|
||||
this.start_idx.Name = "start_idx";
|
||||
this.start_idx.Size = new System.Drawing.Size(42, 21);
|
||||
this.start_idx.TabIndex = 6;
|
||||
this.start_idx.Text = "1";
|
||||
this.start_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
|
||||
//
|
||||
// end_idx
|
||||
//
|
||||
this.end_idx.Location = new System.Drawing.Point(340, 11);
|
||||
this.end_idx.Name = "end_idx";
|
||||
this.end_idx.Size = new System.Drawing.Size(42, 21);
|
||||
this.end_idx.TabIndex = 6;
|
||||
this.end_idx.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress);
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(320, 15);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(14, 12);
|
||||
this.label2.TabIndex = 4;
|
||||
this.label2.Text = "~";
|
||||
//
|
||||
// button2
|
||||
//
|
||||
this.button2.Location = new System.Drawing.Point(503, 10);
|
||||
this.button2.Name = "button2";
|
||||
this.button2.Size = new System.Drawing.Size(75, 23);
|
||||
this.button2.TabIndex = 2;
|
||||
this.button2.Text = "리 셋";
|
||||
this.button2.UseVisualStyleBackColor = true;
|
||||
this.button2.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// cb_api
|
||||
//
|
||||
this.cb_api.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cb_api.FormattingEnabled = true;
|
||||
this.cb_api.Location = new System.Drawing.Point(12, 10);
|
||||
this.cb_api.Name = "cb_api";
|
||||
this.cb_api.Size = new System.Drawing.Size(121, 20);
|
||||
this.cb_api.TabIndex = 0;
|
||||
this.cb_api.SelectedIndexChanged += new System.EventHandler(this.cb_api_SelectedIndexChanged);
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Location = new System.Drawing.Point(786, 10);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(184, 23);
|
||||
this.progressBar1.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
|
||||
this.progressBar1.TabIndex = 7;
|
||||
//
|
||||
// btn_Yes24
|
||||
//
|
||||
this.btn_Yes24.Location = new System.Drawing.Point(590, 10);
|
||||
this.btn_Yes24.Name = "btn_Yes24";
|
||||
this.btn_Yes24.Size = new System.Drawing.Size(75, 23);
|
||||
this.btn_Yes24.TabIndex = 8;
|
||||
this.btn_Yes24.Text = "Yes반출";
|
||||
this.btn_Yes24.UseVisualStyleBackColor = true;
|
||||
this.btn_Yes24.Click += new System.EventHandler(this.btn_Yes24_Click);
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.cb_api);
|
||||
this.panel1.Controls.Add(this.btn_Yes24);
|
||||
this.panel1.Controls.Add(this.cb_filter);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.button1);
|
||||
this.panel1.Controls.Add(this.progressBar1);
|
||||
this.panel1.Controls.Add(this.button2);
|
||||
this.panel1.Controls.Add(this.end_idx);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.start_idx);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(1001, 47);
|
||||
this.panel1.TabIndex = 9;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.richTextBox1);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 518);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(1001, 100);
|
||||
this.panel2.TabIndex = 10;
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Controls.Add(this.dataGridView1);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 47);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(1001, 471);
|
||||
this.panel3.TabIndex = 11;
|
||||
this.dvc_remark.HeaderText = "비고";
|
||||
this.dvc_remark.Name = "dvc_remark";
|
||||
//
|
||||
// Form1
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1001, 618);
|
||||
this.ClientSize = new System.Drawing.Size(1309, 618);
|
||||
this.Controls.Add(this.panel3);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
@@ -346,6 +419,14 @@ namespace ISBN_Check_test
|
||||
private System.Windows.Forms.ComboBox cb_api;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Button btn_Yes24;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Button button3;
|
||||
private System.Windows.Forms.Button button4;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.TextBox tbDelay;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn book_name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn author;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn book_comp;
|
||||
@@ -357,9 +438,8 @@ namespace ISBN_Check_test
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn sold_out;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn count;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_link;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_remark;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,8 @@ using System.Threading;
|
||||
using System.Windows.Forms;
|
||||
using WindowsFormsApp1;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Diagnostics.Eventing.Reader;
|
||||
using Org.BouncyCastle.Pkcs;
|
||||
|
||||
namespace ISBN_Check_test
|
||||
{
|
||||
@@ -20,12 +22,20 @@ namespace ISBN_Check_test
|
||||
public Form1()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.dataGridView1.EditMode = DataGridViewEditMode.EditOnKeystrokeOrF2;
|
||||
this.Text = $"{Application.ProductName} ver {Application.ProductVersion}";
|
||||
}
|
||||
private void Form1_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
string[] api_list = { "다음", "네이버", "알라딘" };
|
||||
cb_api.Items.AddRange(api_list);
|
||||
cb_api.SelectedIndex = 2;
|
||||
Application.DoEvents();
|
||||
cb_filter_SelectedIndexChanged(null, null);
|
||||
Application.DoEvents();
|
||||
|
||||
}
|
||||
private void button2_Click(object sender, EventArgs e)
|
||||
{
|
||||
@@ -44,8 +54,16 @@ namespace ISBN_Check_test
|
||||
if (cb_api.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
|
||||
if (cb_filter.SelectedIndex == -1) { MessageBox.Show("조건이 선택되지 않았습니다."); return; }
|
||||
|
||||
this.dataGridView1.AutoResizeColumn(3);
|
||||
this.Refresh();
|
||||
|
||||
Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start();
|
||||
if (int.TryParse(tbDelay.Text, out int delayms) == false)
|
||||
{
|
||||
MessageBox.Show("지연시간 입력 오류");
|
||||
return;
|
||||
}
|
||||
|
||||
var sistr = start_idx.Text.Trim();
|
||||
var eistr = end_idx.Text.Trim();
|
||||
@@ -68,7 +86,7 @@ namespace ISBN_Check_test
|
||||
|
||||
ei = ei - 1;
|
||||
si = si - 1;
|
||||
if(si < 0 || ei <0)
|
||||
if (si < 0 || ei < 0)
|
||||
{
|
||||
MessageBox.Show("시작,종료번호를 확인하세요");
|
||||
return;
|
||||
@@ -96,7 +114,7 @@ namespace ISBN_Check_test
|
||||
Naver_API(dataGridView1, si, ei);
|
||||
break;
|
||||
case 2:
|
||||
Aladin_API(dataGridView1, si, ei);
|
||||
Aladin_API(dataGridView1, si, ei, delayms);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -118,7 +136,7 @@ namespace ISBN_Check_test
|
||||
/// 알라딘 API
|
||||
/// </summary>
|
||||
/// <param name="gridview"></param>
|
||||
private void Aladin_API(DataGridView gridview, int start, int end)
|
||||
private void Aladin_API(DataGridView gridview, int start, int end, int delayms)
|
||||
{
|
||||
// 도서명 / 저자 / 출판사 / isbn / 정가
|
||||
// 발행일 / 도서분류 / 재고
|
||||
@@ -151,20 +169,32 @@ namespace ISBN_Check_test
|
||||
break;
|
||||
}
|
||||
// string query = dataGridView1.Rows[a].Cells["isbn"].Value?.ToString() ?? string.Empty;
|
||||
string query = Set_query(type, a ); //a=는줄번호이고 idx는 -1 해야함
|
||||
string query = Set_query(type, a); //a=는줄번호이고 idx는 -1 해야함
|
||||
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;
|
||||
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, type, param);
|
||||
insert_By_Aladin(aladin, a);
|
||||
try
|
||||
{
|
||||
richTextBox1.Text = aladin;
|
||||
}
|
||||
catch { }
|
||||
//var aladin = api.Aladin(query, type, param);
|
||||
var aladin_struct = api.Aladin_struct(query, type, out string xmlString);
|
||||
insert_By_Aladin(aladin_struct, a, xmlString);
|
||||
if (aladin_struct.Any())
|
||||
richTextBox1.Text = aladin_struct.First().ToString();
|
||||
else
|
||||
richTextBox1.Text = "No Data";
|
||||
|
||||
System.Threading.Thread.Sleep(delayms);
|
||||
//try
|
||||
//{
|
||||
// var sb = new StringBuilder();
|
||||
// foreach (var item in aladin)
|
||||
// {
|
||||
// sb.AppendLine(string.Join("|", item));
|
||||
// }
|
||||
// richTextBox1.Text = aladin_struct.ToString();// sb.ToString();
|
||||
//}
|
||||
//catch { }
|
||||
}
|
||||
}
|
||||
string Set_query(string type, int idx)
|
||||
@@ -308,17 +338,63 @@ namespace ISBN_Check_test
|
||||
{
|
||||
progressBar1.PerformStep();
|
||||
}
|
||||
void insert_By_Aladin(string data, int row)
|
||||
|
||||
void insert_By_Aladin(List<AladinBookData> insert, int row, string xmlString)
|
||||
{
|
||||
if (row >0)
|
||||
if (row > 0)
|
||||
{
|
||||
dataGridView1.Rows[row - 1].Selected = false;
|
||||
}
|
||||
dataGridView1.Rows[row ].Selected = true;
|
||||
dataGridView1.Rows[row].Selected = true;
|
||||
|
||||
string[] insert = data.Split('|');
|
||||
//데이터가 없다면 처리하지 않는다.
|
||||
if (insert.Any() == false)
|
||||
{
|
||||
dataGridView1.Rows[row].Cells["count"].Value = "0";
|
||||
dataGridView1.Rows[row].Cells["dvc_remark"].Value = $"No Data\n{xmlString}";
|
||||
return;
|
||||
}
|
||||
|
||||
if (data == "") { return; }
|
||||
var item = insert.First();
|
||||
|
||||
// pubDate형 보기편하게 DateTime형으로 재정리
|
||||
string pubdate = item.PubDate;
|
||||
try
|
||||
{
|
||||
//pubdate = item.PubDate;
|
||||
pubdate = String.Format("{0:yyyy/MM/dd}",
|
||||
DateTime.Parse(pubdate.Remove(pubdate.IndexOf(" G"))));
|
||||
}
|
||||
catch (Exception ex) { MessageBox.Show(item.ToString()); }
|
||||
|
||||
//카테고리명 정리
|
||||
item.CategoryName = Aladin_CategorySort(item.CategoryName);
|
||||
//for (int a = 0; a < insert.Length; a++)
|
||||
//{
|
||||
// if (a % 8 == 6) { insert[a] = Aladin_CategorySort(insert[a]); }
|
||||
//}
|
||||
|
||||
dataGridView1.Rows[row].Cells["Column1"].Value += item.ToString();// string.Join("|", insert) + "|";
|
||||
if (item.Description.StartsWith("<")) item.Description = item.Description.Substring(item.Description.IndexOf(">")+1);
|
||||
dataGridView1.Rows[row].Cells["dvc_remark"].Value = item.Description;// $"{insert.Count}건";
|
||||
dataGridView1.Rows[row].Cells["dvc_link"].Value = $"{item.Link}";
|
||||
dataGridView1.Rows[row].Cells["count"].Value = $"{insert.Count}";
|
||||
dataGridView1.Rows[row].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
if (cb_filter.SelectedItem.ToString() == "별치조사")
|
||||
input_api_aladin(item, row, pubdate);
|
||||
|
||||
input_api(item, row, pubdate);
|
||||
}
|
||||
void insert_By_Aladin(string[] insert, int row)
|
||||
{
|
||||
if (row > 0)
|
||||
{
|
||||
dataGridView1.Rows[row - 1].Selected = false;
|
||||
}
|
||||
dataGridView1.Rows[row].Selected = true;
|
||||
|
||||
|
||||
if (insert.Any() == false) { return; }
|
||||
|
||||
// pubDate형 보기편하게 DateTime형으로 재정리
|
||||
string newstring = "";
|
||||
@@ -327,7 +403,7 @@ namespace ISBN_Check_test
|
||||
newstring = String.Format("{0:yyyy/MM/dd}",
|
||||
DateTime.Parse(insert[5].Remove(insert[5].IndexOf(" G"))));
|
||||
}
|
||||
catch (Exception ex) { MessageBox.Show(data); }
|
||||
catch (Exception ex) { MessageBox.Show(string.Join("|", insert)); }
|
||||
|
||||
for (int a = 0; a < insert.Length; a++)
|
||||
{
|
||||
@@ -352,6 +428,17 @@ namespace ISBN_Check_test
|
||||
|
||||
return insert;
|
||||
}
|
||||
|
||||
void input_api_aladin(AladinBookData data, int row, string date)
|
||||
{
|
||||
dataGridView1.Rows[row].Cells["book_name"].Value = data.Title;
|
||||
dataGridView1.Rows[row].Cells["author"].Value = data.Author;
|
||||
dataGridView1.Rows[row].Cells["book_comp"].Value = data.Publisher;
|
||||
dataGridView1.Rows[row].Cells["price2"].Value = data.PriceStandard;
|
||||
dataGridView1.Rows[row].Cells["pubDate"].Value = date;
|
||||
dataGridView1.Rows[row].Cells["category"].Value = data.CategoryName;
|
||||
}
|
||||
|
||||
void input_api_aladin(string[] data, int row, string date)
|
||||
{
|
||||
dataGridView1.Rows[row].Cells["book_name"].Value = data[0];
|
||||
@@ -363,7 +450,7 @@ namespace ISBN_Check_test
|
||||
}
|
||||
void insert_By_Naver(string value, int row)
|
||||
{
|
||||
if (row > 0) { dataGridView1.Rows[row -1].Selected = false; }
|
||||
if (row > 0) { dataGridView1.Rows[row - 1].Selected = false; }
|
||||
dataGridView1.Rows[row].Selected = true;
|
||||
|
||||
if (value == "") return;
|
||||
@@ -474,6 +561,46 @@ namespace ISBN_Check_test
|
||||
|
||||
input_api(grid, row, newstring);
|
||||
}
|
||||
|
||||
void input_api(AladinBookData value, int idx, string date)
|
||||
{
|
||||
|
||||
//string[] param = { "title", "authors", "publisher", "isbn", "price",
|
||||
// "datetime", "status" };
|
||||
//string[] param = { "title", "author", "publisher", "isbn13", "priceStandard",
|
||||
// "pubDate", "categoryName", "stockStatus", };
|
||||
|
||||
bool[] chk = { false, false, false };
|
||||
|
||||
string book_name = dataGridView1.Rows[idx].Cells["book_name"].Value?.ToString() ?? string.Empty;
|
||||
string author = dataGridView1.Rows[idx].Cells["author"].Value?.ToString() ?? string.Empty;
|
||||
string book_comp = dataGridView1.Rows[idx].Cells["book_comp"].Value?.ToString() ?? string.Empty;
|
||||
|
||||
if (value.Title == book_name) chk[0] = true;
|
||||
|
||||
if (value.Author.Contains(author) == true) chk[1] = true;
|
||||
else if (author.Contains(value.Author) == true) chk[1] = true;
|
||||
else if (value.Author == author) chk[1] = true;
|
||||
|
||||
if (value.Publisher.Contains(book_comp) == true) chk[2] = true;
|
||||
else if (book_comp.Contains(value.Publisher) == true) chk[2] = true;
|
||||
else if (value.Publisher == book_comp) chk[2] = true;
|
||||
|
||||
if (chk[0] == true && chk[1] == true && chk[2] == true)
|
||||
{
|
||||
|
||||
dataGridView1.Rows[idx].Cells["isbn"].Value = value.Isbn13;
|
||||
dataGridView1.Rows[idx].Cells["price2"].Value = value.PriceStandard;
|
||||
dataGridView1.Rows[idx].Cells["pubDate"].Value = date;
|
||||
//if (cb_api.SelectedIndex == 2)
|
||||
dataGridView1.Rows[idx].Cells["category"].Value = value.CategoryName;
|
||||
dataGridView1.Rows[idx].Cells["sold_out"].Value = value.StockStatus;
|
||||
dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow;
|
||||
}
|
||||
count_res();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// API에서 가져온 데이터가 요구한 데이터와 일치하는지 알아보는 함수
|
||||
/// </summary>
|
||||
@@ -514,15 +641,15 @@ namespace ISBN_Check_test
|
||||
#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() ?? string.Empty;
|
||||
int tmp_count = st.Char_count(search_data, '|');
|
||||
int lcount = tmp_count / 8;
|
||||
dataGridView1.Rows[a].Cells["count"].Value = lcount.ToString();
|
||||
}
|
||||
//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() ?? string.Empty;
|
||||
// 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)
|
||||
@@ -569,12 +696,49 @@ namespace ISBN_Check_test
|
||||
}
|
||||
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (dataGridView1.Rows[rowidx].Cells["Column1"].Value == null ||
|
||||
dataGridView1.Rows[rowidx].Cells["Column1"].Value.ToString() == "") { return; }
|
||||
Form2 f2 = new Form2(this);
|
||||
f2.row = rowidx;
|
||||
f2.Call_API = cb_api.Text;
|
||||
f2.Show();
|
||||
if (e.RowIndex < 0 || e.ColumnIndex < 0) return;
|
||||
var column = this.dataGridView1.Columns[e.ColumnIndex];
|
||||
|
||||
if (column.Name.Equals("dvc_remark"))
|
||||
{
|
||||
var value = this.dataGridView1.Rows[e.RowIndex].Cells[column.Name].Value?.ToString() ?? string.Empty;
|
||||
if(value.StartsWith("<"))
|
||||
{
|
||||
value = value.Substring(value.IndexOf(">") + 1);
|
||||
}
|
||||
else this.richTextBox1.Text = value;
|
||||
}
|
||||
else if (column.Name.Equals("Column"))
|
||||
{
|
||||
var value = this.dataGridView1.Rows[e.RowIndex].Cells[column.Name].Value?.ToString() ?? string.Empty;
|
||||
if (value == string.Empty) return;
|
||||
|
||||
Form2 f2 = new Form2(this);
|
||||
f2.row = rowidx;
|
||||
f2.Call_API = cb_api.Text;
|
||||
f2.Show();
|
||||
}
|
||||
else if (column.Name.Equals("dvc_link"))
|
||||
{
|
||||
var value = this.dataGridView1.Rows[e.RowIndex].Cells[column.Name].Value?.ToString() ?? string.Empty;
|
||||
if (value == string.Empty) return;
|
||||
try
|
||||
{
|
||||
var prc = new System.Diagnostics.Process();
|
||||
prc.StartInfo = new System.Diagnostics.ProcessStartInfo()
|
||||
{
|
||||
FileName = value,
|
||||
UseShellExecute = true
|
||||
};
|
||||
prc.Start();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
|
||||
@@ -601,6 +765,7 @@ namespace ISBN_Check_test
|
||||
{
|
||||
string[] aladin = { "도서명 + 저자", "도서명", "저자", "출판사", "별치조사" };
|
||||
cb_filter.Items.AddRange(aladin);
|
||||
cb_filter.SelectedIndex = cb_filter.Items.Count - 1;
|
||||
}
|
||||
Must_Col(cb_api.SelectedIndex);
|
||||
}
|
||||
@@ -640,7 +805,8 @@ namespace ISBN_Check_test
|
||||
{
|
||||
if (System.Diagnostics.Debugger.IsAttached)
|
||||
{
|
||||
string[] lst = { "9791193110584",
|
||||
string[] lst = { "9788965427520",
|
||||
"9791193110584",
|
||||
"9791168672260",
|
||||
"9788993858396",
|
||||
"9791171200351",
|
||||
@@ -657,5 +823,22 @@ namespace ISBN_Check_test
|
||||
end_idx.Text = (this.dataGridView1.Rows.Count - 1).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
private void button3_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 button4_Click(object sender, EventArgs e)
|
||||
{
|
||||
dataGridView1.Rows.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,4 +150,10 @@
|
||||
<metadata name="count.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dvc_link.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dvc_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
@@ -10,9 +10,45 @@ using System.Threading.Tasks;
|
||||
using System.Web.Script.Serialization;
|
||||
using System.Windows.Forms;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace ISBN_Check_test
|
||||
{
|
||||
/// <summary>
|
||||
/// 알라딘 API 응답 데이터 구조체
|
||||
/// </summary>
|
||||
public class AladinBookData
|
||||
{
|
||||
public string Title { get; set; }
|
||||
public string Link { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string PubDate { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Isbn { get; set; }
|
||||
public string Isbn13 { get; set; }
|
||||
public string PriceSales { get; set; }
|
||||
public string PriceStandard { get; set; }
|
||||
public string StockStatus { get; set; }
|
||||
public string Mileage { get; set; }
|
||||
public string Cover { get; set; }
|
||||
public string CategoryId { get; set; }
|
||||
public string CategoryName { get; set; }
|
||||
public string Publisher { get; set; }
|
||||
public string CustomerReviewRank { get; set; }
|
||||
public string FullDescription { get; set; }
|
||||
public string FullDescription2 { get; set; }
|
||||
public string ItemId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 지정된 필드들을 "|" 구분자로 출력
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"{Title}|{Author}|{Publisher}|{Isbn13}|{PriceStandard}|{PubDate}|{CategoryName}|{StockStatus}";
|
||||
}
|
||||
}
|
||||
|
||||
class API
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,7 +58,7 @@ namespace ISBN_Check_test
|
||||
/// <param name="QueryType"></param>
|
||||
/// <param name="Param"></param>
|
||||
/// <returns></returns>
|
||||
public string Aladin(string Query, string QueryType, string[] Param)
|
||||
public string[] Aladin(string Query, string QueryType, string[] Param)
|
||||
{
|
||||
string result = string.Empty;
|
||||
// 쿼리 생성
|
||||
@@ -49,58 +85,127 @@ namespace ISBN_Check_test
|
||||
// xml형식을 json형식으로 변환
|
||||
XmlDocument doc = new XmlDocument();
|
||||
doc.LoadXml(xml);
|
||||
var json = JsonConvert.SerializeXmlNode(doc);
|
||||
|
||||
// json형식 분석을 위해 JavaScriptSerializer 개체 생성
|
||||
JavaScriptSerializer js = new JavaScriptSerializer();
|
||||
var xdoc = XDocument.Parse(xml);
|
||||
var xroot = xdoc.Root;
|
||||
|
||||
// 런타임에 개체를 확인하여 사용할수 있는 dynamic을 이용해 역직렬화
|
||||
dynamic dob = js.Deserialize<dynamic>(json);
|
||||
// XML에서 직접 totalResults와 item 추출 (XDocument 사용)
|
||||
XNamespace ns = "http://www.aladin.co.kr/ttb/apiguide.aspx";
|
||||
|
||||
// "object"내에 있는것을 얻어오기 위해 다시 dynamic변수에 참조
|
||||
dynamic docs = "";
|
||||
try
|
||||
// totalResults 추출
|
||||
string totalResults = xdoc.Descendants(ns + "totalResults").FirstOrDefault()?.Value ?? "0";
|
||||
|
||||
// item들 추출
|
||||
var itemElements = xdoc.Descendants(ns + "item");
|
||||
|
||||
if (!itemElements.Any())
|
||||
{
|
||||
docs = dob["object"]["item"];
|
||||
return new string[] { };
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "";
|
||||
}
|
||||
int length = 0;
|
||||
|
||||
int length = itemElements.Count();
|
||||
int ID_length = Param.Length;
|
||||
|
||||
// 검색 결과가 1개 이하일 경우, 오류가 발생하여 try/catch문 사용.
|
||||
try
|
||||
// XML item들을 순회하면서 필요한 데이터 추출 (XDocument 사용)
|
||||
List<string[]> retval = new List<string[]>();
|
||||
foreach (var itemElement in itemElements)
|
||||
{
|
||||
// docs는 요소 컬렉션으로 object로 변환.
|
||||
object[] buf = docs;
|
||||
length = buf.Length;
|
||||
}
|
||||
catch
|
||||
{
|
||||
object buf = docs;
|
||||
length = 1;
|
||||
}
|
||||
for (int a = 0; a < length; a++)
|
||||
{
|
||||
List<string> tmp_data = new List<string>();
|
||||
string[] buffer = new string[ID_length];
|
||||
for (int b = 0; b < ID_length; b++)
|
||||
{
|
||||
if (length == 1)
|
||||
{
|
||||
tmp_data.Add(docs[Param[b]]);
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp_data.Add(docs[a][Param[b]]);
|
||||
}
|
||||
result += tmp_data[b] + "|";
|
||||
buffer[b] = itemElement.Element(ns + Param[b])?.Value ?? "";
|
||||
}
|
||||
result += "\n";
|
||||
//retval.Add(buffer);
|
||||
return buffer;
|
||||
}
|
||||
return result;
|
||||
return new string[] { };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// https://blog.aladin.co.kr/openapi 참고 (구조체 반환 버전)
|
||||
/// </summary>
|
||||
/// <param name="Query"></param>
|
||||
/// <param name="QueryType"></param>
|
||||
/// <returns>AladinBookData 리스트</returns>
|
||||
public List<AladinBookData> Aladin_struct(string Query, string QueryType,out string xml)
|
||||
{
|
||||
// 쿼리 생성
|
||||
string key = "ttbgloriabook1512001";
|
||||
string site = "http://www.aladin.co.kr/ttb/api/ItemSearch.aspx";
|
||||
string query = string.Format("{0}?query={1}&TTBKey={2}&output=xml&querytype={3}&MaxResults={4}",
|
||||
site, Query, key, QueryType, 30.ToString());
|
||||
xml = string.Empty;
|
||||
try
|
||||
{
|
||||
// 쿼리를 입력인자로 WebRequest 개채 생성
|
||||
WebRequest request = WebRequest.Create(query);
|
||||
|
||||
// WebResponse개체를 통해 서비스 요청.
|
||||
WebResponse response = request.GetResponse();
|
||||
|
||||
// 결과문자열 확인
|
||||
Stream stream = response.GetResponseStream();
|
||||
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
|
||||
xml = reader.ReadToEnd();
|
||||
stream.Close();
|
||||
|
||||
var xdoc = XDocument.Parse(xml);
|
||||
|
||||
// XML에서 직접 totalResults와 item 추출 (XDocument 사용)
|
||||
XNamespace ns = "http://www.aladin.co.kr/ttb/apiguide.aspx";
|
||||
|
||||
// totalResults 추출
|
||||
string totalResults = xdoc.Descendants(ns + "totalResults").FirstOrDefault()?.Value ?? "0";
|
||||
|
||||
// item들 추출
|
||||
var itemElements = xdoc.Descendants(ns + "item");
|
||||
|
||||
List<AladinBookData> resultList = new List<AladinBookData>();
|
||||
|
||||
if (!itemElements.Any())
|
||||
{
|
||||
Console.WriteLine(Query);
|
||||
return resultList;
|
||||
}
|
||||
|
||||
// 모든 item을 순회하며 리스트에 추가
|
||||
foreach (var itemElement in itemElements)
|
||||
{
|
||||
AladinBookData bookData = new AladinBookData
|
||||
{
|
||||
ItemId = itemElement.Attribute("itemId")?.Value ?? "",
|
||||
Title = itemElement.Element(ns + "title")?.Value ?? "",
|
||||
Link = itemElement.Element(ns + "link")?.Value ?? "",
|
||||
Author = itemElement.Element(ns + "author")?.Value ?? "",
|
||||
PubDate = itemElement.Element(ns + "pubDate")?.Value ?? "",
|
||||
Description = itemElement.Element(ns + "description")?.Value ?? "",
|
||||
Isbn = itemElement.Element(ns + "isbn")?.Value ?? "",
|
||||
Isbn13 = itemElement.Element(ns + "isbn13")?.Value ?? "",
|
||||
PriceSales = itemElement.Element(ns + "priceSales")?.Value ?? "",
|
||||
PriceStandard = itemElement.Element(ns + "priceStandard")?.Value ?? "",
|
||||
StockStatus = itemElement.Element(ns + "stockStatus")?.Value ?? "",
|
||||
Mileage = itemElement.Element(ns + "mileage")?.Value ?? "",
|
||||
Cover = itemElement.Element(ns + "cover")?.Value ?? "",
|
||||
CategoryId = itemElement.Element(ns + "categoryId")?.Value ?? "",
|
||||
CategoryName = itemElement.Element(ns + "categoryName")?.Value ?? "",
|
||||
Publisher = itemElement.Element(ns + "publisher")?.Value ?? "",
|
||||
CustomerReviewRank = itemElement.Element(ns + "customerReviewRank")?.Value ?? "",
|
||||
FullDescription = itemElement.Element(ns + "fulldescription")?.Value ?? "",
|
||||
FullDescription2 = itemElement.Element(ns + "fulldescription2")?.Value ?? ""
|
||||
};
|
||||
|
||||
resultList.Add(bookData);
|
||||
}
|
||||
|
||||
return resultList;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
// 에러 발생 시 빈 리스트 반환
|
||||
return new List<AladinBookData>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// https://blog.aladin.co.kr/openapi 참고
|
||||
/// </summary>
|
||||
@@ -194,7 +299,7 @@ namespace ISBN_Check_test
|
||||
// url 생성
|
||||
string url = "https://openapi.naver.com/v1/search/book_adv?";
|
||||
|
||||
for(int a = 0; a < Query.Length; a++)
|
||||
for (int a = 0; a < Query.Length; a++)
|
||||
{
|
||||
url += string.Format("{0}={1}&", QueryType[a], Query[a]);
|
||||
}
|
||||
@@ -278,7 +383,7 @@ namespace ISBN_Check_test
|
||||
StreamReader reader = new StreamReader(stream, Encoding.UTF8);
|
||||
string json = reader.ReadToEnd();
|
||||
stream.Close();
|
||||
|
||||
|
||||
JavaScriptSerializer js = new JavaScriptSerializer();
|
||||
dynamic dob = js.Deserialize<dynamic>(json);
|
||||
dynamic docs = dob["documents"];
|
||||
@@ -287,18 +392,20 @@ namespace ISBN_Check_test
|
||||
int length = buf.Length;
|
||||
int ID_length = Param.Length;
|
||||
|
||||
for(int a = 0; a < length; a++)
|
||||
for (int a = 0; a < length; a++)
|
||||
{
|
||||
List<object> tmp_data = new List<object>();
|
||||
for(int b = 0; b < ID_length; b++)
|
||||
for (int b = 0; b < ID_length; b++)
|
||||
{
|
||||
if (Param[b] == "authors") {
|
||||
if (Param[b] == "authors")
|
||||
{
|
||||
object[] tmp = docs[a][Param[b]];
|
||||
string tmp_str = string.Empty;
|
||||
for(int j = 0; j < tmp.Length; j++)
|
||||
for (int j = 0; j < tmp.Length; j++)
|
||||
{
|
||||
tmp_str += tmp[j];
|
||||
if (j < tmp.Length - 1) {
|
||||
if (j < tmp.Length - 1)
|
||||
{
|
||||
tmp_str += ", ";
|
||||
}
|
||||
}
|
||||
@@ -306,7 +413,8 @@ namespace ISBN_Check_test
|
||||
result += tmp_data[b] + "|";
|
||||
tmp_str = "";
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
tmp_data.Add(docs[a][Param[b]]);
|
||||
result += tmp_data[b] + "|";
|
||||
}
|
||||
|
||||
@@ -41,15 +41,15 @@ namespace ISBN_Check_test
|
||||
|
||||
else { tb_price.Text = ""; }
|
||||
|
||||
string data = f1GridView.Rows[row].Cells["Column1"].Value.ToString();
|
||||
var data = (string[])f1GridView.Rows[row].Cells["Column1"].Value;
|
||||
inputGrid(data);
|
||||
}
|
||||
private void inputGrid(string data)
|
||||
private void inputGrid(string[] tmp)
|
||||
{
|
||||
dataGridView1.Rows.Clear();
|
||||
|
||||
// 도서명 / 저자 / 출판사 / isbn / 출간일 / 카테고리 / 품절여부
|
||||
string[] tmp = data.Split('|');
|
||||
//string[] tmp = data.Split('|');
|
||||
string[] grid = { "", "", "", "", "", "", "", "" };
|
||||
|
||||
for (int a = 0; a < tmp.Length; a++)
|
||||
@@ -186,8 +186,8 @@ namespace ISBN_Check_test
|
||||
string type = "Title";
|
||||
string query = tb_book_name.Text;
|
||||
|
||||
string aladin = api.Aladin(query, type, param);
|
||||
if (aladin == "") return;
|
||||
var aladin = api.Aladin(query, type, param);
|
||||
if (aladin.Any()==false) return;
|
||||
|
||||
inputGrid(aladin);
|
||||
}
|
||||
|
||||
@@ -65,32 +65,32 @@
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.5.0, Culture=neutral, PublicKeyToken=0e99375e54769942">
|
||||
<HintPath>packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
<HintPath>..\packages\BouncyCastle.1.8.5\lib\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Google.Protobuf, Version=3.14.0.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Google.Protobuf.3.14.0\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
<HintPath>..\packages\Google.Protobuf.3.14.0\lib\net45\Google.Protobuf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\K4os.Compression.LZ4.1.1.11\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.1.1.11\lib\net46\K4os.Compression.LZ4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\K4os.Compression.LZ4.Streams.1.1.11\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.1.11\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||
<HintPath>packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
||||
<HintPath>..\packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=8.0.25.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MySql.Data.8.0.25\lib\net452\MySql.Data.dll</HintPath>
|
||||
<HintPath>..\packages\MySql.Data.8.0.25\lib\net452\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Renci.SshNet, Version=2020.0.1.0, Culture=neutral, PublicKeyToken=1cee9f8bde3db106, processorArchitecture=MSIL">
|
||||
<HintPath>packages\SSH.NET.2020.0.1\lib\net40\Renci.SshNet.dll</HintPath>
|
||||
<HintPath>..\packages\SSH.NET.2020.0.1\lib\net40\Renci.SshNet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
@@ -99,14 +99,14 @@
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
|
||||
<HintPath>..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Numerics" />
|
||||
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
<HintPath>..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Transactions" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
@@ -120,10 +120,10 @@
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Ubiety.Dns.Core, Version=2.2.1.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MySql.Data.8.0.25\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
||||
<HintPath>..\packages\MySql.Data.8.0.25\lib\net452\Ubiety.Dns.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Zstandard.Net, Version=1.1.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>packages\MySql.Data.8.0.25\lib\net452\Zstandard.Net.dll</HintPath>
|
||||
<HintPath>..\packages\MySql.Data.8.0.25\lib\net452\Zstandard.Net.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
24
ISBN_Check/Main/Main.sln
Normal file
24
ISBN_Check/Main/Main.sln
Normal file
@@ -0,0 +1,24 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.2.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ISBN_Check_test", "ISBN_Check_test.csproj", "{B1FE7D47-6EFF-E4AE-FF42-BADB7C89CEEE}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B1FE7D47-6EFF-E4AE-FF42-BADB7C89CEEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B1FE7D47-6EFF-E4AE-FF42-BADB7C89CEEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B1FE7D47-6EFF-E4AE-FF42-BADB7C89CEEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B1FE7D47-6EFF-E4AE-FF42-BADB7C89CEEE}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {E8EB61EB-992B-4C29-AC57-A0B63137A787}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
|
||||
// 기본값으로 할 수 있습니다.
|
||||
[assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("25.10.29.2300")]
|
||||
// [assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("25.10.29.2300")]
|
||||
|
||||
@@ -12,6 +12,7 @@ using WindowsFormsApp1;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
|
||||
namespace ISBN_Check_test
|
||||
{
|
||||
public partial class Yes24 : Form
|
||||
@@ -55,16 +56,17 @@ namespace ISBN_Check_test
|
||||
int count = f1.dataGridView1.Rows.Count - 1;
|
||||
string price = "";
|
||||
|
||||
for (int a = 0; a < count; a++)
|
||||
foreach(DataGridViewRow drowview in f1.dataGridView1.Rows)
|
||||
{
|
||||
if (f1.dataGridView1.Rows[a].Cells["price"].Value != null)
|
||||
if (drowview.Cells["price"].Value != null)
|
||||
{
|
||||
price = f1.dataGridView1.Rows[a].Cells["price"].Value.ToString();
|
||||
price = drowview.Cells["price"].Value.ToString();
|
||||
}
|
||||
|
||||
var bookName = f1.dataGridView1.Rows[a].Cells["book_name"].Value?.ToString() ?? string.Empty;
|
||||
var author = f1.dataGridView1.Rows[a].Cells["author"].Value?.ToString() ?? string.Empty;
|
||||
var bookComp = f1.dataGridView1.Rows[a].Cells["book_comp"].Value?.ToString() ?? string.Empty;
|
||||
var bookName = drowview.Cells["book_name"].Value?.ToString() ?? string.Empty;
|
||||
var author = drowview.Cells["author"].Value?.ToString() ?? string.Empty;
|
||||
var bookComp = drowview.Cells["book_comp"].Value?.ToString() ?? string.Empty;
|
||||
if (string.IsNullOrEmpty(bookName) && string.IsNullOrEmpty(author) && string.IsNullOrEmpty(bookComp)) continue;
|
||||
|
||||
List<string> grid = new List<string>();
|
||||
grid.Add(bookName);
|
||||
@@ -73,7 +75,7 @@ namespace ISBN_Check_test
|
||||
grid.Add(Replace_target(author, "author"));
|
||||
grid.Add(bookComp);
|
||||
grid.Add(Replace_target(bookComp, "book_comp"));
|
||||
|
||||
grid.Add(price);
|
||||
dataGridView1.Rows.Add(grid.ToArray());
|
||||
|
||||
}
|
||||
@@ -124,15 +126,17 @@ namespace ISBN_Check_test
|
||||
private void btn_change_Click(object sender, EventArgs e)
|
||||
{
|
||||
string[,] grid = new string[dataGridView1.Rows.Count, 6];
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
var idx = 0;
|
||||
foreach (DataGridViewRow drv in dataGridView1.Rows)// int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
string price = dataGridView1.Rows[a].Cells["price"].Value.ToString();
|
||||
int count = a + 1;
|
||||
grid[a, 0] = count.ToString();
|
||||
grid[a, 1] = dataGridView1.Rows[a].Cells["after_book_name"].Value.ToString();
|
||||
grid[a, 3] = dataGridView1.Rows[a].Cells["after_book_comp"].Value.ToString();
|
||||
grid[a, 4] = Regex.Replace(price, @"[^0-9]", "");
|
||||
grid[a, 5] = "1";
|
||||
string price = drv.Cells["price"].Value?.ToString() ?? string.Empty;
|
||||
int count = idx + 1;
|
||||
grid[idx, 0] = count.ToString();
|
||||
grid[idx, 1] = drv.Cells["after_book_name"].Value.ToString();
|
||||
grid[idx, 3] = drv.Cells["after_book_comp"].Value.ToString();
|
||||
grid[idx, 4] = Regex.Replace(price, @"[^0-9]", "");
|
||||
grid[idx, 5] = "1";
|
||||
idx += 1;
|
||||
}
|
||||
Excel_change(grid);
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
</configuration>
|
||||
280
ISBN_Client/ISBN_Client.Designer.cs
generated
280
ISBN_Client/ISBN_Client.Designer.cs
generated
@@ -1,280 +0,0 @@
|
||||
|
||||
namespace ISBN_Client
|
||||
{
|
||||
partial class Client
|
||||
{
|
||||
/// <summary>
|
||||
/// 필수 디자이너 변수입니다.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// 사용 중인 모든 리소스를 정리합니다.
|
||||
/// </summary>
|
||||
/// <param name="disposing">관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form 디자이너에서 생성한 코드
|
||||
|
||||
/// <summary>
|
||||
/// 디자이너 지원에 필요한 메서드입니다.
|
||||
/// 이 메서드의 내용을 코드 편집기로 수정하지 마세요.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.rtb_Ip = new System.Windows.Forms.RichTextBox();
|
||||
this.lbl_cnt = new System.Windows.Forms.Label();
|
||||
this.lbl_filename = new System.Windows.Forms.Label();
|
||||
this.lbl_ClientVer = new System.Windows.Forms.Label();
|
||||
this.lbl_SerVer = new System.Windows.Forms.Label();
|
||||
this.lbl_Files = new System.Windows.Forms.Label();
|
||||
this.lbl_status = new System.Windows.Forms.Label();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.progressBar1 = new System.Windows.Forms.ProgressBar();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.btn_Close = new System.Windows.Forms.Button();
|
||||
this.btn_ok = new System.Windows.Forms.Button();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.file_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.update_status = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.Controls.Add(this.rtb_Ip);
|
||||
this.panel1.Controls.Add(this.lbl_cnt);
|
||||
this.panel1.Controls.Add(this.lbl_filename);
|
||||
this.panel1.Controls.Add(this.lbl_ClientVer);
|
||||
this.panel1.Controls.Add(this.lbl_SerVer);
|
||||
this.panel1.Controls.Add(this.lbl_Files);
|
||||
this.panel1.Controls.Add(this.lbl_status);
|
||||
this.panel1.Controls.Add(this.label7);
|
||||
this.panel1.Controls.Add(this.progressBar1);
|
||||
this.panel1.Controls.Add(this.label3);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Location = new System.Drawing.Point(12, 12);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(325, 268);
|
||||
this.panel1.TabIndex = 5;
|
||||
//
|
||||
// rtb_Ip
|
||||
//
|
||||
this.rtb_Ip.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.rtb_Ip.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
this.rtb_Ip.Location = new System.Drawing.Point(124, 102);
|
||||
this.rtb_Ip.Name = "rtb_Ip";
|
||||
this.rtb_Ip.ReadOnly = true;
|
||||
this.rtb_Ip.Size = new System.Drawing.Size(190, 61);
|
||||
this.rtb_Ip.TabIndex = 5;
|
||||
this.rtb_Ip.Text = "";
|
||||
//
|
||||
// lbl_cnt
|
||||
//
|
||||
this.lbl_cnt.AutoSize = true;
|
||||
this.lbl_cnt.Location = new System.Drawing.Point(265, 217);
|
||||
this.lbl_cnt.Name = "lbl_cnt";
|
||||
this.lbl_cnt.Size = new System.Drawing.Size(45, 12);
|
||||
this.lbl_cnt.TabIndex = 4;
|
||||
this.lbl_cnt.Text = "(10/10)";
|
||||
//
|
||||
// lbl_filename
|
||||
//
|
||||
this.lbl_filename.Location = new System.Drawing.Point(20, 217);
|
||||
this.lbl_filename.Name = "lbl_filename";
|
||||
this.lbl_filename.Size = new System.Drawing.Size(211, 12);
|
||||
this.lbl_filename.TabIndex = 3;
|
||||
//
|
||||
// lbl_ClientVer
|
||||
//
|
||||
this.lbl_ClientVer.AutoSize = true;
|
||||
this.lbl_ClientVer.Location = new System.Drawing.Point(124, 52);
|
||||
this.lbl_ClientVer.Name = "lbl_ClientVer";
|
||||
this.lbl_ClientVer.Size = new System.Drawing.Size(0, 12);
|
||||
this.lbl_ClientVer.TabIndex = 2;
|
||||
//
|
||||
// lbl_SerVer
|
||||
//
|
||||
this.lbl_SerVer.AutoSize = true;
|
||||
this.lbl_SerVer.Location = new System.Drawing.Point(124, 26);
|
||||
this.lbl_SerVer.Name = "lbl_SerVer";
|
||||
this.lbl_SerVer.Size = new System.Drawing.Size(0, 12);
|
||||
this.lbl_SerVer.TabIndex = 2;
|
||||
//
|
||||
// lbl_Files
|
||||
//
|
||||
this.lbl_Files.AutoSize = true;
|
||||
this.lbl_Files.Location = new System.Drawing.Point(124, 79);
|
||||
this.lbl_Files.Name = "lbl_Files";
|
||||
this.lbl_Files.Size = new System.Drawing.Size(0, 12);
|
||||
this.lbl_Files.TabIndex = 2;
|
||||
//
|
||||
// lbl_status
|
||||
//
|
||||
this.lbl_status.Font = new System.Drawing.Font("굴림", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.lbl_status.ForeColor = System.Drawing.Color.DeepPink;
|
||||
this.lbl_status.Location = new System.Drawing.Point(-3, 166);
|
||||
this.lbl_status.Name = "lbl_status";
|
||||
this.lbl_status.Size = new System.Drawing.Size(317, 29);
|
||||
this.lbl_status.TabIndex = 0;
|
||||
this.lbl_status.Text = "최신파일입니다 !!";
|
||||
this.lbl_status.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// label7
|
||||
//
|
||||
this.label7.AutoSize = true;
|
||||
this.label7.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label7.Location = new System.Drawing.Point(12, 52);
|
||||
this.label7.Name = "label7";
|
||||
this.label7.Size = new System.Drawing.Size(106, 12);
|
||||
this.label7.TabIndex = 0;
|
||||
this.label7.Text = "클라이언트버전 :";
|
||||
//
|
||||
// progressBar1
|
||||
//
|
||||
this.progressBar1.Location = new System.Drawing.Point(22, 232);
|
||||
this.progressBar1.Name = "progressBar1";
|
||||
this.progressBar1.Size = new System.Drawing.Size(288, 16);
|
||||
this.progressBar1.TabIndex = 1;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label3.Location = new System.Drawing.Point(51, 26);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(67, 12);
|
||||
this.label3.TabIndex = 0;
|
||||
this.label3.Text = "서버버전 :";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label2.Location = new System.Drawing.Point(2, 79);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(116, 12);
|
||||
this.label2.TabIndex = 0;
|
||||
this.label2.Text = "업데이트 파일 수 :";
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.label1.Location = new System.Drawing.Point(51, 105);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 12);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "설치경로 :";
|
||||
//
|
||||
// btn_Close
|
||||
//
|
||||
this.btn_Close.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.btn_Close.Location = new System.Drawing.Point(197, 294);
|
||||
this.btn_Close.Name = "btn_Close";
|
||||
this.btn_Close.Size = new System.Drawing.Size(123, 34);
|
||||
this.btn_Close.TabIndex = 3;
|
||||
this.btn_Close.Text = "취 소";
|
||||
this.btn_Close.UseVisualStyleBackColor = true;
|
||||
this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
|
||||
//
|
||||
// btn_ok
|
||||
//
|
||||
this.btn_ok.Font = new System.Drawing.Font("굴림", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.btn_ok.Location = new System.Drawing.Point(30, 294);
|
||||
this.btn_ok.Name = "btn_ok";
|
||||
this.btn_ok.Size = new System.Drawing.Size(123, 34);
|
||||
this.btn_ok.TabIndex = 4;
|
||||
this.btn_ok.Text = "button1";
|
||||
this.btn_ok.UseVisualStyleBackColor = true;
|
||||
this.btn_ok.Click += new System.EventHandler(this.btn_ok_Click);
|
||||
//
|
||||
// dataGridView1
|
||||
//
|
||||
this.dataGridView1.AllowUserToAddRows = false;
|
||||
this.dataGridView1.AllowUserToDeleteRows = false;
|
||||
this.dataGridView1.AllowUserToResizeRows = false;
|
||||
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.file_name,
|
||||
this.update_status});
|
||||
this.dataGridView1.Location = new System.Drawing.Point(397, 12);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(399, 269);
|
||||
this.dataGridView1.TabIndex = 6;
|
||||
//
|
||||
// file_name
|
||||
//
|
||||
this.file_name.DataPropertyName = "file_name";
|
||||
this.file_name.HeaderText = "파일명";
|
||||
this.file_name.Name = "file_name";
|
||||
this.file_name.ReadOnly = true;
|
||||
this.file_name.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.file_name.Width = 200;
|
||||
//
|
||||
// update_status
|
||||
//
|
||||
this.update_status.DataPropertyName = "chk";
|
||||
this.update_status.FalseValue = "F";
|
||||
this.update_status.HeaderText = "업데이트완료";
|
||||
this.update_status.IndeterminateValue = "F";
|
||||
this.update_status.Name = "update_status";
|
||||
this.update_status.ReadOnly = true;
|
||||
this.update_status.TrueValue = "T";
|
||||
//
|
||||
// Client
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(351, 347);
|
||||
this.Controls.Add(this.dataGridView1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Controls.Add(this.btn_Close);
|
||||
this.Controls.Add(this.btn_ok);
|
||||
this.Name = "Client";
|
||||
this.Text = "ISBN 조회 자동 업데이트";
|
||||
this.Load += new System.EventHandler(this.Client_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.RichTextBox rtb_Ip;
|
||||
private System.Windows.Forms.Label lbl_cnt;
|
||||
private System.Windows.Forms.Label lbl_filename;
|
||||
private System.Windows.Forms.Label lbl_ClientVer;
|
||||
private System.Windows.Forms.Label lbl_SerVer;
|
||||
private System.Windows.Forms.Label lbl_Files;
|
||||
private System.Windows.Forms.Label lbl_status;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.ProgressBar progressBar1;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button btn_Close;
|
||||
private System.Windows.Forms.Button btn_ok;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn file_name;
|
||||
private System.Windows.Forms.DataGridViewCheckBoxColumn update_status;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,240 +0,0 @@
|
||||
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 System.IO;
|
||||
using System.Net;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace ISBN_Client
|
||||
{
|
||||
public partial class Client : Form
|
||||
{
|
||||
// FTP ID / PW
|
||||
private string Login_id = "ftpgloria";
|
||||
private string Login_pw = "admin@!@#$";
|
||||
|
||||
// 서버 / 클라이언트 버전
|
||||
private string Sr_Vers = "";
|
||||
private string Cl_Vers = "";
|
||||
|
||||
// 서버 아이피
|
||||
private string Server_Ip = "";
|
||||
|
||||
// 종료시 실행시킬 파일명
|
||||
private string Start_Prg = "";
|
||||
|
||||
// 파일 개수
|
||||
private int Files_Count = 0;
|
||||
|
||||
// 업데이트 진행 파일 수
|
||||
private int down_Count = 0;
|
||||
|
||||
// 업데이트 여부
|
||||
bool tf = false;
|
||||
|
||||
private string sLine = "";
|
||||
|
||||
private string[] str = new string[2];
|
||||
int i = -1;
|
||||
|
||||
DataSet ds = new DataSet("files");
|
||||
|
||||
public Client()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void Client_Load(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 파일 목록 생성을 위한 데이터 셋
|
||||
ds.Tables.Add("파일");
|
||||
|
||||
ds.Tables["파일"].Columns.Add("file_name");
|
||||
ds.Tables["파일"].Columns.Add("chk");
|
||||
|
||||
File_info();
|
||||
|
||||
dataGridView1.DataSource = ds.Tables["파일"];
|
||||
|
||||
// 서버의 update_isbn.inf 파일에서 버전 추출
|
||||
FtpWebRequest fwr = (FtpWebRequest)WebRequest.Create("ftp://" + Login_id + "@" + Server_Ip + "/ISBN/Update_isbn.inf");
|
||||
fwr.Credentials = new NetworkCredential(Login_id, Login_pw);
|
||||
|
||||
fwr.Method = WebRequestMethods.Ftp.DownloadFile;
|
||||
|
||||
FtpWebResponse fr = (FtpWebResponse)fwr.GetResponse();
|
||||
StreamReader sr = new StreamReader(fr.GetResponseStream());
|
||||
|
||||
while (!sr.EndOfStream)
|
||||
{
|
||||
sLine = sr.ReadLine();
|
||||
i = sLine.IndexOf("count=", 0);
|
||||
|
||||
// 서버 버전 추출
|
||||
if(sLine.IndexOf("count=", 0) != -1)
|
||||
{
|
||||
Sr_Vers = sLine.Replace("count=", "");
|
||||
lbl_SerVer.Text = Sr_Vers;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sr.Close();
|
||||
|
||||
// 버전이 같은 경우 버튼 변경
|
||||
if (Convert.ToDecimal(Sr_Vers) == Convert.ToDecimal(Cl_Vers))
|
||||
{
|
||||
btn_ok.Text = "프로그램 실행";
|
||||
|
||||
lbl_status.Text = "최신 버전입니다!";
|
||||
lbl_status.ForeColor = Color.Blue;
|
||||
|
||||
lbl_filename.Text = "";
|
||||
lbl_cnt.Text = "";
|
||||
|
||||
for(int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
dataGridView1.Rows[a].Cells["update_status"].Value = "T";
|
||||
}
|
||||
|
||||
btn_ok_Click(null, null);
|
||||
}
|
||||
else if (Convert.ToDecimal(Sr_Vers) > Convert.ToDecimal(Cl_Vers))
|
||||
{
|
||||
btn_ok.Text = "업데이트";
|
||||
tf = true;
|
||||
|
||||
lbl_cnt.Text = "(1/" + dataGridView1.Rows.Count.ToString() + ")";
|
||||
lbl_status.Text = "업데이트가 존재합니다!";
|
||||
lbl_status.ForeColor = Color.DeepPink;
|
||||
}
|
||||
}
|
||||
catch(System.Exception ex)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void btn_ok_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (tf)
|
||||
{
|
||||
// 업데이트가 존재할 때
|
||||
download(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 업데이트가 없을 때
|
||||
string start_program = Application.StartupPath + "\\" + Start_Prg;
|
||||
Process prc = new Process();
|
||||
prc.StartInfo = new System.Diagnostics.ProcessStartInfo(start_program);
|
||||
prc.Start();
|
||||
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void download(int cnt)
|
||||
{
|
||||
if (cnt < Convert.ToInt32(lbl_Files.Text))
|
||||
{
|
||||
WebClient clnt = new WebClient();
|
||||
clnt.Credentials = new NetworkCredential(Login_id, Login_pw);
|
||||
|
||||
lbl_status.Text = "업데이트 진행중!";
|
||||
progressBar1.Value = (progressBar1.Maximum / Convert.ToInt32(lbl_Files.Text)) * (down_Count + 1);
|
||||
|
||||
lbl_filename.Text = dataGridView1.Rows[cnt].Cells["file_name"].Value.ToString();
|
||||
|
||||
dataGridView1.Rows[cnt].Cells["update_status"].Value = "T";
|
||||
lbl_cnt.Text = "(" + (cnt + 1).ToString() + "/" + (dataGridView1.Rows.Count).ToString() + ")";
|
||||
|
||||
File.Delete(Application.StartupPath + lbl_filename.Text);
|
||||
|
||||
clnt.DownloadFileAsync(new Uri("ftp://" + Login_id + "@" + Server_Ip + "/ISBN/" + lbl_filename.Text),
|
||||
Application.StartupPath + "\\" + lbl_filename.Text);
|
||||
|
||||
clnt.DownloadFileCompleted += new AsyncCompletedEventHandler(clnt_DownloadFileCompleted);
|
||||
}
|
||||
else
|
||||
{
|
||||
File_info();
|
||||
|
||||
progressBar1.Value = progressBar1.Maximum;
|
||||
btn_ok.Text = "프로그램 실행";
|
||||
|
||||
lbl_status.Text = "최신 파일입니다!";
|
||||
lbl_status.ForeColor = Color.Blue;
|
||||
|
||||
lbl_filename.Text = "";
|
||||
lbl_cnt.Text = "";
|
||||
tf = false;
|
||||
}
|
||||
}
|
||||
void clnt_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
|
||||
{
|
||||
down_Count += 1;
|
||||
download(down_Count);
|
||||
}
|
||||
|
||||
private void File_info()
|
||||
{
|
||||
// 클라이언트 파일 정보
|
||||
// update.inf 파일에서 파일개수, 파일명, 버전 추출
|
||||
StreamReader sr = new StreamReader(Application.StartupPath + "\\Update_isbn.inf");
|
||||
int i = -1;
|
||||
while(sr.EndOfStream != true)
|
||||
{
|
||||
sLine = sr.ReadLine();
|
||||
i = sLine.IndexOf("count=", 0);
|
||||
|
||||
// 버전 추출
|
||||
if (sLine.IndexOf("count=", 0) != -1)
|
||||
{
|
||||
Cl_Vers = sLine.Replace("count=", "");
|
||||
lbl_ClientVer.Text = Cl_Vers;
|
||||
}
|
||||
// 설치 경로 추출
|
||||
else if (sLine.IndexOf("server_url=", 0) != -1)
|
||||
{
|
||||
Server_Ip = sLine.Replace("server_url=", "");
|
||||
rtb_Ip.Text = Server_Ip;
|
||||
//rtb_Ip.Text = Application.StartupPath;
|
||||
}
|
||||
// 종료시 실행 파일
|
||||
else if (sLine.IndexOf("exe=", 0) != -1)
|
||||
{
|
||||
Start_Prg = sLine.Replace("exe=", "");
|
||||
}
|
||||
// 파일 개수 추출
|
||||
else if (sLine.IndexOf("Files=", 0) != -1)
|
||||
{
|
||||
Files_Count = Convert.ToInt32(sLine.Replace("Files=", ""));
|
||||
lbl_Files.Text = Files_Count.ToString();
|
||||
}
|
||||
else if(sLine.IndexOf("\\", 0) != -1)
|
||||
{
|
||||
str[0] = sLine.Replace("\\", "");
|
||||
str[1] = "F";
|
||||
ds.Tables["파일"].Rows.Add(str);
|
||||
}
|
||||
i = -1;
|
||||
}
|
||||
sr.Close();
|
||||
}
|
||||
|
||||
private void btn_Close_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{1A792D56-127B-446B-8B01-0A60902E0086}</ProjectGuid>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<RootNamespace>ISBN_Client</RootNamespace>
|
||||
<AssemblyName>ISBN_Client</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||
<Deterministic>true</Deterministic>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<TargetZone>LocalIntranet</TargetZone>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<GenerateManifests>false</GenerateManifests>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationManifest>Properties\app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Deployment" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ISBN_Client.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ISBN_Client.Designer.cs">
|
||||
<DependentUpon>ISBN_Client.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<EmbeddedResource Include="ISBN_Client.resx">
|
||||
<DependentUpon>ISBN_Client.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<None Include="Properties\app.manifest" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
@@ -1,22 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ISBN_Client
|
||||
{
|
||||
static class Program
|
||||
{
|
||||
/// <summary>
|
||||
/// 해당 애플리케이션의 주 진입점입니다.
|
||||
/// </summary>
|
||||
[STAThread]
|
||||
static void Main()
|
||||
{
|
||||
Application.EnableVisualStyles();
|
||||
Application.SetCompatibleTextRenderingDefault(false);
|
||||
Application.Run(new Client());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// 어셈블리에 대한 일반 정보는 다음 특성 집합을 통해
|
||||
// 제어됩니다. 어셈블리와 관련된 정보를 수정하려면
|
||||
// 이러한 특성 값을 변경하세요.
|
||||
[assembly: AssemblyTitle("ISBN_Client")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Microsoft Corporation")]
|
||||
[assembly: AssemblyProduct("ISBN_Client")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft Corporation 2021")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// ComVisible을 false로 설정하면 이 어셈블리의 형식이 COM 구성 요소에
|
||||
// 표시되지 않습니다. COM에서 이 어셈블리의 형식에 액세스하려면
|
||||
// 해당 형식에 대해 ComVisible 특성을 true로 설정하세요.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// 이 프로젝트가 COM에 노출되는 경우 다음 GUID는 typelib의 ID를 나타냅니다.
|
||||
[assembly: Guid("1a792d56-127b-446b-8b01-0a60902e0086")]
|
||||
|
||||
// 어셈블리의 버전 정보는 다음 네 가지 값으로 구성됩니다.
|
||||
//
|
||||
// 주 버전
|
||||
// 부 버전
|
||||
// 빌드 번호
|
||||
// 수정 버전
|
||||
//
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
|
||||
// 기본값으로 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
70
ISBN_Client/Properties/Resources.Designer.cs
generated
70
ISBN_Client/Properties/Resources.Designer.cs
generated
@@ -1,70 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// 이 코드는 도구를 사용하여 생성되었습니다.
|
||||
// 런타임 버전:4.0.30319.42000
|
||||
//
|
||||
// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면
|
||||
// 이러한 변경 내용이 손실됩니다.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace ISBN_Client.Properties
|
||||
{
|
||||
/// <summary>
|
||||
/// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다.
|
||||
/// </summary>
|
||||
// 이 클래스는 ResGen 또는 Visual Studio와 같은 도구를 통해 StronglyTypedResourceBuilder
|
||||
// 클래스에서 자동으로 생성되었습니다.
|
||||
// 멤버를 추가하거나 제거하려면 .ResX 파일을 편집한 다음 /str 옵션을 사용하여
|
||||
// ResGen을 다시 실행하거나 VS 프로젝트를 다시 빌드하십시오.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources
|
||||
{
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager
|
||||
{
|
||||
get
|
||||
{
|
||||
if ((resourceMan == null))
|
||||
{
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ISBN_Client.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을
|
||||
/// 재정의합니다.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture
|
||||
{
|
||||
get
|
||||
{
|
||||
return resourceCulture;
|
||||
}
|
||||
set
|
||||
{
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
29
ISBN_Client/Properties/Settings.Designer.cs
generated
29
ISBN_Client/Properties/Settings.Designer.cs
generated
@@ -1,29 +0,0 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace ISBN_Client.Properties
|
||||
{
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -1,73 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<assemblyIdentity version="1.0.0.0" name="MyApplication.app" />
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
|
||||
<security>
|
||||
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<!-- UAC 매니페스트 옵션
|
||||
Windows 사용자 계정 컨트롤 수준을 변경하려면
|
||||
requestedExecutionLevel 노드를 다음 중 하나로 바꿉니다.
|
||||
|
||||
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />
|
||||
|
||||
requestedExecutionLevel 요소를 지정하면 파일 및 레지스트리 가상화를 사용하지 않습니다.
|
||||
이전 버전과의 호환성을 위해 애플리케이션에 가상화가 필요한 경우
|
||||
이 요소를 제거합니다.
|
||||
-->
|
||||
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
|
||||
</requestedPrivileges>
|
||||
<applicationRequestMinimum>
|
||||
<defaultAssemblyRequest permissionSetReference="Custom" />
|
||||
<PermissionSet class="System.Security.PermissionSet" version="1" ID="Custom" SameSite="site" Unrestricted="true" />
|
||||
</applicationRequestMinimum>
|
||||
</security>
|
||||
</trustInfo>
|
||||
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
|
||||
<application>
|
||||
<!-- 이 애플리케이션이 테스트되고 함께 작동하도록 설계된 Windows 버전
|
||||
목록입니다. 해당 요소의 주석 처리를 제거하면 Windows에서
|
||||
호환 가능성이 가장 큰 환경을 자동으로 선택합니다. -->
|
||||
<!-- Windows Vista -->
|
||||
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->
|
||||
<!-- Windows 7 -->
|
||||
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
|
||||
<!-- Windows 8 -->
|
||||
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
|
||||
<!-- Windows 8.1 -->
|
||||
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
|
||||
<!-- Windows 10 -->
|
||||
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->
|
||||
</application>
|
||||
</compatibility>
|
||||
<!-- 애플리케이션이 DPI를 인식하며 높은 DPI에서 Windows가 자동으로 스케일링하지
|
||||
않음을 나타냅니다. WPF(Windows Presentation Foundation) 애플리케이션은 자동으로 DPI를 인식하며
|
||||
옵트인할 필요가 없습니다. 이 설정에 옵트인한 .NET Framework 4.6을 대상으로 하는
|
||||
Windows Forms 애플리케이션은 app.config에서 'EnableWindowsFormsHighDpiAutoResizing' 설정도 'true'로 설정해야 합니다.
|
||||
|
||||
애플리케이션이 긴 경로를 인식하도록 설정합니다. https://docs.microsoft.com/windows/win32/fileio/maximum-file-path-limitation을 참조하세요. -->
|
||||
<!--
|
||||
<application xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<windowsSettings>
|
||||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
|
||||
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
|
||||
</windowsSettings>
|
||||
</application>
|
||||
-->
|
||||
<!-- Windows 공용 컨트롤 및 대화 상자의 테마 사용(Windows XP 이상) -->
|
||||
<!--
|
||||
<dependency>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity
|
||||
type="win32"
|
||||
name="Microsoft.Windows.Common-Controls"
|
||||
version="6.0.0.0"
|
||||
processorArchitecture="*"
|
||||
publicKeyToken="6595b64144ccf1df"
|
||||
language="*"
|
||||
/>
|
||||
</dependentAssembly>
|
||||
</dependency>
|
||||
-->
|
||||
</assembly>
|
||||
@@ -14,7 +14,7 @@ using System.Reflection;
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("pofalApi_tmp")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+8e7df6f68d424e8b9f20e24f017b877849125171")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("pofalApi_tmp")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("pofalApi_tmp")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
@@ -1 +1 @@
|
||||
c13c9c2f2e12bc007cbcab6ccdb94397f9d2465a
|
||||
1e22963f41eb10ec8b7d5cf0f11446afcd4c7c64669758c39d9d6d7a2dc5abbf
|
||||
|
||||
Binary file not shown.
@@ -18,7 +18,7 @@
|
||||
},
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(git add:*)"
|
||||
"Bash(git push:*)"
|
||||
],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"hooks": {
|
||||
"conversation-start": "새로운 대화를 시작할 때 항상 CLAUDE.md 파일을 자동으로 읽고 프로젝트 컨텍스트를 파악하세요",
|
||||
"user-prompt-submit": "작업을 시작하기 전에 항상 CLAUDE.md 파일을 읽고 참조하세요"
|
||||
}
|
||||
}
|
||||
@@ -10,6 +10,9 @@
|
||||
- **데이터베이스**: MySQL
|
||||
- **주요기능**: 마크 작성, 복본조사, DLS 연동, 도서 정보 관리
|
||||
|
||||
## 데이터베이스 정보
|
||||
- Server=1.215.250.130;Port=3306;Database=unimarc;uid=root;pwd=Admin21234;
|
||||
|
||||
## 코딩 컨벤션
|
||||
- 파일명: PascalCase (예: DLS_Copy.cs)
|
||||
- 클래스명: PascalCase
|
||||
|
||||
19
unimarc/NuGet.Config
Normal file
19
unimarc/NuGet.Config
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
||||
<add key="grapecity" value="https://nuget.grapecity.com/nuget" />
|
||||
</packageSources>
|
||||
<packageSourceCredentials />
|
||||
<packageRestore>
|
||||
<add key="enabled" value="True" />
|
||||
<add key="automatic" value="True" />
|
||||
</packageRestore>
|
||||
<bindingRedirects>
|
||||
<add key="skip" value="False" />
|
||||
</bindingRedirects>
|
||||
<packageManagement>
|
||||
<add key="format" value="0" />
|
||||
<add key="disabled" value="False" />
|
||||
</packageManagement>
|
||||
</configuration>
|
||||
@@ -9,6 +9,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Factory_Client", "Factory_C
|
||||
EndProject
|
||||
Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "UniMarcSetup", "UniMarcSetup\UniMarcSetup.vdproj", "{B0A88F76-DC68-44F9-90B4-CD94625CC1F4}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "솔루션 항목", "솔루션 항목", "{2A3A057F-5D22-31FD-628C-DF5EF75AEF1E}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
CLAUDE.md = CLAUDE.md
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace WindowsFormsApp1
|
||||
/// <summary>
|
||||
/// DB접속을 도와주는 클래스
|
||||
/// </summary>
|
||||
class Helper_DB
|
||||
public class Helper_DB
|
||||
{
|
||||
// 접속
|
||||
MySqlConnection conn;
|
||||
@@ -222,6 +222,8 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
public void DB_Send_CMD_reVoid(string cmd)
|
||||
{
|
||||
|
||||
|
||||
//using (conn)
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
48
unimarc/unimarc/Helper_DB2.cs
Normal file
48
unimarc/unimarc/Helper_DB2.cs
Normal file
@@ -0,0 +1,48 @@
|
||||
using AR;
|
||||
using Microsoft.Vbe.Interop;
|
||||
using MySql.Data.MySqlClient;
|
||||
using OpenQA.Selenium.BiDi.Input;
|
||||
using Renci.SshNet;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.IO.Ports;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using UniMarc;
|
||||
using UniMarc.Properties;
|
||||
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
public static class DB2
|
||||
{
|
||||
public static DataTable GetDT(string tableName, string columns="*" , string wheres="", string orders="")
|
||||
{
|
||||
var sql = $"select {columns} from {tableName}";
|
||||
if (wheres.isEmpty() == false) sql += " where " + wheres;
|
||||
if (orders.isEmpty() == false) sql += " order by " + orders;
|
||||
Helper_DB db = new Helper_DB();
|
||||
var cn = db.CreateConnection();
|
||||
var da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, cn);
|
||||
var dt = new DataTable();
|
||||
da.Fill(dt);
|
||||
dt.AcceptChanges();
|
||||
return dt;
|
||||
}
|
||||
|
||||
public static int ExcuteNonQuery(string query)
|
||||
{
|
||||
Helper_DB db = new Helper_DB();
|
||||
var cn = db.CreateConnection();
|
||||
var cmd = new MySqlCommand(query, cn);
|
||||
cn.Open();
|
||||
var cnt = cmd.ExecuteNonQuery();
|
||||
cmd.Dispose();
|
||||
cn.Dispose();
|
||||
return cnt;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
170
unimarc/unimarc/Helper_LibraryDelaySettings.cs
Normal file
170
unimarc/unimarc/Helper_LibraryDelaySettings.cs
Normal file
@@ -0,0 +1,170 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Xml;
|
||||
using System.Text;
|
||||
|
||||
namespace UniMarc
|
||||
{
|
||||
/// <summary>
|
||||
/// 도서관별 지연시간 설정을 관리하는 클래스
|
||||
/// </summary>
|
||||
public class Helper_LibraryDelaySettings
|
||||
{
|
||||
private static readonly string SettingsFileName = "LibraryDelaySettings.xml";
|
||||
private static readonly string SettingsFilePath = Path.Combine(
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
|
||||
"UniMarc",
|
||||
SettingsFileName
|
||||
);
|
||||
|
||||
private Dictionary<string, int> _libraryDelaySettings;
|
||||
|
||||
public Helper_LibraryDelaySettings()
|
||||
{
|
||||
_libraryDelaySettings = new Dictionary<string, int>();
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 도서관별 지연시간 설정을 로드
|
||||
/// </summary>
|
||||
private void LoadSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (File.Exists(SettingsFilePath))
|
||||
{
|
||||
var xmlDoc = new XmlDocument();
|
||||
xmlDoc.Load(SettingsFilePath);
|
||||
|
||||
var libraryNodes = xmlDoc.SelectNodes("//LibraryDelaySettings/Library");
|
||||
if (libraryNodes != null)
|
||||
{
|
||||
foreach (XmlNode node in libraryNodes)
|
||||
{
|
||||
var name = node.Attributes?["Name"]?.Value;
|
||||
var delayStr = node.Attributes?["Delay"]?.Value;
|
||||
|
||||
if (!string.IsNullOrEmpty(name) && int.TryParse(delayStr, out int delay))
|
||||
{
|
||||
_libraryDelaySettings[name] = delay;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"도서관 지연시간 설정 로드 오류: {ex.Message}");
|
||||
_libraryDelaySettings = new Dictionary<string, int>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 도서관별 지연시간 설정을 저장
|
||||
/// </summary>
|
||||
private void SaveSettings()
|
||||
{
|
||||
try
|
||||
{
|
||||
// 디렉토리 생성
|
||||
var directory = Path.GetDirectoryName(SettingsFilePath);
|
||||
if (!Directory.Exists(directory))
|
||||
{
|
||||
Directory.CreateDirectory(directory);
|
||||
}
|
||||
|
||||
// XML 파일로 저장
|
||||
var xmlDoc = new XmlDocument();
|
||||
var declaration = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", null);
|
||||
xmlDoc.AppendChild(declaration);
|
||||
|
||||
var root = xmlDoc.CreateElement("LibraryDelaySettings");
|
||||
xmlDoc.AppendChild(root);
|
||||
|
||||
foreach (var kvp in _libraryDelaySettings)
|
||||
{
|
||||
var libraryElement = xmlDoc.CreateElement("Library");
|
||||
libraryElement.SetAttribute("Name", kvp.Key);
|
||||
libraryElement.SetAttribute("Delay", kvp.Value.ToString());
|
||||
root.AppendChild(libraryElement);
|
||||
}
|
||||
|
||||
xmlDoc.Save(SettingsFilePath);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"도서관 지연시간 설정 저장 오류: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 도서관의 지연시간 설정을 가져옴
|
||||
/// </summary>
|
||||
/// <param name="libraryName">도서관 이름</param>
|
||||
/// <returns>지연시간(초), 설정이 없으면 0</returns>
|
||||
public int GetDelay(string libraryName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(libraryName))
|
||||
return 0;
|
||||
|
||||
return _libraryDelaySettings.TryGetValue(libraryName, out int delay) ? delay : 0;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 도서관의 지연시간 설정을 저장
|
||||
/// </summary>
|
||||
/// <param name="libraryName">도서관 이름</param>
|
||||
/// <param name="delaySeconds">지연시간(초)</param>
|
||||
public void SetDelay(string libraryName, int delaySeconds)
|
||||
{
|
||||
if (string.IsNullOrEmpty(libraryName))
|
||||
return;
|
||||
|
||||
if (delaySeconds < 0)
|
||||
delaySeconds = 0;
|
||||
|
||||
_libraryDelaySettings[libraryName] = delaySeconds;
|
||||
SaveSettings();
|
||||
|
||||
Console.WriteLine($"도서관 지연시간 설정 저장: {libraryName} = {delaySeconds}초");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 모든 도서관 지연시간 설정을 가져옴
|
||||
/// </summary>
|
||||
/// <returns>도서관명-지연시간 딕셔너리</returns>
|
||||
public Dictionary<string, int> GetAllSettings()
|
||||
{
|
||||
return new Dictionary<string, int>(_libraryDelaySettings);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 특정 도서관의 지연시간 설정을 제거
|
||||
/// </summary>
|
||||
/// <param name="libraryName">도서관 이름</param>
|
||||
public void RemoveDelay(string libraryName)
|
||||
{
|
||||
if (string.IsNullOrEmpty(libraryName))
|
||||
return;
|
||||
|
||||
if (_libraryDelaySettings.ContainsKey(libraryName))
|
||||
{
|
||||
_libraryDelaySettings.Remove(libraryName);
|
||||
SaveSettings();
|
||||
Console.WriteLine($"도서관 지연시간 설정 제거: {libraryName}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 모든 지연시간 설정을 초기화
|
||||
/// </summary>
|
||||
public void ClearAllSettings()
|
||||
{
|
||||
_libraryDelaySettings.Clear();
|
||||
SaveSettings();
|
||||
Console.WriteLine("모든 도서관 지연시간 설정 초기화");
|
||||
}
|
||||
}
|
||||
}
|
||||
258
unimarc/unimarc/ListOfValue/fSelectDT.Designer.cs
generated
Normal file
258
unimarc/unimarc/ListOfValue/fSelectDT.Designer.cs
generated
Normal file
@@ -0,0 +1,258 @@
|
||||
namespace UniMarc.ListOfValue
|
||||
{
|
||||
partial class fSelectDT
|
||||
{
|
||||
/// <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()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(fSelectDT));
|
||||
this.dv1 = new System.Windows.Forms.DataGridView();
|
||||
this.bn = new System.Windows.Forms.BindingNavigator(this.components);
|
||||
this.bs = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
|
||||
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.tbFind = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.btfind = new System.Windows.Forms.ToolStripButton();
|
||||
this.btSelect = new System.Windows.Forms.ToolStripButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
|
||||
this.bn.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dv1
|
||||
//
|
||||
this.dv1.AllowUserToAddRows = false;
|
||||
this.dv1.AllowUserToDeleteRows = false;
|
||||
this.dv1.AllowUserToResizeRows = false;
|
||||
this.dv1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle1.Padding = new System.Windows.Forms.Padding(0, 3, 0, 3);
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dv1.DefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dv1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dv1.Location = new System.Drawing.Point(0, 0);
|
||||
this.dv1.MultiSelect = false;
|
||||
this.dv1.Name = "dv1";
|
||||
this.dv1.ReadOnly = true;
|
||||
this.dv1.RowTemplate.Height = 23;
|
||||
this.dv1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dv1.Size = new System.Drawing.Size(768, 423);
|
||||
this.dv1.TabIndex = 0;
|
||||
//
|
||||
// bn
|
||||
//
|
||||
this.bn.AddNewItem = null;
|
||||
this.bn.BindingSource = this.bs;
|
||||
this.bn.CountItem = this.bindingNavigatorCountItem;
|
||||
this.bn.DeleteItem = null;
|
||||
this.bn.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.bn.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.bindingNavigatorMoveFirstItem,
|
||||
this.bindingNavigatorMovePreviousItem,
|
||||
this.bindingNavigatorSeparator,
|
||||
this.bindingNavigatorPositionItem,
|
||||
this.bindingNavigatorCountItem,
|
||||
this.bindingNavigatorSeparator1,
|
||||
this.bindingNavigatorMoveNextItem,
|
||||
this.bindingNavigatorMoveLastItem,
|
||||
this.bindingNavigatorSeparator2,
|
||||
this.toolStripLabel1,
|
||||
this.tbFind,
|
||||
this.btfind,
|
||||
this.btSelect});
|
||||
this.bn.Location = new System.Drawing.Point(0, 423);
|
||||
this.bn.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
|
||||
this.bn.MoveLastItem = this.bindingNavigatorMoveLastItem;
|
||||
this.bn.MoveNextItem = this.bindingNavigatorMoveNextItem;
|
||||
this.bn.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
|
||||
this.bn.Name = "bn";
|
||||
this.bn.PositionItem = this.bindingNavigatorPositionItem;
|
||||
this.bn.Size = new System.Drawing.Size(768, 25);
|
||||
this.bn.TabIndex = 1;
|
||||
this.bn.Text = "bindingNavigator1";
|
||||
//
|
||||
// bindingNavigatorCountItem
|
||||
//
|
||||
this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
|
||||
this.bindingNavigatorCountItem.Size = new System.Drawing.Size(27, 22);
|
||||
this.bindingNavigatorCountItem.Text = "/{0}";
|
||||
this.bindingNavigatorCountItem.ToolTipText = "전체 항목 수";
|
||||
//
|
||||
// bindingNavigatorMoveFirstItem
|
||||
//
|
||||
this.bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveFirstItem.Image")));
|
||||
this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
|
||||
this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMoveFirstItem.Text = "처음으로 이동";
|
||||
//
|
||||
// bindingNavigatorMovePreviousItem
|
||||
//
|
||||
this.bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMovePreviousItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMovePreviousItem.Image")));
|
||||
this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
|
||||
this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMovePreviousItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMovePreviousItem.Text = "이전으로 이동";
|
||||
//
|
||||
// bindingNavigatorSeparator
|
||||
//
|
||||
this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
|
||||
this.bindingNavigatorSeparator.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// bindingNavigatorPositionItem
|
||||
//
|
||||
this.bindingNavigatorPositionItem.AccessibleName = "위치";
|
||||
this.bindingNavigatorPositionItem.AutoSize = false;
|
||||
this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("맑은 고딕", 9F);
|
||||
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
|
||||
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
|
||||
this.bindingNavigatorPositionItem.Text = "0";
|
||||
this.bindingNavigatorPositionItem.ToolTipText = "현재 위치";
|
||||
//
|
||||
// bindingNavigatorSeparator1
|
||||
//
|
||||
this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
|
||||
this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// bindingNavigatorMoveNextItem
|
||||
//
|
||||
this.bindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveNextItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveNextItem.Image")));
|
||||
this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
|
||||
this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveNextItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMoveNextItem.Text = "다음으로 이동";
|
||||
//
|
||||
// bindingNavigatorMoveLastItem
|
||||
//
|
||||
this.bindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveLastItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveLastItem.Image")));
|
||||
this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
|
||||
this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveLastItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMoveLastItem.Text = "마지막으로 이동";
|
||||
//
|
||||
// bindingNavigatorSeparator2
|
||||
//
|
||||
this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator2";
|
||||
this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// toolStripLabel1
|
||||
//
|
||||
this.toolStripLabel1.Name = "toolStripLabel1";
|
||||
this.toolStripLabel1.Size = new System.Drawing.Size(31, 22);
|
||||
this.toolStripLabel1.Text = "검색";
|
||||
//
|
||||
// tbFind
|
||||
//
|
||||
this.tbFind.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.tbFind.Font = new System.Drawing.Font("맑은 고딕", 9F);
|
||||
this.tbFind.Name = "tbFind";
|
||||
this.tbFind.Size = new System.Drawing.Size(200, 25);
|
||||
this.tbFind.TextBoxTextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
this.tbFind.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbFind_KeyDown);
|
||||
//
|
||||
// btfind
|
||||
//
|
||||
this.btfind.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.btfind.Image = ((System.Drawing.Image)(resources.GetObject("btfind.Image")));
|
||||
this.btfind.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btfind.Name = "btfind";
|
||||
this.btfind.Size = new System.Drawing.Size(23, 22);
|
||||
this.btfind.Text = "toolStripButton1";
|
||||
this.btfind.Click += new System.EventHandler(this.btfind_Click);
|
||||
//
|
||||
// btSelect
|
||||
//
|
||||
this.btSelect.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
||||
this.btSelect.Image = ((System.Drawing.Image)(resources.GetObject("btSelect.Image")));
|
||||
this.btSelect.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btSelect.Name = "btSelect";
|
||||
this.btSelect.Size = new System.Drawing.Size(51, 22);
|
||||
this.btSelect.Text = "선택";
|
||||
this.btSelect.TextAlign = System.Drawing.ContentAlignment.TopLeft;
|
||||
this.btSelect.Click += new System.EventHandler(this.btSelect_Click);
|
||||
//
|
||||
// fSelectDT
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(768, 448);
|
||||
this.Controls.Add(this.dv1);
|
||||
this.Controls.Add(this.bn);
|
||||
this.KeyPreview = true;
|
||||
this.Name = "fSelectDT";
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "fSelectDT";
|
||||
this.Load += new System.EventHandler(this.fSelectDT_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bn)).EndInit();
|
||||
this.bn.ResumeLayout(false);
|
||||
this.bn.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dv1;
|
||||
private System.Windows.Forms.BindingNavigator bn;
|
||||
private System.Windows.Forms.ToolStripLabel bindingNavigatorCountItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveFirstItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMovePreviousItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator;
|
||||
private System.Windows.Forms.ToolStripTextBox bindingNavigatorPositionItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveNextItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveLastItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator2;
|
||||
private System.Windows.Forms.BindingSource bs;
|
||||
private System.Windows.Forms.ToolStripLabel toolStripLabel1;
|
||||
private System.Windows.Forms.ToolStripTextBox tbFind;
|
||||
private System.Windows.Forms.ToolStripButton btfind;
|
||||
private System.Windows.Forms.ToolStripButton btSelect;
|
||||
}
|
||||
}
|
||||
143
unimarc/unimarc/ListOfValue/fSelectDT.cs
Normal file
143
unimarc/unimarc/ListOfValue/fSelectDT.cs
Normal file
@@ -0,0 +1,143 @@
|
||||
using AR;
|
||||
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 UniMarc.ListOfValue
|
||||
{
|
||||
public partial class fSelectDT : Form
|
||||
{
|
||||
public DataRow SelectedRow = null;
|
||||
public fSelectDT(DataTable dt)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.KeyDown += (s1, e1) =>
|
||||
{
|
||||
if (e1.KeyCode == Keys.Escape) Close();
|
||||
};
|
||||
this.bs.DataSource = dt;
|
||||
this.bn.BindingSource = this.bs;
|
||||
this.dv1.DataSource = this.bs;
|
||||
this.dv1.MultiSelect = false;
|
||||
this.dv1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dv1.EditMode = DataGridViewEditMode.EditProgrammatically;
|
||||
this.dv1.CellDoubleClick += Dv1_CellDoubleClick;
|
||||
this.dv1.KeyDown += Dv1_KeyDown;
|
||||
}
|
||||
|
||||
private void Dv1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
e.Handled = true;
|
||||
e.SuppressKeyPress = true;
|
||||
btSelect_Click(sender, e);
|
||||
}
|
||||
}
|
||||
|
||||
private void Dv1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.RowIndex >= 0)
|
||||
{
|
||||
var row = this.dv1.Rows[e.RowIndex];
|
||||
if (row.DataBoundItem is DataRowView drv)
|
||||
{
|
||||
SelectedRow = drv.Row;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void fSelectDT_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
this.dv1.AutoResizeColumns();
|
||||
this.dv1.Focus();
|
||||
|
||||
}
|
||||
|
||||
private void btfind_Click(object sender, EventArgs e)
|
||||
{
|
||||
find();
|
||||
}
|
||||
void find()
|
||||
{
|
||||
var search = tbFind.Text.Trim();
|
||||
var filter = "";
|
||||
try
|
||||
{
|
||||
if (!search.isEmpty())
|
||||
{
|
||||
// 검색어에서 작은따옴표 이스케이프 처리
|
||||
var escapedSearch = search.Replace("'", "''");
|
||||
|
||||
// DataTable의 모든 컬럼에 대해 검색 필터 생성
|
||||
var dt = this.bs.DataSource as DataTable;
|
||||
if (dt != null && dt.Columns.Count > 0)
|
||||
{
|
||||
var filters = new List<string>();
|
||||
foreach (DataColumn column in dt.Columns)
|
||||
{
|
||||
// 문자열 컬럼만 검색 (숫자나 날짜 컬럼은 Convert 사용)
|
||||
if (column.DataType == typeof(string))
|
||||
{
|
||||
filters.Add($"ISNULL(CONVERT([{column.ColumnName}], 'System.String'), '') LIKE '%{escapedSearch}%'");
|
||||
}
|
||||
else
|
||||
{
|
||||
filters.Add($"CONVERT([{column.ColumnName}], 'System.String') LIKE '%{escapedSearch}%'");
|
||||
}
|
||||
}
|
||||
|
||||
// OR 조건으로 연결
|
||||
filter = string.Join(" OR ", filters);
|
||||
}
|
||||
}
|
||||
|
||||
this.bs.Filter = filter;
|
||||
if (search.isEmpty()) tbFind.BackColor = Color.White;
|
||||
else tbFind.BackColor = Color.Lime;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.bs.Filter = "";
|
||||
tbFind.BackColor = Color.HotPink;
|
||||
}
|
||||
finally
|
||||
{
|
||||
tbFind.SelectAll();
|
||||
tbFind.Focus();
|
||||
}
|
||||
}
|
||||
|
||||
private void btSelect_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.bs.Current == null)
|
||||
{
|
||||
MessageBox.Show("선택된 데이터가 없습니다.", "알림", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.bs.Current is DataRowView drv)
|
||||
{
|
||||
SelectedRow = drv.Row;
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void tbFind_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter) find();
|
||||
}
|
||||
}
|
||||
}
|
||||
196
unimarc/unimarc/ListOfValue/fSelectDT.resx
Normal file
196
unimarc/unimarc/ListOfValue/fSelectDT.resx
Normal file
@@ -0,0 +1,196 @@
|
||||
<?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="bn.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="bs.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>171, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="bindingNavigatorMoveFirstItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wAAADsABataJCQAAATFJREFUOE9jYBg0oHDW8/9NC57/z5z4+D+6HAyEtz/AKceQO/PZ/1VH3v/HpSi+
|
||||
+8H/4IZrWOXAIGPK0/8L933Aqii+5+H/pfv///evvoAhBwcJPU/+T9vyHkNRRPt9sObMWf//e5WewG1A
|
||||
ZNej/72rP6AoCm29B9bcuu7/f//Ov/9d8g/gNiCw+eH/uvnv4IqCW+7+X7T3//+Odf//Z8z5+d+u7ud/
|
||||
+4ztuA3wqLr/P3/aGxRFdsW3/6fP+f3fv+vbf53Cd/8tEtbjNsC+9O7/7MmvMRTpp5z/b1L04r9K1qf/
|
||||
xpHLcBtgkXfnf2r/a6yKDJJO/JdN+/pfN3gehhwcGGbd/h/W8hKnIv3Uy/81fKdhlQMDnbQb//2qH+JV
|
||||
pOIxAaccg1Pulf8gBXgVDUoAAPB2wKtYlLYeAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMovePreviousItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wAAADsABataJCQAAALtJREFUOE9jYBgyILz9wX90MaJBfPeD/8EN18gzIL7n4f+l+///96++QLoBEe33
|
||||
wZozZ/3/71V6gjQDQlvvgTW3rvv/37/z73+X/APEGxDccvf/or3//3es+/8/Y87P/3Z1P//bZ2wn3gAQ
|
||||
sCu+/T99zu///l3f/usUvvtvkbCeNANAQD/l/H+Tohf/VbI+/TeOXEa6ASBgkHTiv2za1/+6wfPIMwAE
|
||||
9FMv/9fwnUa+ASCg4jGBMgMGLwAA0BRgmCws/7cAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMoveNextItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wAAADsABataJCQAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5
|
||||
8n/2vl//O7f+/e9Wepl0QyK7Hv2fsu3X/5Klf/8nTP/73yb3LGmGBDY//N+69j1Ys3HJl//S0df+G0cu
|
||||
I94Qj6r7/0vmvoNrVnTpIV4zCNiX3v0f2PKMPM0gYJF3579NwRXyNIOAYdZt8jWDgE7aDfI1D00AAKB+
|
||||
X6Bjq5qXAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMoveLastItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wAAADsABataJCQAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe
|
||||
/w9vf4BVHgwypjz9P2//7/8JXXcwFIHkFu778D+44RqGHBwk9Dz5P3vfr/+dW//+dyu9jKIQJDdty/v/
|
||||
/tUXcBsQ2fXo/5Rtv/6XLP37P2H63/82uWfhikFyvas//PcqPYHbgMDmh/9b174HazYu+fJfOvraf+PI
|
||||
ZWANILm6+e/+u+QfwG2AR9X9/yVz38E1K7r0wBWD5PKnvflvn7EdtwH2pXf/B7Y8w9AMk8ue/Pq/RcJ6
|
||||
3AZY5N35b1NwBUMzTC61/zXcS1iBYdZtrJpBACQX1vLyv27wPKzyYKCTdgOnJEjOr/rhfw3faTjV4AVO
|
||||
uVf+q3hMAGN0uYEFAL7Rv7NmXVYYAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="btfind.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIqSURBVDhPY2AYdKCxf9ajJRv2/G+dOPc/iD95wTowOzQ2
|
||||
+Ra6WqygrLHv0bodh/+HxqaCDcgoqvnfN3vF/8b+2U/Q1aKApOyS/13Tl/yv7Zz6v23S/P8mlnZgAxzc
|
||||
fP5nldT9L6hqBYtZ2bks19LS4mFgYGACa5w/fz9HYXWbR1PfbLBTC6vb/nv4h/138Qr4n1PW8D82Le9/
|
||||
RE7T/9qJy/6XtEwBy3Fx8VQxMDAwgg2or9/PMmX+uoeL1u36n1veBMbVE1f9n7J81/+eJVt/NU7f8L+2
|
||||
d/7/6Nzm/+HJhWAXMrOwPGBgYGAGGzBz5kxWkM3TFm/8n11a/x/k55Tc8v/RyTn/1bT0wDaCXAITj0sv
|
||||
AHntHwMDAyvYgLS0NFaf4JifFrZO/70CI/4bW9j+19Y3/i+toPRUVFTUQFJGdquYhNR/BSXV/6Likv95
|
||||
+fj/MzIyvoOHAQh4BUUdBgXcrsNn/q/acuB/94xl/40t7VaA5FTUdVZUtkz4v3bHIbAcKEb4+PgPwzWD
|
||||
gItX4J/8imawAWkFlf/jMwr/6xqbXwXJKSiqXgXFAMiA1PyK/+mF1f85OLn+oBjg6O77H2YATJGatv5P
|
||||
UEiLSUq/AwUczABQWLCysoGjGA6sHd3A8QxKQCAFoMDUNTL7L6ikxK+gqnYFZAAolmByjIyMqAaAEoiB
|
||||
iSU48FQ1df4rqqj/l5ZV+C8sLCzFwy94m5OL+z8bOzso+kAaYXiQAABSzSGsYv7dkQAAAABJRU5ErkJg
|
||||
gg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btSelect.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGTSURBVDhP1c/bL4JxHMfx5w79E27c2zwZ5RCzsZRDeYaS
|
||||
iiLimdksPTr8OqiGOTyXrCXn2XJYdIHZXMoh428w/wT6WLbaCi3uvC5/v+/7d6Cof6d7o41XBltJ7npB
|
||||
UjF7YsDokQ5SvpHL3c+LCcv48egglh898F3PQL/bg/rZKlvu3LeYkIw3H+ux+ODGwgPBwF4vGnwiSIik
|
||||
ODNkPtc1mWLqoaySoihlSMannjyfIJhLOD9vrnFVvmXHF/21xlPNC3fFQhthJjJxUMqPHGoxd+9A4N4O
|
||||
3U43xESYHY+eaZuNMdWzP85hMeGCervjjQm3T3SuSRdMBxr47+zw3XLo32YgInR2nDK5z5QYjlWwXI5h
|
||||
5WkWvvgMzFE92FMDvHErPLdWaLa6IHYI37/EacNRuUC9qwAbM3z+M3Bng/vGAnfcAvWmEmKnMPljnCZf
|
||||
lQsUa1IYI33w3EzDeT0FVVgBkYNOSkhp/jgtdUjLUgM0Wwx61jtQba8oPE6TE1pQ561CJVf+WsaWFeXu
|
||||
F4QmtODP8W99AIUYxS+0cG7HAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
334
unimarc/unimarc/Main.Designer.cs
generated
334
unimarc/unimarc/Main.Designer.cs
generated
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -30,14 +30,9 @@ namespace WindowsFormsApp1
|
||||
Application.Run(new Main());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
static void DB_InitSetting()
|
||||
{
|
||||
UniMarc.Properties.Settings.Default.IP = ConvertIP(UniMarc.Properties.Settings.Default.IP);
|
||||
UniMarc.Properties.Settings.Default.IP = ConvertIP(UniMarc.Properties.Settings.Default.IP);
|
||||
UniMarc.Properties.Settings.Default.Port = Convert2to10(UniMarc.Properties.Settings.Default.Port);
|
||||
UniMarc.Properties.Settings.Default.Uid = ConvertAscii(UniMarc.Properties.Settings.Default.Uid);
|
||||
UniMarc.Properties.Settings.Default.pwd = ConvertAscii(UniMarc.Properties.Settings.Default.pwd);
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
|
||||
// 기본값으로 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2025.08.14.1630")]
|
||||
[assembly: AssemblyFileVersion("2025.08.14.1630")]
|
||||
[assembly: AssemblyVersion("2026.01.21.2318")]
|
||||
[assembly: AssemblyFileVersion("2026.01.21.2318")]
|
||||
|
||||
@@ -397,8 +397,10 @@ namespace BokBonCheck
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
// SearchAsync에서 PageSource 가져오기
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -423,128 +425,40 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
|
||||
if (driver.Url.EndsWith("DetailSearchResult") == false)
|
||||
{
|
||||
errmessage = "결과페이지가아님";
|
||||
return -1;
|
||||
}
|
||||
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. 검색결과가 없는 경우 확인
|
||||
try
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
var noResultElements = driver.FindElements(By.XPath("//*[contains(text(), '검색결과가 없습니다') or contains(text(), '검색된 자료가 없습니다')]"));
|
||||
if (noResultElements.Count > 0)
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다",
|
||||
@"총 0 건",
|
||||
@"총 0건"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 검색결과가 있는 경우로 진행
|
||||
}
|
||||
|
||||
|
||||
RetryPoint:
|
||||
bool retry = false;
|
||||
// 2. 안산시 도서관 특화: span.count.gothic em 요소에서 직접 추출
|
||||
try
|
||||
{
|
||||
|
||||
|
||||
var countElement = driver.FindElement(By.CssSelector("span.count.gothic em"));
|
||||
if (countElement != null)
|
||||
{
|
||||
// Text 대신 InnerHtml이나 GetAttribute 사용해보기
|
||||
var countText = countElement.Text.Trim();
|
||||
var innerHTML = countElement.GetAttribute("innerHTML");
|
||||
var outerHTML = countElement.GetAttribute("outerHTML");
|
||||
|
||||
Console.WriteLine($"count 요소 .Text: '{countText}'");
|
||||
Console.WriteLine($"count 요소 innerHTML: '{innerHTML}'");
|
||||
Console.WriteLine($"count 요소 outerHTML: '{outerHTML}'");
|
||||
|
||||
// innerHTML이나 outerHTML에서 텍스트 추출 시도
|
||||
string textToUse = !string.IsNullOrEmpty(countText) ? countText : innerHTML;
|
||||
if (string.IsNullOrEmpty(textToUse))
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
textToUse = outerHTML;
|
||||
}
|
||||
|
||||
Console.WriteLine($"추출할 텍스트: '{textToUse}'");
|
||||
|
||||
// "총 0 건 " 형태에서 숫자 추출
|
||||
var match = Regex.Match(textToUse, @"총\s*(\d+)\s*건", RegexOptions.IgnoreCase);
|
||||
if (match.Success && int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
Console.WriteLine("검색 결과: 0건");
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"검색 결과: {count}건");
|
||||
return count;
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"정규식 매칭 실패: '{textToUse}'");
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
Console.WriteLine($"span.count.gothic em 요소 추출 실패: {ex1.Message}");
|
||||
}
|
||||
|
||||
// 3. span.count 전체에서 추출 시도
|
||||
try
|
||||
{
|
||||
var countSpan = driver.FindElement(By.CssSelector("span.count"));
|
||||
if (countSpan != null)
|
||||
{
|
||||
var fullText = countSpan.Text.Trim();
|
||||
Console.WriteLine($"count span 전체 텍스트: '{fullText}'");
|
||||
|
||||
var match = Regex.Match(fullText, @"총\s*(\d+)\s*건", RegexOptions.IgnoreCase);
|
||||
if (match.Success && int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
Console.WriteLine($"span.count 요소 추출 실패: {ex2.Message}");
|
||||
}
|
||||
|
||||
// 3. 페이지 소스에서 정규식으로 추출 시도
|
||||
var pageSource = driver.PageSource;
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다") ||
|
||||
pageSource.Contains("자료가 없습니다") ||
|
||||
pageSource.Contains("총 0 건") ||
|
||||
pageSource.Contains("총 0건"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// HTML에서 다양한 패턴 찾기 (안산시 도서관 특화)
|
||||
var htmlPatterns = new[]
|
||||
@@ -560,11 +474,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -576,28 +493,81 @@ namespace BokBonCheck
|
||||
}
|
||||
}
|
||||
|
||||
if (retry == false)
|
||||
{
|
||||
Console.WriteLine( "결과를 찾을 수 없어 재시도");
|
||||
retry = true;
|
||||
Task.Delay(1000);
|
||||
goto RetryPoint;
|
||||
}
|
||||
else
|
||||
{
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
return -1;
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace BokBonCheck
|
||||
public DateTime SearchTime { get; set; }
|
||||
public string ErrorMessage { get; set; }
|
||||
public bool IsSuccess { get; set; }
|
||||
|
||||
public string Resulthtml { get; set; }
|
||||
}
|
||||
|
||||
public class BookSearchService
|
||||
|
||||
@@ -244,8 +244,9 @@ namespace BokBonCheck
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -270,73 +271,39 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. totalCount 요소에서 직접 추출 시도
|
||||
try
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
var totalCountElement = driver.FindElement(By.CssSelector("p.totalCount"));
|
||||
if (totalCountElement != null)
|
||||
{
|
||||
// strong 태그에서 직접 숫자 추출 시도
|
||||
try
|
||||
{
|
||||
var strongElement = totalCountElement.FindElement(By.TagName("strong"));
|
||||
if (strongElement != null)
|
||||
{
|
||||
var countText = strongElement.Text.Trim();
|
||||
if (int.TryParse(countText, out int strongCount))
|
||||
{
|
||||
if (strongCount == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({strongCount}권)";
|
||||
return strongCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다",
|
||||
@"전체 0 건"
|
||||
};
|
||||
|
||||
// 전체 텍스트에서 정규식으로 추출
|
||||
var totalCountText = totalCountElement.Text;
|
||||
var match = Regex.Match(totalCountText, @"전체\s*(\d+)\s*건", RegexOptions.IgnoreCase);
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"totalCount 요소 검색 중 오류: {ex.Message}");
|
||||
}
|
||||
|
||||
// 2. 페이지 소스에서 정규식으로 추출 시도
|
||||
var pageSource = driver.PageSource;
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다") ||
|
||||
pageSource.Contains("자료가 없습니다") ||
|
||||
pageSource.Contains("전체 0 건"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// HTML에서 다양한 패턴 찾기
|
||||
var htmlPatterns = new[]
|
||||
@@ -350,11 +317,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -367,16 +337,80 @@ namespace BokBonCheck
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -84,7 +84,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -112,19 +113,21 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. 검색 결과가 없는 경우 확인
|
||||
if (htmlContent.Contains("검색결과가 없습니다") ||
|
||||
htmlContent.Contains("검색된 자료가 없습니다") ||
|
||||
htmlContent.Contains("자료가 없습니다") ||
|
||||
htmlContent.Contains("자룼가 없습니다") ||
|
||||
htmlContent.Contains("<strong>0</strong> Results:"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -147,8 +150,11 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"조선이공대학교도서관 검색 결과: {count}건");
|
||||
return count;
|
||||
@@ -173,22 +179,27 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"조선이공대학교도서관 검색 결과: {count}건");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
Console.WriteLine("조선이공대학교도서관 검색결과 패턴을 찾을 수 없음");
|
||||
return -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "결과 분석 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -197,5 +208,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -84,7 +84,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -112,9 +113,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -125,6 +127,7 @@ namespace BokBonCheck
|
||||
htmlContent.Contains("총 <strong>0</strong>건"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -147,8 +150,11 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"조선대학교중앙도서관 검색 결과: {count}건");
|
||||
return count;
|
||||
@@ -173,22 +179,28 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"조선대학교중앙도서관 검색 결과: {count}건");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
Console.WriteLine("조선대학교중앙도서관 검색결과 패턴을 찾을 수 없음");
|
||||
return -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "결과 분석 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -197,5 +209,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ using UniMarc.마크;
|
||||
using OpenQA.Selenium.Chromium;
|
||||
using UniMarc.SearchModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using AR;
|
||||
|
||||
namespace BokBonCheck
|
||||
{
|
||||
@@ -169,6 +170,11 @@ namespace BokBonCheck
|
||||
if (_driver.Url.EndsWith("/bookMain") == false)
|
||||
{
|
||||
retrycnt += 1;
|
||||
if (retrycnt > 3)
|
||||
{
|
||||
UTIL.MsgE("3회 연속 로그인 시도로 인해 자동 로그인을 중단합니다\n사용자가 직접 로그인을 하세요");
|
||||
break;
|
||||
}
|
||||
Console.WriteLine($"도서검색화면으로 이동({retrycnt})");
|
||||
_driver.Navigate().GoToUrl(this.SiteUrl);
|
||||
wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15));
|
||||
@@ -190,6 +196,8 @@ namespace BokBonCheck
|
||||
this.SCHOOL = schoolname;
|
||||
this.STYPE = searchtype;
|
||||
}
|
||||
|
||||
string BookMainURL = string.Empty;
|
||||
public async Task<BookSearchResult> SearchAsync(string searchTerm)
|
||||
{
|
||||
var result = new BookSearchResult
|
||||
@@ -247,6 +255,19 @@ namespace BokBonCheck
|
||||
}
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(BookMainURL))
|
||||
{
|
||||
BookMainURL = _driver.Url;
|
||||
}
|
||||
else
|
||||
{
|
||||
//확실하게 하기위해 메인페이지로 다시 이동한다.
|
||||
_driver.Navigate().GoToUrl(this.SiteUrl);
|
||||
new WebDriverWait(_driver, TimeSpan.FromSeconds(15));
|
||||
await Task.Delay(500);
|
||||
}
|
||||
|
||||
|
||||
// 페이지 로딩 대기
|
||||
var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15));
|
||||
|
||||
@@ -378,23 +399,24 @@ namespace BokBonCheck
|
||||
{
|
||||
SafeClick(buttomelm);
|
||||
var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15));
|
||||
Thread.Sleep(200);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
}
|
||||
catch
|
||||
{
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
|
||||
errmessage = "검색결과없음";
|
||||
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
try
|
||||
{
|
||||
@@ -422,7 +444,7 @@ namespace BokBonCheck
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
|
||||
|
||||
|
||||
367
unimarc/unimarc/SearchModel/GochangLibSearcher.cs
Normal file
367
unimarc/unimarc/SearchModel/GochangLibSearcher.cs
Normal file
@@ -0,0 +1,367 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using OpenQA.Selenium;
|
||||
using OpenQA.Selenium.Chrome;
|
||||
using OpenQA.Selenium.Support.UI;
|
||||
using System.Text.RegularExpressions;
|
||||
using WebDriverManager;
|
||||
using WebDriverManager.DriverConfigs.Impl;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using UniMarc.마크;
|
||||
using OpenQA.Selenium.Chromium;
|
||||
using UniMarc.SearchModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
using AR;
|
||||
|
||||
namespace BokBonCheck
|
||||
{
|
||||
public class GochangLibSearcher : ILibrarySearcher
|
||||
{
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
public string SiteName { get; protected set; }
|
||||
public string SiteUrl => "https://libsearch.gochang.go.kr:8443/book/bookAdvancedSearch";
|
||||
public bool HttpApiMode { get; set; } = false;
|
||||
|
||||
public int No { get; set; }
|
||||
|
||||
private ChromiumDriver _driver;
|
||||
|
||||
public GochangLibSearcher(int no, string areaCode, string areaName)
|
||||
{
|
||||
this.No = no;
|
||||
this.AreaCode = areaCode;
|
||||
this.SiteName = $"고창군립({areaName})";
|
||||
}
|
||||
|
||||
public void StopDriver()
|
||||
{
|
||||
if (_driver != null)
|
||||
{
|
||||
_driver.Quit();
|
||||
_driver.Dispose();
|
||||
_driver = null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task StartDriver(bool showdriver = false)
|
||||
{
|
||||
if (_driver == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (SeleniumHelper.IsReady == false) await SeleniumHelper.Download();
|
||||
_driver = await SeleniumHelper.CreateDriver(ShowBrowser: showdriver);
|
||||
Console.WriteLine("GochangLibSearcher Driver 초기화 완료");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"GochangLibSearcher Driver 초기화 실패: {ex.Message}");
|
||||
throw new InvalidOperationException($"GochangLibSearcher Driver 초기화에 실패했습니다: {ex.Message}", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
virtual protected bool SelectLibrary(WebDriverWait wait)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (!string.IsNullOrEmpty(AreaCode))
|
||||
{
|
||||
var libSelect = wait.Until(d => d.FindElement(By.Id("MANAGE_CODE")));
|
||||
var selectElement = new SelectElement(libSelect);
|
||||
selectElement.SelectByValue(AreaCode);
|
||||
Thread.Sleep(300);
|
||||
Console.WriteLine($"{AreaCode} 도서관으로 선택됨");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("전체 도서관으로 검색");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"도서관 선택 실패: {ex.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<BookSearchResult> SearchAsync(string searchTerm)
|
||||
{
|
||||
var result = new BookSearchResult
|
||||
{
|
||||
SiteName = SiteName,
|
||||
SearchTerm = searchTerm,
|
||||
SearchTime = DateTime.Now
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
if (_driver == null)
|
||||
{
|
||||
await StartDriver();
|
||||
}
|
||||
|
||||
var cururl = _driver.Url;
|
||||
if (cururl.Equals(SiteUrl) == false)
|
||||
_driver.Navigate().GoToUrl(SiteUrl);
|
||||
|
||||
var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15));
|
||||
|
||||
if (SelectLibrary(wait) == false)
|
||||
{
|
||||
result.ErrorMessage = "도서관선택실패";
|
||||
result.BookCount = -1;
|
||||
result.IsSuccess = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var titleInput = wait.Until(d => d.FindElement(By.Id("title")));
|
||||
titleInput.Clear();
|
||||
titleInput.SendKeys(searchTerm);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.ErrorMessage = $"검색어입력실패({ex.Message})";
|
||||
result.BookCount = -1;
|
||||
result.IsSuccess = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var jsExecutor = (IJavaScriptExecutor)_driver;
|
||||
jsExecutor.ExecuteScript("fn_openBookAdvancedSearch();");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.ErrorMessage = $"검색실행실패({ex.Message})";
|
||||
result.BookCount = -1;
|
||||
result.IsSuccess = false;
|
||||
return result;
|
||||
}
|
||||
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// SearchAsync에서 PageSource 가져오기
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
result.IsSuccess = false;
|
||||
result.ErrorMessage = ermsg;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.BookCount = resultCount;
|
||||
result.IsSuccess = true;
|
||||
result.ErrorMessage = ermsg;
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.ErrorMessage = ex.Message;
|
||||
result.BookCount = 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
@"검색된 도서가 없습니다",
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
// 검색결과 없음 메시지를 포함한 HTML 조각 추출
|
||||
var index = htmlContent.IndexOf(pattern);
|
||||
if (index >= 0)
|
||||
{
|
||||
var startIndex = Math.Max(0, index - 100);
|
||||
var endIndex = Math.Min(htmlContent.Length, index + pattern.Length + 100);
|
||||
resulthtml = htmlContent.Substring(startIndex, endIndex - startIndex);
|
||||
|
||||
// 상위 태그 찾기 시도
|
||||
try
|
||||
{
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 실패시 기본 추출 결과 사용
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = pattern;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
var htmlPatterns = new[]
|
||||
{
|
||||
@"<span[^>]*class=""bluecolor""[^>]*>총\s*(\d+)건</span>",
|
||||
@"총\s*<span[^>]*class=""bluecolor""[^>]*>(\d+)</span>건",
|
||||
@"총\s*(\d+)건"
|
||||
};
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = "결과수량을찾을수없음";
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "ExtractBookCount 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
try
|
||||
{
|
||||
await Task.Delay(500);
|
||||
|
||||
wait.Until(d =>
|
||||
{
|
||||
var readyState = ((IJavaScriptExecutor)d).ExecuteScript("return document.readyState");
|
||||
return readyState.Equals("complete");
|
||||
});
|
||||
|
||||
wait.Until(d =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var pageSource = d.PageSource;
|
||||
return pageSource.Contains("검색결과입니다") ||
|
||||
pageSource.Contains("총") ||
|
||||
pageSource.Contains("건") ||
|
||||
pageSource.Contains("검색된 도서가 없습니다");
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
await Task.Delay(3000);
|
||||
Console.WriteLine($"페이지 변경 감지 실패: {ex.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -218,8 +218,9 @@ namespace BokBonCheck
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -244,67 +245,21 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. 먼저 totalCount 요소에서 직접 추출 시도
|
||||
try
|
||||
{
|
||||
var totalCountElement = driver.FindElement(By.CssSelector("p.totalCount"));
|
||||
if (totalCountElement != null)
|
||||
{
|
||||
var totalCountText = totalCountElement.Text; // 예: "전체 1 건"
|
||||
var match = Regex.Match(totalCountText, @"전체\s+(\d+)\s+건", RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
// strong 태그에서 직접 숫자 추출 시도
|
||||
try
|
||||
{
|
||||
var strongElement = totalCountElement.FindElement(By.TagName("strong"));
|
||||
if (strongElement != null && int.TryParse(strongElement.Text, out int strongCount))
|
||||
{
|
||||
if(strongCount == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
errmessage = $"검색성공({strongCount}권)";
|
||||
return strongCount;
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"totalCount 요소 검색 중 오류: {ex.Message}");
|
||||
}
|
||||
|
||||
// 2. 페이지 소스에서 정규식으로 추출 시도
|
||||
var pageSource = driver.PageSource;
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다") ||
|
||||
pageSource.Contains("자료가 없습니다") ||
|
||||
pageSource.Contains("전체 0 건"))
|
||||
if (htmlContent.Contains("검색결과가 없습니다") ||
|
||||
htmlContent.Contains("검색된 자료가 없습니다") ||
|
||||
htmlContent.Contains("자료가 없습니다") ||
|
||||
htmlContent.Contains("전체 0 건"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = "검색결과가 없습니다";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -319,11 +274,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -335,49 +293,81 @@ namespace BokBonCheck
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 결과 테이블이나 리스트가 있는지 확인
|
||||
try
|
||||
{
|
||||
var resultElements = driver.FindElements(By.CssSelector(".bookList, .searchResult, .result-list, table tbody tr"));
|
||||
if (resultElements.Count > 0)
|
||||
{
|
||||
// 테이블 헤더나 빈 행을 제외한 실제 결과 개수 계산
|
||||
var actualCount = 0;
|
||||
foreach (var element in resultElements)
|
||||
{
|
||||
var text = element.Text?.Trim();
|
||||
if (!string.IsNullOrEmpty(text) &&
|
||||
!text.Contains("도서명") &&
|
||||
!text.Contains("저자") &&
|
||||
!text.Contains("출판사"))
|
||||
{
|
||||
actualCount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (actualCount > 0)
|
||||
{
|
||||
errmessage = $"검색성공({actualCount}권)";
|
||||
return actualCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"결과 요소 검색 중 오류: {ex.Message}");
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
|
||||
@@ -155,8 +155,9 @@ namespace BokBonCheck
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -181,87 +182,38 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. 검색결과가 없는 경우 확인
|
||||
try
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
var noResultElement = driver.FindElement(By.XPath("//p[contains(text(), '조회된 도서가 없습니다')]"));
|
||||
if (noResultElement != null)
|
||||
@"조회된 도서가 없습니다",
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 검색결과가 있는 경우로 진행
|
||||
}
|
||||
|
||||
// 2. srch_info div에서 직접 추출 시도
|
||||
try
|
||||
{
|
||||
var srchInfoElement = driver.FindElement(By.CssSelector("div.srch_info"));
|
||||
if (srchInfoElement != null)
|
||||
{
|
||||
// span.heighlight에서 숫자 추출 시도
|
||||
try
|
||||
{
|
||||
var highlightElement = srchInfoElement.FindElement(By.CssSelector("span.heighlight"));
|
||||
if (highlightElement != null)
|
||||
{
|
||||
var countText = highlightElement.Text.Trim();
|
||||
if (int.TryParse(countText, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
// 전체 텍스트에서 정규식으로 추출
|
||||
var srchInfoText = srchInfoElement.Text;
|
||||
var match = Regex.Match(srchInfoText, @"검색결과\s*총\s*(\d+)\s*건", RegexOptions.IgnoreCase);
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"srch_info 요소 검색 중 오류: {ex.Message}");
|
||||
}
|
||||
|
||||
// 3. 페이지 소스에서 정규식으로 추출 시도
|
||||
var pageSource = driver.PageSource;
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("조회된 도서가 없습니다") ||
|
||||
pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// HTML에서 다양한 패턴 찾기
|
||||
var htmlPatterns = new[]
|
||||
@@ -274,11 +226,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -291,16 +246,80 @@ namespace BokBonCheck
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
|
||||
@@ -81,10 +81,11 @@ namespace BokBonCheck
|
||||
// HTTP GET 요청 실행 (추가 헤더 포함)
|
||||
using (var request = new HttpRequestMessage(HttpMethod.Get, searchUrl))
|
||||
{
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
// 브라우저와 유사한 헤더 추가 (인코딩 문제 방지를 위해 압축 해제)
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.9,en;q=0.1");
|
||||
request.Headers.Add("Accept-Charset", "UTF-8,*;q=0.1");
|
||||
// Accept-Encoding 제거 - 압축으로 인한 인코딩 문제 방지
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -96,10 +97,50 @@ namespace BokBonCheck
|
||||
throw new HttpRequestException($"HTTP {(int)response.StatusCode} {response.StatusCode}: {errorContent}");
|
||||
}
|
||||
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
// 인코딩 문제 해결: 서버 응답의 Content-Type 확인 후 적절한 인코딩 사용
|
||||
string htmlContent;
|
||||
var contentType = response.Content.Headers.ContentType?.ToString() ?? "";
|
||||
Console.WriteLine($"광주동구 Content-Type: {contentType}");
|
||||
|
||||
if (contentType.Contains("charset="))
|
||||
{
|
||||
// 서버에서 지정한 charset 사용
|
||||
htmlContent = await response.Content.ReadAsStringAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
// charset이 명시되지 않은 경우 수동 처리
|
||||
var responseBytes = await response.Content.ReadAsByteArrayAsync();
|
||||
|
||||
// UTF-8 먼저 시도
|
||||
htmlContent = Encoding.UTF8.GetString(responseBytes);
|
||||
|
||||
// 한글이 없거나 깨진 경우 EUC-KR 시도
|
||||
if (!ContainsKorean(htmlContent) || htmlContent.Contains("<22>"))
|
||||
{
|
||||
try
|
||||
{
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
var euckrEncoding = Encoding.GetEncoding("EUC-KR");
|
||||
var euckrContent = euckrEncoding.GetString(responseBytes);
|
||||
if (ContainsKorean(euckrContent))
|
||||
{
|
||||
htmlContent = euckrContent;
|
||||
Console.WriteLine("광주동구: EUC-KR 인코딩 사용");
|
||||
}
|
||||
}
|
||||
catch (Exception encEx)
|
||||
{
|
||||
Console.WriteLine($"광주동구 EUC-KR 변환 오류: {encEx.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
|
||||
// ResultHtml에 분석용 HTML 저장 (디버깅용으로 일부만)
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -126,10 +167,11 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage,out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
|
||||
resulthtml=string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. 검색 결과가 없는 경우 확인
|
||||
@@ -141,18 +183,23 @@ namespace BokBonCheck
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 2. 검색 결과 수량 추출: <p class="totalCount">전체 <strong>2</strong> 건</p>
|
||||
// 2. 검색 결과 수량 추출 - 더 포괄적인 패턴 사용
|
||||
var patterns = new[]
|
||||
{
|
||||
@"<p[^>]*class=""totalCount""[^>]*>전체\s*<strong>\s*(\d+)\s*</strong>\s*건</p>",
|
||||
@"전체\s*<strong>\s*(\d+)\s*</strong>\s*건",
|
||||
@"<strong>\s*(\d+)\s*</strong>\s*건",
|
||||
@"총\s*(\d+)\s*건"
|
||||
// 기본 패턴들
|
||||
@"전체\s*(?:\*\*)?(\d+)(?:\*\*)?\s*건", // 전체 **N** 건 또는 전체 N 건
|
||||
@"<h[1-6][^>]*>.*?전체\s*(?:\*\*)?(\d+)(?:\*\*)?\s*건.*?</h[1-6]>", // h태그 안의 전체 N 건
|
||||
@"<p[^>]*class=""totalCount""[^>]*>전체\s*<strong>\s*(\d+)\s*</strong>\s*건</p>", // 원래 패턴
|
||||
@"전체\s*<strong>\s*(\d+)\s*</strong>\s*건", // strong 태그
|
||||
@"<strong>\s*(\d+)\s*</strong>\s*건", // strong만
|
||||
@"총\s*(\d+)\s*건", // 총 N 건
|
||||
@"검색결과\s*:\s*(\d+)\s*건", // 검색결과: N 건
|
||||
@"(\d+)\s*건의\s*검색결과", // N 건의 검색결과
|
||||
};
|
||||
|
||||
foreach (var pattern in patterns)
|
||||
{
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase | RegexOptions.Singleline);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
@@ -160,25 +207,31 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value; // 매칭된 부분만 저장
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"광주동구 검색 결과: {count}건");
|
||||
Console.WriteLine($"광주동구 검색 결과: {count}건 (패턴: {pattern})");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 더 자세한 패턴으로 시도 (줄바꿈 포함)
|
||||
// 3. 멀티라인 패턴으로 재시도
|
||||
var multilinePatterns = new[]
|
||||
{
|
||||
@"전체\s*<strong>\s*\r?\n?\s*(\d+)\s*\r?\n?\s*</strong>\s*건",
|
||||
@"<strong>\s*\r?\n?\s*(\d+)\s*\r?\n?\s*</strong>\s*건"
|
||||
@"전체\s*(?:\*\*)?[\r\n\s]*(\d+)[\r\n\s]*(?:\*\*)?\s*건",
|
||||
@"전체\s*<strong>\s*[\r\n]*\s*(\d+)\s*[\r\n]*\s*</strong>\s*건",
|
||||
@"<strong>\s*[\r\n]*\s*(\d+)\s*[\r\n]*\s*</strong>\s*건"
|
||||
};
|
||||
|
||||
foreach (var pattern in multilinePatterns)
|
||||
{
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Singleline);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
@@ -186,15 +239,24 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value; // 매칭된 부분만 저장
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"광주동구 검색 결과: {count}건");
|
||||
Console.WriteLine($"광주동구 검색 결과: {count}건 (멀티라인 패턴)");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 4. 패턴을 찾지 못한 경우 - 디버깅을 위한 HTML 내용 일부 출력
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
Console.WriteLine($"광주동구 HTML 샘플: {resulthtml}");
|
||||
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
Console.WriteLine("광주동구 검색결과 패턴을 찾을 수 없음");
|
||||
return -1;
|
||||
@@ -202,6 +264,8 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음"; // 오류 시 HTML 일부 저장
|
||||
Console.WriteLine($"광주동구 결과 분석 오류: {ex.Message}");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -210,5 +274,83 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 문자열에 한글이 포함되어 있는지 확인
|
||||
/// </summary>
|
||||
private bool ContainsKorean(string text)
|
||||
{
|
||||
if (string.IsNullOrEmpty(text))
|
||||
return false;
|
||||
|
||||
foreach (char c in text)
|
||||
{
|
||||
if (c >= 0xAC00 && c <= 0xD7A3) // 한글 유니코드 범위
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -337,7 +337,8 @@ namespace BokBonCheck
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출 (페이징 포함)
|
||||
var (resultCount, ermsg) = await ExtractBookCountWithPaging(_driver, searchTerm);
|
||||
var (resultCount, ermsg, resultHtml) = await ExtractBookCountWithPaging(_driver, searchTerm);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -362,13 +363,15 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private async Task<(int count, string message)> ExtractBookCountWithPaging(IWebDriver driver, string searchTerm)
|
||||
private async Task<(int count, string message, string resultHtml)> ExtractBookCountWithPaging(IWebDriver driver, string searchTerm)
|
||||
{
|
||||
string errmessage = string.Empty;
|
||||
int totalCount = 0;
|
||||
|
||||
try
|
||||
{
|
||||
var htmlContent = driver.PageSource;
|
||||
string resultHtml = string.Empty;
|
||||
// 첫 번째 페이지에서 테이블 row 수 확인
|
||||
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
|
||||
|
||||
@@ -381,7 +384,28 @@ namespace BokBonCheck
|
||||
if (firstPageRows.Count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return (0, errmessage);
|
||||
// "검색결과가 없습니다"와 같은 메시지를 찾아 context 추출 시도
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
resultHtml = ExtractResultContext(htmlContent, match);
|
||||
return (0, errmessage, resultHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
resultHtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return (0, errmessage, resultHtml);
|
||||
}
|
||||
|
||||
totalCount += firstPageRows.Count;
|
||||
@@ -390,7 +414,28 @@ namespace BokBonCheck
|
||||
catch
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return (0, errmessage);
|
||||
// "검색결과가 없습니다"와 같은 메시지를 찾아 context 추출 시도
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
resultHtml = ExtractResultContext(htmlContent, match);
|
||||
return (0, errmessage, resultHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
resultHtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return (0, errmessage, resultHtml);
|
||||
}
|
||||
|
||||
// 페이징이 있는지 확인하고 각 페이지 방문
|
||||
@@ -436,18 +481,42 @@ namespace BokBonCheck
|
||||
if (totalCount == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return (0, errmessage);
|
||||
// "검색결과가 없습니다"와 같은 메시지를 찾아 context 추출 시도
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다",
|
||||
@"전체\s*0\s*건"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
resultHtml = ExtractResultContext(htmlContent, match);
|
||||
return (0, errmessage, resultHtml);
|
||||
}
|
||||
}
|
||||
}
|
||||
resultHtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return (0, errmessage, resultHtml);
|
||||
}
|
||||
|
||||
resultHtml = $"검색성공 - 총 {totalCount}건";
|
||||
errmessage = $"검색성공({totalCount}권)";
|
||||
Console.WriteLine($"전체 검색 결과: {totalCount}건");
|
||||
return (totalCount, errmessage);
|
||||
return (totalCount, errmessage, resultHtml);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
return (-1, errmessage);
|
||||
string resultHtml = "오류 발생";
|
||||
return (-1, errmessage, resultHtml);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -492,5 +561,67 @@ namespace BokBonCheck
|
||||
Console.WriteLine($"페이지 변경 감지 실패: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, System.Text.RegularExpressions.Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = System.Text.RegularExpressions.Regex.Matches(searchText, tagPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = System.Text.RegularExpressions.Regex.Match(tagMatch.Value, @"<(\w+)", System.Text.RegularExpressions.RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = System.Text.RegularExpressions.Regex.Match(searchText, closeTagPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -84,7 +84,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -112,9 +113,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -124,6 +126,7 @@ namespace BokBonCheck
|
||||
htmlContent.Contains("자료가 없습니다"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -146,8 +149,11 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
@@ -171,20 +177,25 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -193,5 +204,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -107,8 +107,9 @@ namespace BokBonCheck
|
||||
// JavaScript 렌더링 대기
|
||||
await Task.Delay(3000);
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -133,71 +134,21 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// JavaScript 실행 후 실제 렌더링된 DOM에서 결과 추출
|
||||
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
|
||||
|
||||
// 1. 검색결과가 없는 경우 확인
|
||||
try
|
||||
{
|
||||
var noResultElements = driver.FindElements(By.XPath("//*[contains(text(), '검색결과가 없습니다') or contains(text(), '검색된 자료가 없습니다')]"));
|
||||
if (noResultElements.Count > 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 검색결과가 있는 경우로 진행
|
||||
}
|
||||
|
||||
// 2. total_area에서 결과 수량 추출 (JavaScript 렌더링 후)
|
||||
try
|
||||
{
|
||||
var totalAreaElement = wait.Until(d => d.FindElement(By.CssSelector("div.total_area p.total span")));
|
||||
if (totalAreaElement != null)
|
||||
{
|
||||
var countText = totalAreaElement.Text.Trim();
|
||||
Console.WriteLine($"total_area 텍스트: '{countText}'");
|
||||
|
||||
// "총 3건" 형태에서 숫자 추출
|
||||
var match = Regex.Match(countText, @"총\s*(\d+)\s*건", RegexOptions.IgnoreCase);
|
||||
if (match.Success && int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
Console.WriteLine("검색 결과: 0건");
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"검색 결과: {count}건");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
Console.WriteLine($"total_area 요소 추출 실패: {ex1.Message}");
|
||||
}
|
||||
|
||||
// 3. 페이지 소스에서 렌더링된 결과 추출
|
||||
var pageSource = driver.PageSource;
|
||||
Console.WriteLine("페이지 소스에서 결과 추출 시도");
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다") ||
|
||||
pageSource.Contains("자료가 없습니다") ||
|
||||
pageSource.Contains("총 0건"))
|
||||
if (htmlContent.Contains("검색결과가 없습니다") ||
|
||||
htmlContent.Contains("검색된 자료가 없습니다") ||
|
||||
htmlContent.Contains("자료가 없습니다") ||
|
||||
htmlContent.Contains("총 0건"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -212,11 +163,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -229,16 +183,80 @@ namespace BokBonCheck
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 완전한 페이지 로딩 대기 메서드
|
||||
private async Task WaitForCompletePageLoad(WebDriverWait wait)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -84,7 +84,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -110,9 +111,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
try
|
||||
{
|
||||
// 실제 HTML 구조에 맞는 패턴으로 수정
|
||||
@@ -139,6 +141,7 @@ namespace BokBonCheck
|
||||
if (pattern.Contains(@"\s*0\s*"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -148,17 +151,21 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 디버깅을 위해 HTML 내용 일부 출력
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
Console.WriteLine($"HTML 내용 일부: {htmlContent.Substring(0, Math.Min(1000, htmlContent.Length))}");
|
||||
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
return -1;
|
||||
|
||||
@@ -166,6 +173,7 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -177,5 +185,66 @@ namespace BokBonCheck
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,8 +227,9 @@ namespace BokBonCheck
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -253,71 +254,20 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 1. search-info div에서 직접 추출 시도
|
||||
try
|
||||
{
|
||||
var searchInfoElement = driver.FindElement(By.CssSelector("div.search-info"));
|
||||
if (searchInfoElement != null)
|
||||
{
|
||||
var searchInfoText = searchInfoElement.Text;
|
||||
|
||||
// "총 N건이 검색되었습니다" 패턴 찾기
|
||||
var match = Regex.Match(searchInfoText, @"총\s*(\d+)\s*건이\s*검색되었습니다", RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
// <b> 태그에서 직접 숫자 추출 시도
|
||||
try
|
||||
{
|
||||
var boldElements = searchInfoElement.FindElements(By.TagName("b"));
|
||||
foreach (var boldElement in boldElements)
|
||||
{
|
||||
var boldText = boldElement.Text.Trim();
|
||||
if (int.TryParse(boldText, out int boldCount))
|
||||
{
|
||||
if (boldCount == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({boldCount}권)";
|
||||
return boldCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"search-info 요소 검색 중 오류: {ex.Message}");
|
||||
}
|
||||
|
||||
// 2. 페이지 소스에서 정규식으로 추출 시도
|
||||
var pageSource = driver.PageSource;
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("0건이 검색되었습니다") ||
|
||||
pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다"))
|
||||
if (htmlContent.Contains("0건이 검색되었습니다") ||
|
||||
htmlContent.Contains("검색결과가 없습니다") ||
|
||||
htmlContent.Contains("검색된 자료가 없습니다"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -332,11 +282,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -349,16 +302,80 @@ namespace BokBonCheck
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
|
||||
263
unimarc/unimarc/SearchModel/JeonnamProvLibSearcher.cs
Normal file
263
unimarc/unimarc/SearchModel/JeonnamProvLibSearcher.cs
Normal file
@@ -0,0 +1,263 @@
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web;
|
||||
using UniMarc.SearchModel;
|
||||
using System.Text;
|
||||
using OpenQA.Selenium.Support.UI;
|
||||
|
||||
namespace BokBonCheck
|
||||
{
|
||||
public class JeonnamProvLibSearcher : ILibrarySearcher
|
||||
{
|
||||
public string AreaCode { get; set; } = string.Empty;
|
||||
public string SiteName { get; protected set; }
|
||||
public string SiteUrl => "https://lib.jeonnam.go.kr/plus/search_list.php";
|
||||
public bool HttpApiMode { get; set; } = true;
|
||||
|
||||
public int No { get; set; }
|
||||
|
||||
private static readonly HttpClient _httpClient = new HttpClient()
|
||||
{
|
||||
DefaultRequestHeaders =
|
||||
{
|
||||
{ "User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" }
|
||||
}
|
||||
};
|
||||
|
||||
public JeonnamProvLibSearcher(int no, string areaCode, string areaName)
|
||||
{
|
||||
this.No = no;
|
||||
this.AreaCode = areaCode;
|
||||
this.SiteName = $"전라남도립({areaName})";
|
||||
}
|
||||
|
||||
public async Task StartDriver(bool showdriver = false)
|
||||
{
|
||||
// HTTP 클라이언트 사용으로 별도 드라이버 불필요
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
public void StopDriver()
|
||||
{
|
||||
// HTTP 클라이언트 사용으로 별도 정리 불필요
|
||||
}
|
||||
|
||||
public async Task<BookSearchResult> SearchAsync(string searchTerm)
|
||||
{
|
||||
var result = new BookSearchResult
|
||||
{
|
||||
SiteName = SiteName,
|
||||
SearchTerm = searchTerm,
|
||||
SearchTime = DateTime.Now
|
||||
};
|
||||
|
||||
try
|
||||
{
|
||||
// 검색어 URL 인코딩
|
||||
var encodedSearchTerm = HttpUtility.UrlEncode(searchTerm, Encoding.UTF8);
|
||||
|
||||
// 실제 검색 URL 구성 (사용자가 확인한 정확한 파라미터 사용)
|
||||
var searchUrl = $"{SiteUrl}?act=1&aon1=AND&msa=M&jongbook=1&value1={encodedSearchTerm}&field1=IAL&formclass=&local=&sort=";
|
||||
|
||||
Console.WriteLine($"전라남도립도서관 검색 URL: {searchUrl}");
|
||||
|
||||
// HTTP GET 요청 실행 (추가 헤더 포함)
|
||||
using (var request = new HttpRequestMessage(HttpMethod.Get, searchUrl))
|
||||
{
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
request.Headers.Add("Referer", "https://lib.jeonnam.go.kr/plus/search_simple.php");
|
||||
|
||||
var response = await _httpClient.SendAsync(request);
|
||||
|
||||
if (!response.IsSuccessStatusCode)
|
||||
{
|
||||
var errorContent = await response.Content.ReadAsStringAsync();
|
||||
throw new HttpRequestException($"HTTP {(int)response.StatusCode} {response.StatusCode}: {errorContent}");
|
||||
}
|
||||
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
result.IsSuccess = false;
|
||||
result.ErrorMessage = errorMessage;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.BookCount = resultCount;
|
||||
result.IsSuccess = true;
|
||||
result.ErrorMessage = $"검색성공({resultCount}권)";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.ErrorMessage = $"검색 오류: {ex.Message}";
|
||||
result.BookCount = 0;
|
||||
Console.WriteLine($"전라남도립도서관 검색 오류: {ex.Message}");
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 전라남도립도서관 실제 HTML 패턴: <font>전체 1</font>개가 검색되었습니다
|
||||
var patterns = new[]
|
||||
{
|
||||
@"<font[^>]*>전체\s*(\d+)</font>\s*개가\s*검색되었습니다",
|
||||
@"'[^']*'\s*에\s*대하여\s*<font[^>]*>전체\s*(\d+)</font>\s*개가\s*검색되었습니다",
|
||||
@"전체\s*(\d+)\s*개가\s*검색되었습니다"
|
||||
};
|
||||
|
||||
foreach (var pattern in patterns)
|
||||
{
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Page X / Y 패턴으로도 확인 (총 페이지 수에서 결과 유무 판단)
|
||||
var pagePattern = @"Page\s*\d+\s*/\s*(\d+)";
|
||||
var pageMatch = Regex.Match(htmlContent, pagePattern, RegexOptions.IgnoreCase);
|
||||
if (pageMatch.Success)
|
||||
{
|
||||
if (int.TryParse(pageMatch.Groups[1].Value, out int totalPages))
|
||||
{
|
||||
if (totalPages == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = pageMatch.Value;
|
||||
return 0;
|
||||
}
|
||||
// 페이지가 있지만 정확한 개수를 알 수 없는 경우 -1 반환
|
||||
resulthtml = pageMatch.Value;
|
||||
errorMessage = "결과수량을찾을수없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (htmlContent.Contains("검색결과가 없습니다") ||
|
||||
htmlContent.Contains("검색된 자료가 없습니다") ||
|
||||
htmlContent.Contains("자료가 없습니다") ||
|
||||
htmlContent.Contains("개가 검색되었습니다") && !Regex.IsMatch(htmlContent, @"\d+\s*개가"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
public Task WaitForPageChange(WebDriverWait wait)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -260,7 +260,8 @@ namespace BokBonCheck
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -285,11 +286,13 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
try
|
||||
{
|
||||
var htmlContent = driver.PageSource;
|
||||
// 먼저 검색결과가 없는 경우 확인
|
||||
try
|
||||
{
|
||||
@@ -298,6 +301,7 @@ namespace BokBonCheck
|
||||
if (noResultText.Contains("검색결과가 없습니다"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = noResultText;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -318,17 +322,36 @@ namespace BokBonCheck
|
||||
if (int.TryParse(match.Groups[1].Value, out int vqty))
|
||||
{
|
||||
errmessage = $"검색성공({vqty}건)";
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
return vqty;
|
||||
}
|
||||
else
|
||||
{
|
||||
errmessage = $"수량값오류({match.Groups[1].Value})";
|
||||
resulthtml = match.Value;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errmessage = "수량항목없음";
|
||||
// 매칭된 부분이 없는 경우, 기본적으로 pageInfoText 부분 추출 시도
|
||||
try
|
||||
{
|
||||
var dummyMatch = System.Text.RegularExpressions.Regex.Match(pageInfoText, @"전체.*");
|
||||
if (dummyMatch.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, dummyMatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -336,6 +359,7 @@ namespace BokBonCheck
|
||||
{
|
||||
// page_info가 없는 경우 검색결과가 없는 것으로 판단
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = "검색결과 없음: " + ex.Message;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -343,11 +367,72 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "ExtractBookCount 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
|
||||
@@ -272,7 +272,8 @@ namespace BokBonCheck
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -297,11 +298,13 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
try
|
||||
{
|
||||
var htmlContent = driver.PageSource;
|
||||
// 먼저 검색결과가 없는 경우 확인
|
||||
try
|
||||
{
|
||||
@@ -310,6 +313,7 @@ namespace BokBonCheck
|
||||
if (noResultText.Contains("검색결과가 없습니다"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = noResultText;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -330,17 +334,36 @@ namespace BokBonCheck
|
||||
if (int.TryParse(match.Groups[1].Value, out int vqty))
|
||||
{
|
||||
errmessage = $"검색성공({vqty}건)";
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
return vqty;
|
||||
}
|
||||
else
|
||||
{
|
||||
errmessage = $"수량값오류({match.Groups[1].Value})";
|
||||
resulthtml = match.Value;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
errmessage = "수량항목없음";
|
||||
// 매칭된 부분이 없는 경우, 기본적으로 pageInfoText 부분 추출 시도
|
||||
try
|
||||
{
|
||||
var dummyMatch = System.Text.RegularExpressions.Regex.Match(pageInfoText, @"전체.*");
|
||||
if (dummyMatch.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, dummyMatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -348,6 +371,27 @@ namespace BokBonCheck
|
||||
{
|
||||
// page_info가 없는 경우 검색결과가 없는 것으로 판단
|
||||
errmessage = "검색결과없음";
|
||||
// "검색결과가 없습니다"와 같은 메시지를 찾아 context 추출 시도
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -355,11 +399,72 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "ExtractBookCount 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -100,7 +100,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -128,9 +129,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -141,6 +143,7 @@ namespace BokBonCheck
|
||||
htmlContent.Contains("총 0 건이 검색되었습니다"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -163,8 +166,11 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"KCM자료검색시스템 검색 결과: {count}건");
|
||||
return count;
|
||||
@@ -189,15 +195,19 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"KCM자료검색시스템 검색 결과: {count}건");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
Console.WriteLine("KCM자료검색시스템 검색결과 패턴을 찾을 수 없음");
|
||||
return -1;
|
||||
@@ -205,6 +215,7 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -213,5 +224,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ using OpenQA.Selenium.Chromium;
|
||||
|
||||
namespace BokBonCheck
|
||||
{
|
||||
public class KwangjuCityEduLibrarySearcher : ILibrarySearcher
|
||||
public class KwangjuCityEduLibrarySearcher : ILibrarySearcher
|
||||
{
|
||||
public int No { get; set; }
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace BokBonCheck
|
||||
try
|
||||
{
|
||||
if (SeleniumHelper.IsReady == false) await SeleniumHelper.Download();
|
||||
_driver = await SeleniumHelper.CreateDriver(ShowBrowser:showBrowser);
|
||||
_driver = await SeleniumHelper.CreateDriver(ShowBrowser: showBrowser);
|
||||
Console.WriteLine("KwangjuCityLibrarySearcher Driver 초기화 완료");
|
||||
}
|
||||
catch (Exception ex)
|
||||
@@ -94,7 +94,7 @@ namespace BokBonCheck
|
||||
_driver.Navigate().GoToUrl(SiteUrl);
|
||||
|
||||
// 페이지 로딩 대기
|
||||
var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(15));
|
||||
var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(30));
|
||||
|
||||
// 모든 감지 방법이 끝나면 크롬창 최소화
|
||||
// whale 브라우저가 최소화되어 우선해제
|
||||
@@ -190,13 +190,24 @@ namespace BokBonCheck
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(30)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver);
|
||||
var resultCount = ExtractBookCount(_driver, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
result.BookCount = resultCount;
|
||||
result.IsSuccess = true;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
result.IsSuccess = false;
|
||||
result.ErrorMessage = errorMessage;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.BookCount = resultCount;
|
||||
result.IsSuccess = true;
|
||||
result.ErrorMessage = errorMessage;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
@@ -204,14 +215,21 @@ namespace BokBonCheck
|
||||
result.ErrorMessage = ex.Message;
|
||||
result.BookCount = 0;
|
||||
}
|
||||
|
||||
finally
|
||||
{
|
||||
await Task.Delay(1000);//.Threading.Thread.Sleep(500);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver)
|
||||
private int ExtractBookCount(IWebDriver driver, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
try
|
||||
{
|
||||
var htmlContent = driver.PageSource;
|
||||
|
||||
// div.search-result 내부의 span에서 '전체 N' 텍스트 추출
|
||||
var resultDiv = driver.FindElement(By.CssSelector("div.ndls_result"));
|
||||
var span = resultDiv.FindElement(By.XPath(".//span[contains(text(),'전체')]"));
|
||||
@@ -219,13 +237,106 @@ namespace BokBonCheck
|
||||
var match = System.Text.RegularExpressions.Regex.Match(text, @"전체\s*(\d+)");
|
||||
if (match.Success)
|
||||
{
|
||||
return int.Parse(match.Groups[1].Value);
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = text;
|
||||
return 0;
|
||||
}
|
||||
errorMessage = $"검색성공({count}건)";
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
return count;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
errorMessage = "수량항목없음";
|
||||
// 매칭된 부분이 없는 경우, 기본적으로 text 부분 추출 시도
|
||||
try
|
||||
{
|
||||
var dummyMatch = System.Text.RegularExpressions.Regex.Match(text, @"전체.*");
|
||||
if (dummyMatch.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, dummyMatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
catch
|
||||
catch (Exception ex)
|
||||
{
|
||||
return 0;
|
||||
errorMessage = ex.Message;
|
||||
resulthtml = "오류발생";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -92,7 +92,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -120,9 +121,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -146,8 +148,11 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
@@ -161,6 +166,7 @@ namespace BokBonCheck
|
||||
htmlContent.Contains("총 0권(개)"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -183,20 +189,25 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -205,5 +216,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -196,9 +196,9 @@ namespace BokBonCheck
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var htmlContent = _driver.PageSource;
|
||||
var resultCount = ExtractBookCount(htmlContent, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -223,71 +223,56 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
// 검색결과 페이지 대기
|
||||
var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
|
||||
|
||||
// 1. 검색결과가 없는 경우 확인
|
||||
try
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
var noResultPatterns = new[]
|
||||
{
|
||||
var noResultElements = driver.FindElements(By.XPath("//*[contains(text(), '검색결과가 없습니다') or contains(text(), '검색된 자료가 없습니다')]"));
|
||||
if (noResultElements.Count > 0)
|
||||
@"검색결과가 없습니다",
|
||||
@"검색된 자료가 없습니다",
|
||||
@"자료가 없습니다",
|
||||
@"전체 <strong>0</strong> 건"
|
||||
};
|
||||
|
||||
foreach (var pattern in noResultPatterns)
|
||||
{
|
||||
if (htmlContent.Contains(pattern))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
// 검색결과 없음 메시지를 포함한 HTML 조각 추출
|
||||
var index = htmlContent.IndexOf(pattern);
|
||||
if (index >= 0)
|
||||
{
|
||||
var startIndex = Math.Max(0, index - 100);
|
||||
var endIndex = Math.Min(htmlContent.Length, index + pattern.Length + 100);
|
||||
resulthtml = htmlContent.Substring(startIndex, endIndex - startIndex);
|
||||
|
||||
// 상위 태그 찾기 시도
|
||||
try
|
||||
{
|
||||
var match = System.Text.RegularExpressions.Regex.Match(htmlContent, pattern);
|
||||
if (match.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 실패시 기본 추출 결과 사용
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = pattern;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 검색결과가 있는 경우로 진행
|
||||
}
|
||||
|
||||
// 2. totalCount에서 결과 수량 추출
|
||||
try
|
||||
{
|
||||
var totalCountElement = wait.Until(d => d.FindElement(By.CssSelector("p.totalCount strong")));
|
||||
if (totalCountElement != null)
|
||||
{
|
||||
var countText = totalCountElement.Text.Trim();
|
||||
Console.WriteLine($"totalCount 텍스트: '{countText}'");
|
||||
|
||||
if (int.TryParse(countText, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
Console.WriteLine("검색 결과: 0건");
|
||||
return 0;
|
||||
}
|
||||
errmessage = $"검색성공({count}권)";
|
||||
Console.WriteLine($"검색 결과: {count}건");
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex1)
|
||||
{
|
||||
Console.WriteLine($"totalCount 요소 추출 실패: {ex1.Message}");
|
||||
}
|
||||
|
||||
// 3. 페이지 소스에서 결과 추출
|
||||
var pageSource = driver.PageSource;
|
||||
Console.WriteLine("페이지 소스에서 결과 추출 시도");
|
||||
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (pageSource.Contains("검색결과가 없습니다") ||
|
||||
pageSource.Contains("검색된 자료가 없습니다") ||
|
||||
pageSource.Contains("자료가 없습니다") ||
|
||||
pageSource.Contains("전체 <strong>0</strong> 건"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
// HTML에서 다양한 패턴 찾기
|
||||
var htmlPatterns = new[]
|
||||
@@ -299,11 +284,14 @@ namespace BokBonCheck
|
||||
|
||||
foreach (var pattern in htmlPatterns)
|
||||
{
|
||||
var match = Regex.Match(pageSource, pattern, RegexOptions.IgnoreCase);
|
||||
var match = Regex.Match(htmlContent, pattern, RegexOptions.IgnoreCase);
|
||||
if (match.Success)
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
// 매칭된 부분과 상위 태그 추출하여 resulthtml에 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
@@ -316,16 +304,80 @@ namespace BokBonCheck
|
||||
}
|
||||
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
resulthtml = "결과수량을찾을수없음";
|
||||
return -1;
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "ExtractBookCount 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 완전한 페이지 로딩 대기 메서드
|
||||
private async Task WaitForCompletePageLoad(WebDriverWait wait)
|
||||
{
|
||||
|
||||
@@ -269,7 +269,8 @@ namespace BokBonCheck
|
||||
await WaitForPageChange(new WebDriverWait(_driver, TimeSpan.FromSeconds(15)));
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg);
|
||||
var resultCount = ExtractBookCount(_driver, searchTerm, out string ermsg, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
if (resultCount == -1)
|
||||
{
|
||||
result.BookCount = 0;
|
||||
@@ -294,11 +295,14 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage)
|
||||
private int ExtractBookCount(IWebDriver driver, string searchTerm, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
try
|
||||
{
|
||||
var htmlContent = driver.PageSource;
|
||||
|
||||
// div.search-result 내부의 span에서 '전체 N' 텍스트 추출
|
||||
var resultDiv = driver.FindElement(By.CssSelector("div.search-result"));
|
||||
|
||||
@@ -306,6 +310,7 @@ namespace BokBonCheck
|
||||
if (bodytext.Contains("검색결과가 없습니다"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = bodytext;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -315,6 +320,7 @@ namespace BokBonCheck
|
||||
if (searchTerm.Contains(searchtitle) == false)
|
||||
{
|
||||
errmessage = $"검색어불일치({searchtitle}/{searchTerm})";
|
||||
resulthtml = searchtitle;
|
||||
return -1;
|
||||
}
|
||||
var span = resultDiv.FindElement(By.XPath(".//span[contains(text(),'전체')]"));
|
||||
@@ -325,10 +331,13 @@ namespace BokBonCheck
|
||||
if (int.TryParse(match.Groups[1].Value, out int vqty) == false)
|
||||
{
|
||||
errmessage = $"수량값오류({match.Groups[1].Value})";
|
||||
resulthtml = match.Value;
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
errmessage = $"검색성공({vqty}건)";
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
searchTerm = string.Empty;
|
||||
return vqty;
|
||||
}
|
||||
@@ -336,6 +345,23 @@ namespace BokBonCheck
|
||||
else
|
||||
{
|
||||
errmessage = "수량항목없음";
|
||||
// 매칭된 부분이 없는 경우, 기본적으로 text 부분 추출 시도
|
||||
try
|
||||
{
|
||||
var dummyMatch = System.Text.RegularExpressions.Regex.Match(text, @"전체.*");
|
||||
if (dummyMatch.Success)
|
||||
{
|
||||
resulthtml = ExtractResultContext(htmlContent, dummyMatch);
|
||||
}
|
||||
else
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
resulthtml = htmlContent.Length > 500 ? htmlContent.Substring(0, 500) : htmlContent;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -343,11 +369,72 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "ExtractBookCount 오류: " + ex.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
|
||||
// 페이지 변경을 감지하는 메서드
|
||||
public async Task WaitForPageChange(WebDriverWait wait)
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -97,7 +97,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -125,9 +126,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -150,8 +152,11 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
@@ -165,6 +170,7 @@ namespace BokBonCheck
|
||||
htmlContent.Contains("총 0건"))
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -178,8 +184,10 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = resultConMatch.Value;
|
||||
return 0;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, resultConMatch);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
@@ -203,20 +211,25 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -225,5 +238,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -96,7 +96,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -122,15 +123,17 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errmessage, out string resulthtml)
|
||||
{
|
||||
errmessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
try
|
||||
{
|
||||
// 검색 결과가 없다는 메시지 확인
|
||||
if (htmlContent.Contains("0권(개)") || htmlContent.Contains("검색결과가 없습니다"))
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = "검색결과없음";
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -153,14 +156,19 @@ namespace BokBonCheck
|
||||
if (count == 0)
|
||||
{
|
||||
errmessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errmessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errmessage = "결과수량을찾을수없음";
|
||||
return -1;
|
||||
|
||||
@@ -168,6 +176,7 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errmessage = ex.Message;
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -178,5 +187,67 @@ namespace BokBonCheck
|
||||
// HTTP 방식에서는 즉시 응답이 오므로 대기 불필요
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace BokBonCheck
|
||||
// 브라우저와 유사한 헤더 추가
|
||||
request.Headers.Add("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8");
|
||||
request.Headers.Add("Accept-Language", "ko-KR,ko;q=0.8,en-US;q=0.5,en;q=0.3");
|
||||
request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
//request.Headers.Add("Accept-Encoding", "gzip, deflate, br");
|
||||
request.Headers.Add("Connection", "keep-alive");
|
||||
request.Headers.Add("Upgrade-Insecure-Requests", "1");
|
||||
|
||||
@@ -92,7 +92,8 @@ namespace BokBonCheck
|
||||
var htmlContent = await response.Content.ReadAsStringAsync();
|
||||
|
||||
// 검색 결과 수 추출
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage);
|
||||
var resultCount = ExtractBookCount(htmlContent, out string errorMessage, out string resultHtml);
|
||||
result.Resulthtml = resultHtml;
|
||||
|
||||
if (resultCount == -1)
|
||||
{
|
||||
@@ -120,9 +121,10 @@ namespace BokBonCheck
|
||||
return result;
|
||||
}
|
||||
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage)
|
||||
private int ExtractBookCount(string htmlContent, out string errorMessage, out string resulthtml)
|
||||
{
|
||||
errorMessage = string.Empty;
|
||||
resulthtml = string.Empty;
|
||||
|
||||
try
|
||||
{
|
||||
@@ -134,12 +136,21 @@ namespace BokBonCheck
|
||||
{
|
||||
if (int.TryParse(match.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = match.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, match);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
else
|
||||
{
|
||||
errorMessage = $"수량값오류({match.Groups[1].Value})";
|
||||
resulthtml = match.Value;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -153,11 +164,21 @@ namespace BokBonCheck
|
||||
{
|
||||
if (int.TryParse(alternateMatch.Groups[1].Value, out int count))
|
||||
{
|
||||
if (count == 0)
|
||||
{
|
||||
errorMessage = "검색결과없음";
|
||||
resulthtml = alternateMatch.Value;
|
||||
return 0;
|
||||
}
|
||||
// 매칭된 부분과 그 상위 태그를 찾아서 저장
|
||||
resulthtml = ExtractResultContext(htmlContent, alternateMatch);
|
||||
errorMessage = $"검색성공({count}권)";
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 패턴을 찾지 못한 경우
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
errorMessage = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
@@ -165,6 +186,7 @@ namespace BokBonCheck
|
||||
catch (Exception ex)
|
||||
{
|
||||
errorMessage = $"결과 분석 오류: {ex.Message}";
|
||||
resulthtml = "검색결과 패턴을 찾을 수 없음";
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -173,5 +195,67 @@ namespace BokBonCheck
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 매칭된 결과와 그 상위 태그를 추출
|
||||
/// </summary>
|
||||
private string ExtractResultContext(string htmlContent, Match match)
|
||||
{
|
||||
try
|
||||
{
|
||||
var matchIndex = match.Index;
|
||||
var matchLength = match.Length;
|
||||
|
||||
// 매칭된 위치 앞쪽에서 상위 태그 시작 찾기
|
||||
var startSearchIndex = Math.Max(0, matchIndex - 200); // 매칭 위치 200자 전부터 검색
|
||||
var searchText = htmlContent.Substring(startSearchIndex, matchIndex - startSearchIndex + matchLength + Math.Min(200, htmlContent.Length - matchIndex - matchLength));
|
||||
|
||||
// 상위 태그 패턴들 (div, p, h1-h6, span 등)
|
||||
var tagPatterns = new[] { @"<(div|p|h[1-6]|span|section|article)[^>]*>", @"<[^>]+>" };
|
||||
|
||||
string resultContext = match.Value; // 기본값은 매칭된 부분만
|
||||
|
||||
foreach (var tagPattern in tagPatterns)
|
||||
{
|
||||
// 매칭된 부분 앞에서 가장 가까운 태그 시작 찾기
|
||||
var tagMatches = Regex.Matches(searchText, tagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
for (int i = tagMatches.Count - 1; i >= 0; i--)
|
||||
{
|
||||
var tagMatch = tagMatches[i];
|
||||
if (tagMatch.Index < (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 태그 이름 추출
|
||||
var tagName = Regex.Match(tagMatch.Value, @"<(\w+)", RegexOptions.IgnoreCase).Groups[1].Value;
|
||||
|
||||
// 닫는 태그 찾기
|
||||
var closeTagPattern = $@"</{tagName}[^>]*>";
|
||||
var closeMatch = Regex.Match(searchText, closeTagPattern, RegexOptions.IgnoreCase);
|
||||
|
||||
if (closeMatch.Success && closeMatch.Index > (matchIndex - startSearchIndex))
|
||||
{
|
||||
// 상위 태그와 그 내용을 포함하여 반환
|
||||
var startIdx = tagMatch.Index;
|
||||
var endIdx = closeMatch.Index + closeMatch.Length;
|
||||
resultContext = searchText.Substring(startIdx, Math.Min(endIdx - startIdx, 500)); // 최대 500자
|
||||
return resultContext;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 상위 태그를 찾지 못한 경우, 매칭 전후 50자씩 포함
|
||||
var contextStart = Math.Max(0, matchIndex - 50);
|
||||
var contextEnd = Math.Min(htmlContent.Length, matchIndex + matchLength + 50);
|
||||
resultContext = htmlContent.Substring(contextStart, contextEnd - contextStart);
|
||||
|
||||
return resultContext;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"ExtractResultContext 오류: {ex.Message}");
|
||||
return match.Value; // 오류 시 매칭된 부분만 반환
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,6 +23,7 @@ using System.Drawing.Text;
|
||||
using System.Globalization;
|
||||
using System.Threading;
|
||||
using System.Data.SqlTypes;
|
||||
using AR;
|
||||
|
||||
namespace WindowsFormsApp1
|
||||
{
|
||||
@@ -63,7 +64,7 @@ namespace WindowsFormsApp1
|
||||
else
|
||||
dataGridView.Sort(dataGridView.Columns[col], System.ComponentModel.ListSortDirection.Ascending);
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// * Row헤더에 체크박스를 넣는 기능*
|
||||
@@ -99,7 +100,7 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
private void datagridview_checkBox_Click(object sender, EventArgs e)
|
||||
{
|
||||
foreach(DataGridViewRow r in ((DataGridView)sender).Rows)
|
||||
foreach (DataGridViewRow r in ((DataGridView)sender).Rows)
|
||||
{
|
||||
r.Cells["colCheck"].Value = ((CheckBox)sender).Checked;
|
||||
}
|
||||
@@ -119,23 +120,32 @@ namespace WindowsFormsApp1
|
||||
char[] columnSplitter = { '\t' };
|
||||
|
||||
//get the text from clipboard
|
||||
IDataObject dataInClipboard = Clipboard.GetDataObject();
|
||||
|
||||
string stringInClipboard = (string)dataInClipboard.GetData(DataFormats.Text);
|
||||
if (Clipboard.ContainsText() == false) return;
|
||||
|
||||
string stringInClipboard = null;
|
||||
|
||||
if (e.Alt)
|
||||
stringInClipboard = Clipboard.GetText(TextDataFormat.UnicodeText);
|
||||
else
|
||||
stringInClipboard = Clipboard.GetText();// (string)objdata;
|
||||
|
||||
//split it into lines
|
||||
//20230209 \r텝 기능과 \n 줄넘김 기능을 같이 공백 제거 처리해버려 공백칸을 활용해야 함에도 제거하는 현상 발생.
|
||||
//텝 공백 문자열 동시에 사용하여 분류
|
||||
// stringInClipboard= stringInClipboard.Replace("\r", "");
|
||||
if (stringInClipboard == null) return;
|
||||
List<string>rowsInClipboard = stringInClipboard.Split(rowSpliteter, StringSplitOptions.None).ToList();
|
||||
rowsInClipboard.RemoveAt(rowsInClipboard.Count-1);
|
||||
//get the row and column of selected cell in dataGridView1
|
||||
int r = ((DataGridView)sender).SelectedCells[0].RowIndex;
|
||||
int c = ((DataGridView)sender).SelectedCells[0].ColumnIndex;
|
||||
List<string> rowsInClipboard = stringInClipboard.Split(rowSpliteter, StringSplitOptions.None).ToList();
|
||||
if (rowsInClipboard.Last().isEmpty()) rowsInClipboard.RemoveAt(rowsInClipboard.Count - 1);
|
||||
|
||||
var dv = sender as DataGridView;
|
||||
|
||||
int r = dv.SelectedCells[0].RowIndex;
|
||||
int c = dv.SelectedCells[0].ColumnIndex;
|
||||
//add rows into dataGridView1 to fit clipboard lines
|
||||
if (((DataGridView)sender).Rows.Count < (r + rowsInClipboard.Count))
|
||||
if (dv.Rows.Count < (r + rowsInClipboard.Count))
|
||||
{
|
||||
((DataGridView)sender).Rows.Add(r + rowsInClipboard.Count - ((DataGridView)sender).Rows.Count);
|
||||
dv.Rows.Add(r + rowsInClipboard.Count - dv.Rows.Count);
|
||||
}
|
||||
// loop through the lines, split them into cells and place the values in the corresponding cell.
|
||||
for (int iRow = 0; iRow < rowsInClipboard.Count; iRow++)
|
||||
@@ -146,10 +156,10 @@ namespace WindowsFormsApp1
|
||||
for (int iCol = 0; iCol < valuesInRow.Length; iCol++)
|
||||
{
|
||||
//assign cell value, only if it within columns of the dataGridView1
|
||||
if (((DataGridView)sender).ColumnCount - 1 >= c + iCol)
|
||||
if (dv.ColumnCount - 1 >= c + iCol)
|
||||
{
|
||||
if (((DataGridView)sender).Rows.Count <= r + iRow) continue;
|
||||
((DataGridView)sender).Rows[r + iRow].Cells[c + iCol].Value = valuesInRow[iCol];
|
||||
if (dv.Rows.Count <= r + iRow) continue;
|
||||
dv.Rows[r + iRow].Cells[c + iCol].Value = valuesInRow[iCol];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -209,7 +219,7 @@ namespace WindowsFormsApp1
|
||||
private Rectangle dragBoxFromMouseDown;
|
||||
private int rowIndexFromMouseDown;
|
||||
private int rowIndexOfItemUnderMouseToDrop;
|
||||
|
||||
|
||||
public void MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
DataGridView dataGridView = sender as DataGridView;
|
||||
@@ -292,7 +302,8 @@ namespace WindowsFormsApp1
|
||||
string[] db_data = db_res1.Split('|');
|
||||
string[] db_pur = db_res2.Split('|');
|
||||
|
||||
if (db_res1.Length < 3) {
|
||||
if (db_res1.Length < 3)
|
||||
{
|
||||
MessageBox.Show("DB호출 에러!", "Error");
|
||||
return "False";
|
||||
}
|
||||
@@ -300,20 +311,26 @@ namespace WindowsFormsApp1
|
||||
string fax = string.Empty;
|
||||
string emchk = string.Empty;
|
||||
|
||||
if (db_pur.Length > 3) {
|
||||
for(int a= 0; a < db_pur.Length; a++)
|
||||
if (db_pur.Length > 3)
|
||||
{
|
||||
for (int a = 0; a < db_pur.Length; a++)
|
||||
{
|
||||
if (a % 3 == 0) { // 전화번호
|
||||
if (db_pur[a] != "") {
|
||||
if (a % 3 == 0)
|
||||
{ // 전화번호
|
||||
if (db_pur[a] != "")
|
||||
{
|
||||
tel = db_pur[a];
|
||||
}
|
||||
}
|
||||
if (a % 3 == 1) { // 팩스
|
||||
if (db_pur[a] != "") {
|
||||
if (a % 3 == 1)
|
||||
{ // 팩스
|
||||
if (db_pur[a] != "")
|
||||
{
|
||||
fax = db_pur[a];
|
||||
}
|
||||
}
|
||||
if (a % 3 == 2) { // 팩스 이메일 체크
|
||||
if (a % 3 == 2)
|
||||
{ // 팩스 이메일 체크
|
||||
emchk = db_pur[a];
|
||||
}
|
||||
}
|
||||
@@ -401,7 +418,7 @@ namespace WindowsFormsApp1
|
||||
#region 주문일자 / 보낸곳 (4행)
|
||||
rng = ws.Range["A4", "C4"];
|
||||
rng.MergeCells = true;
|
||||
rng.Value2 = "주문일자 : "+DateTime.Now.ToString("yyyy-MM-dd H:m:ss");
|
||||
rng.Value2 = "주문일자 : " + DateTime.Now.ToString("yyyy-MM-dd H:m:ss");
|
||||
rng.HorizontalAlignment = Excel.XlHAlign.xlHAlignLeft;
|
||||
rng.Font.Bold = true;
|
||||
|
||||
@@ -495,7 +512,7 @@ namespace WindowsFormsApp1
|
||||
|
||||
#region 추신
|
||||
endcount++;
|
||||
string 발송처 = "D"+endcount.ToString();
|
||||
string 발송처 = "D" + endcount.ToString();
|
||||
|
||||
rng = ws.Range["A" + endcount, "C" + endcount];
|
||||
rng.MergeCells = true;
|
||||
@@ -551,7 +568,7 @@ namespace WindowsFormsApp1
|
||||
rng2.Font.Bold = true;
|
||||
|
||||
////////
|
||||
rng = ws.Range[발송처, "D"+endcount];
|
||||
rng = ws.Range[발송처, "D" + endcount];
|
||||
rng.MergeCells = true;
|
||||
rng.Value2 = "발 송 처";
|
||||
rng.Font.Bold = true;
|
||||
@@ -580,10 +597,10 @@ namespace WindowsFormsApp1
|
||||
|
||||
application.Interactive = true;
|
||||
application.Quit();
|
||||
|
||||
|
||||
return FileName;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
MessageBox.Show(e.ToString());
|
||||
return "False";
|
||||
@@ -630,9 +647,9 @@ namespace WindowsFormsApp1
|
||||
private string Excel_Sub(string[] data)
|
||||
{
|
||||
string[] length = {
|
||||
"1", "2", "3", "4", "5",
|
||||
"6", "7", "8", "9", "10",
|
||||
"11", "12", "13", "14", "15",
|
||||
"1", "2", "3", "4", "5",
|
||||
"6", "7", "8", "9", "10",
|
||||
"11", "12", "13", "14", "15",
|
||||
"16", "17", "18", "19", "20",
|
||||
"21", "22", "23", "24", "25", "26"
|
||||
};
|
||||
@@ -646,8 +663,8 @@ namespace WindowsFormsApp1
|
||||
|
||||
string count = data.Length.ToString();
|
||||
string res = string.Empty;
|
||||
|
||||
for(int a = 0; a < length.Length; a++)
|
||||
|
||||
for (int a = 0; a < length.Length; a++)
|
||||
{
|
||||
if (length[a] == count)
|
||||
{
|
||||
@@ -658,7 +675,7 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
public class Helper_Print
|
||||
public class Helper_Print
|
||||
{
|
||||
/// <summary>
|
||||
/// 행의 갯수
|
||||
@@ -788,7 +805,7 @@ namespace WindowsFormsApp1
|
||||
/// <param name="file_name"></param>
|
||||
/// <param name="fax_param">[0] 발신번호 / [1] 수신번호
|
||||
/// / [2] 수신자 회사명 / [3 ]수신자명 </param>
|
||||
public string Send_BaroFax(string file_name, string[] fax_param )
|
||||
public string Send_BaroFax(string file_name, string[] fax_param)
|
||||
{
|
||||
BaroService_FAXSoapClient fAXSoapClient = new BaroService_FAXSoapClient();
|
||||
|
||||
@@ -824,7 +841,7 @@ namespace WindowsFormsApp1
|
||||
BaroService_FAXSoapClient fAXSoapClient = new BaroService_FAXSoapClient();
|
||||
|
||||
// 수신자회사명, 수신번호, 전송일시, 전송결과, 전송페이지수, 성공페이지수, 전송파일명
|
||||
string[] MsgBox_Array = {
|
||||
string[] MsgBox_Array = {
|
||||
fAXSoapClient.GetFaxMessage(CERTKEY, CorpNum, sendkey).ReceiveCorp,
|
||||
fAXSoapClient.GetFaxMessage(CERTKEY, CorpNum, sendkey).ReceiverNum,
|
||||
fAXSoapClient.GetFaxMessage(CERTKEY, CorpNum, sendkey).SendDT,
|
||||
@@ -1190,9 +1207,9 @@ namespace WindowsFormsApp1
|
||||
public bool IsConnected { get; set; }
|
||||
|
||||
private string ipAddr = string.Empty;
|
||||
private string Port = string.Empty;
|
||||
private string Port = string.Empty;
|
||||
private string userId = string.Empty;
|
||||
private string Pwd = string.Empty;
|
||||
private string Pwd = string.Empty;
|
||||
|
||||
public FTP() { }
|
||||
|
||||
@@ -1219,7 +1236,7 @@ namespace WindowsFormsApp1
|
||||
using (ftpRequest.GetResponse()) { }
|
||||
this.IsConnected = true;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LastException = ex;
|
||||
System.Reflection.MemberInfo info = System.Reflection.MethodInfo.GetCurrentMethod();
|
||||
@@ -1288,7 +1305,7 @@ namespace WindowsFormsApp1
|
||||
buff = null;
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
MessageBox.Show(ex.ToString());
|
||||
this.LastException = ex;
|
||||
@@ -1392,14 +1409,14 @@ namespace WindowsFormsApp1
|
||||
|
||||
if (reader != null) reader.Close();
|
||||
|
||||
foreach(string file in result.ToString().Split('\n'))
|
||||
foreach (string file in result.ToString().Split('\n'))
|
||||
{
|
||||
resultList.Add(file);
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
this.LastException = ex;
|
||||
|
||||
@@ -1420,12 +1437,12 @@ namespace WindowsFormsApp1
|
||||
|
||||
try
|
||||
{
|
||||
foreach(string tmpFolder in arrDir)
|
||||
foreach (string tmpFolder in arrDir)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (tmpFolder == string.Empty) continue;
|
||||
|
||||
|
||||
currentDir += @"/" + tmpFolder;
|
||||
|
||||
string url = string.Format(@"FTP://{0}:{1}/{2}", this.ipAddr, this.Port, currentDir);
|
||||
@@ -1453,9 +1470,11 @@ namespace WindowsFormsApp1
|
||||
private void checkDir(string localFullPathFile)
|
||||
{
|
||||
FileInfo finfo = new FileInfo(localFullPathFile);
|
||||
if (!finfo.Exists) {
|
||||
if (!finfo.Exists)
|
||||
{
|
||||
DirectoryInfo dInfo = new DirectoryInfo(finfo.DirectoryName);
|
||||
if (!dInfo.Exists) {
|
||||
if (!dInfo.Exists)
|
||||
{
|
||||
dInfo.Create();
|
||||
}
|
||||
}
|
||||
@@ -1552,30 +1571,35 @@ namespace WindowsFormsApp1
|
||||
int tDown = 0;
|
||||
for (int a = 0; a < array_text.Count; a++)
|
||||
{
|
||||
// if (array_text[a] == "") continue;
|
||||
// if (array_text[a] == "") continue;
|
||||
|
||||
num.Add(array_text[a].Substring(0, 3));
|
||||
|
||||
if (array_text[a][5] == '▼') {
|
||||
if (array_text[a][5] == '▼')
|
||||
{
|
||||
array_text[a] = array_text[a].Remove(0, 3);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
array_text[a] = array_text[a].Remove(0, 5);
|
||||
}
|
||||
|
||||
가변길이 += array_text[a] + "\n";
|
||||
int textLength = 0;
|
||||
if (EncodingType == "UTF-8") {
|
||||
if (EncodingType == "UTF-8")
|
||||
{
|
||||
textLength = Encoding.UTF8.GetBytes(array_text[a]).Length
|
||||
- WordCheck(array_text[a], "▲")
|
||||
- WordCheck(array_text[a], "▼");
|
||||
}
|
||||
else if (EncodingType == "UniCode") {
|
||||
else if (EncodingType == "UniCode")
|
||||
{
|
||||
textLength = Encoding.Unicode.GetBytes(array_text[a]).Length
|
||||
- WordCheck(array_text[a], "▲")
|
||||
- WordCheck(array_text[a], "▼");
|
||||
}
|
||||
else { // ANSI
|
||||
else
|
||||
{ // ANSI
|
||||
textLength = Encoding.Default.GetBytes(array_text[a]).Length
|
||||
- WordCheck(array_text[a], "▲")
|
||||
- WordCheck(array_text[a], "▼");
|
||||
@@ -1587,12 +1611,13 @@ namespace WindowsFormsApp1
|
||||
|
||||
for (int a = 0; a < array_text.Count; a++)
|
||||
{
|
||||
if (a == 0) { //total.Add("0");
|
||||
if (a == 0)
|
||||
{ //total.Add("0");
|
||||
tTotal.Add(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// total.Add(total[a - 1] + count[a - 1]);
|
||||
// total.Add(total[a - 1] + count[a - 1]);
|
||||
tTotal.Add(tTotal[a - 1] + tCount[a - 1]);
|
||||
}
|
||||
//else if (a == 1)
|
||||
@@ -1609,7 +1634,7 @@ namespace WindowsFormsApp1
|
||||
// else c = Convert.ToInt32(Encoding.Default.GetBytes(array_text[a - 2]).Length.ToString()) - WordCheck(array_text[a - 2], "▲") - WordCheck(array_text[a - 2], "▼");
|
||||
// int res = b + c;
|
||||
// total.Add(res.ToString());
|
||||
|
||||
|
||||
}
|
||||
|
||||
string[] str_num = num.ToArray();
|
||||
@@ -1626,7 +1651,7 @@ namespace WindowsFormsApp1
|
||||
// else if (total[a].Length == 2) { total[a] = total[a].Insert(0, "000"); }
|
||||
// else if (total[a].Length == 1) { total[a] = total[a].Insert(0, "0000"); }
|
||||
// 디렉토리 += str_num[a] + count[a] + total[a] + "\n";
|
||||
디렉토리 += str_num[a] + tCount[a].ToString().PadLeft(4, '0') + tTotal[a].ToString().PadLeft(5, '0');
|
||||
디렉토리 += str_num[a] + tCount[a].ToString().PadLeft(4, '0') + tTotal[a].ToString().PadLeft(5, '0');
|
||||
}
|
||||
|
||||
string[] 리더부 = { "00000","n", "a", "m", " ",
|
||||
@@ -1642,11 +1667,11 @@ namespace WindowsFormsApp1
|
||||
|
||||
string dp = 가변길이 + 디렉토리;
|
||||
int recode = 0;
|
||||
if (EncodingType == "UTF-8") recode = Encoding.UTF8.GetBytes(dp).Length- WordCheck(dp, "▲") - WordCheck(dp, "▼") - WordCheck(dp, "↔");
|
||||
if (EncodingType == "UTF-8") recode = Encoding.UTF8.GetBytes(dp).Length - WordCheck(dp, "▲") - WordCheck(dp, "▼") - WordCheck(dp, "↔");
|
||||
else if (EncodingType == "UniCode") recode = Encoding.Unicode.GetBytes(dp).Length - WordCheck(dp, "▲") - WordCheck(dp, "▼") - WordCheck(dp, "↔");
|
||||
else recode = Encoding.Default.GetBytes(dp).Length- WordCheck(dp, "▲") - WordCheck(dp, "▼") - WordCheck(dp, "↔");
|
||||
|
||||
|
||||
else recode = Encoding.Default.GetBytes(dp).Length - WordCheck(dp, "▲") - WordCheck(dp, "▼") - WordCheck(dp, "↔");
|
||||
|
||||
|
||||
리더부[0] = insert_Zero(recode + 24, 5);
|
||||
|
||||
int data_addr = 24 + Encoding.Default.GetBytes(디렉토리).Length - WordCheck(디렉토리, "▲");
|
||||
@@ -1693,7 +1718,7 @@ namespace WindowsFormsApp1
|
||||
return result;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 추가하고 싶은 태그를 뷰형태의 마크에 추가하는 함수.
|
||||
@@ -1706,7 +1731,7 @@ namespace WindowsFormsApp1
|
||||
if (Tag.Length < 3) return "";
|
||||
|
||||
int TargetTagNum = Convert.ToInt32(Tag.Substring(0, 3));
|
||||
|
||||
|
||||
string[] SplitView = TypeView.Split('\n');
|
||||
List<string> View = new List<string>(SplitView);
|
||||
|
||||
@@ -1731,9 +1756,9 @@ namespace WindowsFormsApp1
|
||||
/// <param name="pAddTag">추가할 태그 (태그명\t지시기호\t태그내용)</param>
|
||||
/// <param name="pTargetData">뷰형태의 마크</param>
|
||||
/// <returns></returns>
|
||||
public string AddTagInMarc(int pTargetTagNum,string pAddTag, string pTargetData)//TagTarget Num 을 찾아서 있을경우는 해당 Tag 데이터를 전송, 없을경우는 신규로 해야함.
|
||||
public string AddTagInMarc(int pTargetTagNum, string pAddTag, string pTargetData)//TagTarget Num 을 찾아서 있을경우는 해당 Tag 데이터를 전송, 없을경우는 신규로 해야함.
|
||||
{
|
||||
|
||||
|
||||
if (pAddTag.Length < 3) return "";
|
||||
string tRet = pTargetData;
|
||||
// ex ) 020 : ~~~ 에 XXXX 내용줄 뒤에 추가
|
||||
@@ -1827,7 +1852,7 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{// 기존 태그 변경
|
||||
int endIdx = SplitView[a].IndexOf("▼", startIdx + 1);
|
||||
@@ -1906,7 +1931,7 @@ namespace WindowsFormsApp1
|
||||
/// <param name="marc">마크 데이터</param>
|
||||
/// <param name="search">추출할 함수(배열)</param>
|
||||
/// <returns></returns>
|
||||
public string[] Take_Tag(string marc, string[] search,bool pSearchTag = false)
|
||||
public string[] Take_Tag(string marc, string[] search, bool pSearchTag = false)
|
||||
{
|
||||
string[] ary = marc.Split('');
|
||||
string[] tag = res_dir(ary[0].Substring(24));
|
||||
@@ -1958,7 +1983,7 @@ namespace WindowsFormsApp1
|
||||
//memo = result[b];
|
||||
start += 2;
|
||||
int end = -1;
|
||||
if (tmp.Length > 1) end=tmp.IndexOf("", start);
|
||||
if (tmp.Length > 1) end = tmp.IndexOf("", start);
|
||||
if (memo == result[b])
|
||||
break;
|
||||
|
||||
@@ -2130,9 +2155,14 @@ namespace WindowsFormsApp1
|
||||
/// </summary>
|
||||
/// <param name="Marc">한줄짜리 마크</param>
|
||||
/// <returns></returns>
|
||||
public string ConvertMarcType(string Marc)
|
||||
public string ConvertMarcType(string Marc, out string errmessage)
|
||||
{
|
||||
if (Marc.Length < 3) return "";
|
||||
errmessage = string.Empty;
|
||||
if (Marc.Length < 3)
|
||||
{
|
||||
errmessage = "MARC 데이터길이가 너무 짧습니다.";
|
||||
return "";
|
||||
}
|
||||
|
||||
string result = "";
|
||||
|
||||
@@ -2140,12 +2170,15 @@ namespace WindowsFormsApp1
|
||||
List<string> Field = new List<string>(); // 가변길이필드 저장용
|
||||
|
||||
Marc = Marc.Replace("", "▼").Replace("", "▲");
|
||||
Marc = Marc.Replace(((char)0x1D).ToString(), "");
|
||||
Marc = Marc.Replace(((char)0x1E).ToString(), "");
|
||||
Marc = Marc.Replace(((char)0x1F).ToString(), "");
|
||||
|
||||
int StartIdx = 0;
|
||||
|
||||
// 리더부를 제외한 디렉토리, 가변길이필드 저장
|
||||
string[] data = Marc.Substring(24).Split('▲');
|
||||
for (int a = 1; a < data.Length - 1; a++)
|
||||
string[] data = Marc.Substring(24).Split(new char[] { '▲' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
for (int a = 1; a < data.Length; a++)
|
||||
{
|
||||
TagNum.Add(data[0].Substring(StartIdx, 3));
|
||||
StartIdx += 12;
|
||||
@@ -2161,10 +2194,32 @@ namespace WindowsFormsApp1
|
||||
else if (res.StartsWith("00")) { res += "\t \t" + Field[a]; }
|
||||
else
|
||||
{
|
||||
string temp = Field[a].Insert(2, "\t");
|
||||
res += "\t" + temp;
|
||||
var fieldValue = Field[a].Trim();
|
||||
bool isEmpty = false;
|
||||
if (fieldValue.IndexOf("▼") != -1)
|
||||
{
|
||||
var dataArea = fieldValue.Substring(fieldValue.IndexOf("▼") + 1);
|
||||
isEmpty = dataArea.ToString().isEmpty();
|
||||
}
|
||||
else
|
||||
{
|
||||
isEmpty = fieldValue.Replace("▲", "").Trim().isEmpty();
|
||||
}
|
||||
if (isEmpty) //no data
|
||||
{
|
||||
errmessage = (errmessage.isEmpty() == false ? "\n" : "") + "태그 " + TagNum[a] + " 에 데이터가 없습니다.";
|
||||
Console.WriteLine("field length error");
|
||||
res = string.Empty;
|
||||
}
|
||||
else
|
||||
{
|
||||
string temp = Field[a].Insert(2, "\t");
|
||||
res += "\t" + temp;
|
||||
}
|
||||
|
||||
}
|
||||
result += res + "\n";
|
||||
if (res.isEmpty() == false)
|
||||
result += res + "\n";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -2188,7 +2243,8 @@ namespace WindowsFormsApp1
|
||||
/// <param name="e">EventArgs</param>
|
||||
public void Int_Comma(object sender, EventArgs e)
|
||||
{
|
||||
if (((TextBox)sender).Text != "") {
|
||||
if (((TextBox)sender).Text != "")
|
||||
{
|
||||
string text;
|
||||
text = ((TextBox)sender).Text.Replace(",", "");
|
||||
((TextBox)sender).Text = String.Format("{0:#,###}", Convert.ToInt32(text));
|
||||
@@ -2204,7 +2260,7 @@ namespace WindowsFormsApp1
|
||||
public bool isContainHangul(string value)
|
||||
{
|
||||
char[] charArr = value.ToCharArray();
|
||||
foreach(char c in charArr)
|
||||
foreach (char c in charArr)
|
||||
{
|
||||
if (char.GetUnicodeCategory(c) == System.Globalization.UnicodeCategory.OtherLetter)
|
||||
return true;
|
||||
@@ -2221,7 +2277,7 @@ namespace WindowsFormsApp1
|
||||
public bool CheckString(string value, string chkString)
|
||||
{
|
||||
int index = value.IndexOf(chkString);
|
||||
if (index < 0)
|
||||
if (index < 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -2264,10 +2320,10 @@ namespace WindowsFormsApp1
|
||||
public class API
|
||||
{
|
||||
|
||||
public string CheckString(string pText,string pStr)
|
||||
public string CheckString(string pText, string pStr)
|
||||
{
|
||||
string tRet = pText;
|
||||
Regex reg = new Regex(@"([\"+pStr+"]+)" + @"[가-힣]+");//+ @"([\>]+)");//new Regex(@"([\<]+)"+ @"[ㄱ-ㅎ가-힣]+"+@"([\>]+)");
|
||||
Regex reg = new Regex(@"([\" + pStr + "]+)" + @"[가-힣]+");//+ @"([\>]+)");//new Regex(@"([\<]+)"+ @"[ㄱ-ㅎ가-힣]+"+@"([\>]+)");
|
||||
MatchCollection tMatch = reg.Matches(tRet);
|
||||
for (int i = 0; i < tMatch.Count; i++)
|
||||
{
|
||||
@@ -2326,8 +2382,9 @@ namespace WindowsFormsApp1
|
||||
xml = CheckString(xml, "〈");
|
||||
doc.LoadXml(xml);
|
||||
}
|
||||
catch (Exception ex){
|
||||
return "";
|
||||
catch (Exception ex)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
var json = JsonConvert.SerializeXmlNode(doc);
|
||||
|
||||
@@ -2520,19 +2577,23 @@ namespace WindowsFormsApp1
|
||||
{
|
||||
if (length == 1)
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
tmp_data.Add(docs[Param[b]]["#text"]);
|
||||
}
|
||||
catch (KeyNotFoundException e) {
|
||||
catch (KeyNotFoundException e)
|
||||
{
|
||||
tmp_data.Add("");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
try {
|
||||
try
|
||||
{
|
||||
tmp_data.Add(docs[a][Param[b]]["#text"]);
|
||||
}
|
||||
catch (KeyNotFoundException e) {
|
||||
catch (KeyNotFoundException e)
|
||||
{
|
||||
tmp_data.Add("");
|
||||
}
|
||||
}
|
||||
@@ -2649,8 +2710,8 @@ namespace WindowsFormsApp1
|
||||
return dialogResult;
|
||||
}
|
||||
}
|
||||
public class PrintLine
|
||||
{
|
||||
public class PrintLine
|
||||
{
|
||||
string num { get; set; }
|
||||
string count { get; set; }
|
||||
string list_name { get; set; }
|
||||
@@ -2963,7 +3024,7 @@ namespace WindowsFormsApp1
|
||||
{
|
||||
string version = "0";
|
||||
var fn = Application.StartupPath + "\\update.inf";
|
||||
if(System.IO.File.Exists(fn))
|
||||
if (System.IO.File.Exists(fn))
|
||||
{
|
||||
StreamReader sr = new StreamReader(fn);
|
||||
while (!sr.EndOfStream)
|
||||
@@ -2976,7 +3037,7 @@ namespace WindowsFormsApp1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return version;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,14 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helper_DB2.cs" />
|
||||
<Compile Include="Helper_LibraryDelaySettings.cs" />
|
||||
<Compile Include="ListOfValue\fSelectDT.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ListOfValue\fSelectDT.Designer.cs">
|
||||
<DependentUpon>fSelectDT.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PUB.cs" />
|
||||
<Compile Include="SearchModel\AnsanLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\BookSearchService.cs" />
|
||||
@@ -236,6 +244,7 @@
|
||||
<Compile Include="SearchModel\DownloadProgressForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="SearchModel\GochangLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\GoheungLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\GwangjuCityLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\GwangjuDongguLibSearcher.cs" />
|
||||
@@ -247,6 +256,7 @@
|
||||
<Compile Include="SearchModel\IksanLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\ILibrarySearcher.cs" />
|
||||
<Compile Include="SearchModel\JeonbukEduLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\JeonnamProvLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\KcmLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\MokpoLibSearcher.cs" />
|
||||
<Compile Include="SearchModel\MuanLibSearcher.cs" />
|
||||
@@ -324,6 +334,12 @@
|
||||
<Compile Include="마크\Check_Copy_Login.Designer.cs">
|
||||
<DependentUpon>Check_Copy_Login.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Check_Copy_Sub_Selector.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="마크\Check_Copy_Sub_Selector.Designer.cs">
|
||||
<DependentUpon>Check_Copy_Sub_Selector.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Help_007.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -336,6 +352,7 @@
|
||||
<Compile Include="마크\Help_008.Designer.cs">
|
||||
<DependentUpon>Help_008.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\MacEditorParameter.cs" />
|
||||
<Compile Include="마크\Mac_List_Add.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -348,6 +365,18 @@
|
||||
<Compile Include="마크\MarcCopySelect.Designer.cs">
|
||||
<DependentUpon>MarcCopySelect.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\MarcEditorControl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
<Compile Include="마크\MarcEditorControl.Designer.cs">
|
||||
<DependentUpon>MarcEditorControl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc.designer.cs">
|
||||
<DependentUpon>Marc.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc_FillBlank.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -483,6 +512,12 @@
|
||||
<Compile Include="마크\Marc_Plan_PrintLabel.Designer.cs">
|
||||
<DependentUpon>Marc_Plan_PrintLabel.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc_Plan_Sub_MarcEdit2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc_Plan_Sub_MarcEdit2.Designer.cs">
|
||||
<DependentUpon>Marc_Plan_Sub_MarcEdit2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc_Plan_Sub_MarcEdit.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -519,11 +554,11 @@
|
||||
<Compile Include="마크\Make_Document.Designer.cs">
|
||||
<DependentUpon>Make_Document.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc.cs">
|
||||
<Compile Include="마크\Marc2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc.designer.cs">
|
||||
<DependentUpon>Marc.cs</DependentUpon>
|
||||
<Compile Include="마크\Marc2.designer.cs">
|
||||
<DependentUpon>Marc2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\Marc_memo.cs">
|
||||
<SubType>Form</SubType>
|
||||
@@ -988,6 +1023,9 @@
|
||||
<Compile Include="작업일지\Work_Log.Designer.cs">
|
||||
<DependentUpon>Work_Log.cs</DependentUpon>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="ListOfValue\fSelectDT.resx">
|
||||
<DependentUpon>fSelectDT.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="개발자용\fDevDB.resx">
|
||||
<DependentUpon>fDevDB.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -1021,6 +1059,9 @@
|
||||
<EmbeddedResource Include="마크\Check_Copy_Login.resx">
|
||||
<DependentUpon>Check_Copy_Login.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Check_Copy_Sub_Selector.resx">
|
||||
<DependentUpon>Check_Copy_Sub_Selector.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Help_007.resx">
|
||||
<DependentUpon>Help_007.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -1033,6 +1074,12 @@
|
||||
<EmbeddedResource Include="마크\MarcCopySelect.resx">
|
||||
<DependentUpon>MarcCopySelect.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Marc.resx">
|
||||
<DependentUpon>Marc.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\MarcEditorControl.resx">
|
||||
<DependentUpon>MarcEditorControl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Marc_FillBlank.resx">
|
||||
<DependentUpon>Marc_FillBlank.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -1099,6 +1146,9 @@
|
||||
<EmbeddedResource Include="마크\Marc_Plan_PrintLabel.resx">
|
||||
<DependentUpon>Marc_Plan_PrintLabel.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Marc_Plan_Sub_MarcEdit2.resx">
|
||||
<DependentUpon>Marc_Plan_Sub_MarcEdit2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Marc_Plan_Sub_MarcEdit.resx">
|
||||
<DependentUpon>Marc_Plan_Sub_MarcEdit.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@@ -1117,8 +1167,8 @@
|
||||
<EmbeddedResource Include="마크\Make_Document.resx">
|
||||
<DependentUpon>Make_Document.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Marc.resx">
|
||||
<DependentUpon>Marc.cs</DependentUpon>
|
||||
<EmbeddedResource Include="마크\Marc2.resx">
|
||||
<DependentUpon>Marc2.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="마크\Marc_memo.resx">
|
||||
<DependentUpon>Marc_memo.cs</DependentUpon>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<ErrorReportUrlHistory />
|
||||
<FallbackCulture>ko-KR</FallbackCulture>
|
||||
<VerifyUploadedFiles>false</VerifyUploadedFiles>
|
||||
<ProjectView>ShowAllFiles</ProjectView>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<EnableSecurityDebugging>false</EnableSecurityDebugging>
|
||||
|
||||
24
unimarc/unimarc/UniMarc.sln
Normal file
24
unimarc/unimarc/UniMarc.sln
Normal file
@@ -0,0 +1,24 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.5.2.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UniMarc", "UniMarc.csproj", "{4FCAFD58-3A8E-4E08-85E2-05329866193A}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{4FCAFD58-3A8E-4E08-85E2-05329866193A}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {FA0A3E60-8B04-4285-947B-DE3CCCCDEB3B}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -33,6 +33,10 @@ namespace UniMarc.개발자용
|
||||
var sql = $"select * from {cmbTables.Text}";
|
||||
var cn = db.CreateConnection();
|
||||
var da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, cn);
|
||||
var cb = new MySql.Data.MySqlClient.MySqlCommandBuilder(da);
|
||||
da.UpdateCommand = cb.GetUpdateCommand();
|
||||
da.InsertCommand = cb.GetInsertCommand();
|
||||
da.DeleteCommand = cb.GetDeleteCommand();
|
||||
var cnt = da.Update(dt);
|
||||
UTIL.MsgI($"P{cnt}");
|
||||
cn.Dispose();
|
||||
|
||||
@@ -583,13 +583,10 @@ namespace WindowsFormsApp1.Delivery
|
||||
if (e.ColumnIndex != 2 || e.ColumnIndex != 4 || e.ColumnIndex != 5 ||
|
||||
e.ColumnIndex != 6 || e.ColumnIndex != 15)
|
||||
{
|
||||
List_Lookup list_l = new List_Lookup(this)
|
||||
var list_l = main.OpenFormInTab(() => new List_Lookup(this)
|
||||
{
|
||||
call_base = dataGridView1.Rows[e.RowIndex].Cells["list_name"].Value.ToString()
|
||||
};
|
||||
list_l.MdiParent = main;
|
||||
list_l.WindowState = FormWindowState.Maximized;
|
||||
list_l.Show();
|
||||
});
|
||||
}
|
||||
}
|
||||
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
|
||||
201
unimarc/unimarc/마스터/Batch_processing.Designer.cs
generated
201
unimarc/unimarc/마스터/Batch_processing.Designer.cs
generated
@@ -28,26 +28,190 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Batch_processing));
|
||||
this.dv1 = new System.Windows.Forms.DataGridView();
|
||||
this.bs = new System.Windows.Forms.BindingSource(this.components);
|
||||
this.bn = new System.Windows.Forms.BindingNavigator(this.components);
|
||||
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
|
||||
this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorAddNewItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorDeleteItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.btSave = new System.Windows.Forms.ToolStripButton();
|
||||
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bn)).BeginInit();
|
||||
this.bn.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label1
|
||||
// dv1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(311, 121);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(119, 12);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "마스터_일괄처리관리";
|
||||
this.dv1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
||||
this.dv1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dv1.Location = new System.Drawing.Point(0, 0);
|
||||
this.dv1.Name = "dv1";
|
||||
this.dv1.RowTemplate.Height = 23;
|
||||
this.dv1.Size = new System.Drawing.Size(866, 559);
|
||||
this.dv1.TabIndex = 0;
|
||||
//
|
||||
// bn
|
||||
//
|
||||
this.bn.AddNewItem = this.bindingNavigatorAddNewItem;
|
||||
this.bn.CountItem = this.bindingNavigatorCountItem;
|
||||
this.bn.DeleteItem = this.bindingNavigatorDeleteItem;
|
||||
this.bn.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.bn.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.bindingNavigatorMoveFirstItem,
|
||||
this.bindingNavigatorMovePreviousItem,
|
||||
this.bindingNavigatorSeparator,
|
||||
this.bindingNavigatorPositionItem,
|
||||
this.bindingNavigatorCountItem,
|
||||
this.bindingNavigatorSeparator1,
|
||||
this.bindingNavigatorMoveNextItem,
|
||||
this.bindingNavigatorMoveLastItem,
|
||||
this.bindingNavigatorSeparator2,
|
||||
this.bindingNavigatorAddNewItem,
|
||||
this.bindingNavigatorDeleteItem,
|
||||
this.btSave,
|
||||
this.toolStripButton1});
|
||||
this.bn.Location = new System.Drawing.Point(0, 559);
|
||||
this.bn.MoveFirstItem = this.bindingNavigatorMoveFirstItem;
|
||||
this.bn.MoveLastItem = this.bindingNavigatorMoveLastItem;
|
||||
this.bn.MoveNextItem = this.bindingNavigatorMoveNextItem;
|
||||
this.bn.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
|
||||
this.bn.Name = "bn";
|
||||
this.bn.PositionItem = this.bindingNavigatorPositionItem;
|
||||
this.bn.Size = new System.Drawing.Size(866, 25);
|
||||
this.bn.TabIndex = 1;
|
||||
this.bn.Text = "bindingNavigator1";
|
||||
//
|
||||
// bindingNavigatorMoveFirstItem
|
||||
//
|
||||
this.bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveFirstItem.Image")));
|
||||
this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
|
||||
this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMoveFirstItem.Text = "처음으로 이동";
|
||||
//
|
||||
// bindingNavigatorMovePreviousItem
|
||||
//
|
||||
this.bindingNavigatorMovePreviousItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMovePreviousItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMovePreviousItem.Image")));
|
||||
this.bindingNavigatorMovePreviousItem.Name = "bindingNavigatorMovePreviousItem";
|
||||
this.bindingNavigatorMovePreviousItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMovePreviousItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMovePreviousItem.Text = "이전으로 이동";
|
||||
//
|
||||
// bindingNavigatorSeparator
|
||||
//
|
||||
this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
|
||||
this.bindingNavigatorSeparator.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// bindingNavigatorPositionItem
|
||||
//
|
||||
this.bindingNavigatorPositionItem.AccessibleName = "위치";
|
||||
this.bindingNavigatorPositionItem.AutoSize = false;
|
||||
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
|
||||
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
|
||||
this.bindingNavigatorPositionItem.Text = "0";
|
||||
this.bindingNavigatorPositionItem.ToolTipText = "현재 위치";
|
||||
//
|
||||
// bindingNavigatorCountItem
|
||||
//
|
||||
this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
|
||||
this.bindingNavigatorCountItem.Size = new System.Drawing.Size(27, 22);
|
||||
this.bindingNavigatorCountItem.Text = "/{0}";
|
||||
this.bindingNavigatorCountItem.ToolTipText = "전체 항목 수";
|
||||
//
|
||||
// bindingNavigatorSeparator1
|
||||
//
|
||||
this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator";
|
||||
this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// bindingNavigatorMoveNextItem
|
||||
//
|
||||
this.bindingNavigatorMoveNextItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveNextItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveNextItem.Image")));
|
||||
this.bindingNavigatorMoveNextItem.Name = "bindingNavigatorMoveNextItem";
|
||||
this.bindingNavigatorMoveNextItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveNextItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMoveNextItem.Text = "다음으로 이동";
|
||||
//
|
||||
// bindingNavigatorMoveLastItem
|
||||
//
|
||||
this.bindingNavigatorMoveLastItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorMoveLastItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveLastItem.Image")));
|
||||
this.bindingNavigatorMoveLastItem.Name = "bindingNavigatorMoveLastItem";
|
||||
this.bindingNavigatorMoveLastItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorMoveLastItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorMoveLastItem.Text = "마지막으로 이동";
|
||||
//
|
||||
// bindingNavigatorSeparator2
|
||||
//
|
||||
this.bindingNavigatorSeparator2.Name = "bindingNavigatorSeparator";
|
||||
this.bindingNavigatorSeparator2.Size = new System.Drawing.Size(6, 25);
|
||||
//
|
||||
// bindingNavigatorAddNewItem
|
||||
//
|
||||
this.bindingNavigatorAddNewItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorAddNewItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorAddNewItem.Image")));
|
||||
this.bindingNavigatorAddNewItem.Name = "bindingNavigatorAddNewItem";
|
||||
this.bindingNavigatorAddNewItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorAddNewItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorAddNewItem.Text = "새로 추가";
|
||||
//
|
||||
// bindingNavigatorDeleteItem
|
||||
//
|
||||
this.bindingNavigatorDeleteItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
|
||||
this.bindingNavigatorDeleteItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorDeleteItem.Image")));
|
||||
this.bindingNavigatorDeleteItem.Name = "bindingNavigatorDeleteItem";
|
||||
this.bindingNavigatorDeleteItem.RightToLeftAutoMirrorImage = true;
|
||||
this.bindingNavigatorDeleteItem.Size = new System.Drawing.Size(23, 22);
|
||||
this.bindingNavigatorDeleteItem.Text = "삭제";
|
||||
//
|
||||
// btSave
|
||||
//
|
||||
this.btSave.Image = ((System.Drawing.Image)(resources.GetObject("btSave.Image")));
|
||||
this.btSave.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.btSave.Name = "btSave";
|
||||
this.btSave.Size = new System.Drawing.Size(52, 22);
|
||||
this.btSave.Text = "Save";
|
||||
this.btSave.Click += new System.EventHandler(this.btSave_Click);
|
||||
//
|
||||
// toolStripButton1
|
||||
//
|
||||
this.toolStripButton1.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
||||
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
|
||||
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
|
||||
this.toolStripButton1.Name = "toolStripButton1";
|
||||
this.toolStripButton1.Size = new System.Drawing.Size(66, 22);
|
||||
this.toolStripButton1.Text = "Refresh";
|
||||
this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click);
|
||||
//
|
||||
// Batch_processing
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(800, 450);
|
||||
this.Controls.Add(this.label1);
|
||||
this.ClientSize = new System.Drawing.Size(866, 584);
|
||||
this.Controls.Add(this.dv1);
|
||||
this.Controls.Add(this.bn);
|
||||
this.Name = "Batch_processing";
|
||||
this.Text = "Batch_processing";
|
||||
this.Load += new System.EventHandler(this.Batch_processing_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bn)).EndInit();
|
||||
this.bn.ResumeLayout(false);
|
||||
this.bn.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
@@ -55,6 +219,21 @@
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.DataGridView dv1;
|
||||
private System.Windows.Forms.BindingSource bs;
|
||||
private System.Windows.Forms.BindingNavigator bn;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorAddNewItem;
|
||||
private System.Windows.Forms.ToolStripLabel bindingNavigatorCountItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorDeleteItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveFirstItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMovePreviousItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator;
|
||||
private System.Windows.Forms.ToolStripTextBox bindingNavigatorPositionItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator1;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveNextItem;
|
||||
private System.Windows.Forms.ToolStripButton bindingNavigatorMoveLastItem;
|
||||
private System.Windows.Forms.ToolStripSeparator bindingNavigatorSeparator2;
|
||||
private System.Windows.Forms.ToolStripButton btSave;
|
||||
private System.Windows.Forms.ToolStripButton toolStripButton1;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using AR;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
@@ -12,11 +13,83 @@ namespace WindowsFormsApp1.Home
|
||||
{
|
||||
public partial class Batch_processing : Form
|
||||
{
|
||||
Helper_DB db = new Helper_DB();
|
||||
Main main;
|
||||
MySql.Data.MySqlClient.MySqlDataAdapter da;
|
||||
DataTable dt = new DataTable();
|
||||
public Batch_processing(Main _main)
|
||||
{
|
||||
InitializeComponent();
|
||||
main = _main;
|
||||
this.Text = $"매크로 데이터 관리";
|
||||
}
|
||||
|
||||
private void Batch_processing_Load(object sender, EventArgs e)
|
||||
{
|
||||
RefreshData();
|
||||
}
|
||||
void RefreshData()
|
||||
{
|
||||
var sql = "select * from SetMacro order by tag";
|
||||
var firstrun = da == null;
|
||||
if(firstrun)
|
||||
{
|
||||
var cn = db.CreateConnection();
|
||||
|
||||
da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, cn);
|
||||
var cb = new MySql.Data.MySqlClient.MySqlCommandBuilder(da);
|
||||
|
||||
// CommandBuilder가 Insert/Update/Delete 명령을 자동으로 생성하도록 설정
|
||||
da.InsertCommand = cb.GetInsertCommand();
|
||||
da.UpdateCommand = cb.GetUpdateCommand();
|
||||
da.DeleteCommand = cb.GetDeleteCommand();
|
||||
}
|
||||
|
||||
this.dt.Clear();
|
||||
da.Fill(dt);
|
||||
dt.AcceptChanges();
|
||||
|
||||
if(firstrun)
|
||||
{
|
||||
this.bs.DataSource = dt;
|
||||
this.bn.BindingSource = this.bs;
|
||||
this.dv1.DataSource = this.bs;
|
||||
|
||||
// idx 열(첫번째 열) 편집 비활성화 및 배경색 회색으로 설정
|
||||
if (this.dv1.Columns.Count > 0)
|
||||
{
|
||||
this.dv1.Columns[0].ReadOnly = true;
|
||||
this.dv1.Columns[0].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
this.dv1.Columns[0].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
}
|
||||
|
||||
// 1, 3번 열 가운데 정렬
|
||||
if (this.dv1.Columns.Count > 1)
|
||||
{
|
||||
this.dv1.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
}
|
||||
if (this.dv1.Columns.Count > 3)
|
||||
{
|
||||
this.dv1.Columns[3].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
|
||||
}
|
||||
}
|
||||
|
||||
this.dv1.AutoResizeColumns();
|
||||
}
|
||||
|
||||
private void btSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Validate();
|
||||
this.bs.EndEdit();
|
||||
if (UTIL.MsgQ("자료를 저장할까요?") != DialogResult.Yes) return;
|
||||
var cnt = da.Update(this.dt);
|
||||
dt.AcceptChanges();
|
||||
UTIL.MsgI($"{cnt}건의 자료가 저장 되었습니다");
|
||||
}
|
||||
|
||||
private void toolStripButton1_Click(object sender, EventArgs e)
|
||||
{
|
||||
RefreshData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,105 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="bs.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="bn.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>156, 17</value>
|
||||
</metadata>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="bindingNavigatorAddNewItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFXSURBVDhPzc9LSwJhFAZgd5FkaAlFRCEhVCRm9TssIiqw
|
||||
7CKWXZCQJA1Lw0JIo1Ckm1SL2rSoTYvaBEUQBhEF4YyXaex3fN/3hrNo4SxkNtELZ3U4D+9Rqf5tCmdV
|
||||
yJ5U4zOlxvuBBuX7ismk1CDfGyDFENIJrXLgbV/zCzzE9MqB57gOpLgOIq7iNtJQGfg4rMFrshbpuA5P
|
||||
u3W4j+pBxBVQwYPrUDMuAy248Btw6m3DkccoB18SWpBiEERcAxH9IMIyiOAGLcyB5h2gOTsYPwrGDyG+
|
||||
2CEHHnfqpbr0ywsiLIEWFkDzTtDcJFjWBsYPg3GDYBkrtmdMcuAu0oibcBOupLqtOPcZQLNjYPwIku52
|
||||
7M13IuoyIeI0IzxlkQPlOfYYpbqMG0DM1VX5oDylPxnXD8ZZseUwKweisybp39IE7T3Kgc3pboQmLAiM
|
||||
98Jv61MO/Fl+ACQj2J5cFZvRAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorDeleteItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFrSURBVDhPtZBNKMNhHMf/V+WtlIsLSjkgk5iQTIbkJTKN
|
||||
yLwlBw6LhFx2cCDlQg64SA4kJeVEstO8zWtrSn9pWmkX/OPyfMQQnrWm+Fy/3++n5/kpyl+A6xi6q8Gx
|
||||
w88sJFiZR3SWIyxG2FoPKuHmCpZmvndYW4BeE6LViGgvhbmJgJLXFwpLMdh65JwTh19Sm4kw54K14VtJ
|
||||
DHUgTNkwOSKPv8LiNKIs+U3EcAe4T2Gs3y8d6w8+/oArFzQW+L9UnYGo00NfU2jjD9jbRZj0iIpUqNL9
|
||||
cuxRwZwHWTFoumjudZFQkxmaBM81mHIgPw5fWwWcH74d15sSCcuzwSXceaHZwENhPO6iVHz27c8Bo1ac
|
||||
SRFox/uBJTw/wWAbGBI4SonFt7EqFW9L0lBbKtFurqVMYXcTLTsWZ2IYalc9aI9ySVGUnaQoNKdDzpiy
|
||||
oSaH4zamg3opF97RRrrh7EDOuXDC+AAc2OXwP3kBiiMDHFY5tmwAAAAASUVORK5CYII=
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMoveFirstItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAExSURBVDhPY2AYNKBw1vP/TQue/8+c+Pg/uhwMhLc/wCnH
|
||||
kDvz2f9VR97/x6UovvvB/+CGa1jlwCBjytP/C/d9wKoovufh/6X7///3r76AIQcHCT1P/k/b8h5DUUT7
|
||||
fbDmzFn//3uVnsBtQGTXo/+9qz+gKAptvQfW3Lru/3//zr//XfIP4DYgsPnh/7r57+CKglvu/l+09///
|
||||
jnX//2fM+fnfru7nf/uM7bgN8Ki6/z9/2hsURXbFt/+nz/n937/r23+dwnf/LRLW4zbAvvTu/+zJrzEU
|
||||
6aec/29S9OK/Stan/8aRy3AbYJF3539q/2usigySTvyXTfv6Xzd4HoYcHBhm3f4f1vISpyL91Mv/NXyn
|
||||
YZUDA520G//9qh/iVaTiMQGnHINT7pX/IAV4FQ1KAADwdsCrWJS2HgAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMovePreviousItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAC7SURBVDhPY2AYMiC8/cF/dDGiQXz3g//BDdfIMyC+5+H/
|
||||
pfv///evvkC6ARHt98GaM2f9/+9VeoI0A0Jb74E1t677/9+/8+9/l/wDxBsQ3HL3/6K9//93rPv/P2PO
|
||||
z/92dT//22dsJ94AELArvv0/fc7v//5d3/7rFL77b5GwnjQDQEA/5fx/k6IX/1WyPv03jlxGugEgYJB0
|
||||
4r9s2tf/usHzyDMABPRTL//X8J1GvgEgoOIxgTIDBi8AANAUYJgsLP+3AAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMoveNextItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACkSURBVDhPY2AYdKBw1vP/6GIkgdyZz/4ndN8j35CMKU//
|
||||
z9v/+39C1x3yDEnoefJ/9r5f/zu3/v3vVnqZdEMiux79n7Lt1/+SpX//J0z/+98m9yxphgQ2P/zfuvY9
|
||||
WLNxyZf/0tHX/htHLiPeEI+q+/9L5r6Da1Z06SFeMwjYl979H9jyjDzNIGCRd+e/TcEV8jSDgGHWbfI1
|
||||
g4BO2g3yNQ9NAACgfl+gY6ualwAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="bindingNavigatorMoveLastItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAErSURBVDhPY2AYVKBw1vP/6GIwAJJrWvD8f+bExzjVMOTO
|
||||
fPY/ofseVgUguVVH3v8Pb3+AVR4MMqY8/T9v/+//CV13MBSB5Bbu+/A/uOEahhwcJPQ8+T9736//nVv/
|
||||
/ncrvYyiECQ3bcv7//7VF3AbENn16P+Ubb/+lyz9+z9h+t//Nrln4YpBcr2rP/z3Kj2B24DA5of/W9e+
|
||||
B2s2LvnyXzr62n/jyGVgDSC5uvnv/rvkH8BtgEfV/f8lc9/BNSu69MAVg+Typ735b5+xHbcB9qV3/we2
|
||||
PMPQDJPLnvz6v0XCetwGWOTd+W9TcAVDM0wutf813EtYgWHWbayaQQAkF9by8r9u8Dys8mCgk3YDpyRI
|
||||
zq/64X8N32k41eAFTrlX/qt4TABjdLmBBQC+0b+zZl1WGAAAAABJRU5ErkJggg==
|
||||
</value>
|
||||
</data>
|
||||
<data name="btSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIFSURBVDhPpZLtS1NhGMbPPxJmmlYSgqHiKzGU1EDxg4iK
|
||||
YKyG2WBogqMYJQOtCEVRFBGdTBCJfRnkS4VaaWNT5sqx1BUxRXxDHYxAJLvkusEeBaPAB+5z4Jzn+t3X
|
||||
/aLhnEfjo8m+dCoa+7/C3O2Hqe0zDC+8KG+cRZHZhdzaaWTVTCLDMIY0vfM04Nfh77/G/sEhwpEDbO3t
|
||||
I7TxE8urEVy99fT/AL5gWDLrTB/hnF4XsW0khCu5ln8DmJliT2AXrcNBsU1gj/MH4nMeKwBrPktM28xM
|
||||
cX79DFKrHHD5d9D26hvicx4pABt2lpg10zYzU0zr7+e3xXGcrkEB2O2TNec9nJFwB3alZn5jZorfeDZh
|
||||
6Q3g8s06BeCoKF4MRURoH1+BY2oNCbeb0TIclIYxOhzf8frTOuo7FxCbbVIAzpni0iceEc8vhzEwGkJD
|
||||
lx83ymxifejdKjRNk/8PWnyIyTQqAJek0jqHwfEVscu31baIu8+90sTE4nY025dQ2/5FIPpnXlzKuK8A
|
||||
HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb
|
||||
1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC
|
||||
nOccAdABIDXXE1nzAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<data name="toolStripButton1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
|
||||
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAIFSURBVDhPpZLtS1NhGMbPPxJmmlYSgqHiKzGU1EDxg4iK
|
||||
YKyG2WBogqMYJQOtCEVRFBGdTBCJfRnkS4VaaWNT5sqx1BUxRXxDHYxAJLvkusEeBaPAB+5z4Jzn+t3X
|
||||
/aLhnEfjo8m+dCoa+7/C3O2Hqe0zDC+8KG+cRZHZhdzaaWTVTCLDMIY0vfM04Nfh77/G/sEhwpEDbO3t
|
||||
I7TxE8urEVy99fT/AL5gWDLrTB/hnF4XsW0khCu5ln8DmJliT2AXrcNBsU1gj/MH4nMeKwBrPktM28xM
|
||||
cX79DFKrHHD5d9D26hvicx4pABt2lpg10zYzU0zr7+e3xXGcrkEB2O2TNec9nJFwB3alZn5jZorfeDZh
|
||||
6Q3g8s06BeCoKF4MRURoH1+BY2oNCbeb0TIclIYxOhzf8frTOuo7FxCbbVIAzpni0iceEc8vhzEwGkJD
|
||||
lx83ymxifejdKjRNk/8PWnyIyTQqAJek0jqHwfEVscu31baIu8+90sTE4nY025dQ2/5FIPpnXlzKuK8A
|
||||
HBUzHot52djqQ6HZhfR7IwK4mKpHtvEDMqvfCiQ6zaAAXM8x94aIWTNrLLG4kVUzgaTSPlzLtyJOZxbb
|
||||
1wtfyg4Q+AfA3aZlButjSfxGcUJBk4g5tuP3haQKRKXcUQDOmbvNTpPOJeFFjordZmbWTNvMTHFUcpUC
|
||||
nOccAdABIDXXE1nzAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
</root>
|
||||
2
unimarc/unimarc/마크/AddMarc.Designer.cs
generated
2
unimarc/unimarc/마크/AddMarc.Designer.cs
generated
@@ -2321,7 +2321,7 @@ namespace UniMarc.마크
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "AddMarc";
|
||||
this.Text = "마크 작성";
|
||||
this.Text = "마크 작성(2)";
|
||||
this.Load += new System.EventHandler(this.AddMarc_Load);
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
|
||||
@@ -123,37 +123,38 @@
|
||||
iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAABGdBTUEAALGPC/xhBQAAAIFQTFRF////
|
||||
AAAAlJSU4ODgU1NT6enp+Pj4w8PDxMTEkpKS/Pz81tbW5eXlRERE3NzcmZmZzMzMZGRkTU1Nb29vg4OD
|
||||
urq6KioqW1tb8vLyf39/sbGxEhISPz8/i4uL0NDQZmZmIyMjoqKiNTU1tLS0GRkZp6end3d3Li4uOjo6
|
||||
Dg4OJSUlLUB5vgAABwxJREFUeF7tnX97ojAMx6ceIqDi/DXndJ47vZt7/y/wFOMUSKG0SWE8+fxz9zxl
|
||||
ZN8BaZq26ZMgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCELrWHnDsb8+7uNuvD+u/fHQW0GLOT34t276kb99
|
||||
nn51siynu60f9eEqA7Zb+E+d9P1g9AaKcN42gR/C1dUIOl34X12E43gDMsrYxGP4IX26nZoVRtt/8Ovr
|
||||
8bmtJvIssE6Fq/3n9feuxOao73wuAutTGD0nv7AJM80HmQisS6E/TaybMh3AfYq4CqxH4ULXuagp1wgC
|
||||
61A4MPn88kzf4X44N4HuFQ5/gWV7dh7cE+FboGuF/S3YpSFWhQF3gY4VTqp1f+V8RnDnNA8C3Sr8C0Yp
|
||||
wcLOR4EuFUYnsEnLMjd4SAl0qDAGi/SswQKQFuhMYWgewpTzF4wkZAS6Ujj8DfZ4+LzHqlmBjhROwBob
|
||||
p1uomhPoRuEajJUzms3jtT+JxtHEP3bnM/3w7hrF5QU6UbgHW8V8BAsvl60I+8M/2w+4opjF+XJEoAuF
|
||||
mNkMy3lhIB0uZhrf8RG3xK8wAEtKvrZ4YJJmMitO5ZzB3TW7wrIn+OLrJtJWa73XNQO3wpJvcFYtmzkY
|
||||
wc9VgFnhHzCDMysY/iiYVNbIq/AdrKC8VE8OXlhUHJ+wKvTACMZJJ9WCEpb6rhScCsN8kv6bV7MU9pVe
|
||||
lTwPp8IZ2MhzmMAlpmj0sTcYFard6LP9jNKktHe8wadwDBbyBHCFFStdp8qnUBlnGbuYDJo5ETaFr2Ag
|
||||
y5tOiKaHnk/lUqjqCQ9DuIACrUELk8JQEUIe7H3MI8Uh0xUmhQpvTixQK7vFo1ARzLxRvqJntHpFHoU7
|
||||
uHsGOieToNftsyhUuBkfmonQjGtYFOLTn8SmdAM3DoV47vAZWonQFciiEH2ExG5UWyCHQvwR2o4m0ugL
|
||||
5FD4ArdO8QqNNFQQyKCwB3dOcbIZ8OaoIpBBIRryU40nEioJpFfYhxuneIFGEqoJpFeIzsKYZdVwKgqk
|
||||
V4h1FTNoo6CqQHKFqJ+pnvhVUi2TeIFaITaeIXyElZ8gvUIsP0S30tpAILVCbGBI50hNBFIrPMJtHyEb
|
||||
NBkJpFaIRGxLi4X2KcwEUiuEuz5CtRvAUCCxQmxwT5S6MBVIrBD5DP9BkyXGAokVIp/hHJrsMBdIrBCZ
|
||||
qyAZVVSPZO6QKhzCTR+BJitsBNIqRBzNBppssHhFz5AqRBwNwVyhnUBahcjw/rLazA6rV/QMqULElVoP
|
||||
nGwF0sw430AGFrYhWzjuWUKZp10dQNadETS1BGToRJm/aABId0gT0TQGJEcTQ1NLQCYsMlshfjoLkPUA
|
||||
8aRo3SAKaWecagdJdxPP3NcNEpZSpvMbQPufYfu/w/b70vb3h+2Padofl7Z/bNH+8SHHGL9hcORpmgVL
|
||||
rq1R8ORLmwRTzrtBcM1bNAiuuafmwDZ/2BgQV7OEppbAOI/fFEDVI+5e02D6Kwc00YFs+idbT1PGCqnw
|
||||
k6rrQgLyITob52PbvOhDKt51bcVgiwYZ3h9sAa2bKrARWHuEeBdLAvP60gKQvpglTcS9RliJO8Pc67xV
|
||||
YKVbdtBGC/tafRx0QyBPTMy/3wIFqzd5gjZq0D0z3H0ikm7nS9Zig0TifU850BenQ7yt+g7mton3rmVB
|
||||
3xv6iO2Gi/2HaQZgIw1joOFiD+kjWMjN1VVccbIP+AH0s+DtodCHyJZYxAv3cj5CRffL1WWgHUWnQ1y+
|
||||
IYubmgoJir8md2ZBURfjRP+HRQPuM+yJBcXKZXKH6inKRfHProeKuuvEEhXvSmcK7ZwoPg/aAi69/JTs
|
||||
FSdZBQd1opTlsx2tj1DW+qLqNHy4Xw5X813qem00+wPUi/idzTuz1txb4aHaBYfTzuq6iW+2I42Jysdw
|
||||
j9MyLMEoglXty1Dlxs64Xd+i6q4unMwdjl9wBMHB8fIWVa+YYFiDdqz+As84X7JLXkfYQxMW39Qwp05b
|
||||
C7qndl4JtazeKds9qF/PO/QL388zR7jSMaXb677mOoFcNC+tAb2HS52jsQe0pK7+02Be0PHcqOkJXtAq
|
||||
M9r5xM5GeOp7i0Cv8nOtC64rnW/RPSbnW7z763g+0y0WXPua+cJ+kYTa17R4BcXLCfjgSzdrEyrSbyQ0
|
||||
ZDU533lPNTrRNJF6xGPD7ybtHiuOKc1wOhwsh/zsvI/GbR0jPv8w4J1aNmNYFj7r88I8+2LMwP6c1Quj
|
||||
Ju9tJDhLdtT0jRy+fsCJMao5CtXC5kznn7Kw2tubvKyb+EdtpYo0z8W7sdRKBzSLcBzrfpIf8biJ3Z8O
|
||||
fT8YFR/9c9gE2gmrptKP/O3zNJ+N+Zrutovop6u7s/KG48H6uI+78X6/9qOh14ChrSAIgiAIgiAIgiAI
|
||||
giAIgiAIgiAIgiAIAilPT/8BzuZT5uV+S2QAAAAASUVORK5CYII=
|
||||
Dg4OJSUlLUB5vgAABzdJREFUeF7tne12ojAQhosuIqBiRa212q7dult7/xe4R6wKwwRCMhMoZ56fPSnj
|
||||
K8l8BeLDgyAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIQt/Y+JNZsD0ekkFyOG6D2cTfwCGNGcI/tMQoDvaP
|
||||
iy8Psl687YN4BIfrs9/Dv7TAKAinL1BagZddGETw37QIvQH8k2OiWbKDehTskhn871oGXssK4/0/qKOS
|
||||
z30zkQOvVYWbwydUoMHuqO98zgLbUxg/ws+uTap5IzOBbSkMFvBjN2IxhhdEuAhsR+FK17moqdf4LbAN
|
||||
hWOT5Vdm8QovXOAq0L3Cya/iB7XgzYcXv3MT6FrhaF/4jLYkqjTgLtCxwnmz8FfPZwxNZOQEulX4N2eY
|
||||
CiztzAt0qTA+5Q2TsS4VDwWBDhUmBbuUbIuGigKdKYzMU5h6/uYtAYGuFE5+A7u0fN5zVSjQkcI5NEvN
|
||||
6ZqqlgS6UbiFVpVM02WyDebxLJ4Hx8Ey1U/vLllcWaAThQdoFOU9XPmlbkU0mvzZv8OhKCtcoAuFmFnA
|
||||
elmZSEerVGMdH3FL/ApDaBLytccTkyLztLqV43ke7q7ZFaLfa46noDQ1FWy2etMVwK2wZg2mpYSkkvEU
|
||||
XqAeZoV/oL0CaUX5o2DeWCOvwldoLs+TZrsFsGpYn7Aq9KG1HKdK71lFVOu7CnAqjMpN+hvPqtpVh6F+
|
||||
IsCrMIXGbnzM4diG1HnoHIwK1W70Ub+pq2JeGx2v8CmcQVM3QjjUhI2uU+VTqMyzjF0MQLMnwqbwGVr6
|
||||
5kUnRdNDz6dyKVRFwo8JHGmBeqXnYFIYKVLID3sfk6c6ZbrApFDhzYkFanW3eBQqkpkXyimq/h6L8Ch8
|
||||
g2Yu0DmZDC2BPAoVbiaA4+zQE8ijEN/+JDalKZDabAbeO3yEw+zQFciiEL2FxG5UWyCHQvwW2lYTRfQF
|
||||
cih8gjbOPMNRVjQQyKBwCE2cOdkUvCWaCGRQiKb8VPVERiOB9ApH0MKZJzjKhmYC6RWiuzBmXTWchgLp
|
||||
FWKhIoWDLGgqkFwh6meaN36V6FW9eagVYvUM4S1sfAfpFWL9oWZ7E1UYCKRWiBWGdI7URCC1wiO8PmXR
|
||||
ZCSQWiGSsa119wfrMBNIrRBeXvFYlgmGAokVYsU9UevCVCCxQmQZ/oNjzDAWSKwQWYZLOMYIc4HECpG9
|
||||
CpKqonkmc4dU4QRe3fM8OMYEG4G0ChFHs4NjDLCYotQKEUdDsFdoJ5BWIVLen582s8NqilIrRFypdeFk
|
||||
K5BiFt1BCgvblC2aDS2h7NNuPqA+bwrH/GyQ0omw+O0CSDikyWg6A9KjSeCYnw2yYQFehfjprKA+wvq+
|
||||
GyAKaXecWgdpdxOVv10BSUsp2/kdoP/3sP/rEFHYM1/a/3jY/5ym/3lp/2uL/teHHDV+x+Do03QLll5b
|
||||
p0ASU9JOV/sw9bw7BBIQSfYtOgTX3lN3QJxpz7IaxNWs4ZifDeJq+lYEQ3lOp2m4+FUCjrEGeemf7Hma
|
||||
OjbICT+Fc11IQBaiszofe82LPqVCCijC59qqQfJ+jsQfe4CW7tnEKmJolv4tlgzm50srQGIxS5sI6dW4
|
||||
KaHcGcamqYubiHhx7w0OIgFpfLto7mO5BlNOzP++BQp23uQJDiICKfT5YyLSbudr1mJFIvF7TyXQieNR
|
||||
PmdSAHPbxO+uQdB5Q5+xXUG2L5h3ocbQWAZjooEFDOp3SPNgKTdXqLiA30SODOoCuix4IxR6E9kai/jB
|
||||
vZy3UBF+uUIGGig8j/j4BoibMxUyFN8md2cBKxPPUZH+i0UTbp7CsIjiyWVyh+orjoviKJuKRIpz14kl
|
||||
KuaKt4ADGVAsD9oDXIblLdkLjMH+joNzopTHZ3Ol3ABkD+MCVdAI4IWvuNrvUp/XRvN+gPohfpbeBYb6
|
||||
JC6CM/c2eKp2hr5HqkR9buKLbaUxV/kY7joNsIbW71idfRmp3Jjz51tU4erMydzhBCofeg647MlMEVVU
|
||||
zDA8g3amXoHcNRMGtltyx+AcYR9tWNzg6R9WonaoGQ3Pgh6qnVeGQzd6R5GD39A/zzsKKudndip7K6gj
|
||||
8zdfS51ELl7WngF9gP/jirq7WH+u/sN4WRF4rrR0B8/UrMVvPrHfRngY+atQ7+Rn/pKwAnS3BmWaLgfH
|
||||
7PctXoNtskyxfV0c8/BKQmVcJEFnKbPiVxxeTsC7fSpvTaRov5HgYgdWA2yHn4YWnWiRWF3x2PDbeSpa
|
||||
QXVOaYbTcrAe8t/Oe7ctpckh/v3D0KaO5mJSlz7r80TZe6VkrJeF1THt3ATNQfBbstNWSsEGBPoJJ8a0
|
||||
5SxUC5vfdG49CdXEP5hM1l3SvLnTIrHm7+JdWWu1A7pFNEt0l+R7Muti+NNhFIRTxV7uNx+7ULth1VVG
|
||||
cbB/XJS7MV+Lt/0q/unq7mz8yWy8PR6SQXI4bIN44negtBUEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQSDm
|
||||
P87mU+ZvyRQDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="text505n.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace UniMarc.마크
|
||||
|
||||
String_Text st = new String_Text();
|
||||
|
||||
string ViewMarc = st.ConvertMarcType(SelectMarc);
|
||||
string ViewMarc = st.ConvertMarcType(SelectMarc,out string errmesage);
|
||||
List<string> Tmp = new List<string>(ViewMarc.Split('\n'));
|
||||
for (int a = 0; a < Tmp.Count; a++)
|
||||
{
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace UniMarc.마크
|
||||
else
|
||||
return;
|
||||
|
||||
richTextBox1.Text = st.ConvertMarcType(dataGridView1.Rows[row].Cells["Marc"].Value.ToString());
|
||||
richTextBox1.Text = st.ConvertMarcType(dataGridView1.Rows[row].Cells["Marc"].Value.ToString(),out string errmesage);
|
||||
}
|
||||
|
||||
private void Btn_Excel_Click(object sender, EventArgs e)
|
||||
|
||||
149
unimarc/unimarc/마크/Check_Copy_Sub_Selector.Designer.cs
generated
Normal file
149
unimarc/unimarc/마크/Check_Copy_Sub_Selector.Designer.cs
generated
Normal file
@@ -0,0 +1,149 @@
|
||||
|
||||
namespace UniMarc.마크
|
||||
{
|
||||
partial class Check_Copy_Sub_Selector
|
||||
{
|
||||
/// <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.dv1 = new System.Windows.Forms.DataGridView();
|
||||
this.lib_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.tbSearch = new System.Windows.Forms.TextBox();
|
||||
this.btFind = new System.Windows.Forms.Button();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// dv1
|
||||
//
|
||||
this.dv1.AllowUserToAddRows = false;
|
||||
this.dv1.AllowUserToDeleteRows = false;
|
||||
this.dv1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.AllCells;
|
||||
this.dv1.BackgroundColor = System.Drawing.SystemColors.Control;
|
||||
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.dv1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.dv1.ColumnHeadersHeight = 35;
|
||||
this.dv1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.DisableResizing;
|
||||
this.dv1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.lib_name});
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
|
||||
dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.ControlText;
|
||||
dataGridViewCellStyle2.Padding = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
|
||||
this.dv1.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.dv1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dv1.Location = new System.Drawing.Point(0, 0);
|
||||
this.dv1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.dv1.Name = "dv1";
|
||||
this.dv1.ReadOnly = true;
|
||||
this.dv1.RowHeadersWidth = 51;
|
||||
this.dv1.RowTemplate.Height = 23;
|
||||
this.dv1.Size = new System.Drawing.Size(631, 823);
|
||||
this.dv1.TabIndex = 0;
|
||||
this.dv1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
|
||||
this.dv1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
this.dv1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
|
||||
//
|
||||
// lib_name
|
||||
//
|
||||
this.lib_name.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
|
||||
this.lib_name.HeaderText = "도서관명";
|
||||
this.lib_name.MinimumWidth = 6;
|
||||
this.lib_name.Name = "lib_name";
|
||||
this.lib_name.ReadOnly = true;
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.tbSearch);
|
||||
this.panel1.Controls.Add(this.btFind);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Bottom;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 823);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Padding = new System.Windows.Forms.Padding(3);
|
||||
this.panel1.Size = new System.Drawing.Size(631, 45);
|
||||
this.panel1.TabIndex = 1;
|
||||
//
|
||||
// tbSearch
|
||||
//
|
||||
this.tbSearch.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.tbSearch.Font = new System.Drawing.Font("굴림", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.tbSearch.Location = new System.Drawing.Point(3, 3);
|
||||
this.tbSearch.Name = "tbSearch";
|
||||
this.tbSearch.Size = new System.Drawing.Size(498, 38);
|
||||
this.tbSearch.TabIndex = 0;
|
||||
this.tbSearch.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// btFind
|
||||
//
|
||||
this.btFind.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btFind.Location = new System.Drawing.Point(501, 3);
|
||||
this.btFind.Name = "btFind";
|
||||
this.btFind.Size = new System.Drawing.Size(127, 39);
|
||||
this.btFind.TabIndex = 1;
|
||||
this.btFind.Text = "검색";
|
||||
this.btFind.UseVisualStyleBackColor = true;
|
||||
this.btFind.Click += new System.EventHandler(this.btFind_Click);
|
||||
//
|
||||
// Check_Copy_Sub_Selector
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(631, 868);
|
||||
this.Controls.Add(this.dv1);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.Name = "Check_Copy_Sub_Selector";
|
||||
this.Text = "도서관 검색";
|
||||
this.Load += new System.EventHandler(this.Check_Copy_Sub_Selector_Load);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).EndInit();
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.DataGridView dv1;
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Button btFind;
|
||||
private System.Windows.Forms.TextBox tbSearch;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn lib_name;
|
||||
}
|
||||
}
|
||||
109
unimarc/unimarc/마크/Check_Copy_Sub_Selector.cs
Normal file
109
unimarc/unimarc/마크/Check_Copy_Sub_Selector.cs
Normal file
@@ -0,0 +1,109 @@
|
||||
using AR;
|
||||
using Org.BouncyCastle.Utilities;
|
||||
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 System.Windows.Forms.VisualStyles;
|
||||
using WindowsFormsApp1;
|
||||
using WindowsFormsApp1.Mac;
|
||||
|
||||
namespace UniMarc.마크
|
||||
{
|
||||
public partial class Check_Copy_Sub_Selector : Form
|
||||
{
|
||||
string[] Items;
|
||||
public string SelectedValue = string.Empty;
|
||||
public Check_Copy_Sub_Selector(string[] arrays, string search)
|
||||
{
|
||||
InitializeComponent();
|
||||
this.KeyPreview = true;
|
||||
tbSearch.Text = search;
|
||||
this.Items = arrays;
|
||||
this.KeyDown += (s1, e1) => {
|
||||
if (e1.KeyCode == Keys.Escape) this.Close();
|
||||
};
|
||||
this.tbSearch.ImeMode = ImeMode.Hangul;
|
||||
this.tbSearch.KeyDown += (s1, e1) => {
|
||||
if (e1.KeyCode == Keys.Enter) btFind.PerformClick();
|
||||
};
|
||||
}
|
||||
|
||||
private void dataGridView1_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
|
||||
{
|
||||
Skill_Grid sg = new Skill_Grid();
|
||||
sg.Print_Grid_Num(sender, e);
|
||||
}
|
||||
|
||||
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.RowIndex < 0) return;
|
||||
int row = e.RowIndex;
|
||||
|
||||
SetCode(e.RowIndex);
|
||||
this.Close();
|
||||
}
|
||||
|
||||
void SetCode(int rowindex)
|
||||
{
|
||||
var drow = dv1.Rows[rowindex];
|
||||
var title = drow.Cells[0].Value?.ToString() ?? string.Empty;
|
||||
this.SelectedValue = title;
|
||||
}
|
||||
|
||||
private void dataGridView1_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
if (dv1.Rows.Count <= 0) return;
|
||||
SetCode(dv1.CurrentRow.Index);
|
||||
this.Close();
|
||||
}
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
SelectedValue = string.Empty;
|
||||
this.Close();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void btFind_Click(object sender, EventArgs e)
|
||||
{
|
||||
var search = tbSearch.Text.Trim();
|
||||
this.dv1.Rows.Clear();
|
||||
foreach (var item in this.Items)
|
||||
{
|
||||
if (search.isEmpty() || item.ToLower().Contains(search.ToLower()))
|
||||
this.dv1.Rows.Add(item);
|
||||
}
|
||||
if (search.isEmpty() == true)
|
||||
{
|
||||
tbSearch.Focus();
|
||||
tbSearch.SelectAll();
|
||||
}
|
||||
else if (dv1.Rows.Count > 0)
|
||||
{
|
||||
dv1.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
tbSearch.Focus();
|
||||
tbSearch.SelectAll();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Check_Copy_Sub_Selector_Load(object sender, EventArgs e)
|
||||
{
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
this.btFind.PerformClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -117,10 +117,7 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="file_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="update_status.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="lib_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
</root>
|
||||
247
unimarc/unimarc/마크/Check_copyWD.Designer.cs
generated
247
unimarc/unimarc/마크/Check_copyWD.Designer.cs
generated
@@ -28,8 +28,11 @@
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.components = new System.ComponentModel.Container();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.nudAddDelay = new System.Windows.Forms.NumericUpDown();
|
||||
this.chkShowBrowser = new System.Windows.Forms.CheckBox();
|
||||
this.chkRetryErrData = new System.Windows.Forms.CheckBox();
|
||||
this.groupBox1 = new System.Windows.Forms.GroupBox();
|
||||
@@ -44,7 +47,7 @@
|
||||
this.btn_Stop = new System.Windows.Forms.Button();
|
||||
this.btn_Close = new System.Windows.Forms.Button();
|
||||
this.tb_SearchTarget = new System.Windows.Forms.ComboBox();
|
||||
this.btSearchLibrary = new System.Windows.Forms.Label();
|
||||
this.btSearchLibrary = new System.Windows.Forms.Button();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.btn_SiteDenote = new System.Windows.Forms.Button();
|
||||
this.lbl_PW = new System.Windows.Forms.Label();
|
||||
@@ -54,6 +57,10 @@
|
||||
this.book_comp = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.Count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_resulthtml = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
|
||||
this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.일반문자로붙여넣기ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.btn_ApplyFilter = new System.Windows.Forms.Button();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
@@ -67,9 +74,11 @@
|
||||
this.btn_OpenMemo = new System.Windows.Forms.Button();
|
||||
this.chk_spChar = new System.Windows.Forms.CheckBox();
|
||||
this.panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudAddDelay)).BeginInit();
|
||||
this.groupBox1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).BeginInit();
|
||||
this.contextMenuStrip1.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
this.panel6.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
@@ -79,6 +88,8 @@
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.nudAddDelay);
|
||||
this.panel1.Controls.Add(this.chkShowBrowser);
|
||||
this.panel1.Controls.Add(this.chkRetryErrData);
|
||||
this.panel1.Controls.Add(this.groupBox1);
|
||||
@@ -88,19 +99,39 @@
|
||||
this.panel1.Controls.Add(this.btn_Start);
|
||||
this.panel1.Controls.Add(this.btn_Stop);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 34);
|
||||
this.panel1.Location = new System.Drawing.Point(0, 42);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(637, 106);
|
||||
this.panel1.Size = new System.Drawing.Size(822, 132);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(639, 104);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(67, 15);
|
||||
this.label1.TabIndex = 10;
|
||||
this.label1.Text = "추가지연";
|
||||
//
|
||||
// nudAddDelay
|
||||
//
|
||||
this.nudAddDelay.Location = new System.Drawing.Point(706, 99);
|
||||
this.nudAddDelay.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.nudAddDelay.Name = "nudAddDelay";
|
||||
this.nudAddDelay.Size = new System.Drawing.Size(64, 25);
|
||||
this.nudAddDelay.TabIndex = 9;
|
||||
this.nudAddDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// chkShowBrowser
|
||||
//
|
||||
this.chkShowBrowser.AutoSize = true;
|
||||
this.chkShowBrowser.Checked = true;
|
||||
this.chkShowBrowser.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkShowBrowser.Location = new System.Drawing.Point(515, 81);
|
||||
this.chkShowBrowser.Location = new System.Drawing.Point(706, 62);
|
||||
this.chkShowBrowser.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.chkShowBrowser.Name = "chkShowBrowser";
|
||||
this.chkShowBrowser.Size = new System.Drawing.Size(96, 16);
|
||||
this.chkShowBrowser.Size = new System.Drawing.Size(119, 19);
|
||||
this.chkShowBrowser.TabIndex = 8;
|
||||
this.chkShowBrowser.Text = "브라우저표시";
|
||||
this.chkShowBrowser.UseVisualStyleBackColor = true;
|
||||
@@ -110,9 +141,10 @@
|
||||
this.chkRetryErrData.AutoSize = true;
|
||||
this.chkRetryErrData.Checked = true;
|
||||
this.chkRetryErrData.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkRetryErrData.Location = new System.Drawing.Point(319, 81);
|
||||
this.chkRetryErrData.Location = new System.Drawing.Point(365, 101);
|
||||
this.chkRetryErrData.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.chkRetryErrData.Name = "chkRetryErrData";
|
||||
this.chkRetryErrData.Size = new System.Drawing.Size(188, 16);
|
||||
this.chkRetryErrData.Size = new System.Drawing.Size(234, 19);
|
||||
this.chkRetryErrData.TabIndex = 7;
|
||||
this.chkRetryErrData.Text = "검색 후 오류 데이터 추가 검색";
|
||||
this.chkRetryErrData.UseVisualStyleBackColor = true;
|
||||
@@ -123,9 +155,11 @@
|
||||
this.groupBox1.Controls.Add(this.radTargetEmpty);
|
||||
this.groupBox1.Controls.Add(this.radTargetErrEmpty);
|
||||
this.groupBox1.Controls.Add(this.radTargetAll);
|
||||
this.groupBox1.Location = new System.Drawing.Point(318, 34);
|
||||
this.groupBox1.Location = new System.Drawing.Point(363, 42);
|
||||
this.groupBox1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.groupBox1.Name = "groupBox1";
|
||||
this.groupBox1.Size = new System.Drawing.Size(304, 39);
|
||||
this.groupBox1.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.groupBox1.Size = new System.Drawing.Size(336, 49);
|
||||
this.groupBox1.TabIndex = 6;
|
||||
this.groupBox1.TabStop = false;
|
||||
this.groupBox1.Text = "검색대상";
|
||||
@@ -133,9 +167,10 @@
|
||||
// radTargetErr
|
||||
//
|
||||
this.radTargetErr.AutoSize = true;
|
||||
this.radTargetErr.Location = new System.Drawing.Point(197, 16);
|
||||
this.radTargetErr.Location = new System.Drawing.Point(273, 20);
|
||||
this.radTargetErr.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.radTargetErr.Name = "radTargetErr";
|
||||
this.radTargetErr.Size = new System.Drawing.Size(47, 16);
|
||||
this.radTargetErr.Size = new System.Drawing.Size(58, 19);
|
||||
this.radTargetErr.TabIndex = 9;
|
||||
this.radTargetErr.Text = "오류";
|
||||
this.radTargetErr.UseVisualStyleBackColor = true;
|
||||
@@ -143,9 +178,10 @@
|
||||
// radTargetEmpty
|
||||
//
|
||||
this.radTargetEmpty.AutoSize = true;
|
||||
this.radTargetEmpty.Location = new System.Drawing.Point(144, 16);
|
||||
this.radTargetEmpty.Location = new System.Drawing.Point(197, 20);
|
||||
this.radTargetEmpty.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.radTargetEmpty.Name = "radTargetEmpty";
|
||||
this.radTargetEmpty.Size = new System.Drawing.Size(47, 16);
|
||||
this.radTargetEmpty.Size = new System.Drawing.Size(58, 19);
|
||||
this.radTargetEmpty.TabIndex = 8;
|
||||
this.radTargetEmpty.Text = "없음";
|
||||
this.radTargetEmpty.UseVisualStyleBackColor = true;
|
||||
@@ -153,9 +189,10 @@
|
||||
// radTargetErrEmpty
|
||||
//
|
||||
this.radTargetErrEmpty.AutoSize = true;
|
||||
this.radTargetErrEmpty.Location = new System.Drawing.Point(61, 17);
|
||||
this.radTargetErrEmpty.Location = new System.Drawing.Point(86, 20);
|
||||
this.radTargetErrEmpty.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.radTargetErrEmpty.Name = "radTargetErrEmpty";
|
||||
this.radTargetErrEmpty.Size = new System.Drawing.Size(77, 16);
|
||||
this.radTargetErrEmpty.Size = new System.Drawing.Size(96, 19);
|
||||
this.radTargetErrEmpty.TabIndex = 7;
|
||||
this.radTargetErrEmpty.Text = "오류+없음";
|
||||
this.radTargetErrEmpty.UseVisualStyleBackColor = true;
|
||||
@@ -164,9 +201,10 @@
|
||||
//
|
||||
this.radTargetAll.AutoSize = true;
|
||||
this.radTargetAll.Checked = true;
|
||||
this.radTargetAll.Location = new System.Drawing.Point(8, 16);
|
||||
this.radTargetAll.Location = new System.Drawing.Point(9, 20);
|
||||
this.radTargetAll.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.radTargetAll.Name = "radTargetAll";
|
||||
this.radTargetAll.Size = new System.Drawing.Size(47, 16);
|
||||
this.radTargetAll.Size = new System.Drawing.Size(58, 19);
|
||||
this.radTargetAll.TabIndex = 6;
|
||||
this.radTargetAll.TabStop = true;
|
||||
this.radTargetAll.Text = "전체";
|
||||
@@ -175,9 +213,10 @@
|
||||
// rb_isNumber
|
||||
//
|
||||
this.rb_isNumber.AutoSize = true;
|
||||
this.rb_isNumber.Location = new System.Drawing.Point(394, 8);
|
||||
this.rb_isNumber.Location = new System.Drawing.Point(450, 10);
|
||||
this.rb_isNumber.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.rb_isNumber.Name = "rb_isNumber";
|
||||
this.rb_isNumber.Size = new System.Drawing.Size(71, 16);
|
||||
this.rb_isNumber.Size = new System.Drawing.Size(88, 19);
|
||||
this.rb_isNumber.TabIndex = 5;
|
||||
this.rb_isNumber.TabStop = true;
|
||||
this.rb_isNumber.Text = "숫자표출";
|
||||
@@ -187,9 +226,10 @@
|
||||
//
|
||||
this.rb_isHave.AutoSize = true;
|
||||
this.rb_isHave.Checked = true;
|
||||
this.rb_isHave.Location = new System.Drawing.Point(318, 8);
|
||||
this.rb_isHave.Location = new System.Drawing.Point(363, 10);
|
||||
this.rb_isHave.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.rb_isHave.Name = "rb_isHave";
|
||||
this.rb_isHave.Size = new System.Drawing.Size(71, 16);
|
||||
this.rb_isHave.Size = new System.Drawing.Size(88, 19);
|
||||
this.rb_isHave.TabIndex = 5;
|
||||
this.rb_isHave.TabStop = true;
|
||||
this.rb_isHave.Text = "소장표출";
|
||||
@@ -197,9 +237,10 @@
|
||||
//
|
||||
// btn_SearchList
|
||||
//
|
||||
this.btn_SearchList.Location = new System.Drawing.Point(4, 4);
|
||||
this.btn_SearchList.Location = new System.Drawing.Point(5, 5);
|
||||
this.btn_SearchList.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_SearchList.Name = "btn_SearchList";
|
||||
this.btn_SearchList.Size = new System.Drawing.Size(305, 93);
|
||||
this.btn_SearchList.Size = new System.Drawing.Size(349, 116);
|
||||
this.btn_SearchList.TabIndex = 3;
|
||||
this.btn_SearchList.Text = "목록 검색";
|
||||
this.btn_SearchList.UseVisualStyleBackColor = true;
|
||||
@@ -207,9 +248,10 @@
|
||||
//
|
||||
// btn_Start
|
||||
//
|
||||
this.btn_Start.Location = new System.Drawing.Point(470, 4);
|
||||
this.btn_Start.Location = new System.Drawing.Point(537, 5);
|
||||
this.btn_Start.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_Start.Name = "btn_Start";
|
||||
this.btn_Start.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_Start.Size = new System.Drawing.Size(175, 30);
|
||||
this.btn_Start.TabIndex = 2;
|
||||
this.btn_Start.Text = "검색시작";
|
||||
this.btn_Start.UseVisualStyleBackColor = true;
|
||||
@@ -217,9 +259,10 @@
|
||||
//
|
||||
// btn_Stop
|
||||
//
|
||||
this.btn_Stop.Location = new System.Drawing.Point(548, 4);
|
||||
this.btn_Stop.Location = new System.Drawing.Point(721, 5);
|
||||
this.btn_Stop.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_Stop.Name = "btn_Stop";
|
||||
this.btn_Stop.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_Stop.Size = new System.Drawing.Size(86, 30);
|
||||
this.btn_Stop.TabIndex = 2;
|
||||
this.btn_Stop.Text = "검색중지";
|
||||
this.btn_Stop.UseVisualStyleBackColor = true;
|
||||
@@ -227,9 +270,10 @@
|
||||
//
|
||||
// btn_Close
|
||||
//
|
||||
this.btn_Close.Location = new System.Drawing.Point(548, 4);
|
||||
this.btn_Close.Location = new System.Drawing.Point(721, 5);
|
||||
this.btn_Close.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_Close.Name = "btn_Close";
|
||||
this.btn_Close.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_Close.Size = new System.Drawing.Size(86, 30);
|
||||
this.btn_Close.TabIndex = 2;
|
||||
this.btn_Close.Text = "닫 기";
|
||||
this.btn_Close.UseVisualStyleBackColor = true;
|
||||
@@ -237,13 +281,14 @@
|
||||
//
|
||||
// tb_SearchTarget
|
||||
//
|
||||
this.tb_SearchTarget.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.SuggestAppend;
|
||||
this.tb_SearchTarget.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
|
||||
this.tb_SearchTarget.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.ListItems;
|
||||
this.tb_SearchTarget.Enabled = false;
|
||||
this.tb_SearchTarget.ImeMode = System.Windows.Forms.ImeMode.Hangul;
|
||||
this.tb_SearchTarget.Location = new System.Drawing.Point(66, 6);
|
||||
this.tb_SearchTarget.Location = new System.Drawing.Point(91, 8);
|
||||
this.tb_SearchTarget.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tb_SearchTarget.Name = "tb_SearchTarget";
|
||||
this.tb_SearchTarget.Size = new System.Drawing.Size(390, 20);
|
||||
this.tb_SearchTarget.Size = new System.Drawing.Size(429, 23);
|
||||
this.tb_SearchTarget.TabIndex = 1;
|
||||
this.tb_SearchTarget.SelectedIndexChanged += new System.EventHandler(this.tb_SearchTarget_SelectedIndexChanged);
|
||||
this.tb_SearchTarget.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_SearchTarget_KeyDown);
|
||||
@@ -251,9 +296,9 @@
|
||||
// btSearchLibrary
|
||||
//
|
||||
this.btSearchLibrary.AutoSize = true;
|
||||
this.btSearchLibrary.Location = new System.Drawing.Point(7, 10);
|
||||
this.btSearchLibrary.Location = new System.Drawing.Point(8, 7);
|
||||
this.btSearchLibrary.Name = "btSearchLibrary";
|
||||
this.btSearchLibrary.Size = new System.Drawing.Size(53, 12);
|
||||
this.btSearchLibrary.Size = new System.Drawing.Size(77, 25);
|
||||
this.btSearchLibrary.TabIndex = 0;
|
||||
this.btSearchLibrary.Text = "검색대상";
|
||||
this.btSearchLibrary.Click += new System.EventHandler(this.btSearchLibrary_Click);
|
||||
@@ -269,15 +314,17 @@
|
||||
this.panel2.Controls.Add(this.btn_Close);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(637, 34);
|
||||
this.panel2.Size = new System.Drawing.Size(822, 42);
|
||||
this.panel2.TabIndex = 0;
|
||||
//
|
||||
// btn_SiteDenote
|
||||
//
|
||||
this.btn_SiteDenote.Location = new System.Drawing.Point(462, 5);
|
||||
this.btn_SiteDenote.Location = new System.Drawing.Point(537, 6);
|
||||
this.btn_SiteDenote.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_SiteDenote.Name = "btn_SiteDenote";
|
||||
this.btn_SiteDenote.Size = new System.Drawing.Size(77, 23);
|
||||
this.btn_SiteDenote.Size = new System.Drawing.Size(177, 29);
|
||||
this.btn_SiteDenote.TabIndex = 4;
|
||||
this.btn_SiteDenote.Text = "사이트 표출";
|
||||
this.btn_SiteDenote.UseVisualStyleBackColor = true;
|
||||
@@ -286,18 +333,18 @@
|
||||
// lbl_PW
|
||||
//
|
||||
this.lbl_PW.AutoSize = true;
|
||||
this.lbl_PW.Location = new System.Drawing.Point(379, 10);
|
||||
this.lbl_PW.Location = new System.Drawing.Point(433, 12);
|
||||
this.lbl_PW.Name = "lbl_PW";
|
||||
this.lbl_PW.Size = new System.Drawing.Size(9, 12);
|
||||
this.lbl_PW.Size = new System.Drawing.Size(12, 15);
|
||||
this.lbl_PW.TabIndex = 3;
|
||||
this.lbl_PW.Text = " ";
|
||||
//
|
||||
// lbl_ID
|
||||
//
|
||||
this.lbl_ID.AutoSize = true;
|
||||
this.lbl_ID.Location = new System.Drawing.Point(316, 10);
|
||||
this.lbl_ID.Location = new System.Drawing.Point(361, 12);
|
||||
this.lbl_ID.Name = "lbl_ID";
|
||||
this.lbl_ID.Size = new System.Drawing.Size(9, 12);
|
||||
this.lbl_ID.Size = new System.Drawing.Size(12, 15);
|
||||
this.lbl_ID.TabIndex = 3;
|
||||
this.lbl_ID.Text = " ";
|
||||
//
|
||||
@@ -320,12 +367,16 @@
|
||||
this.book_name,
|
||||
this.book_comp,
|
||||
this.Count,
|
||||
this.dvc_remark});
|
||||
this.dvc_remark,
|
||||
this.dvc_resulthtml});
|
||||
this.dv1.ContextMenuStrip = this.contextMenuStrip1;
|
||||
this.dv1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dv1.Location = new System.Drawing.Point(0, 0);
|
||||
this.dv1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.dv1.Name = "dv1";
|
||||
this.dv1.RowHeadersWidth = 51;
|
||||
this.dv1.RowTemplate.Height = 23;
|
||||
this.dv1.Size = new System.Drawing.Size(637, 542);
|
||||
this.dv1.Size = new System.Drawing.Size(822, 680);
|
||||
this.dv1.TabIndex = 1;
|
||||
this.dv1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
this.dv1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
|
||||
@@ -333,6 +384,7 @@
|
||||
// book_name
|
||||
//
|
||||
this.book_name.HeaderText = "도서명(총서명)";
|
||||
this.book_name.MinimumWidth = 6;
|
||||
this.book_name.Name = "book_name";
|
||||
this.book_name.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.book_name.Width = 300;
|
||||
@@ -340,6 +392,7 @@
|
||||
// book_comp
|
||||
//
|
||||
this.book_comp.HeaderText = "출판사";
|
||||
this.book_comp.MinimumWidth = 6;
|
||||
this.book_comp.Name = "book_comp";
|
||||
this.book_comp.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.book_comp.Width = 120;
|
||||
@@ -347,6 +400,7 @@
|
||||
// Count
|
||||
//
|
||||
this.Count.HeaderText = "검색 수";
|
||||
this.Count.MinimumWidth = 6;
|
||||
this.Count.Name = "Count";
|
||||
this.Count.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
this.Count.Width = 50;
|
||||
@@ -354,14 +408,46 @@
|
||||
// dvc_remark
|
||||
//
|
||||
this.dvc_remark.HeaderText = "비고";
|
||||
this.dvc_remark.MinimumWidth = 6;
|
||||
this.dvc_remark.Name = "dvc_remark";
|
||||
this.dvc_remark.Width = 110;
|
||||
//
|
||||
// dvc_resulthtml
|
||||
//
|
||||
this.dvc_resulthtml.HeaderText = "결과";
|
||||
this.dvc_resulthtml.MinimumWidth = 6;
|
||||
this.dvc_resulthtml.Name = "dvc_resulthtml";
|
||||
this.dvc_resulthtml.Width = 125;
|
||||
//
|
||||
// contextMenuStrip1
|
||||
//
|
||||
this.contextMenuStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem,
|
||||
this.일반문자로붙여넣기ToolStripMenuItem});
|
||||
this.contextMenuStrip1.Name = "contextMenuStrip1";
|
||||
this.contextMenuStrip1.Size = new System.Drawing.Size(254, 52);
|
||||
//
|
||||
// 유니코드문자로붙여넝ㅎ기ToolStripMenuItem
|
||||
//
|
||||
this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem.Name = "유니코드문자로붙여넝ㅎ기ToolStripMenuItem";
|
||||
this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem.Size = new System.Drawing.Size(253, 24);
|
||||
this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem.Text = "유니코드 문자로 붙여넣기";
|
||||
this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem.Click += new System.EventHandler(this.유니코드문자로붙여넝ㅎ기ToolStripMenuItem_Click);
|
||||
//
|
||||
// 일반문자로붙여넣기ToolStripMenuItem
|
||||
//
|
||||
this.일반문자로붙여넣기ToolStripMenuItem.Name = "일반문자로붙여넣기ToolStripMenuItem";
|
||||
this.일반문자로붙여넣기ToolStripMenuItem.Size = new System.Drawing.Size(253, 24);
|
||||
this.일반문자로붙여넣기ToolStripMenuItem.Text = "일반 문자로 붙여넣기";
|
||||
this.일반문자로붙여넣기ToolStripMenuItem.Click += new System.EventHandler(this.일반문자로붙여넣기ToolStripMenuItem_Click);
|
||||
//
|
||||
// btn_ApplyFilter
|
||||
//
|
||||
this.btn_ApplyFilter.Location = new System.Drawing.Point(317, 4);
|
||||
this.btn_ApplyFilter.Location = new System.Drawing.Point(362, 5);
|
||||
this.btn_ApplyFilter.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_ApplyFilter.Name = "btn_ApplyFilter";
|
||||
this.btn_ApplyFilter.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_ApplyFilter.Size = new System.Drawing.Size(86, 30);
|
||||
this.btn_ApplyFilter.TabIndex = 2;
|
||||
this.btn_ApplyFilter.Text = "필터적용";
|
||||
this.btn_ApplyFilter.UseVisualStyleBackColor = true;
|
||||
@@ -375,8 +461,9 @@
|
||||
this.panel3.Controls.Add(this.panel2);
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(637, 738);
|
||||
this.panel3.Size = new System.Drawing.Size(822, 922);
|
||||
this.panel3.TabIndex = 3;
|
||||
//
|
||||
// panel6
|
||||
@@ -384,32 +471,35 @@
|
||||
this.panel6.Controls.Add(this.dv1);
|
||||
this.panel6.Controls.Add(this.statusStrip1);
|
||||
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel6.Location = new System.Drawing.Point(0, 174);
|
||||
this.panel6.Location = new System.Drawing.Point(0, 216);
|
||||
this.panel6.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel6.Name = "panel6";
|
||||
this.panel6.Size = new System.Drawing.Size(637, 564);
|
||||
this.panel6.Size = new System.Drawing.Size(822, 706);
|
||||
this.panel6.TabIndex = 3;
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.lblStatus,
|
||||
this.lbSite});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 542);
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 680);
|
||||
this.statusStrip1.Name = "statusStrip1";
|
||||
this.statusStrip1.Size = new System.Drawing.Size(637, 22);
|
||||
this.statusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 16, 0);
|
||||
this.statusStrip1.Size = new System.Drawing.Size(822, 26);
|
||||
this.statusStrip1.TabIndex = 2;
|
||||
this.statusStrip1.Text = "statusStrip1";
|
||||
//
|
||||
// lblStatus
|
||||
//
|
||||
this.lblStatus.Name = "lblStatus";
|
||||
this.lblStatus.Size = new System.Drawing.Size(27, 20);
|
||||
this.lblStatus.Size = new System.Drawing.Size(34, 24);
|
||||
this.lblStatus.Text = "WD";
|
||||
//
|
||||
// lbSite
|
||||
//
|
||||
this.lbSite.Name = "lbSite";
|
||||
this.lbSite.Size = new System.Drawing.Size(55, 17);
|
||||
this.lbSite.Size = new System.Drawing.Size(68, 20);
|
||||
this.lbSite.Text = "-- Site --";
|
||||
//
|
||||
// panel4
|
||||
@@ -422,26 +512,29 @@
|
||||
this.panel4.Controls.Add(this.btn_ApplyFilter);
|
||||
this.panel4.Controls.Add(this.chk_spChar);
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel4.Location = new System.Drawing.Point(0, 140);
|
||||
this.panel4.Location = new System.Drawing.Point(0, 174);
|
||||
this.panel4.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(637, 34);
|
||||
this.panel4.Size = new System.Drawing.Size(822, 42);
|
||||
this.panel4.TabIndex = 2;
|
||||
//
|
||||
// chk_RemoveBrit
|
||||
//
|
||||
this.chk_RemoveBrit.AutoSize = true;
|
||||
this.chk_RemoveBrit.Location = new System.Drawing.Point(113, 8);
|
||||
this.chk_RemoveBrit.Location = new System.Drawing.Point(129, 10);
|
||||
this.chk_RemoveBrit.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.chk_RemoveBrit.Name = "chk_RemoveBrit";
|
||||
this.chk_RemoveBrit.Size = new System.Drawing.Size(128, 16);
|
||||
this.chk_RemoveBrit.Size = new System.Drawing.Size(159, 19);
|
||||
this.chk_RemoveBrit.TabIndex = 0;
|
||||
this.chk_RemoveBrit.Text = "괄호안의 문자 제거";
|
||||
this.chk_RemoveBrit.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btn_ResultEmpty
|
||||
//
|
||||
this.btn_ResultEmpty.Location = new System.Drawing.Point(471, 4);
|
||||
this.btn_ResultEmpty.Location = new System.Drawing.Point(538, 5);
|
||||
this.btn_ResultEmpty.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_ResultEmpty.Name = "btn_ResultEmpty";
|
||||
this.btn_ResultEmpty.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_ResultEmpty.Size = new System.Drawing.Size(86, 30);
|
||||
this.btn_ResultEmpty.TabIndex = 2;
|
||||
this.btn_ResultEmpty.Text = "결과 비움";
|
||||
this.btn_ResultEmpty.UseVisualStyleBackColor = true;
|
||||
@@ -449,9 +542,10 @@
|
||||
//
|
||||
// btn_GridReset
|
||||
//
|
||||
this.btn_GridReset.Location = new System.Drawing.Point(548, 4);
|
||||
this.btn_GridReset.Location = new System.Drawing.Point(626, 5);
|
||||
this.btn_GridReset.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_GridReset.Name = "btn_GridReset";
|
||||
this.btn_GridReset.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_GridReset.Size = new System.Drawing.Size(86, 30);
|
||||
this.btn_GridReset.TabIndex = 2;
|
||||
this.btn_GridReset.Text = "표 비우기";
|
||||
this.btn_GridReset.UseVisualStyleBackColor = true;
|
||||
@@ -459,9 +553,10 @@
|
||||
//
|
||||
// btn_OpenMemo
|
||||
//
|
||||
this.btn_OpenMemo.Location = new System.Drawing.Point(394, 4);
|
||||
this.btn_OpenMemo.Location = new System.Drawing.Point(450, 5);
|
||||
this.btn_OpenMemo.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_OpenMemo.Name = "btn_OpenMemo";
|
||||
this.btn_OpenMemo.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_OpenMemo.Size = new System.Drawing.Size(86, 30);
|
||||
this.btn_OpenMemo.TabIndex = 2;
|
||||
this.btn_OpenMemo.Text = ".txt 열기";
|
||||
this.btn_OpenMemo.UseVisualStyleBackColor = true;
|
||||
@@ -470,30 +565,34 @@
|
||||
// chk_spChar
|
||||
//
|
||||
this.chk_spChar.AutoSize = true;
|
||||
this.chk_spChar.Location = new System.Drawing.Point(7, 8);
|
||||
this.chk_spChar.Location = new System.Drawing.Point(8, 10);
|
||||
this.chk_spChar.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.chk_spChar.Name = "chk_spChar";
|
||||
this.chk_spChar.Size = new System.Drawing.Size(100, 16);
|
||||
this.chk_spChar.Size = new System.Drawing.Size(124, 19);
|
||||
this.chk_spChar.TabIndex = 0;
|
||||
this.chk_spChar.Text = "특수문자 제거";
|
||||
this.chk_spChar.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Check_copyWD
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(637, 738);
|
||||
this.ClientSize = new System.Drawing.Size(822, 922);
|
||||
this.Controls.Add(this.panel3);
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.Name = "Check_copyWD";
|
||||
this.Text = "복본조사(New)";
|
||||
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Check_copy_FormClosing);
|
||||
this.Load += new System.EventHandler(this.Check_copy_Load);
|
||||
this.panel1.ResumeLayout(false);
|
||||
this.panel1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudAddDelay)).EndInit();
|
||||
this.groupBox1.ResumeLayout(false);
|
||||
this.groupBox1.PerformLayout();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).EndInit();
|
||||
this.contextMenuStrip1.ResumeLayout(false);
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panel6.ResumeLayout(false);
|
||||
this.panel6.PerformLayout();
|
||||
@@ -508,7 +607,7 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Label btSearchLibrary;
|
||||
private System.Windows.Forms.Button btSearchLibrary;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.Button btn_Close;
|
||||
private System.Windows.Forms.Button btn_Stop;
|
||||
@@ -536,13 +635,19 @@
|
||||
private System.Windows.Forms.RadioButton radTargetErr;
|
||||
private System.Windows.Forms.RadioButton radTargetEmpty;
|
||||
private System.Windows.Forms.RadioButton radTargetErrEmpty;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn book_name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn book_comp;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Count;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_remark;
|
||||
public System.Windows.Forms.CheckBox chkRetryErrData;
|
||||
public System.Windows.Forms.GroupBox groupBox1;
|
||||
public System.Windows.Forms.CheckBox chkShowBrowser;
|
||||
private System.Windows.Forms.ToolStripStatusLabel lbSite;
|
||||
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
|
||||
private System.Windows.Forms.ToolStripMenuItem 유니코드문자로붙여넝ㅎ기ToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem 일반문자로붙여넣기ToolStripMenuItem;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn book_name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn book_comp;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn Count;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_remark;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_resulthtml;
|
||||
private System.Windows.Forms.NumericUpDown nudAddDelay;
|
||||
private System.Windows.Forms.Label label1;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,9 @@ using AR;
|
||||
using UniMarc.SearchModel;
|
||||
using System.Linq;
|
||||
using UniMarc;
|
||||
using System.Globalization;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
@@ -28,7 +31,7 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
get
|
||||
{
|
||||
return (DateTime.Now <= new DateTime(2025, 09, 30));
|
||||
return (DateTime.Now <= new DateTime(2026, 12, 30));
|
||||
|
||||
}
|
||||
}
|
||||
@@ -38,6 +41,9 @@ namespace WindowsFormsApp1.Mac
|
||||
main = _main;
|
||||
db.DBcon();
|
||||
|
||||
// 도서관별 지연시간 설정 초기화
|
||||
_delaySettings = new Helper_LibraryDelaySettings();
|
||||
|
||||
var idx = 1;
|
||||
//도서검색(크롤링)
|
||||
_searchService = new BookSearchService();
|
||||
@@ -49,7 +55,7 @@ namespace WindowsFormsApp1.Mac
|
||||
_searchService.AddSearcher(new NamguLibrarySearcher(idx++, "#libSW", "효천어울림도서관"));
|
||||
|
||||
|
||||
if (GetDemoRunAuth == true)
|
||||
|
||||
{
|
||||
//광주시교육청통합도서관
|
||||
_searchService.AddSearcher(new KwangjuCityEduLibrarySearcher(idx++, "MD", "중앙도서관"));
|
||||
@@ -405,6 +411,21 @@ namespace WindowsFormsApp1.Mac
|
||||
|
||||
}
|
||||
|
||||
//고창도서관 추가 250903
|
||||
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MA", "고창군립도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MB", "선운산작은도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MC", "고수해마루작은도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MD", "고창군립성호도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "ME", "대산큰별작은도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MF", "무장글샘작은도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MG", "글마루작은도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MH", "흥덕가온누리작은도서관"));
|
||||
_searchService.AddSearcher(new GochangLibSearcher(idx++, "MI", "공음참나무골작은도서관"));
|
||||
|
||||
//전라남도립도서관 추가 250917
|
||||
_searchService.AddSearcher(new JeonnamProvLibSearcher(idx++, "all", "전라남도립도서관"));
|
||||
|
||||
this.tb_SearchTarget.Items.Clear();
|
||||
// this.tb_SearchTarget.Items.Add("-- 검색대상을 선택하세요 --");
|
||||
foreach (var item in _searchService.GetAvailableSites().OrderBy(t => t))
|
||||
@@ -436,6 +457,7 @@ namespace WindowsFormsApp1.Mac
|
||||
|
||||
private readonly BookSearchService _searchService;
|
||||
private bool _isSearching = false;
|
||||
private readonly Helper_LibraryDelaySettings _delaySettings;
|
||||
|
||||
private async void InitializeChromeDriver()
|
||||
{
|
||||
@@ -533,13 +555,23 @@ namespace WindowsFormsApp1.Mac
|
||||
string Target = tb_SearchTarget.Text;
|
||||
// if (Target == "") { MessageBox.Show("도서관명이 비어있습니다."); return; }
|
||||
|
||||
string area = "`Province`, `Area`, `LibName`, `Code`, `URL`, `SearcherNo`";
|
||||
string cmd = string.Format("SELECT {0} FROM `lib_CopyCheck` WHERE CONCAT( province , '_' , AREA , '_' , libname) LIKE '%{1}%' and ifnull(searcherno,0) > 0 ;", area, Target);
|
||||
string data = db.self_Made_Cmd(cmd);
|
||||
string[] ary = data.Split('|');
|
||||
Check_Copy_Sub_Search ccs = new Check_Copy_Sub_Search(this);
|
||||
ccs.Init(ary, Target);
|
||||
ccs.Show();
|
||||
List<string> items = new List<string>();
|
||||
foreach (string item in tb_SearchTarget.Items)
|
||||
{
|
||||
if (items.Contains(item) == false) items.Add(item);
|
||||
}
|
||||
|
||||
|
||||
//string area = "`Province`, `Area`, `LibName`, `Code`, `URL`, `SearcherNo`";
|
||||
//string cmd = string.Format("SELECT {0} FROM `lib_CopyCheck` WHERE CONCAT( province , '_' , AREA , '_' , libname) LIKE '%{1}%' and ifnull(searcherno,0) > 0 ;", area, Target);
|
||||
//string data = db.self_Made_Cmd(cmd);
|
||||
string[] ary = items.ToArray();// data.Split('|');
|
||||
using (var ccs = new Check_Copy_Sub_Selector(items.ToArray(), Target))
|
||||
{
|
||||
ccs.ShowDialog();
|
||||
if (ccs.SelectedValue.isEmpty() == false)
|
||||
tb_SearchTarget.Text = ccs.SelectedValue;
|
||||
}
|
||||
}
|
||||
|
||||
private void btn_SearchList_Click(object sender, EventArgs e)
|
||||
@@ -598,7 +630,10 @@ namespace WindowsFormsApp1.Mac
|
||||
int cnt_ok = 0;
|
||||
int cnt_ng = 0;
|
||||
int cnt_er = 0;
|
||||
int addDelay = (int)nudAddDelay.Value * 1000; //추가 지연시간 : 1개의 레코드 처리 후 추가 지연한다.
|
||||
|
||||
// 현재 지연시간을 도서관별로 저장
|
||||
SaveLibraryDelaySettings(searcher.SiteName, (int)nudAddDelay.Value);
|
||||
|
||||
RetrySearch:
|
||||
foreach (DataGridViewRow drow in this.dv1.Rows)
|
||||
@@ -606,6 +641,10 @@ namespace WindowsFormsApp1.Mac
|
||||
if (this._isSearching == false)
|
||||
{
|
||||
drow.Cells["dvc_remark"].Value = "Cancel";
|
||||
if (dv1.Columns.Contains("dvc_resulthtml"))
|
||||
{
|
||||
drow.Cells["dvc_resulthtml"].Value = "";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -616,6 +655,10 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
cnt_skip += 1;
|
||||
drow.Cells["dvc_remark"].Value = "No Title";
|
||||
if (dv1.Columns.Contains("dvc_resulthtml"))
|
||||
{
|
||||
drow.Cells["dvc_resulthtml"].Value = "";
|
||||
}
|
||||
drow.DefaultCellStyle.BackColor = Color.HotPink;
|
||||
drow.DefaultCellStyle.ForeColor = Color.Blue;
|
||||
continue;
|
||||
@@ -629,15 +672,15 @@ namespace WindowsFormsApp1.Mac
|
||||
if (cntValue.Equals("-1") == false)
|
||||
continue;
|
||||
}
|
||||
else if (radTargetEmpty.Checked) //빈데이터만 처리
|
||||
else if (radTargetEmpty.Checked) //빈데이터만 처리 (검사된 수량이 0이라면 동작한다)
|
||||
{
|
||||
if (int.TryParse(cntValue, out int cntvalue) && cntvalue > 0)
|
||||
continue;
|
||||
}
|
||||
else if (radTargetErrEmpty.Checked) //오류+빈데이터처리
|
||||
{
|
||||
if (cntValue.Equals("-1") == false && int.TryParse(cntValue, out int cntvalue) && cntvalue > 0)
|
||||
continue;
|
||||
if (cntValue.Equals("-1") == false) continue;
|
||||
if (int.TryParse(cntValue, out int cntvalue) && cntvalue > 0) continue;
|
||||
}
|
||||
|
||||
cnt_totalcnt += 1;
|
||||
@@ -646,6 +689,13 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
drow.Cells["dvc_remark"].Value = rlt.ErrorMessage;
|
||||
drow.Cells["Count"].Value = $"{rlt.BookCount}";
|
||||
|
||||
// ResultHtml을 dvc_resulthtml 컬럼에 저장
|
||||
if (dv1.Columns.Contains("dvc_resulthtml"))
|
||||
{
|
||||
drow.Cells["dvc_resulthtml"].Value = rlt.Resulthtml ?? "";
|
||||
}
|
||||
|
||||
if (rlt.BookCount == 0)
|
||||
{
|
||||
cnt_ng += 1;
|
||||
@@ -661,11 +711,21 @@ namespace WindowsFormsApp1.Mac
|
||||
}
|
||||
else
|
||||
{
|
||||
cnt_er += 1;
|
||||
cnt_er += 1;
|
||||
drow.Cells["dvc_remark"].Value = $"Error|{rlt.ErrorMessage}";
|
||||
drow.Cells["Count"].Value = "-1"; //오류발생시에는 -1이 입력되도록한다
|
||||
|
||||
// 오류시에도 ResultHtml이 있으면 저장 (디버깅용)
|
||||
if (dv1.Columns.Contains("dvc_resulthtml"))
|
||||
{
|
||||
drow.Cells["dvc_resulthtml"].Value = rlt.Resulthtml ?? "";
|
||||
}
|
||||
|
||||
drow.DefaultCellStyle.BackColor = Color.HotPink;
|
||||
drow.DefaultCellStyle.ForeColor = Color.Blue;
|
||||
}
|
||||
if (addDelay > 0)
|
||||
await Task.Delay(addDelay);
|
||||
}
|
||||
|
||||
if (_isSearching == true && retry == false && chkRetryErrData.Checked)
|
||||
@@ -847,6 +907,12 @@ namespace WindowsFormsApp1.Mac
|
||||
dv1.Rows[a].DefaultCellStyle.BackColor = Color.White;
|
||||
dv1.Rows[a].Cells["Count"].Value = "";
|
||||
dv1.Rows[a].Cells["dvc_remark"].Value = "";
|
||||
|
||||
// dvc_resulthtml 컬럼도 초기화
|
||||
if (dv1.Columns.Contains("dvc_resulthtml"))
|
||||
{
|
||||
dv1.Rows[a].Cells["dvc_resulthtml"].Value = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -898,6 +964,67 @@ namespace WindowsFormsApp1.Mac
|
||||
}
|
||||
chkShowBrowser.Enabled = !searcher.HttpApiMode;
|
||||
this.lbSite.Text = $"[{searcher.AreaCode}] {searcher.SiteUrl}";
|
||||
|
||||
// 저장된 지연시간 불러오기
|
||||
LoadLibraryDelaySettings(searcher.SiteName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 선택된 도서관의 저장된 지연시간을 불러와서 UI에 설정
|
||||
/// </summary>
|
||||
/// <param name="libraryName">도서관 이름</param>
|
||||
private void LoadLibraryDelaySettings(string libraryName)
|
||||
{
|
||||
try
|
||||
{
|
||||
var savedDelay = _delaySettings.GetDelay(libraryName);
|
||||
if (savedDelay > 0)
|
||||
{
|
||||
nudAddDelay.Value = savedDelay;
|
||||
Console.WriteLine($"도서관 지연시간 불러옴: {libraryName} = {savedDelay}초");
|
||||
}
|
||||
else
|
||||
{
|
||||
// 저장된 설정이 없으면 기본값 유지
|
||||
Console.WriteLine($"도서관 지연시간 설정 없음, 기본값 사용: {libraryName}");
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"도서관 지연시간 불러오기 오류: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 검색 시작시 현재 지연시간을 저장
|
||||
/// </summary>
|
||||
/// <param name="libraryName">도서관 이름</param>
|
||||
/// <param name="delaySeconds">지연시간(초)</param>
|
||||
private void SaveLibraryDelaySettings(string libraryName, int delaySeconds)
|
||||
{
|
||||
try
|
||||
{
|
||||
_delaySettings.SetDelay(libraryName, delaySeconds);
|
||||
Console.WriteLine($"도서관 지연시간 저장됨: {libraryName} = {delaySeconds}초");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine($"도서관 지연시간 저장 오류: {ex.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
private void 유니코드문자로붙여넝ㅎ기ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Skill_Grid sg = new Skill_Grid();
|
||||
var newkey = new KeyEventArgs(Keys.Control | Keys.V | Keys.Alt);
|
||||
sg.Excel_to_DataGridView(this.dv1, newkey);
|
||||
}
|
||||
|
||||
private void 일반문자로붙여넣기ToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
{
|
||||
Skill_Grid sg = new Skill_Grid();
|
||||
var newkey = new KeyEventArgs(Keys.Control | Keys.V);
|
||||
sg.Excel_to_DataGridView(this.dv1, newkey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,12 @@
|
||||
<metadata name="dvc_remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dvc_resulthtml.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>134, 17</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
|
||||
172
unimarc/unimarc/마크/DLS_Copy.Designer.cs
generated
172
unimarc/unimarc/마크/DLS_Copy.Designer.cs
generated
@@ -32,12 +32,20 @@
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel8 = new System.Windows.Forms.Panel();
|
||||
this.dv1 = new System.Windows.Forms.DataGridView();
|
||||
this.Book_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ISBN = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.chkShowBrowser = new System.Windows.Forms.CheckBox();
|
||||
this.btn_ResultEmpty = new System.Windows.Forms.Button();
|
||||
this.btn_GridReset = new System.Windows.Forms.Button();
|
||||
this.chk_RemoveBrit = new System.Windows.Forms.CheckBox();
|
||||
this.chk_spChar = new System.Windows.Forms.CheckBox();
|
||||
this.btn_ApplyFilter = new System.Windows.Forms.Button();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.nudAddDelay = new System.Windows.Forms.NumericUpDown();
|
||||
this.chkShowBrowser = new System.Windows.Forms.CheckBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.rBtn_ISBN = new System.Windows.Forms.RadioButton();
|
||||
this.btnStop = new System.Windows.Forms.Button();
|
||||
@@ -53,17 +61,13 @@
|
||||
this.tb_SearchClient = new System.Windows.Forms.TextBox();
|
||||
this.statusStrip1 = new System.Windows.Forms.StatusStrip();
|
||||
this.lblStatus = new System.Windows.Forms.ToolStripLabel();
|
||||
this.btn_ResultEmpty = new System.Windows.Forms.Button();
|
||||
this.btn_GridReset = new System.Windows.Forms.Button();
|
||||
this.Book_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.ISBN = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_Remark = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.btn_Close = new System.Windows.Forms.Button();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel8.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dv1)).BeginInit();
|
||||
this.panel5.SuspendLayout();
|
||||
this.panel3.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudAddDelay)).BeginInit();
|
||||
this.panel2.SuspendLayout();
|
||||
this.statusStrip1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
@@ -73,7 +77,7 @@
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(7, 5);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(63, 22);
|
||||
this.label1.Size = new System.Drawing.Size(77, 25);
|
||||
this.label1.TabIndex = 0;
|
||||
this.label1.Text = "납품처명";
|
||||
this.label1.Click += new System.EventHandler(this.label1_Click);
|
||||
@@ -120,6 +124,35 @@
|
||||
this.dv1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
this.dv1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
|
||||
//
|
||||
// Book_name
|
||||
//
|
||||
this.Book_name.HeaderText = "도서명";
|
||||
this.Book_name.MinimumWidth = 6;
|
||||
this.Book_name.Name = "Book_name";
|
||||
this.Book_name.Width = 140;
|
||||
//
|
||||
// ISBN
|
||||
//
|
||||
this.ISBN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
|
||||
this.ISBN.HeaderText = "ISBN";
|
||||
this.ISBN.MinimumWidth = 6;
|
||||
this.ISBN.Name = "ISBN";
|
||||
this.ISBN.Width = 140;
|
||||
//
|
||||
// dvc_count
|
||||
//
|
||||
this.dvc_count.HeaderText = "검색";
|
||||
this.dvc_count.MinimumWidth = 6;
|
||||
this.dvc_count.Name = "dvc_count";
|
||||
this.dvc_count.Width = 125;
|
||||
//
|
||||
// dvc_Remark
|
||||
//
|
||||
this.dvc_Remark.HeaderText = "비고";
|
||||
this.dvc_Remark.MinimumWidth = 6;
|
||||
this.dvc_Remark.Name = "dvc_Remark";
|
||||
this.dvc_Remark.Width = 200;
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
@@ -134,18 +167,25 @@
|
||||
this.panel5.Size = new System.Drawing.Size(638, 35);
|
||||
this.panel5.TabIndex = 4;
|
||||
//
|
||||
// chkShowBrowser
|
||||
// btn_ResultEmpty
|
||||
//
|
||||
this.chkShowBrowser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chkShowBrowser.AutoSize = true;
|
||||
this.chkShowBrowser.Checked = true;
|
||||
this.chkShowBrowser.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkShowBrowser.Location = new System.Drawing.Point(354, 9);
|
||||
this.chkShowBrowser.Name = "chkShowBrowser";
|
||||
this.chkShowBrowser.Size = new System.Drawing.Size(96, 16);
|
||||
this.chkShowBrowser.TabIndex = 209;
|
||||
this.chkShowBrowser.Text = "브라우저표시";
|
||||
this.chkShowBrowser.UseVisualStyleBackColor = true;
|
||||
this.btn_ResultEmpty.Location = new System.Drawing.Point(478, 4);
|
||||
this.btn_ResultEmpty.Name = "btn_ResultEmpty";
|
||||
this.btn_ResultEmpty.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_ResultEmpty.TabIndex = 6;
|
||||
this.btn_ResultEmpty.Text = "결과 비움";
|
||||
this.btn_ResultEmpty.UseVisualStyleBackColor = true;
|
||||
this.btn_ResultEmpty.Click += new System.EventHandler(this.btn_ResultEmpty_Click);
|
||||
//
|
||||
// btn_GridReset
|
||||
//
|
||||
this.btn_GridReset.Location = new System.Drawing.Point(555, 4);
|
||||
this.btn_GridReset.Name = "btn_GridReset";
|
||||
this.btn_GridReset.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_GridReset.TabIndex = 7;
|
||||
this.btn_GridReset.Text = "표 비우기";
|
||||
this.btn_GridReset.UseVisualStyleBackColor = true;
|
||||
this.btn_GridReset.Click += new System.EventHandler(this.btn_GridReset_Click);
|
||||
//
|
||||
// chk_RemoveBrit
|
||||
//
|
||||
@@ -181,6 +221,8 @@
|
||||
// panel3
|
||||
//
|
||||
this.panel3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel3.Controls.Add(this.label3);
|
||||
this.panel3.Controls.Add(this.nudAddDelay);
|
||||
this.panel3.Controls.Add(this.chkShowBrowser);
|
||||
this.panel3.Controls.Add(this.label2);
|
||||
this.panel3.Controls.Add(this.rBtn_ISBN);
|
||||
@@ -193,6 +235,36 @@
|
||||
this.panel3.Size = new System.Drawing.Size(638, 35);
|
||||
this.panel3.TabIndex = 4;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(517, 10);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(53, 12);
|
||||
this.label3.TabIndex = 211;
|
||||
this.label3.Text = "추가지연";
|
||||
//
|
||||
// nudAddDelay
|
||||
//
|
||||
this.nudAddDelay.Location = new System.Drawing.Point(576, 6);
|
||||
this.nudAddDelay.Name = "nudAddDelay";
|
||||
this.nudAddDelay.Size = new System.Drawing.Size(56, 21);
|
||||
this.nudAddDelay.TabIndex = 210;
|
||||
this.nudAddDelay.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// chkShowBrowser
|
||||
//
|
||||
this.chkShowBrowser.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chkShowBrowser.AutoSize = true;
|
||||
this.chkShowBrowser.Checked = true;
|
||||
this.chkShowBrowser.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkShowBrowser.Location = new System.Drawing.Point(354, 9);
|
||||
this.chkShowBrowser.Name = "chkShowBrowser";
|
||||
this.chkShowBrowser.Size = new System.Drawing.Size(96, 16);
|
||||
this.chkShowBrowser.TabIndex = 209;
|
||||
this.chkShowBrowser.Text = "브라우저표시";
|
||||
this.chkShowBrowser.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
@@ -247,6 +319,7 @@
|
||||
// panel2
|
||||
//
|
||||
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel2.Controls.Add(this.btn_Close);
|
||||
this.panel2.Controls.Add(this.btn_SiteDenote);
|
||||
this.panel2.Controls.Add(this.btn_Connect);
|
||||
this.panel2.Controls.Add(this.lbl_PW);
|
||||
@@ -264,7 +337,7 @@
|
||||
// btn_SiteDenote
|
||||
//
|
||||
this.btn_SiteDenote.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btn_SiteDenote.Location = new System.Drawing.Point(555, 5);
|
||||
this.btn_SiteDenote.Location = new System.Drawing.Point(479, 5);
|
||||
this.btn_SiteDenote.Name = "btn_SiteDenote";
|
||||
this.btn_SiteDenote.Size = new System.Drawing.Size(77, 23);
|
||||
this.btn_SiteDenote.TabIndex = 6;
|
||||
@@ -275,7 +348,7 @@
|
||||
// btn_Connect
|
||||
//
|
||||
this.btn_Connect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.btn_Connect.Location = new System.Drawing.Point(479, 5);
|
||||
this.btn_Connect.Location = new System.Drawing.Point(406, 5);
|
||||
this.btn_Connect.Name = "btn_Connect";
|
||||
this.btn_Connect.Size = new System.Drawing.Size(70, 23);
|
||||
this.btn_Connect.TabIndex = 5;
|
||||
@@ -326,12 +399,13 @@
|
||||
this.tb_SearchClient.ImeMode = System.Windows.Forms.ImeMode.Hangul;
|
||||
this.tb_SearchClient.Location = new System.Drawing.Point(76, 6);
|
||||
this.tb_SearchClient.Name = "tb_SearchClient";
|
||||
this.tb_SearchClient.Size = new System.Drawing.Size(397, 21);
|
||||
this.tb_SearchClient.Size = new System.Drawing.Size(326, 21);
|
||||
this.tb_SearchClient.TabIndex = 1;
|
||||
this.tb_SearchClient.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_SearchClient_KeyDown);
|
||||
//
|
||||
// statusStrip1
|
||||
//
|
||||
this.statusStrip1.ImageScalingSize = new System.Drawing.Size(20, 20);
|
||||
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.lblStatus});
|
||||
this.statusStrip1.Location = new System.Drawing.Point(0, 699);
|
||||
@@ -347,49 +421,15 @@
|
||||
this.lblStatus.Text = "WD";
|
||||
this.lblStatus.Click += new System.EventHandler(this.lblStatus_Click);
|
||||
//
|
||||
// btn_ResultEmpty
|
||||
// btn_Close
|
||||
//
|
||||
this.btn_ResultEmpty.Location = new System.Drawing.Point(478, 4);
|
||||
this.btn_ResultEmpty.Name = "btn_ResultEmpty";
|
||||
this.btn_ResultEmpty.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_ResultEmpty.TabIndex = 6;
|
||||
this.btn_ResultEmpty.Text = "결과 비움";
|
||||
this.btn_ResultEmpty.UseVisualStyleBackColor = true;
|
||||
this.btn_ResultEmpty.Click += new System.EventHandler(this.btn_ResultEmpty_Click);
|
||||
//
|
||||
// btn_GridReset
|
||||
//
|
||||
this.btn_GridReset.Location = new System.Drawing.Point(555, 4);
|
||||
this.btn_GridReset.Name = "btn_GridReset";
|
||||
this.btn_GridReset.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_GridReset.TabIndex = 7;
|
||||
this.btn_GridReset.Text = "표 비우기";
|
||||
this.btn_GridReset.UseVisualStyleBackColor = true;
|
||||
this.btn_GridReset.Click += new System.EventHandler(this.btn_GridReset_Click);
|
||||
//
|
||||
// Book_name
|
||||
//
|
||||
this.Book_name.HeaderText = "도서명";
|
||||
this.Book_name.Name = "Book_name";
|
||||
this.Book_name.Width = 140;
|
||||
//
|
||||
// ISBN
|
||||
//
|
||||
this.ISBN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
|
||||
this.ISBN.HeaderText = "ISBN";
|
||||
this.ISBN.Name = "ISBN";
|
||||
this.ISBN.Width = 140;
|
||||
//
|
||||
// dvc_count
|
||||
//
|
||||
this.dvc_count.HeaderText = "검색";
|
||||
this.dvc_count.Name = "dvc_count";
|
||||
//
|
||||
// dvc_Remark
|
||||
//
|
||||
this.dvc_Remark.HeaderText = "비고";
|
||||
this.dvc_Remark.Name = "dvc_Remark";
|
||||
this.dvc_Remark.Width = 200;
|
||||
this.btn_Close.Location = new System.Drawing.Point(559, 4);
|
||||
this.btn_Close.Name = "btn_Close";
|
||||
this.btn_Close.Size = new System.Drawing.Size(75, 24);
|
||||
this.btn_Close.TabIndex = 7;
|
||||
this.btn_Close.Text = "닫 기";
|
||||
this.btn_Close.UseVisualStyleBackColor = true;
|
||||
this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
|
||||
//
|
||||
// DLS_Copy
|
||||
//
|
||||
@@ -408,6 +448,7 @@
|
||||
this.panel5.PerformLayout();
|
||||
this.panel3.ResumeLayout(false);
|
||||
this.panel3.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudAddDelay)).EndInit();
|
||||
this.panel2.ResumeLayout(false);
|
||||
this.panel2.PerformLayout();
|
||||
this.statusStrip1.ResumeLayout(false);
|
||||
@@ -450,5 +491,8 @@
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn ISBN;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_count;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_Remark;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.NumericUpDown nudAddDelay;
|
||||
private System.Windows.Forms.Button btn_Close;
|
||||
}
|
||||
}
|
||||
@@ -212,6 +212,8 @@ namespace WindowsFormsApp1.Mac
|
||||
var sType = rBtn_ISBN.Checked ? "ea_isbn" : "title";
|
||||
_searcher.SetParameter(this.lbl_ID.Text, lbl_PW.Text, "유덕초등학교", sType);
|
||||
|
||||
int addDelay = (int)nudAddDelay.Value * 1000; //추가 지연시간 : 1개의 레코드 처리 후 추가 지연한다.
|
||||
|
||||
foreach (DataGridViewRow dr in this.dv1.Rows)
|
||||
{
|
||||
var title = dr.Cells[0].Value?.ToString() ?? string.Empty;
|
||||
@@ -232,6 +234,9 @@ namespace WindowsFormsApp1.Mac
|
||||
else
|
||||
dr.DefaultCellStyle.BackColor = Color.LightSkyBlue;
|
||||
}
|
||||
|
||||
if (addDelay > 0)
|
||||
await Task.Delay(addDelay);
|
||||
}
|
||||
|
||||
|
||||
@@ -407,5 +412,10 @@ namespace WindowsFormsApp1.Mac
|
||||
dv1.Rows[a].Cells[booknamecol].Value = st.RemoveWordInBracket(Target).Trim();
|
||||
}
|
||||
}
|
||||
|
||||
private void btn_Close_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,18 @@
|
||||
<metadata name="dvc_Remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="Book_name.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="dvc_count.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dvc_Remark.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
|
||||
@@ -18,6 +18,18 @@ namespace ExcelTest
|
||||
public string call = "";
|
||||
Marc mac;
|
||||
Marc_Plan_Sub_MarcEdit me;
|
||||
Marc2 mae;
|
||||
MarcEditorControl mec;
|
||||
public Helper008(MarcEditorControl _mae)
|
||||
{
|
||||
InitializeComponent();
|
||||
mec = _mae;
|
||||
}
|
||||
public Helper008(Marc2 _mae)
|
||||
{
|
||||
InitializeComponent();
|
||||
mae = _mae;
|
||||
}
|
||||
public Helper008(Marc _mac)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
25
unimarc/unimarc/마크/MacEditorParameter.cs
Normal file
25
unimarc/unimarc/마크/MacEditorParameter.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
//using Microsoft.Office.Interop.Excel;
|
||||
namespace ExcelTest
|
||||
{
|
||||
|
||||
public class MacEditorParameter
|
||||
{
|
||||
public string ISBN13 { get; set; }
|
||||
public string URL { get; set; }
|
||||
public string MarcIdx { get; set; }
|
||||
public string Grade { get; set; }
|
||||
public string User { get; set; }
|
||||
public string SaveDate { get; set; }
|
||||
public string ListIdx { get; set; }
|
||||
|
||||
public string BookName { get; set; }
|
||||
public string Author { get; set; }
|
||||
public string Publisher { get; set; }
|
||||
public string Price { get; set; }
|
||||
|
||||
public string Remark1 { get; set; }
|
||||
public string Remark2 { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
483
unimarc/unimarc/마크/Mac_List.Designer.cs
generated
483
unimarc/unimarc/마크/Mac_List.Designer.cs
generated
@@ -33,6 +33,20 @@
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.tb_Search = new System.Windows.Forms.TextBox();
|
||||
this.dataGridView1 = new System.Windows.Forms.DataGridView();
|
||||
this.idx = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.start_date = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.end_date = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_custname = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.list_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.work_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.stock = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.unstock = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.state = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.etc = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.charge = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dvc_cust = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.check = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.cb_state = new System.Windows.Forms.ComboBox();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.btn_Lookup = new System.Windows.Forms.Button();
|
||||
@@ -46,20 +60,20 @@
|
||||
this.btn_Delete = new System.Windows.Forms.Button();
|
||||
this.btn_AddList = new System.Windows.Forms.Button();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
this.panel12 = new System.Windows.Forms.Panel();
|
||||
this.chkEditorTest = new System.Windows.Forms.CheckBox();
|
||||
this.panel13 = new System.Windows.Forms.Panel();
|
||||
this.panel11 = new System.Windows.Forms.Panel();
|
||||
this.btnSearchISBN = new System.Windows.Forms.Button();
|
||||
this.check = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.charge = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.etc = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.state = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.unstock = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.stock = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.count = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.work_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.list_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.end_date = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.start_date = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.idx = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.panel10 = new System.Windows.Forms.Panel();
|
||||
this.panel9 = new System.Windows.Forms.Panel();
|
||||
this.panel8 = new System.Windows.Forms.Panel();
|
||||
this.panel7 = new System.Windows.Forms.Panel();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
this.panel5 = new System.Windows.Forms.Panel();
|
||||
this.panel4 = new System.Windows.Forms.Panel();
|
||||
this.panel3 = new System.Windows.Forms.Panel();
|
||||
this.panel2 = new System.Windows.Forms.Panel();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
this.panel2.SuspendLayout();
|
||||
@@ -67,18 +81,21 @@
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(14, 13);
|
||||
this.label1.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.label1.Location = new System.Drawing.Point(0, 5);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(57, 12);
|
||||
this.label1.Size = new System.Drawing.Size(63, 27);
|
||||
this.label1.TabIndex = 5;
|
||||
this.label1.Text = "목록 검색";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// tb_Search
|
||||
//
|
||||
this.tb_Search.Location = new System.Drawing.Point(73, 9);
|
||||
this.tb_Search.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.tb_Search.Font = new System.Drawing.Font("맑은 고딕", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.tb_Search.Location = new System.Drawing.Point(63, 5);
|
||||
this.tb_Search.Name = "tb_Search";
|
||||
this.tb_Search.Size = new System.Drawing.Size(241, 21);
|
||||
this.tb_Search.Size = new System.Drawing.Size(269, 25);
|
||||
this.tb_Search.TabIndex = 6;
|
||||
this.tb_Search.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_Search_KeyDown);
|
||||
//
|
||||
@@ -102,6 +119,7 @@
|
||||
this.idx,
|
||||
this.start_date,
|
||||
this.end_date,
|
||||
this.dvc_custname,
|
||||
this.list_name,
|
||||
this.work_name,
|
||||
this.count,
|
||||
@@ -110,6 +128,7 @@
|
||||
this.state,
|
||||
this.etc,
|
||||
this.charge,
|
||||
this.dvc_cust,
|
||||
this.check});
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Window;
|
||||
@@ -126,36 +145,142 @@
|
||||
this.dataGridView1.RowHeadersWidth = 40;
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1124, 623);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1638, 624);
|
||||
this.dataGridView1.TabIndex = 48;
|
||||
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
|
||||
this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
|
||||
//
|
||||
// idx
|
||||
//
|
||||
this.idx.HeaderText = "idx";
|
||||
this.idx.MinimumWidth = 6;
|
||||
this.idx.Name = "idx";
|
||||
this.idx.Visible = false;
|
||||
this.idx.Width = 125;
|
||||
//
|
||||
// start_date
|
||||
//
|
||||
this.start_date.HeaderText = "목록일자";
|
||||
this.start_date.MinimumWidth = 6;
|
||||
this.start_date.Name = "start_date";
|
||||
this.start_date.Width = 125;
|
||||
//
|
||||
// end_date
|
||||
//
|
||||
this.end_date.HeaderText = "완료일자";
|
||||
this.end_date.MinimumWidth = 6;
|
||||
this.end_date.Name = "end_date";
|
||||
this.end_date.Width = 125;
|
||||
//
|
||||
// dvc_custname
|
||||
//
|
||||
this.dvc_custname.HeaderText = "납품처";
|
||||
this.dvc_custname.MinimumWidth = 6;
|
||||
this.dvc_custname.Name = "dvc_custname";
|
||||
this.dvc_custname.Width = 125;
|
||||
//
|
||||
// list_name
|
||||
//
|
||||
this.list_name.HeaderText = "목록명";
|
||||
this.list_name.MinimumWidth = 6;
|
||||
this.list_name.Name = "list_name";
|
||||
this.list_name.Width = 200;
|
||||
//
|
||||
// work_name
|
||||
//
|
||||
this.work_name.HeaderText = "작업명";
|
||||
this.work_name.MinimumWidth = 6;
|
||||
this.work_name.Name = "work_name";
|
||||
this.work_name.Width = 125;
|
||||
//
|
||||
// count
|
||||
//
|
||||
this.count.HeaderText = "수량";
|
||||
this.count.MinimumWidth = 6;
|
||||
this.count.Name = "count";
|
||||
this.count.Width = 80;
|
||||
//
|
||||
// stock
|
||||
//
|
||||
this.stock.HeaderText = "입고";
|
||||
this.stock.MinimumWidth = 6;
|
||||
this.stock.Name = "stock";
|
||||
this.stock.Visible = false;
|
||||
this.stock.Width = 70;
|
||||
//
|
||||
// unstock
|
||||
//
|
||||
this.unstock.HeaderText = "미입고";
|
||||
this.unstock.MinimumWidth = 6;
|
||||
this.unstock.Name = "unstock";
|
||||
this.unstock.Visible = false;
|
||||
this.unstock.Width = 70;
|
||||
//
|
||||
// state
|
||||
//
|
||||
this.state.HeaderText = "상태";
|
||||
this.state.MinimumWidth = 6;
|
||||
this.state.Name = "state";
|
||||
this.state.Width = 70;
|
||||
//
|
||||
// etc
|
||||
//
|
||||
this.etc.HeaderText = "비고";
|
||||
this.etc.MinimumWidth = 6;
|
||||
this.etc.Name = "etc";
|
||||
this.etc.Width = 280;
|
||||
//
|
||||
// charge
|
||||
//
|
||||
this.charge.HeaderText = "담당자";
|
||||
this.charge.MinimumWidth = 6;
|
||||
this.charge.Name = "charge";
|
||||
this.charge.Width = 70;
|
||||
//
|
||||
// dvc_cust
|
||||
//
|
||||
this.dvc_cust.HeaderText = "CustomerIDX";
|
||||
this.dvc_cust.MinimumWidth = 6;
|
||||
this.dvc_cust.Name = "dvc_cust";
|
||||
this.dvc_cust.Visible = false;
|
||||
this.dvc_cust.Width = 125;
|
||||
//
|
||||
// check
|
||||
//
|
||||
this.check.HeaderText = "V";
|
||||
this.check.MinimumWidth = 6;
|
||||
this.check.Name = "check";
|
||||
this.check.Width = 35;
|
||||
//
|
||||
// cb_state
|
||||
//
|
||||
this.cb_state.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.cb_state.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cb_state.Font = new System.Drawing.Font("맑은 고딕", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.cb_state.FormattingEnabled = true;
|
||||
this.cb_state.Location = new System.Drawing.Point(354, 9);
|
||||
this.cb_state.Location = new System.Drawing.Point(364, 5);
|
||||
this.cb_state.Name = "cb_state";
|
||||
this.cb_state.Size = new System.Drawing.Size(74, 20);
|
||||
this.cb_state.Size = new System.Drawing.Size(100, 25);
|
||||
this.cb_state.TabIndex = 49;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(323, 13);
|
||||
this.label2.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.label2.Location = new System.Drawing.Point(332, 5);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(29, 12);
|
||||
this.label2.Size = new System.Drawing.Size(32, 27);
|
||||
this.label2.TabIndex = 5;
|
||||
this.label2.Text = "상태";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
//
|
||||
// btn_Lookup
|
||||
//
|
||||
this.btn_Lookup.Location = new System.Drawing.Point(484, 2);
|
||||
this.btn_Lookup.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.btn_Lookup.Location = new System.Drawing.Point(586, 5);
|
||||
this.btn_Lookup.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Lookup.Name = "btn_Lookup";
|
||||
this.btn_Lookup.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Lookup.Size = new System.Drawing.Size(61, 27);
|
||||
this.btn_Lookup.TabIndex = 50;
|
||||
this.btn_Lookup.Text = "조 회";
|
||||
this.btn_Lookup.UseVisualStyleBackColor = true;
|
||||
@@ -163,10 +288,11 @@
|
||||
//
|
||||
// btn_Excel
|
||||
//
|
||||
this.btn_Excel.Location = new System.Drawing.Point(990, 2);
|
||||
this.btn_Excel.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Excel.Location = new System.Drawing.Point(1482, 5);
|
||||
this.btn_Excel.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Excel.Name = "btn_Excel";
|
||||
this.btn_Excel.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Excel.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_Excel.TabIndex = 50;
|
||||
this.btn_Excel.Text = "엑셀반출";
|
||||
this.btn_Excel.UseVisualStyleBackColor = true;
|
||||
@@ -174,10 +300,11 @@
|
||||
//
|
||||
// btn_Close
|
||||
//
|
||||
this.btn_Close.Location = new System.Drawing.Point(1053, 2);
|
||||
this.btn_Close.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Close.Location = new System.Drawing.Point(1564, 5);
|
||||
this.btn_Close.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Close.Name = "btn_Close";
|
||||
this.btn_Close.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Close.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_Close.TabIndex = 50;
|
||||
this.btn_Close.Text = "닫 기";
|
||||
this.btn_Close.UseVisualStyleBackColor = true;
|
||||
@@ -185,21 +312,23 @@
|
||||
//
|
||||
// btn_Save
|
||||
//
|
||||
this.btn_Save.Location = new System.Drawing.Point(927, 2);
|
||||
this.btn_Save.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Save.Location = new System.Drawing.Point(1378, 5);
|
||||
this.btn_Save.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Save.Name = "btn_Save";
|
||||
this.btn_Save.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Save.Size = new System.Drawing.Size(96, 27);
|
||||
this.btn_Save.TabIndex = 50;
|
||||
this.btn_Save.Text = "체크사항\r\n저장";
|
||||
this.btn_Save.Text = "체크사항저장";
|
||||
this.btn_Save.UseVisualStyleBackColor = true;
|
||||
this.btn_Save.Click += new System.EventHandler(this.btn_Save_Click);
|
||||
//
|
||||
// btn_Merge
|
||||
//
|
||||
this.btn_Merge.Location = new System.Drawing.Point(673, 2);
|
||||
this.btn_Merge.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Merge.Location = new System.Drawing.Point(1050, 5);
|
||||
this.btn_Merge.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Merge.Name = "btn_Merge";
|
||||
this.btn_Merge.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Merge.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_Merge.TabIndex = 51;
|
||||
this.btn_Merge.Text = "목록병합";
|
||||
this.btn_Merge.UseVisualStyleBackColor = true;
|
||||
@@ -207,10 +336,11 @@
|
||||
//
|
||||
// btn_Progress
|
||||
//
|
||||
this.btn_Progress.Location = new System.Drawing.Point(738, 2);
|
||||
this.btn_Progress.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Progress.Location = new System.Drawing.Point(1132, 5);
|
||||
this.btn_Progress.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Progress.Name = "btn_Progress";
|
||||
this.btn_Progress.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Progress.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_Progress.TabIndex = 51;
|
||||
this.btn_Progress.Text = "진행처리";
|
||||
this.btn_Progress.UseVisualStyleBackColor = true;
|
||||
@@ -218,10 +348,11 @@
|
||||
//
|
||||
// btn_Completion
|
||||
//
|
||||
this.btn_Completion.Location = new System.Drawing.Point(801, 2);
|
||||
this.btn_Completion.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Completion.Location = new System.Drawing.Point(1214, 5);
|
||||
this.btn_Completion.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Completion.Name = "btn_Completion";
|
||||
this.btn_Completion.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Completion.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_Completion.TabIndex = 51;
|
||||
this.btn_Completion.Text = "완료처리";
|
||||
this.btn_Completion.UseVisualStyleBackColor = true;
|
||||
@@ -229,10 +360,11 @@
|
||||
//
|
||||
// btn_Delete
|
||||
//
|
||||
this.btn_Delete.Location = new System.Drawing.Point(864, 2);
|
||||
this.btn_Delete.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_Delete.Location = new System.Drawing.Point(1296, 5);
|
||||
this.btn_Delete.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_Delete.Name = "btn_Delete";
|
||||
this.btn_Delete.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_Delete.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_Delete.TabIndex = 51;
|
||||
this.btn_Delete.Text = "목록삭제";
|
||||
this.btn_Delete.UseVisualStyleBackColor = true;
|
||||
@@ -240,10 +372,11 @@
|
||||
//
|
||||
// btn_AddList
|
||||
//
|
||||
this.btn_AddList.Location = new System.Drawing.Point(610, 2);
|
||||
this.btn_AddList.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btn_AddList.Location = new System.Drawing.Point(968, 5);
|
||||
this.btn_AddList.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btn_AddList.Name = "btn_AddList";
|
||||
this.btn_AddList.Size = new System.Drawing.Size(61, 32);
|
||||
this.btn_AddList.Size = new System.Drawing.Size(74, 27);
|
||||
this.btn_AddList.TabIndex = 50;
|
||||
this.btn_AddList.Text = "목록생성";
|
||||
this.btn_AddList.UseVisualStyleBackColor = true;
|
||||
@@ -251,122 +384,178 @@
|
||||
//
|
||||
// panel1
|
||||
//
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.btn_Delete);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.btn_Completion);
|
||||
this.panel1.Controls.Add(this.tb_Search);
|
||||
this.panel1.Controls.Add(this.btn_Progress);
|
||||
this.panel1.Controls.Add(this.cb_state);
|
||||
this.panel1.Controls.Add(this.btn_Merge);
|
||||
this.panel1.Controls.Add(this.btnSearchISBN);
|
||||
this.panel1.Controls.Add(this.btn_Lookup);
|
||||
this.panel1.Controls.Add(this.btn_Close);
|
||||
this.panel1.Controls.Add(this.panel12);
|
||||
this.panel1.Controls.Add(this.chkEditorTest);
|
||||
this.panel1.Controls.Add(this.panel13);
|
||||
this.panel1.Controls.Add(this.cb_state);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.tb_Search);
|
||||
this.panel1.Controls.Add(this.panel11);
|
||||
this.panel1.Controls.Add(this.btnSearchISBN);
|
||||
this.panel1.Controls.Add(this.panel10);
|
||||
this.panel1.Controls.Add(this.btn_AddList);
|
||||
this.panel1.Controls.Add(this.btn_Excel);
|
||||
this.panel1.Controls.Add(this.panel9);
|
||||
this.panel1.Controls.Add(this.btn_Merge);
|
||||
this.panel1.Controls.Add(this.panel8);
|
||||
this.panel1.Controls.Add(this.btn_Progress);
|
||||
this.panel1.Controls.Add(this.panel7);
|
||||
this.panel1.Controls.Add(this.btn_Completion);
|
||||
this.panel1.Controls.Add(this.panel6);
|
||||
this.panel1.Controls.Add(this.btn_Delete);
|
||||
this.panel1.Controls.Add(this.panel5);
|
||||
this.panel1.Controls.Add(this.btn_Save);
|
||||
this.panel1.Controls.Add(this.panel4);
|
||||
this.panel1.Controls.Add(this.btn_Excel);
|
||||
this.panel1.Controls.Add(this.panel3);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.btn_Close);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(1124, 38);
|
||||
this.panel1.Padding = new System.Windows.Forms.Padding(0, 5, 0, 2);
|
||||
this.panel1.Size = new System.Drawing.Size(1638, 34);
|
||||
this.panel1.TabIndex = 52;
|
||||
//
|
||||
// panel12
|
||||
//
|
||||
this.panel12.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.panel12.Location = new System.Drawing.Point(578, 5);
|
||||
this.panel12.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel12.Name = "panel12";
|
||||
this.panel12.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel12.TabIndex = 62;
|
||||
//
|
||||
// chkEditorTest
|
||||
//
|
||||
this.chkEditorTest.AutoSize = true;
|
||||
this.chkEditorTest.BackColor = System.Drawing.SystemColors.Control;
|
||||
this.chkEditorTest.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.chkEditorTest.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
this.chkEditorTest.ForeColor = System.Drawing.Color.Blue;
|
||||
this.chkEditorTest.Location = new System.Drawing.Point(472, 5);
|
||||
this.chkEditorTest.Name = "chkEditorTest";
|
||||
this.chkEditorTest.Size = new System.Drawing.Size(106, 27);
|
||||
this.chkEditorTest.TabIndex = 52;
|
||||
this.chkEditorTest.Text = "Editor (OLD)";
|
||||
this.chkEditorTest.UseVisualStyleBackColor = false;
|
||||
//
|
||||
// panel13
|
||||
//
|
||||
this.panel13.Dock = System.Windows.Forms.DockStyle.Left;
|
||||
this.panel13.Location = new System.Drawing.Point(464, 5);
|
||||
this.panel13.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel13.Name = "panel13";
|
||||
this.panel13.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel13.TabIndex = 63;
|
||||
//
|
||||
// panel11
|
||||
//
|
||||
this.panel11.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel11.Location = new System.Drawing.Point(878, 5);
|
||||
this.panel11.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel11.Name = "panel11";
|
||||
this.panel11.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel11.TabIndex = 61;
|
||||
//
|
||||
// btnSearchISBN
|
||||
//
|
||||
this.btnSearchISBN.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.btnSearchISBN.Location = new System.Drawing.Point(886, 5);
|
||||
this.btnSearchISBN.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btnSearchISBN.Name = "btnSearchISBN";
|
||||
this.btnSearchISBN.Size = new System.Drawing.Size(74, 27);
|
||||
this.btnSearchISBN.TabIndex = 50;
|
||||
this.btnSearchISBN.Text = "ISBN조회";
|
||||
this.btnSearchISBN.UseVisualStyleBackColor = true;
|
||||
this.btnSearchISBN.Click += new System.EventHandler(this.btnSearchISBN_Click);
|
||||
//
|
||||
// panel10
|
||||
//
|
||||
this.panel10.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel10.Location = new System.Drawing.Point(960, 5);
|
||||
this.panel10.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel10.Name = "panel10";
|
||||
this.panel10.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel10.TabIndex = 60;
|
||||
//
|
||||
// panel9
|
||||
//
|
||||
this.panel9.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel9.Location = new System.Drawing.Point(1042, 5);
|
||||
this.panel9.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel9.Name = "panel9";
|
||||
this.panel9.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel9.TabIndex = 59;
|
||||
//
|
||||
// panel8
|
||||
//
|
||||
this.panel8.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel8.Location = new System.Drawing.Point(1124, 5);
|
||||
this.panel8.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel8.Name = "panel8";
|
||||
this.panel8.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel8.TabIndex = 58;
|
||||
//
|
||||
// panel7
|
||||
//
|
||||
this.panel7.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel7.Location = new System.Drawing.Point(1206, 5);
|
||||
this.panel7.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel7.Name = "panel7";
|
||||
this.panel7.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel7.TabIndex = 57;
|
||||
//
|
||||
// panel6
|
||||
//
|
||||
this.panel6.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel6.Location = new System.Drawing.Point(1288, 5);
|
||||
this.panel6.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel6.Name = "panel6";
|
||||
this.panel6.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel6.TabIndex = 56;
|
||||
//
|
||||
// panel5
|
||||
//
|
||||
this.panel5.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel5.Location = new System.Drawing.Point(1370, 5);
|
||||
this.panel5.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel5.Name = "panel5";
|
||||
this.panel5.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel5.TabIndex = 55;
|
||||
//
|
||||
// panel4
|
||||
//
|
||||
this.panel4.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel4.Location = new System.Drawing.Point(1474, 5);
|
||||
this.panel4.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel4.TabIndex = 54;
|
||||
//
|
||||
// panel3
|
||||
//
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
this.panel3.Location = new System.Drawing.Point(1556, 5);
|
||||
this.panel3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(8, 27);
|
||||
this.panel3.TabIndex = 53;
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.dataGridView1);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 38);
|
||||
this.panel2.Location = new System.Drawing.Point(0, 34);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(1124, 623);
|
||||
this.panel2.Size = new System.Drawing.Size(1638, 624);
|
||||
this.panel2.TabIndex = 53;
|
||||
//
|
||||
// btnSearchISBN
|
||||
//
|
||||
this.btnSearchISBN.Location = new System.Drawing.Point(547, 2);
|
||||
this.btnSearchISBN.Margin = new System.Windows.Forms.Padding(1);
|
||||
this.btnSearchISBN.Name = "btnSearchISBN";
|
||||
this.btnSearchISBN.Size = new System.Drawing.Size(61, 32);
|
||||
this.btnSearchISBN.TabIndex = 50;
|
||||
this.btnSearchISBN.Text = "ISBN 조회";
|
||||
this.btnSearchISBN.UseVisualStyleBackColor = true;
|
||||
this.btnSearchISBN.Click += new System.EventHandler(this.btnSearchISBN_Click);
|
||||
//
|
||||
// check
|
||||
//
|
||||
this.check.HeaderText = "V";
|
||||
this.check.Name = "check";
|
||||
this.check.Width = 35;
|
||||
//
|
||||
// charge
|
||||
//
|
||||
this.charge.HeaderText = "담당자";
|
||||
this.charge.Name = "charge";
|
||||
this.charge.Width = 70;
|
||||
//
|
||||
// etc
|
||||
//
|
||||
this.etc.HeaderText = "비고";
|
||||
this.etc.Name = "etc";
|
||||
this.etc.Width = 280;
|
||||
//
|
||||
// state
|
||||
//
|
||||
this.state.HeaderText = "상태";
|
||||
this.state.Name = "state";
|
||||
this.state.Width = 70;
|
||||
//
|
||||
// unstock
|
||||
//
|
||||
this.unstock.HeaderText = "미입고";
|
||||
this.unstock.Name = "unstock";
|
||||
this.unstock.Visible = false;
|
||||
this.unstock.Width = 70;
|
||||
//
|
||||
// stock
|
||||
//
|
||||
this.stock.HeaderText = "입고";
|
||||
this.stock.Name = "stock";
|
||||
this.stock.Visible = false;
|
||||
this.stock.Width = 70;
|
||||
//
|
||||
// count
|
||||
//
|
||||
this.count.HeaderText = "수량";
|
||||
this.count.Name = "count";
|
||||
this.count.Width = 80;
|
||||
//
|
||||
// work_name
|
||||
//
|
||||
this.work_name.HeaderText = "작업명";
|
||||
this.work_name.Name = "work_name";
|
||||
//
|
||||
// list_name
|
||||
//
|
||||
this.list_name.HeaderText = "목록명";
|
||||
this.list_name.Name = "list_name";
|
||||
this.list_name.Width = 200;
|
||||
//
|
||||
// end_date
|
||||
//
|
||||
this.end_date.HeaderText = "완료일자";
|
||||
this.end_date.Name = "end_date";
|
||||
//
|
||||
// start_date
|
||||
//
|
||||
this.start_date.HeaderText = "목록일자";
|
||||
this.start_date.Name = "start_date";
|
||||
//
|
||||
// idx
|
||||
//
|
||||
this.idx.HeaderText = "idx";
|
||||
this.idx.Name = "idx";
|
||||
this.idx.Visible = false;
|
||||
//
|
||||
// Mac_List
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(1124, 661);
|
||||
this.ClientSize = new System.Drawing.Size(1638, 658);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Name = "Mac_List";
|
||||
@@ -404,6 +593,7 @@
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn idx;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn start_date;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn end_date;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_custname;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn list_name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn work_name;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn count;
|
||||
@@ -412,6 +602,19 @@
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn state;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn etc;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn charge;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dvc_cust;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn check;
|
||||
private System.Windows.Forms.CheckBox chkEditorTest;
|
||||
private System.Windows.Forms.Panel panel12;
|
||||
private System.Windows.Forms.Panel panel11;
|
||||
private System.Windows.Forms.Panel panel10;
|
||||
private System.Windows.Forms.Panel panel9;
|
||||
private System.Windows.Forms.Panel panel8;
|
||||
private System.Windows.Forms.Panel panel7;
|
||||
private System.Windows.Forms.Panel panel6;
|
||||
private System.Windows.Forms.Panel panel5;
|
||||
private System.Windows.Forms.Panel panel4;
|
||||
private System.Windows.Forms.Panel panel3;
|
||||
private System.Windows.Forms.Panel panel13;
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,8 @@ namespace WindowsFormsApp1.Mac
|
||||
}
|
||||
private void tb_Search_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter) {
|
||||
if (e.KeyCode == Keys.Enter)
|
||||
{
|
||||
btn_Lookup_Click(null, null);
|
||||
}
|
||||
}
|
||||
@@ -55,9 +56,8 @@ namespace WindowsFormsApp1.Mac
|
||||
/* idx / 목록일자 / 완료일자 / 목록명 / 작업명
|
||||
* 전체수량 / 입고 / 미입고 / 상태 / 비고
|
||||
* 마크담당자 */
|
||||
string Area = "`idx`, `date`, `date_res`, `list_name`, `work_name`, " +
|
||||
"`vol`, `stock`, `unstock`, `state`, `m_etc`, " +
|
||||
"`m_charge`";
|
||||
string Area = $"`idx`, `date`, `date_res`,GetClientName({compidx},customer) as custname, `list_name`, `work_name`, " +
|
||||
"`vol`, `stock`, `unstock`, `state`, `m_etc`,`m_charge`,`customer` ";
|
||||
string search = tb_Search.Text;
|
||||
string state = cb_state.Text;
|
||||
|
||||
@@ -83,14 +83,14 @@ namespace WindowsFormsApp1.Mac
|
||||
/// <param name="data"></param>
|
||||
private void input_Grid(string[] data)
|
||||
{
|
||||
/* idx / 목록일자 / 완료일자 / 목록명 / 작업명
|
||||
/* idx / 목록일자 / 완료일자 / 납품처 / 목록명 / 작업명
|
||||
* 전체수량 / 입고 / 미입고 / 상태 / 비고
|
||||
* 마크담당자 */
|
||||
|
||||
string[] grid = { "", "", "", "", "",
|
||||
"", "", "", "", "",
|
||||
"", "" };
|
||||
int area_count = 11;
|
||||
"", "" ,"","","","","",""};
|
||||
int area_count = 13;
|
||||
dataGridView1.Rows.Clear();
|
||||
for (int a = 0; a < data.Length; a++)
|
||||
{
|
||||
@@ -104,8 +104,13 @@ namespace WindowsFormsApp1.Mac
|
||||
if (a % area_count == 7) { grid[7] = data[a]; }
|
||||
if (a % area_count == 8) { grid[8] = data[a]; }
|
||||
if (a % area_count == 9) { grid[9] = data[a]; }
|
||||
if (a % area_count == 10) { grid[10] = data[a];
|
||||
dataGridView1.Rows.Add(grid);
|
||||
if (a % area_count == 10) { grid[10] = data[a]; }
|
||||
if (a % area_count == 11) { grid[11] = data[a]; }
|
||||
//if (a % area_count == 12) { grid[12] = data[a]; }
|
||||
if (a % area_count == 12)
|
||||
{ //cutomeridx
|
||||
grid[12] = data[a];
|
||||
dataGridView1.Rows.Add(grid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -122,18 +127,20 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
if (MessageBox.Show("선택사항을 저장하시겠습니까?", "저장", MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return;
|
||||
|
||||
|
||||
string table = "Obj_List";
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V") {
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V")
|
||||
{
|
||||
string[] edit_col = {
|
||||
"date", "date_res", "list_name", "work_name", "vol",
|
||||
"stock", "unstock", "state", "m_etc", "m_charge"
|
||||
"date", "date_res","custname", "list_name", "work_name", "vol",
|
||||
"stock", "unstock", "state", "m_etc", "m_charge","customer"
|
||||
};
|
||||
string[] edit_tbl = {
|
||||
dataGridView1.Rows[a].Cells["start_date"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["end_date"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["custname"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["list_name"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["work_name"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["count"].Value.ToString(),
|
||||
@@ -141,7 +148,9 @@ namespace WindowsFormsApp1.Mac
|
||||
dataGridView1.Rows[a].Cells["unstock"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["state"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["etc"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["charge"].Value.ToString()
|
||||
dataGridView1.Rows[a].Cells["charge"].Value.ToString(),
|
||||
dataGridView1.Rows[a].Cells["customer"].Value.ToString(),
|
||||
|
||||
};
|
||||
string[] sear_col = { "idx", "comp_num" };
|
||||
string[] sear_tbl = { dataGridView1.Rows[a].Cells["idx"].Value.ToString(), compidx };
|
||||
@@ -159,7 +168,7 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
Excel_text et = new Excel_text();
|
||||
string[] Excel_title = {
|
||||
"NO", "목록일자", "완료일자", "목록명", "마크담당자",
|
||||
"NO", "목록일자", "완료일자", "납품처","목록명", "마크담당자",
|
||||
//"작업명", "수량", "입고", "미입고", "상태", "비고" };
|
||||
"작업명", "수량", "상태", "비고" };
|
||||
int rowCount = dataGridView1.RowCount;
|
||||
@@ -169,21 +178,19 @@ namespace WindowsFormsApp1.Mac
|
||||
for (int a = 0; a < rowCount; a++)
|
||||
{
|
||||
int row_idx = dataGridView1.Rows[a].HeaderCell.RowIndex + 1;
|
||||
inputExcel[a, 0] = row_idx.ToString();
|
||||
inputExcel[a, 1] = dataGridView1.Rows[a].Cells["start_date"].Value.ToString();
|
||||
inputExcel[a, 2] = dataGridView1.Rows[a].Cells["end_date"].Value.ToString();
|
||||
inputExcel[a, 3] = dataGridView1.Rows[a].Cells["list_name"].Value.ToString();
|
||||
inputExcel[a, 4] = dataGridView1.Rows[a].Cells["charge"].Value.ToString();
|
||||
inputExcel[a, 5] = dataGridView1.Rows[a].Cells["work_name"].Value.ToString();
|
||||
inputExcel[a, 6] = dataGridView1.Rows[a].Cells["count"].Value.ToString();
|
||||
|
||||
inputExcel[a, 7] = dataGridView1.Rows[a].Cells["state"].Value.ToString();
|
||||
inputExcel[a, 8] = dataGridView1.Rows[a].Cells["etc"].Value.ToString();
|
||||
|
||||
// inputExcel[a, 7] = dataGridView1.Rows[a].Cells["stock"].Value.ToString();
|
||||
// inputExcel[a, 8] = dataGridView1.Rows[a].Cells["unstock"].Value.ToString();
|
||||
// inputExcel[a, 9] = dataGridView1.Rows[a].Cells["state"].Value.ToString();
|
||||
// inputExcel[a, 10] =dataGridView1.Rows[a].Cells["etc"].Value.ToString();
|
||||
var seq = 0;
|
||||
inputExcel[a, seq++] = row_idx.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["start_date"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["end_date"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["custname"]?.Value.ToString() ?? "";
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["list_name"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["charge"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["work_name"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["count"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["state"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["etc"].Value.ToString();
|
||||
inputExcel[a, seq++] = dataGridView1.Rows[a].Cells["customer"]?.Value.ToString() ?? "";
|
||||
}
|
||||
et.Mk_Excel(Excel_title, inputExcel);
|
||||
}
|
||||
@@ -198,19 +205,23 @@ namespace WindowsFormsApp1.Mac
|
||||
|
||||
private void btn_Progress_Click(object sender, EventArgs e)
|
||||
{
|
||||
for(int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V") {
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "진행") {
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V")
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "진행")
|
||||
{
|
||||
MessageBox.Show("체크된 목록이 현재 진행중입니다.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(int a= 0; a < dataGridView1.Rows.Count; a++)
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V") {
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "완료") {
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V")
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "완료")
|
||||
{
|
||||
dataGridView1.Rows[a].Cells["state"].Value = "진행";
|
||||
state_Save(a);
|
||||
}
|
||||
@@ -225,8 +236,10 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V") {
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "완료") {
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V")
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "완료")
|
||||
{
|
||||
MessageBox.Show("체크된 목록은 현재 완료되어있습니다.");
|
||||
return;
|
||||
}
|
||||
@@ -234,8 +247,10 @@ namespace WindowsFormsApp1.Mac
|
||||
}
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V") {
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "진행") {
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V")
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["state"].Value.ToString() == "진행")
|
||||
{
|
||||
dataGridView1.Rows[a].Cells["state"].Value = "완료";
|
||||
state_Save(a);
|
||||
}
|
||||
@@ -268,9 +283,10 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V") {
|
||||
if (dataGridView1.Rows[a].Cells["check"].Value.ToString() == "V")
|
||||
{
|
||||
string l_idx = dataGridView1.Rows[a].Cells["idx"].Value.ToString();
|
||||
string D_cmd = db.DB_Delete("Obj_List", "comp_num", compidx,
|
||||
string D_cmd = db.DB_Delete("Obj_List", "comp_num", compidx,
|
||||
"idx", l_idx);
|
||||
db.DB_Send_CMD_reVoid(D_cmd);
|
||||
|
||||
@@ -294,17 +310,29 @@ namespace WindowsFormsApp1.Mac
|
||||
{
|
||||
int idx_row = e.RowIndex;
|
||||
int idx_col = e.ColumnIndex;
|
||||
if (3 <= idx_col && idx_col <= 8) {
|
||||
ExcelTest.Marc marc = new ExcelTest.Marc(this);
|
||||
marc.MdiParent = main;
|
||||
marc.WindowState = FormWindowState.Maximized;
|
||||
marc.Show();
|
||||
marc.input_list(
|
||||
dataGridView1.Rows[idx_row].Cells["idx"].Value.ToString(),
|
||||
dataGridView1.Rows[idx_row].Cells["list_name"].Value.ToString(), compidx);
|
||||
/// marc.input_list(
|
||||
/// dataGridView1.Rows[idx_row].Cells["idx"].Value.ToString(),
|
||||
/// dataGridView1.Rows[idx_row].Cells["list_name"].Value.ToString());
|
||||
if (3 <= idx_col && idx_col <= 8)
|
||||
{
|
||||
if (chkEditorTest.Checked == false)
|
||||
{
|
||||
var marc = this.main.OpenFormInTab(() => new ExcelTest.Marc2(this), allowMultiple: true);
|
||||
marc.input_list(
|
||||
dataGridView1.Rows[idx_row].Cells["idx"].Value.ToString(),
|
||||
dataGridView1.Rows[idx_row].Cells["list_name"].Value.ToString(), compidx,
|
||||
(dataGridView1.Rows[idx_row].Cells["dvc_cust"]?.Value.ToString() ?? string.Empty),
|
||||
(dataGridView1.Rows[idx_row].Cells["dvc_custname"]?.Value.ToString() ?? string.Empty)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
var marc = this.main.OpenFormInTab(() => new ExcelTest.Marc(this), allowMultiple: true);
|
||||
marc.input_list(
|
||||
dataGridView1.Rows[idx_row].Cells["idx"].Value.ToString(),
|
||||
dataGridView1.Rows[idx_row].Cells["list_name"].Value.ToString(), compidx,
|
||||
(dataGridView1.Rows[idx_row].Cells["dvc_cust"]?.Value.ToString() ?? string.Empty),
|
||||
(dataGridView1.Rows[idx_row].Cells["dvc_custname"]?.Value.ToString() ?? string.Empty)
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
if (((DataGridView)sender).Columns[idx_col].Name == "check")
|
||||
{
|
||||
@@ -340,25 +368,15 @@ namespace WindowsFormsApp1.Mac
|
||||
Skill_Grid sg = new Skill_Grid();
|
||||
sg.Print_Grid_Num(sender, e);
|
||||
}
|
||||
private Check_ISBN mMac_check_ISBN;
|
||||
|
||||
private void btnSearchISBN_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.dataGridView1.RowCount < 1) return;
|
||||
if (dataGridView1.SelectedRows[0].Index < 0) return;
|
||||
string tSearchText = dataGridView1.SelectedRows[0].Cells["list_name"].Value.ToString();
|
||||
string tSearchIDX = dataGridView1.SelectedRows[0].Cells["idx"].Value.ToString();
|
||||
if (mMac_check_ISBN != null)
|
||||
{
|
||||
mMac_check_ISBN.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
mMac_check_ISBN = new Check_ISBN(main, tSearchText, tSearchIDX);
|
||||
mMac_check_ISBN.MdiParent = main;
|
||||
mMac_check_ISBN.WindowState = FormWindowState.Maximized;
|
||||
mMac_check_ISBN.FormClosed += (o, ea) => mMac_check_ISBN = null;
|
||||
mMac_check_ISBN.tb_list_name.Enabled = true;
|
||||
mMac_check_ISBN.Show();
|
||||
}
|
||||
var isbn = main.OpenFormInTab(() => new Check_ISBN(main, tSearchText, tSearchIDX));
|
||||
isbn.tb_list_name.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,9 @@
|
||||
<metadata name="end_date.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dvc_custname.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="list_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -150,6 +153,9 @@
|
||||
<metadata name="charge.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dvc_cust.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="check.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -157,6 +163,6 @@
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>51</value>
|
||||
<value>55</value>
|
||||
</metadata>
|
||||
</root>
|
||||
155
unimarc/unimarc/마크/Mac_List_Add.Designer.cs
generated
155
unimarc/unimarc/마크/Mac_List_Add.Designer.cs
generated
@@ -37,18 +37,19 @@ namespace UniMarc.마크
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.panel1 = new System.Windows.Forms.Panel();
|
||||
this.tbCustomIDX = new System.Windows.Forms.TextBox();
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
this.cb_Gubun = new System.Windows.Forms.ComboBox();
|
||||
this.btn_DelRow = new System.Windows.Forms.Button();
|
||||
this.btn_Upload = new System.Windows.Forms.Button();
|
||||
this.cb_User = new System.Windows.Forms.ComboBox();
|
||||
this.btn_Close = new System.Windows.Forms.Button();
|
||||
this.btClose = new System.Windows.Forms.Button();
|
||||
this.btn_Empty = new System.Windows.Forms.Button();
|
||||
this.btn_AddList = new System.Windows.Forms.Button();
|
||||
this.btSave = new System.Windows.Forms.Button();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.btCustom = new System.Windows.Forms.Button();
|
||||
this.tb_ExpectList = new System.Windows.Forms.TextBox();
|
||||
this.tb_divName = new System.Windows.Forms.TextBox();
|
||||
this.tb_divComp = new System.Windows.Forms.TextBox();
|
||||
@@ -72,33 +73,46 @@ namespace UniMarc.마크
|
||||
// panel1
|
||||
//
|
||||
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
this.panel1.Controls.Add(this.tbCustomIDX);
|
||||
this.panel1.Controls.Add(this.label5);
|
||||
this.panel1.Controls.Add(this.cb_Gubun);
|
||||
this.panel1.Controls.Add(this.btn_DelRow);
|
||||
this.panel1.Controls.Add(this.btn_Upload);
|
||||
this.panel1.Controls.Add(this.cb_User);
|
||||
this.panel1.Controls.Add(this.btn_Close);
|
||||
this.panel1.Controls.Add(this.btClose);
|
||||
this.panel1.Controls.Add(this.btn_Empty);
|
||||
this.panel1.Controls.Add(this.btn_AddList);
|
||||
this.panel1.Controls.Add(this.btSave);
|
||||
this.panel1.Controls.Add(this.label3);
|
||||
this.panel1.Controls.Add(this.label2);
|
||||
this.panel1.Controls.Add(this.label4);
|
||||
this.panel1.Controls.Add(this.label1);
|
||||
this.panel1.Controls.Add(this.btCustom);
|
||||
this.panel1.Controls.Add(this.tb_ExpectList);
|
||||
this.panel1.Controls.Add(this.tb_divName);
|
||||
this.panel1.Controls.Add(this.tb_divComp);
|
||||
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel1.Location = new System.Drawing.Point(0, 0);
|
||||
this.panel1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel1.Name = "panel1";
|
||||
this.panel1.Size = new System.Drawing.Size(897, 59);
|
||||
this.panel1.Size = new System.Drawing.Size(1025, 73);
|
||||
this.panel1.TabIndex = 0;
|
||||
//
|
||||
// tbCustomIDX
|
||||
//
|
||||
this.tbCustomIDX.Location = new System.Drawing.Point(200, 6);
|
||||
this.tbCustomIDX.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tbCustomIDX.Name = "tbCustomIDX";
|
||||
this.tbCustomIDX.ReadOnly = true;
|
||||
this.tbCustomIDX.Size = new System.Drawing.Size(75, 25);
|
||||
this.tbCustomIDX.TabIndex = 15;
|
||||
this.tbCustomIDX.TabStop = false;
|
||||
this.tbCustomIDX.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
|
||||
//
|
||||
// label5
|
||||
//
|
||||
this.label5.AutoSize = true;
|
||||
this.label5.Location = new System.Drawing.Point(592, 35);
|
||||
this.label5.Location = new System.Drawing.Point(677, 44);
|
||||
this.label5.Name = "label5";
|
||||
this.label5.Size = new System.Drawing.Size(53, 12);
|
||||
this.label5.Size = new System.Drawing.Size(67, 15);
|
||||
this.label5.TabIndex = 14;
|
||||
this.label5.Text = "쉼표구분";
|
||||
//
|
||||
@@ -106,16 +120,18 @@ namespace UniMarc.마크
|
||||
//
|
||||
this.cb_Gubun.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cb_Gubun.FormattingEnabled = true;
|
||||
this.cb_Gubun.Location = new System.Drawing.Point(647, 31);
|
||||
this.cb_Gubun.Location = new System.Drawing.Point(739, 39);
|
||||
this.cb_Gubun.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.cb_Gubun.Name = "cb_Gubun";
|
||||
this.cb_Gubun.Size = new System.Drawing.Size(75, 20);
|
||||
this.cb_Gubun.Size = new System.Drawing.Size(85, 23);
|
||||
this.cb_Gubun.TabIndex = 6;
|
||||
//
|
||||
// btn_DelRow
|
||||
//
|
||||
this.btn_DelRow.Location = new System.Drawing.Point(560, 4);
|
||||
this.btn_DelRow.Location = new System.Drawing.Point(640, 5);
|
||||
this.btn_DelRow.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_DelRow.Name = "btn_DelRow";
|
||||
this.btn_DelRow.Size = new System.Drawing.Size(81, 23);
|
||||
this.btn_DelRow.Size = new System.Drawing.Size(93, 29);
|
||||
this.btn_DelRow.TabIndex = 5;
|
||||
this.btn_DelRow.Text = "선택 셀 삭제";
|
||||
this.btn_DelRow.UseVisualStyleBackColor = true;
|
||||
@@ -123,9 +139,10 @@ namespace UniMarc.마크
|
||||
//
|
||||
// btn_Upload
|
||||
//
|
||||
this.btn_Upload.Location = new System.Drawing.Point(728, 30);
|
||||
this.btn_Upload.Location = new System.Drawing.Point(832, 38);
|
||||
this.btn_Upload.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_Upload.Name = "btn_Upload";
|
||||
this.btn_Upload.Size = new System.Drawing.Size(75, 23);
|
||||
this.btn_Upload.Size = new System.Drawing.Size(86, 29);
|
||||
this.btn_Upload.TabIndex = 7;
|
||||
this.btn_Upload.Text = "txt불러오기";
|
||||
this.btn_Upload.UseVisualStyleBackColor = true;
|
||||
@@ -135,108 +152,119 @@ namespace UniMarc.마크
|
||||
//
|
||||
this.cb_User.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cb_User.FormattingEnabled = true;
|
||||
this.cb_User.Location = new System.Drawing.Point(373, 5);
|
||||
this.cb_User.Location = new System.Drawing.Point(517, 6);
|
||||
this.cb_User.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.cb_User.Name = "cb_User";
|
||||
this.cb_User.Size = new System.Drawing.Size(82, 20);
|
||||
this.cb_User.Size = new System.Drawing.Size(93, 23);
|
||||
this.cb_User.TabIndex = 2;
|
||||
//
|
||||
// btn_Close
|
||||
// btClose
|
||||
//
|
||||
this.btn_Close.Location = new System.Drawing.Point(809, 4);
|
||||
this.btn_Close.Name = "btn_Close";
|
||||
this.btn_Close.Size = new System.Drawing.Size(75, 23);
|
||||
this.btn_Close.TabIndex = 8;
|
||||
this.btn_Close.Text = "닫 기";
|
||||
this.btn_Close.UseVisualStyleBackColor = true;
|
||||
this.btn_Close.Click += new System.EventHandler(this.btn_Close_Click);
|
||||
this.btClose.Location = new System.Drawing.Point(925, 5);
|
||||
this.btClose.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btClose.Name = "btClose";
|
||||
this.btClose.Size = new System.Drawing.Size(86, 29);
|
||||
this.btClose.TabIndex = 8;
|
||||
this.btClose.Text = "닫 기";
|
||||
this.btClose.UseVisualStyleBackColor = true;
|
||||
this.btClose.Click += new System.EventHandler(this.btn_Close_Click);
|
||||
//
|
||||
// btn_Empty
|
||||
//
|
||||
this.btn_Empty.Location = new System.Drawing.Point(647, 4);
|
||||
this.btn_Empty.Location = new System.Drawing.Point(739, 5);
|
||||
this.btn_Empty.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btn_Empty.Name = "btn_Empty";
|
||||
this.btn_Empty.Size = new System.Drawing.Size(75, 23);
|
||||
this.btn_Empty.Size = new System.Drawing.Size(86, 29);
|
||||
this.btn_Empty.TabIndex = 4;
|
||||
this.btn_Empty.Text = "비 우 기";
|
||||
this.btn_Empty.UseVisualStyleBackColor = true;
|
||||
this.btn_Empty.Click += new System.EventHandler(this.btn_Empty_Click);
|
||||
//
|
||||
// btn_AddList
|
||||
// btSave
|
||||
//
|
||||
this.btn_AddList.Location = new System.Drawing.Point(728, 4);
|
||||
this.btn_AddList.Name = "btn_AddList";
|
||||
this.btn_AddList.Size = new System.Drawing.Size(75, 23);
|
||||
this.btn_AddList.TabIndex = 3;
|
||||
this.btn_AddList.Text = "저 장";
|
||||
this.btn_AddList.UseVisualStyleBackColor = true;
|
||||
this.btn_AddList.Click += new System.EventHandler(this.btn_AddList_Click);
|
||||
this.btSave.Location = new System.Drawing.Point(832, 5);
|
||||
this.btSave.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btSave.Name = "btSave";
|
||||
this.btSave.Size = new System.Drawing.Size(86, 29);
|
||||
this.btSave.TabIndex = 3;
|
||||
this.btSave.Text = "저 장";
|
||||
this.btSave.UseVisualStyleBackColor = true;
|
||||
this.btSave.Click += new System.EventHandler(this.btn_AddList_Click);
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(330, 9);
|
||||
this.label3.Location = new System.Drawing.Point(467, 11);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(41, 12);
|
||||
this.label3.Size = new System.Drawing.Size(52, 15);
|
||||
this.label3.TabIndex = 13;
|
||||
this.label3.Text = "담당자";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(178, 9);
|
||||
this.label2.Location = new System.Drawing.Point(294, 11);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(41, 12);
|
||||
this.label2.Size = new System.Drawing.Size(52, 15);
|
||||
this.label2.TabIndex = 11;
|
||||
this.label2.Text = "납품명";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(27, 35);
|
||||
this.label4.Location = new System.Drawing.Point(31, 44);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(81, 12);
|
||||
this.label4.Size = new System.Drawing.Size(102, 15);
|
||||
this.label4.TabIndex = 10;
|
||||
this.label4.Text = "생성될 목록명";
|
||||
//
|
||||
// label1
|
||||
// btCustom
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(26, 9);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(41, 12);
|
||||
this.label1.TabIndex = 9;
|
||||
this.label1.Text = "납품처";
|
||||
this.btCustom.AutoSize = true;
|
||||
this.btCustom.Location = new System.Drawing.Point(6, 5);
|
||||
this.btCustom.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.btCustom.Name = "btCustom";
|
||||
this.btCustom.Size = new System.Drawing.Size(71, 31);
|
||||
this.btCustom.TabIndex = 9;
|
||||
this.btCustom.Text = "납품처";
|
||||
this.btCustom.Click += new System.EventHandler(this.label1_Click);
|
||||
//
|
||||
// tb_ExpectList
|
||||
//
|
||||
this.tb_ExpectList.Enabled = false;
|
||||
this.tb_ExpectList.Location = new System.Drawing.Point(114, 31);
|
||||
this.tb_ExpectList.Location = new System.Drawing.Point(130, 39);
|
||||
this.tb_ExpectList.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tb_ExpectList.Name = "tb_ExpectList";
|
||||
this.tb_ExpectList.Size = new System.Drawing.Size(250, 21);
|
||||
this.tb_ExpectList.Size = new System.Drawing.Size(285, 25);
|
||||
this.tb_ExpectList.TabIndex = 12;
|
||||
//
|
||||
// tb_divName
|
||||
//
|
||||
this.tb_divName.Location = new System.Drawing.Point(221, 5);
|
||||
this.tb_divName.Location = new System.Drawing.Point(343, 6);
|
||||
this.tb_divName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tb_divName.Name = "tb_divName";
|
||||
this.tb_divName.Size = new System.Drawing.Size(100, 21);
|
||||
this.tb_divName.Size = new System.Drawing.Size(114, 25);
|
||||
this.tb_divName.TabIndex = 1;
|
||||
this.tb_divName.TextChanged += new System.EventHandler(this.Delivery_TextChanged);
|
||||
//
|
||||
// tb_divComp
|
||||
//
|
||||
this.tb_divComp.Location = new System.Drawing.Point(69, 5);
|
||||
this.tb_divComp.Location = new System.Drawing.Point(79, 6);
|
||||
this.tb_divComp.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.tb_divComp.Name = "tb_divComp";
|
||||
this.tb_divComp.Size = new System.Drawing.Size(100, 21);
|
||||
this.tb_divComp.Size = new System.Drawing.Size(114, 25);
|
||||
this.tb_divComp.TabIndex = 0;
|
||||
this.tb_divComp.TextChanged += new System.EventHandler(this.Delivery_TextChanged);
|
||||
this.tb_divComp.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_divComp_KeyDown);
|
||||
//
|
||||
// panel2
|
||||
//
|
||||
this.panel2.Controls.Add(this.dataGridView1);
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 59);
|
||||
this.panel2.Location = new System.Drawing.Point(0, 73);
|
||||
this.panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.panel2.Name = "panel2";
|
||||
this.panel2.Size = new System.Drawing.Size(897, 621);
|
||||
this.panel2.Size = new System.Drawing.Size(1025, 777);
|
||||
this.panel2.TabIndex = 1;
|
||||
//
|
||||
// dataGridView1
|
||||
@@ -264,9 +292,10 @@ namespace UniMarc.마크
|
||||
this.ISBN});
|
||||
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
|
||||
this.dataGridView1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.RowTemplate.Height = 23;
|
||||
this.dataGridView1.Size = new System.Drawing.Size(897, 621);
|
||||
this.dataGridView1.Size = new System.Drawing.Size(1025, 777);
|
||||
this.dataGridView1.TabIndex = 1;
|
||||
this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
|
||||
this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown);
|
||||
@@ -347,11 +376,12 @@ namespace UniMarc.마크
|
||||
//
|
||||
// Mac_List_Add
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(897, 680);
|
||||
this.ClientSize = new System.Drawing.Size(1025, 850);
|
||||
this.Controls.Add(this.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
|
||||
this.Name = "Mac_List_Add";
|
||||
this.Text = "마크 목록 생성";
|
||||
this.Load += new System.EventHandler(this.Mac_List_Add_Load);
|
||||
@@ -368,16 +398,16 @@ namespace UniMarc.마크
|
||||
private System.Windows.Forms.Panel panel1;
|
||||
private System.Windows.Forms.Panel panel2;
|
||||
private System.Windows.Forms.DataGridView dataGridView1;
|
||||
private System.Windows.Forms.Button btn_AddList;
|
||||
private System.Windows.Forms.Button btSave;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button btCustom;
|
||||
private System.Windows.Forms.TextBox tb_divName;
|
||||
private System.Windows.Forms.TextBox tb_divComp;
|
||||
private System.Windows.Forms.Label label3;
|
||||
private System.Windows.Forms.ComboBox cb_User;
|
||||
private System.Windows.Forms.TextBox tb_ExpectList;
|
||||
private System.Windows.Forms.Label label4;
|
||||
private System.Windows.Forms.Button btn_Close;
|
||||
private System.Windows.Forms.Button btClose;
|
||||
private System.Windows.Forms.Button btn_Empty;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn header;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn num;
|
||||
@@ -393,5 +423,6 @@ namespace UniMarc.마크
|
||||
private System.Windows.Forms.Label label5;
|
||||
private System.Windows.Forms.OpenFileDialog openFileDialog1;
|
||||
private System.Windows.Forms.Button btn_DelRow;
|
||||
private System.Windows.Forms.TextBox tbCustomIDX;
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,9 @@ using System.Windows.Forms;
|
||||
using WindowsFormsApp1;
|
||||
using WindowsFormsApp1.Mac;
|
||||
using System.IO;
|
||||
using Microsoft.Office.Interop.Excel;
|
||||
using UniMarc.ListOfValue;
|
||||
using AR;
|
||||
|
||||
namespace UniMarc.마크
|
||||
{
|
||||
@@ -78,11 +81,22 @@ namespace UniMarc.마크
|
||||
string listName = tb_ExpectList.Text;
|
||||
string charge = cb_User.Text;
|
||||
|
||||
if (!CopyCheck(compidx, listName, Today)) {
|
||||
int custidx = -1;
|
||||
if (int.TryParse(tbCustomIDX.Text, out custidx) == false)
|
||||
{
|
||||
UTIL.MsgE("납품처를 올바르게 선택하세요");
|
||||
tb_divComp.Focus();
|
||||
tb_divComp.SelectAll();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CopyCheck(compidx, listName, Today))
|
||||
{
|
||||
MessageBox.Show("목록이 중복되었습니다! 다시 확인해주세요.", "Error");
|
||||
return;
|
||||
}
|
||||
if (tb_ExpectList.Text == "") {
|
||||
if (listName.isEmpty())
|
||||
{
|
||||
MessageBox.Show("목록명이 비어있습니다! 다시 확인해주세요.", "Error");
|
||||
return;
|
||||
}
|
||||
@@ -95,8 +109,8 @@ namespace UniMarc.마크
|
||||
int TotalCount = 0;
|
||||
string InList_Idx = "㏓InList_Idx♠";
|
||||
|
||||
string[] InList_Tbl = { "comp_num", "date", "list_name", "m_charge", "state", "vol", "chk_marc" };
|
||||
string[] InList_Col = { compidx, Today, listName, charge, "진행", TotalCount.ToString(), "1" };
|
||||
string[] InList_Tbl = { "comp_num", "date", "list_name", "m_charge", "state", "vol", "chk_marc", "customer" };
|
||||
string[] InList_Col = { compidx, Today, listName, charge, "진행", TotalCount.ToString(), "1", $"{custidx}" };
|
||||
|
||||
for (int a = 0; a < dataGridView1.Rows.Count; a++)
|
||||
{
|
||||
@@ -105,15 +119,15 @@ namespace UniMarc.마크
|
||||
if (dataGridView1.Rows[a].Cells["BookName"].Value.ToString() == "")
|
||||
break;
|
||||
|
||||
string header = dataGridView1.Rows[a].Cells["header"].Value.ToString();
|
||||
string num = dataGridView1.Rows[a].Cells["num"].Value.ToString();
|
||||
string header = dataGridView1.Rows[a].Cells["header"].Value.ToString();
|
||||
string num = dataGridView1.Rows[a].Cells["num"].Value.ToString();
|
||||
string bookname = dataGridView1.Rows[a].Cells["BookName"].Value.ToString();
|
||||
string author = dataGridView1.Rows[a].Cells["Author"].Value.ToString();
|
||||
string author = dataGridView1.Rows[a].Cells["Author"].Value.ToString();
|
||||
string bookcomp = dataGridView1.Rows[a].Cells["BookComp"].Value.ToString();
|
||||
string price = dataGridView1.Rows[a].Cells["Price"].Value.ToString().Replace(",", "");
|
||||
string count = dataGridView1.Rows[a].Cells["Count"].Value.ToString().Replace(",", "");
|
||||
string total = dataGridView1.Rows[a].Cells["Total"].Value.ToString().Replace(",", "");
|
||||
string isbn = dataGridView1.Rows[a].Cells["ISBN"].Value.ToString();
|
||||
string price = dataGridView1.Rows[a].Cells["Price"].Value.ToString().Replace(",", "");
|
||||
string count = dataGridView1.Rows[a].Cells["Count"].Value.ToString().Replace(",", "");
|
||||
string total = dataGridView1.Rows[a].Cells["Total"].Value.ToString().Replace(",", "");
|
||||
string isbn = dataGridView1.Rows[a].Cells["ISBN"].Value.ToString();
|
||||
|
||||
string tmp = string.Format(
|
||||
"(\"{0}\", \"{1}\", \"{2}\", \"{3}\", \"{4}\", " +
|
||||
@@ -176,12 +190,14 @@ namespace UniMarc.마크
|
||||
{
|
||||
for (int a = 0; a < dataGridView1.Columns.Count; a++)
|
||||
{
|
||||
if (a == 5 || a == 7) {
|
||||
if (a == 5 || a == 7)
|
||||
{
|
||||
if (dataGridView1.Rows[row].Cells[a].Value == null)
|
||||
dataGridView1.Rows[row].Cells[a].Value = "0";
|
||||
}
|
||||
|
||||
else if (a == 6) {
|
||||
else if (a == 6)
|
||||
{
|
||||
if (dataGridView1.Rows[row].Cells[a].Value == null)
|
||||
dataGridView1.Rows[row].Cells[a].Value = "1";
|
||||
}
|
||||
@@ -208,7 +224,7 @@ namespace UniMarc.마크
|
||||
{
|
||||
Gubun = '\t';
|
||||
}
|
||||
|
||||
|
||||
if (textValue.Length < 0)
|
||||
return;
|
||||
try
|
||||
@@ -252,5 +268,35 @@ namespace UniMarc.마크
|
||||
{
|
||||
sg.Excel_to_DataGridView(sender, e);
|
||||
}
|
||||
|
||||
private void label1_Click(object sender, EventArgs e)
|
||||
{
|
||||
LovCustom();
|
||||
}
|
||||
void LovCustom()
|
||||
{
|
||||
string compidx = Properties.Settings.Default.compidx;
|
||||
var inputsearch = tb_divComp.Text.Trim();
|
||||
var where = $"campanyidx={compidx}";
|
||||
if (inputsearch.isEmpty() == false)
|
||||
{
|
||||
where += $" and c_sangho like '%{inputsearch.Replace("'", "''")}%'";
|
||||
}
|
||||
var dt = DB2.GetDT("Client", columns: "idx,c_sangho", orders: "c_sangho", wheres: where);
|
||||
using (var f = new fSelectDT(dt))
|
||||
if (f.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var dr = f.SelectedRow;
|
||||
if (dr == null) return;
|
||||
tbCustomIDX.Text = dr["idx"]?.ToString() ?? string.Empty;
|
||||
tb_divComp.Text = dr["c_sangho"]?.ToString() ?? string.Empty;
|
||||
tb_divName.Focus(); //납품명으로 커서 이동
|
||||
}
|
||||
}
|
||||
|
||||
private void tb_divComp_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Enter) LovCustom();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
//using Microsoft.Office.Interop.Excel;
|
||||
using AR;
|
||||
using OpenQA.Selenium.DevTools.V136.Animation;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
@@ -11,6 +13,7 @@ using System.Text.RegularExpressions;
|
||||
using System.Web.UI;
|
||||
using System.Windows.Forms;
|
||||
using UniMarc;
|
||||
using UniMarc.ListOfValue;
|
||||
using UniMarc.마크;
|
||||
using WindowsFormsApp1;
|
||||
using WindowsFormsApp1.Mac;
|
||||
@@ -27,6 +30,7 @@ namespace ExcelTest
|
||||
int SaveRowIdx = -1;
|
||||
public string mUserName;
|
||||
string mCompidx = UniMarc.Properties.Settings.Default.compidx;
|
||||
string mListIdx = "";
|
||||
public string find;
|
||||
public string change;
|
||||
public string call = "";
|
||||
@@ -44,6 +48,8 @@ namespace ExcelTest
|
||||
public Marc()
|
||||
{
|
||||
InitializeComponent();
|
||||
this.ml = null;
|
||||
mUserName = string.Empty;
|
||||
}
|
||||
public Marc(Mac_List _ml)
|
||||
{
|
||||
@@ -52,6 +58,8 @@ namespace ExcelTest
|
||||
mUserName = ml.user_name;
|
||||
}
|
||||
|
||||
string l_idx = string.Empty;
|
||||
string c_idx = string.Empty;
|
||||
private void Marc_Load(object sender, EventArgs e)
|
||||
{
|
||||
#region ComboBox Item Setting
|
||||
@@ -90,94 +98,6 @@ namespace ExcelTest
|
||||
#endregion
|
||||
}
|
||||
|
||||
//public void input_list(string l_idx, string value)
|
||||
//{
|
||||
// db.DBcon();
|
||||
|
||||
// lbl_BookList.Text = value;
|
||||
|
||||
// string Area =
|
||||
// // 0 1 2 3
|
||||
// "olb.idx, olb.isbn_marc, olb.header, olb.num, " +
|
||||
// // 4 5 6 7 8 9
|
||||
// "olb.book_name, olb.author, olb.book_comp, olb.`count`, olb.price, olb.image_url, " +
|
||||
// // 10 11 12 13 14 15 16
|
||||
// "mac.idx, mac.marc, mac.marc_chk, mac.marc1, mac.marc_chk1, mac.marc2, mac.marc_chk2, " +
|
||||
// // 17 18 19 20
|
||||
// "mac.grade, mac.compidx, mac.`user`, mac.date";
|
||||
|
||||
// string CMD = string.Format("" +
|
||||
// "SELECT {0} " +
|
||||
// "FROM Obj_List_Book AS olb " +
|
||||
// "LEFT JOIN Marc AS mac " +
|
||||
// // "ON if (olb.m_idx = 0, mac.ISBN = olb.isbn_marc, mac.idx = olb.m_idx) " +
|
||||
// "ON mac.ISBN = olb.isbn_marc " +
|
||||
// "WHERE olb.l_idx = {1} " +
|
||||
// "GROUP BY olb.book_name " +
|
||||
// "ORDER BY olb.idx ASC;", Area, l_idx);
|
||||
// string db_res = db.DB_Send_CMD_Search(CMD);
|
||||
// string[] db_data = db_res.Split('|');
|
||||
|
||||
// string[] grid = {
|
||||
// "", "", "", "", "",
|
||||
// "", "", "", "", "",
|
||||
// "", "", "V", "", "" };
|
||||
|
||||
// string[] MarcData = { "", "", "", "", "", "" };
|
||||
|
||||
// for (int a = 0; a < db_data.Length; a++)
|
||||
// {
|
||||
// if (a % 21 == 00) grid[0] = db_data[a];
|
||||
// if (a % 21 == 01) grid[1] = db_data[a];
|
||||
// if (a % 21 == 02) grid[2] = db_data[a];
|
||||
// if (a % 21 == 03) grid[2] += db_data[a];
|
||||
// if (a % 21 == 04) grid[3] = db_data[a];
|
||||
// if (a % 21 == 05) grid[4] = db_data[a];
|
||||
// if (a % 21 == 06) grid[5] = db_data[a];
|
||||
// if (a % 21 == 07) grid[6] = db_data[a];
|
||||
// if (a % 21 == 08) grid[7] = db_data[a];
|
||||
// if (a % 21 == 09) grid[8] = db_data[a];
|
||||
// if (a % 21 == 10) grid[9] = db_data[a];
|
||||
// if (a % 21 == 11) MarcData[0] = db_data[a];
|
||||
// if (a % 21 == 12) MarcData[1] = db_data[a];
|
||||
// if (a % 21 == 13) MarcData[2] = db_data[a];
|
||||
// if (a % 21 == 14) MarcData[3] = db_data[a];
|
||||
// if (a % 21 == 15) MarcData[4] = db_data[a];
|
||||
// if (a % 21 == 16) MarcData[5] = db_data[a];
|
||||
// if (a % 21 == 17)
|
||||
// {
|
||||
// grid[10] = RealMarc(MarcData);
|
||||
// if (grid[10] == "") grid[11] = "3";
|
||||
// else grid[11] = db_data[a];
|
||||
// }
|
||||
// if (a % 21 == 18) {
|
||||
// if (db_data[a] == "") grid[13] = "";
|
||||
// else if (mCompidx != db_data[a]) {
|
||||
// string FindCompCmd = string.Format("SELECT `comp_name` FROM `Comp` WHERE `idx` = {0}", db_data[a]);
|
||||
// grid[13] = db.DB_Send_CMD_Search(FindCompCmd).Replace("|", "");
|
||||
// }
|
||||
// }
|
||||
// if (a % 21 == 19) {
|
||||
// if (grid[13] == "")
|
||||
// grid[13] = db_data[a];
|
||||
// }
|
||||
// if (a % 21 == 20)
|
||||
// {
|
||||
// grid[14] = db_data[a];
|
||||
// List_Book.Rows.Add(grid);
|
||||
// }
|
||||
// }
|
||||
|
||||
// for (int a = 0; a < List_Book.Rows.Count; a++)
|
||||
// {
|
||||
// string Grade = List_Book.Rows[a].Cells["grade"].Value.ToString();
|
||||
// string SaveDate = List_Book.Rows[a].Cells["SaveDate"].Value.ToString();
|
||||
// List_Book.Rows[a].DefaultCellStyle.ForeColor = SetGradeColor(Grade);
|
||||
// SaveDateCheck(SaveDate, a);
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
private string RealMarc(string[] MarcData)
|
||||
{
|
||||
string result = "";
|
||||
@@ -198,14 +118,26 @@ namespace ExcelTest
|
||||
/// </summary>
|
||||
/// <param name="date">목록일자</param>
|
||||
/// <param name="value">목록명</param>
|
||||
public void input_list(string l_idx, string value, string C_idx)
|
||||
public void input_list(string l_idx, string value, string C_idx, string custidx, string custname)
|
||||
{
|
||||
db.DBcon();
|
||||
if (value.isEmpty() == false)
|
||||
{
|
||||
if (value.IndexOf("]") != -1)
|
||||
this.Text = $"마크 작성(1)-{value.Substring(value.IndexOf("]")+1)}";
|
||||
else
|
||||
this.Text = $"마크 작성(1){value}";
|
||||
}
|
||||
|
||||
this.l_idx = l_idx;
|
||||
this.c_idx = C_idx;
|
||||
string Area = "`idx`, `isbn_marc`, `header`, `num`, `book_name`, `author`, `book_comp`, `count`, `pay`, `image_url`, `m_idx`";
|
||||
string[] sear_tbl = { "l_idx", "compidx" };
|
||||
string[] sear_col = { l_idx, C_idx };
|
||||
|
||||
lbl_BookList.Text = value;
|
||||
tbCustName.Text = custname;
|
||||
lbCustIDX.Text = custidx;
|
||||
|
||||
string cmd =
|
||||
string.Format("SELECT {0} " +
|
||||
@@ -222,7 +154,7 @@ namespace ExcelTest
|
||||
|
||||
|
||||
mLoadCompleted = false;
|
||||
for (int a = 0; a < db_data.Length-1; a += 11)
|
||||
for (int a = 0; a < db_data.Length - 1; a += 11)
|
||||
{
|
||||
|
||||
grid[0] = db_data[a]; // 0: idx
|
||||
@@ -256,7 +188,8 @@ namespace ExcelTest
|
||||
mLoadCompleted = true;
|
||||
|
||||
List_Book.ClearSelection();
|
||||
List_Book.Rows[0].Selected = true;
|
||||
if (this.List_Book.RowCount > 0)
|
||||
List_Book.Rows[0].Selected = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -291,18 +224,19 @@ namespace ExcelTest
|
||||
string[] Chk_Arr = Chk_Res.Split('|');
|
||||
|
||||
bool isMyData = true;
|
||||
if (Chk_Arr.Length < 2) {
|
||||
if (Chk_Arr.Length < 2)
|
||||
{
|
||||
List_Book.Rows[a].Cells["grade"].Value = "3";
|
||||
List_Book.Rows[a].DefaultCellStyle.ForeColor = Color.Red;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Chk_Arr[1] != mCompidx)
|
||||
if (Chk_Arr[1] != mCompidx)
|
||||
isMyData = false;
|
||||
|
||||
|
||||
string[] MarcData = { Chk_Arr[2], Chk_Arr[4], Chk_Arr[6] };
|
||||
string[] CheckData = { Chk_Arr[3], Chk_Arr[5], Chk_Arr[7] };
|
||||
|
||||
|
||||
List_Book.Rows[a].DefaultCellStyle.ForeColor = SetGradeColor(Chk_Arr[8], isMyData);
|
||||
List_Book.Rows[a].Cells["marc_idx"].Value = Chk_Arr[0];
|
||||
List_Book.Rows[a].Cells["db_marc"].Value = MarcData[0];//NewestMarc(MarcData, CheckData);
|
||||
@@ -310,11 +244,12 @@ namespace ExcelTest
|
||||
text008.Text = Chk_Arr[9];
|
||||
List_Book.Rows[a].Cells["user"].Value = Chk_Arr[10];
|
||||
List_Book.Rows[a].Cells["SaveDate"].Value = Chk_Arr[11];
|
||||
|
||||
|
||||
if (isMyData)
|
||||
SaveDateCheck(Chk_Arr[11], a);
|
||||
|
||||
else {
|
||||
|
||||
else
|
||||
{
|
||||
string FindCompCmd = string.Format("SELECT `comp_name` FROM `Comp` WHERE `idx` = {0}", Chk_Arr[1]);
|
||||
List_Book.Rows[a].Cells["user"].Value = db.DB_Send_CMD_Search(FindCompCmd).Replace("|", "");
|
||||
List_Book.Rows[a].DefaultCellStyle.BackColor = Color.LightGray;
|
||||
@@ -322,7 +257,7 @@ namespace ExcelTest
|
||||
}
|
||||
}
|
||||
|
||||
private string NewestMarc(string[] marc, string[] marc_chk )
|
||||
private string NewestMarc(string[] marc, string[] marc_chk)
|
||||
{
|
||||
string result = "";
|
||||
int count = 0;
|
||||
@@ -345,13 +280,13 @@ namespace ExcelTest
|
||||
{
|
||||
case "0": // A
|
||||
return Color.Blue;
|
||||
|
||||
|
||||
case "1": // B
|
||||
return Color.Black;
|
||||
|
||||
|
||||
case "2": // C
|
||||
return Color.Gray;
|
||||
|
||||
|
||||
case "3": // D
|
||||
return Color.Red;
|
||||
|
||||
@@ -372,7 +307,7 @@ namespace ExcelTest
|
||||
DateTime TargetDate = DateTime.Today.AddDays(-14);
|
||||
|
||||
int result = DateTime.Compare(SaveDate, TargetDate);
|
||||
|
||||
|
||||
if (result >= 0) // SaveDate가 같거나 큼
|
||||
List_Book.Rows[row].DefaultCellStyle.BackColor = Color.Yellow;
|
||||
|
||||
@@ -386,7 +321,8 @@ namespace ExcelTest
|
||||
call = ((RichTextBox)sender).Name;
|
||||
richTextBox1.LanguageOption = 0;
|
||||
|
||||
if (e.Control) {
|
||||
if (e.Control)
|
||||
{
|
||||
switch (e.KeyValue)
|
||||
{
|
||||
case 70: // f
|
||||
@@ -487,7 +423,8 @@ namespace ExcelTest
|
||||
}
|
||||
private void Btn_Save_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (SaveRowIdx < 0) {
|
||||
if (SaveRowIdx < 0)
|
||||
{
|
||||
MessageBox.Show("마크가 선택되지않았습니다.");
|
||||
return;
|
||||
}
|
||||
@@ -498,10 +435,11 @@ namespace ExcelTest
|
||||
MessageBox.Show("[칸채우기]가 아닌 [마크 편집] 탭에서 저장해주세요!");
|
||||
return;
|
||||
}
|
||||
if (grade == 3) {
|
||||
MessageBox.Show("등급을 설정해주세요. (C 이상)");
|
||||
return;
|
||||
}
|
||||
//if (grade == 3)
|
||||
//{
|
||||
// MessageBox.Show("등급을 설정해주세요. (C 이상)");
|
||||
// return;
|
||||
//}
|
||||
string table_name = "Marc";
|
||||
string BaseText = richTextBox1.Text;
|
||||
string lblisbn = lbl_ISBN.Text.Replace("[", "").Replace("]", "");
|
||||
@@ -509,15 +447,19 @@ namespace ExcelTest
|
||||
if (!BaseText.EndsWith("\n"))
|
||||
BaseText += "\n";
|
||||
|
||||
if (!isPass(BaseText)) {
|
||||
if (!isPass(BaseText))
|
||||
{
|
||||
MessageBox.Show("입력된 마크의 상태를 확인해주세요.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (BaseText.IndexOf(lblisbn) < 0) {
|
||||
MessageBox.Show("ISBN 상태를 확인해주세요.");
|
||||
if (BaseText.IndexOf(lblisbn) < 0)
|
||||
{
|
||||
UTIL.MsgE("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다");
|
||||
//if (dlg != DialogResult.Yes) return;
|
||||
return;
|
||||
}
|
||||
|
||||
string tag056 = Tag056();
|
||||
string[] grid_data = {
|
||||
List_Book.Rows[SaveRowIdx].Cells["ISBN13"].Value.ToString(),
|
||||
@@ -529,6 +471,7 @@ namespace ExcelTest
|
||||
string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
string orimarc = st.made_Ori_marc(richTextBox1).Replace(@"\", "₩");
|
||||
string Midx = List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value.ToString();
|
||||
|
||||
// 필수태그 확인
|
||||
if (!isMustTag(orimarc))
|
||||
{
|
||||
@@ -545,24 +488,11 @@ namespace ExcelTest
|
||||
// 마지막 수정일로부터 2일이 지났는지, 마지막 저장자가 사용자인지 확인
|
||||
TimeSpan sp = spspsp(SaveDate, date);
|
||||
IsCoverDate = IsCoverData(sp.Days, SaveUser);
|
||||
|
||||
// if (IsCoverDate) {
|
||||
// etc2.Text = etc2.Text.Replace(SaveDate, date);
|
||||
// }
|
||||
// else {
|
||||
// etc2.Text += string.Format("{0}\t{1}\n", date, mUserName);
|
||||
// }
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// etc2.Text += string.Format("{0}\t{1}\n", date, mUserName);
|
||||
//}
|
||||
|
||||
// true일 경우 INSERT, false일 경우 UPDATE
|
||||
bool isNewData = true;
|
||||
// true일 경우 INSERT, false일 경우 UPDATE
|
||||
bool isNewData = Midx != "" ? false : true;
|
||||
|
||||
if (Midx != "")
|
||||
isNewData = false;
|
||||
|
||||
if (List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor == Color.Orange ||
|
||||
List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor == Color.Red)
|
||||
@@ -579,7 +509,7 @@ namespace ExcelTest
|
||||
date, mCompidx };
|
||||
|
||||
string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col);
|
||||
PUB.log.Add("INSERT", string.Format( "{0}({1},{2}) : {3}", mUserName, mCompidx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, Incmd));
|
||||
PUB.log.Add("INSERT", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, Incmd));
|
||||
db.DB_Send_CMD_reVoid(Incmd);
|
||||
isNewData = true;
|
||||
}
|
||||
@@ -600,38 +530,9 @@ namespace ExcelTest
|
||||
MessageBox.Show("ISBN 데이터가 없습니다.");
|
||||
return;
|
||||
}
|
||||
//if (grid_data[0] != null && grid_data[0] != "")
|
||||
//{
|
||||
// int marcChk = Sub_marc_chk(grid_data[0]);
|
||||
// if (IsCoverDate)
|
||||
// marcChk--;
|
||||
|
||||
// switch (marcChk)
|
||||
// {
|
||||
// case 0:
|
||||
// Edit_tbl[1] = "marc1";
|
||||
// Edit_tbl[2] = "marc_chk1";
|
||||
// Edit_tbl[3] = "marc_chk";
|
||||
// break;
|
||||
// case 1:
|
||||
// Edit_tbl[1] = "marc2";
|
||||
// Edit_tbl[2] = "marc_chk2";
|
||||
// Edit_tbl[3] = "marc_chk1";
|
||||
// break;
|
||||
// case 2:
|
||||
// Edit_tbl[1] = "marc";
|
||||
// Edit_tbl[2] = "marc_chk";
|
||||
// Edit_tbl[3] = "marc_chk2";
|
||||
// break;
|
||||
// default:
|
||||
// Edit_tbl[1] = "marc";
|
||||
// Edit_tbl[2] = "marc_chk";
|
||||
// Edit_tbl[3] = "marc_chk2";
|
||||
// break;
|
||||
// }
|
||||
//}
|
||||
string U_cmd = db.More_Update(table_name, Edit_tbl, Edit_col, Sear_tbl, Sear_col);
|
||||
PUB.log.Add("Update", string.Format( "{0}({1},{2}) : {3}", mUserName, mCompidx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor , U_cmd.Replace("\r", " ").Replace("\n", " ")));
|
||||
PUB.log.Add("Update", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " ")));
|
||||
db.DB_Send_CMD_reVoid(U_cmd);
|
||||
isNewData = false;
|
||||
}
|
||||
@@ -643,16 +544,17 @@ namespace ExcelTest
|
||||
|
||||
List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor = SetGradeColor(grade.ToString());
|
||||
|
||||
if (isNewData) {
|
||||
if (isNewData)
|
||||
{
|
||||
string MidxQuery = string.Format("SELECT `idx` FROM Marc WHERE isbn = {0} AND `compidx` = {1};", grid_data[0], mCompidx);
|
||||
PUB.log.Add("MarcInsert", string.Format( "{0}({1}) : {2}", mUserName, mCompidx, MidxQuery));
|
||||
PUB.log.Add("MarcInsert", string.Format("{0}({1}) : {2}", mUserName, mCompidx, MidxQuery));
|
||||
Midx = db.DB_Send_CMD_Search(MidxQuery).Replace("|", "");
|
||||
List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value = Midx;
|
||||
}
|
||||
|
||||
string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND 'compidx' ={2};",
|
||||
Midx, List_Book.Rows[SaveRowIdx].Cells["list_idx"].Value.ToString(), mCompidx);
|
||||
PUB.log.Add("MarcUpdate", string.Format( "{0}({1}) : {2}", mUserName, mCompidx, UpdateListIndex));
|
||||
PUB.log.Add("MarcUpdate", string.Format("{0}({1}) : {2}", mUserName, mCompidx, UpdateListIndex));
|
||||
db.DB_Send_CMD_reVoid(UpdateListIndex);
|
||||
MessageBox.Show("저장되었습니다!");
|
||||
}
|
||||
@@ -835,7 +737,8 @@ namespace ExcelTest
|
||||
|
||||
for (int a = 0; a < chk_ary.Length; a++)
|
||||
{
|
||||
if (chk_ary[a] == "1") {
|
||||
if (chk_ary[a] == "1")
|
||||
{
|
||||
return a;
|
||||
}
|
||||
}
|
||||
@@ -894,7 +797,7 @@ namespace ExcelTest
|
||||
Create_008();
|
||||
st.Color_change("▼", richTextBox1);
|
||||
st.Color_change("▲", richTextBox1);
|
||||
|
||||
|
||||
int grade = 2;
|
||||
if (List_Book.Rows[row_idx].Cells["grade"].Value != null || List_Book.Rows[row_idx].Cells["grade"].Value.ToString() != "")
|
||||
{
|
||||
@@ -903,60 +806,7 @@ namespace ExcelTest
|
||||
cb_grade.SelectedIndex = grade;
|
||||
OnSaveData(row_idx);
|
||||
}
|
||||
//private void List_Book_CellClick(object sender, DataGridViewCellEventArgs e)
|
||||
//{
|
||||
// //if (e.RowIndex == -1) { return; }
|
||||
// //int row_idx = e.RowIndex;
|
||||
// //SaveRowIdx = row_idx;
|
||||
// //int col_idx = e.ColumnIndex;
|
||||
|
||||
// //string isbn = List_Book.Rows[row_idx].Cells["ISBN13"].Value.ToString();
|
||||
// //if (isbn != "") {
|
||||
// // string CountQuery = string.Format("SELECT Count(isbn) FROM Marc WHERE isbn = {0} GROUP BY isbn;", isbn);
|
||||
// // string CountResult = db.self_Made_Cmd(CountQuery).Replace("|", "");
|
||||
|
||||
// // if (CountResult == "")
|
||||
// // btn_CopySelect.Text = "0";
|
||||
|
||||
// // if (CountResult == "0") {
|
||||
// // btn_CopySelect.Enabled = false;
|
||||
// // btn_CopySelect.BackColor = Color.Silver;
|
||||
// // }
|
||||
// // else {
|
||||
// // btn_CopySelect.Enabled = true;
|
||||
// // btn_CopySelect.BackColor = Color.Khaki;
|
||||
// // }
|
||||
|
||||
// // btn_CopySelect.Text = CountResult;
|
||||
// //}
|
||||
|
||||
// //tabControl1.SelectedIndex = 0;
|
||||
|
||||
// //if (check_V(row_idx, col_idx))
|
||||
// // return;
|
||||
|
||||
// //Save_data(row_idx);
|
||||
// //richTextBox1.Text = "";
|
||||
|
||||
// //bool check_Marc = click_Marc(row_idx);
|
||||
|
||||
// //if (!check_Marc)
|
||||
// // richTextBox1.Text = Make_Empty();
|
||||
// //else
|
||||
// // ReadRemark(row_idx);
|
||||
|
||||
// //input_picture(row_idx);
|
||||
// //Create_008();
|
||||
// //st.Color_change("▼", richTextBox1);
|
||||
// //st.Color_change("▲", richTextBox1);
|
||||
|
||||
// //int grade = 2;
|
||||
// //if (List_Book.Rows[row_idx].Cells["grade"].Value != null || List_Book.Rows[row_idx].Cells["grade"].Value.ToString() != "") {
|
||||
// // grade = Convert.ToInt32(List_Book.Rows[row_idx].Cells["grade"].Value.ToString());
|
||||
// //}
|
||||
// //cb_grade.SelectedIndex = grade;
|
||||
// //OnSaveData(row_idx);
|
||||
//}
|
||||
|
||||
#region CellClick_Sub
|
||||
|
||||
void OnSaveData(int row)
|
||||
@@ -965,7 +815,9 @@ namespace ExcelTest
|
||||
string Date = List_Book.Rows[row].Cells["SaveDate"].Value.ToString();
|
||||
|
||||
lbl_SaveData.Text = string.Format("[{0}] [{1}]", User, Date);
|
||||
lbl_ISBN.Text = "[" + List_Book.Rows[row].Cells["ISBN13"].Value.ToString() + "]";
|
||||
|
||||
var isbn13 = List_Book.Rows[row].Cells["ISBN13"]?.Value.ToString() ?? string.Empty;
|
||||
lbl_ISBN.Text = $"[{isbn13}]";
|
||||
}
|
||||
void ReadRemark(int row)
|
||||
{
|
||||
@@ -975,7 +827,8 @@ namespace ExcelTest
|
||||
string res = db.DB_Send_CMD_Search(cmd);
|
||||
|
||||
string[] ary = res.Split('|');
|
||||
if (res.Length < 1) {
|
||||
if (res.Length < 1)
|
||||
{
|
||||
etc1.Text = res;
|
||||
etc2.Text = "";
|
||||
return;
|
||||
@@ -1027,7 +880,7 @@ namespace ExcelTest
|
||||
string[] data = Marc_data.Substring(24).Split('▲'); // 리더부를 제외한 디렉터리, 가변길이필드 저장
|
||||
|
||||
// List에 필요한 데이터 집어넣는 작업.
|
||||
for (int a = 1; a < data.Length - 1&& data[0].Length> startidx ; a++)
|
||||
for (int a = 1; a < data.Length - 1 && data[0].Length > startidx; a++)
|
||||
{
|
||||
TagNum.Add(data[0].Substring(startidx, 3));
|
||||
startidx += 12;
|
||||
@@ -1068,8 +921,8 @@ namespace ExcelTest
|
||||
data_book[0] = List_Book.Rows[row].Cells["ISBN13"].Value.ToString();
|
||||
data_book[1] = List_Book.Rows[row].Cells["book_name"].Value.ToString();
|
||||
data_book[2] = List_Book.Rows[row].Cells["author"].Value.ToString();
|
||||
data_book[3] = List_Book.Rows[row].Cells["book_comp"].Value.ToString();
|
||||
data_book[4] = List_Book.Rows[row].Cells["pay"].Value.ToString();
|
||||
data_book[3] = List_Book.Rows[row].Cells["book_comp"].Value.ToString(); //publichser
|
||||
data_book[4] = List_Book.Rows[row].Cells["pay"].Value.ToString(); //price
|
||||
}
|
||||
void input_picture(int row)
|
||||
{
|
||||
@@ -1198,7 +1051,7 @@ namespace ExcelTest
|
||||
|
||||
private void btn_Reflesh008_Click(object sender, EventArgs e)
|
||||
{
|
||||
string data =text008.Text;
|
||||
string data = text008.Text;
|
||||
//data =data.PadRight(40,' ');
|
||||
string oriMarc = st.made_Ori_marc(richTextBox1).Replace("\\", "₩");
|
||||
|
||||
@@ -1255,11 +1108,11 @@ namespace ExcelTest
|
||||
Publication(checkBox2.Checked, 30);// 기념논문집 (30) c
|
||||
Publication(checkBox4.Checked, 31);// 색인 (31)
|
||||
|
||||
textArray = text008.Text.ToCharArray() ;
|
||||
textArray = text008.Text.ToCharArray();
|
||||
|
||||
textArray[26] = col008res.Text[0]; //대학코드
|
||||
textArray[27] = col008res.Text[1];
|
||||
|
||||
|
||||
textArray[38] = gov008res.Text[0];// 정부코드
|
||||
textArray[39] = gov008res.Text[1];
|
||||
|
||||
@@ -1281,7 +1134,8 @@ namespace ExcelTest
|
||||
|
||||
string pubDate = Regex.Replace(ContentTag, @"[^0-9]", "");
|
||||
|
||||
if (pubDate.Length < 3) {
|
||||
if (pubDate.Length < 3)
|
||||
{
|
||||
MessageBox.Show("260c가 인식되지않습니다.");
|
||||
return "false";
|
||||
}
|
||||
@@ -1309,7 +1163,8 @@ namespace ExcelTest
|
||||
"SELECT `Code` FROM `Tag008_Country` WHERE `Area` <= \"{0}\" ORDER BY `Area` DESC LIMIT 1;", ContentTag);
|
||||
string res = db.DB_Send_CMD_Search(cmd).Replace("|", "");
|
||||
|
||||
if (res == "") {
|
||||
if (res == "")
|
||||
{
|
||||
MessageBox.Show("260a가 인식되지않습니다.");
|
||||
return "false";
|
||||
}
|
||||
@@ -1374,47 +1229,48 @@ namespace ExcelTest
|
||||
|
||||
private void checkBox1_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
string name = ((CheckBox)sender).Name;
|
||||
if (((CheckBox)sender).Checked == true)
|
||||
var chk = sender as CheckBox;
|
||||
string name = chk.Name;
|
||||
if (chk.Checked == true)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "checkBox1":
|
||||
((CheckBox)sender).InvokeText("회의간행물o");
|
||||
chk.InvokeText("회의간행물o");
|
||||
break;
|
||||
case "checkBox2":
|
||||
((CheckBox)sender).InvokeText("기념논문집o");
|
||||
chk.InvokeText("기념논문집o");
|
||||
break;
|
||||
case "checkBox4":
|
||||
((CheckBox)sender).InvokeText("색인o");
|
||||
chk.InvokeText("색인o");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (((CheckBox)sender).Checked == false)
|
||||
else if (chk.Checked == false)
|
||||
{
|
||||
switch (name)
|
||||
{
|
||||
case "checkBox1":
|
||||
((CheckBox)sender).InvokeText("회의간행물x");
|
||||
chk.InvokeText("회의간행물x");
|
||||
break;
|
||||
case "checkBox2":
|
||||
((CheckBox)sender).InvokeText("기념논문집x");
|
||||
chk.InvokeText("기념논문집x");
|
||||
break;
|
||||
case "checkBox4":
|
||||
((CheckBox)sender).InvokeText("색인x");
|
||||
chk.InvokeText("색인x");
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (name)
|
||||
{
|
||||
case "checkBox1":
|
||||
Publication(checkBox1.Checked, 29);
|
||||
case "checkBox1": //회의간행물
|
||||
Publication(chk.Checked, 29);
|
||||
break;
|
||||
case "checkBox2":
|
||||
Publication(checkBox2.Checked, 30);
|
||||
case "checkBox2": //기념논문집
|
||||
Publication(chk.Checked, 30);
|
||||
break;
|
||||
case "checkBox4":
|
||||
Publication(checkBox4.Checked, 31);
|
||||
case "checkBox4": //색인
|
||||
Publication(chk.Checked, 31);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1464,21 +1320,27 @@ namespace ExcelTest
|
||||
bool isSort = rb_Sort.Checked;
|
||||
int combo = comboBox8.SelectedIndex; // 0: 등급 / 1: 복본
|
||||
|
||||
if (isSort) {
|
||||
if (combo == 0) {
|
||||
if (isSort)
|
||||
{
|
||||
if (combo == 0)
|
||||
{
|
||||
List_Book.Sort(List_Book.Columns["grade"], System.ComponentModel.ListSortDirection.Ascending);
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
List_Book.Sort(List_Book.Columns["ISBN13"], System.ComponentModel.ListSortDirection.Ascending);
|
||||
}
|
||||
}
|
||||
else {
|
||||
else
|
||||
{
|
||||
int comboIdx;
|
||||
if (combo == 0) {
|
||||
if (combo == 0)
|
||||
{
|
||||
comboIdx = comboBox9.SelectedIndex;
|
||||
Search_Filter("grade", comboIdx);
|
||||
}
|
||||
else { // 수정필요
|
||||
else
|
||||
{ // 수정필요
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1498,7 +1360,8 @@ namespace ExcelTest
|
||||
{
|
||||
int count = List_Book.Rows.Count;
|
||||
DataGridViewBand band;
|
||||
if (comboIdx == 0) {
|
||||
if (comboIdx == 0)
|
||||
{
|
||||
for (int a = 0; a < count; a++)
|
||||
{
|
||||
band = List_Book.Rows[a];
|
||||
@@ -1510,7 +1373,8 @@ namespace ExcelTest
|
||||
comboIdx--;
|
||||
for (int a = 0; a < count; a++)
|
||||
{
|
||||
if (List_Book.Rows[a].Cells[target].Value.ToString() != comboIdx.ToString()) {
|
||||
if (List_Book.Rows[a].Cells[target].Value.ToString() != comboIdx.ToString())
|
||||
{
|
||||
band = List_Book.Rows[a];
|
||||
band.Visible = false;
|
||||
}
|
||||
@@ -1544,10 +1408,10 @@ namespace ExcelTest
|
||||
text008.Text = GridData[5];
|
||||
List_Book.Rows[row].Cells["db_marc"].Value = GridData[6];
|
||||
mOldMarc = GridData[6];
|
||||
List_Book.Rows[row].DefaultCellStyle.ForeColor= SetGradeColor(GridData[4]);
|
||||
List_Book.Rows[row].DefaultCellStyle.ForeColor = SetGradeColor(GridData[4]);
|
||||
List_Book.Rows[row].DefaultCellStyle.BackColor = Color.Yellow;
|
||||
|
||||
|
||||
|
||||
bool checkMarc = click_Marc(row);
|
||||
if (checkMarc)
|
||||
{
|
||||
@@ -1563,7 +1427,8 @@ namespace ExcelTest
|
||||
comboBox9.Items.Clear();
|
||||
|
||||
ComboBox cb = sender as ComboBox;
|
||||
if (cb.SelectedIndex == 0) {
|
||||
if (cb.SelectedIndex == 0)
|
||||
{
|
||||
comboBox9.Enabled = true;
|
||||
string[] grade = { "전체", "A", "B", "C", "D" };
|
||||
comboBox9.Items.AddRange(grade);
|
||||
@@ -1588,6 +1453,7 @@ namespace ExcelTest
|
||||
private void btn_mk_marcList_Click(object sender, EventArgs e)
|
||||
{
|
||||
Marc_mkList mkList = new Marc_mkList(this);
|
||||
mkList.StartPosition = FormStartPosition.CenterScreen;
|
||||
mkList.Show();
|
||||
}
|
||||
#region 마크생성목록_Sub
|
||||
@@ -1663,7 +1529,7 @@ namespace ExcelTest
|
||||
//tb.SelectionStart = tb.Text.Length;
|
||||
//tb.Select(tb.Text.Length, 0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#region DataGridView 드래그 행이동 이벤트 함수
|
||||
|
||||
@@ -1858,10 +1724,11 @@ namespace ExcelTest
|
||||
|
||||
for (int count = 0; count < GridView020.Rows.Count; count++)
|
||||
{
|
||||
if (GridView020.Rows[count].Cells["CheckSet"].Value == null &&
|
||||
if (GridView020.Rows[count].Cells["CheckSet"].Value == null &&
|
||||
GridView020.Rows[count].Cells["Text020a"].Value == null &&
|
||||
GridView020.Rows[count].Cells["Text020g"].Value == null &&
|
||||
GridView020.Rows[count].Cells["Text020c"].Value == null) {
|
||||
GridView020.Rows[count].Cells["Text020c"].Value == null)
|
||||
{
|
||||
|
||||
GridView020.Rows[count].Cells["CheckSet"].Value = Grid[0];
|
||||
GridView020.Rows[count].Cells["Text020a"].Value = Grid[1];
|
||||
@@ -1935,7 +1802,7 @@ namespace ExcelTest
|
||||
GridView440.Rows[count].Cells["text440vTxt"].Value == null &&
|
||||
GridView440.Rows[count].Cells["text440x"].Value == null)
|
||||
{
|
||||
|
||||
|
||||
GridView440.Rows[count].Cells["text440a"].Value = Grid[0];
|
||||
GridView440.Rows[count].Cells["text440n"].Value = Grid[1];
|
||||
GridView440.Rows[count].Cells["text440p"].Value = Grid[2];
|
||||
@@ -2027,7 +1894,8 @@ namespace ExcelTest
|
||||
Before = After;
|
||||
for (int a = 0; a < Symbol.Length; a++)
|
||||
{
|
||||
if (Tag[0] == Symbol[a]) {
|
||||
if (Tag[0] == Symbol[a])
|
||||
{
|
||||
After = a;
|
||||
break;
|
||||
}
|
||||
@@ -2163,7 +2031,7 @@ namespace ExcelTest
|
||||
text245d, text245e
|
||||
};
|
||||
|
||||
string a = GetMiddelString(SplitTag, "▼a", "▼","245a");
|
||||
string a = GetMiddelString(SplitTag, "▼a", "▼", "245a");
|
||||
string b = GetMiddelString(SplitTag, "▼b", "▼");
|
||||
string x = GetMiddelString(SplitTag, "▼x", "▼");
|
||||
string n = GetMiddelString(SplitTag, "▼n", "▼");
|
||||
@@ -2263,20 +2131,30 @@ namespace ExcelTest
|
||||
/// <param name="Marc">텍스트박스에 들어갈 값 배열</param>
|
||||
private void InputMoreTextBox(TextBox[] box, string[] Marc)
|
||||
{
|
||||
int count = 0;
|
||||
//int count = 0;
|
||||
|
||||
foreach (string marc in Marc)
|
||||
for (int i = 0; i < box.Length; i++)
|
||||
{
|
||||
if (box[count].Text == "")
|
||||
box[count].InvokeText(marc);
|
||||
//box[count].Text = marc;
|
||||
|
||||
if (i >= Marc.Length) continue;
|
||||
var marc = Marc[i];
|
||||
if (box[i].Text == "")
|
||||
box[i].InvokeText(marc);
|
||||
else
|
||||
box[count].InvokeADDText("▽" + marc);
|
||||
//box[count].Text += "▽" + marc;
|
||||
|
||||
count++;
|
||||
box[i].InvokeADDText("▽" + marc);
|
||||
}
|
||||
|
||||
//foreach (string marc in Marc)
|
||||
//{
|
||||
// if (box[count].Text == "")
|
||||
// box[count].InvokeText(marc);
|
||||
// //box[count].Text = marc;
|
||||
|
||||
// else
|
||||
// box[count].InvokeADDText("▽" + marc);
|
||||
// //box[count].Text += "▽" + marc;
|
||||
|
||||
// count++;
|
||||
//}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -2345,33 +2223,34 @@ namespace ExcelTest
|
||||
string TrimEndGubun(string str, string TagNum)
|
||||
{
|
||||
char[] gu = { '.', ',', ':', ';', '/', ' ' };
|
||||
if (TagNum == "300"||TagNum == "300a")
|
||||
if (TagNum == "300" || TagNum == "300a")
|
||||
{
|
||||
str = str.Trim();
|
||||
if (TagNum == "300a")
|
||||
{
|
||||
gu = new char[] { '.', ',', '=', ':', ';', '/','+', ' ' };
|
||||
//gu = new char[] { ',', '=', ':', ';', '/', '+', ' ' };
|
||||
gu = new char[] { '.', ',', '=', ':', ';', '/', '+', ' ' };
|
||||
for (int i = 0; i < gu.Length; i++)
|
||||
{
|
||||
str = str.TrimEnd(gu[i]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (str.Contains("ill."))
|
||||
return str;
|
||||
if (str.Contains("p."))
|
||||
return str;
|
||||
}
|
||||
|
||||
if (TagNum == "710" || TagNum == "910" )
|
||||
if (TagNum == "710" || TagNum == "910")
|
||||
return str;
|
||||
|
||||
|
||||
if (TagNum == "245") gu = new char[] { '.',':', ';', '/', ' ' };
|
||||
|
||||
if (TagNum == "245") gu = new char[] { '.', ':', ';', '/', ' ' };
|
||||
if (TagNum == "245a") gu = new char[] { '.', ',', '=', ':', ';', '/', ' ' };
|
||||
for (int i = 0; i < gu.Length; i++)
|
||||
{
|
||||
str=str.TrimEnd(gu[i]);
|
||||
str = str.TrimEnd(gu[i]);
|
||||
}
|
||||
//foreach (char gubun in gu)
|
||||
//{
|
||||
@@ -2405,7 +2284,7 @@ namespace ExcelTest
|
||||
"653", "700", "710", "900", "910",
|
||||
"940"
|
||||
};
|
||||
|
||||
|
||||
List<string> RemainTag = new List<string>(); // 메모장으로 출력되는 최종 리스트
|
||||
|
||||
List<string> BlankTag = MakeMarcLine(); // 칸채우기의 값들이 여기로 저장이 되어 들어옴
|
||||
@@ -2415,15 +2294,15 @@ namespace ExcelTest
|
||||
AllTag.AddRange(TextTag);
|
||||
|
||||
AllTag.Sort();
|
||||
AllTag.RemoveAll(x => x.Length < 3 || x =="");
|
||||
for(int i=0; i<AllTag.Count;i++)
|
||||
AllTag.RemoveAll(x => x.Length < 3 || x == "");
|
||||
for (int i = 0; i < AllTag.Count; i++)
|
||||
{
|
||||
string tTagNum = AllTag[i].Substring(0, 3);
|
||||
bool isCopy = false;
|
||||
List<string> tTag = Tag.ToList();
|
||||
List<string> tFindTag =tTag.FindAll(x => x == tTagNum);
|
||||
List<string> tFindTag = tTag.FindAll(x => x == tTagNum);
|
||||
if (tFindTag.Count > 0) isCopy = true;
|
||||
|
||||
|
||||
if (isCopy)
|
||||
{
|
||||
string AddText = "";
|
||||
@@ -2464,7 +2343,7 @@ namespace ExcelTest
|
||||
if (tEndIDX == -1) tEndIDX = AllTag[i].IndexOf("▲", tStartIDX - 1);
|
||||
if (tEndIDX == -1) tEndIDX = AllTag[i].Length;
|
||||
|
||||
AllTag[i]=AllTag[i].Remove(tStartIDX, tEndIDX - tStartIDX);
|
||||
AllTag[i] = AllTag[i].Remove(tStartIDX, tEndIDX - tStartIDX);
|
||||
string tNewText = string.Format("{0}{1}", AllTag[i], tTagText020);
|
||||
tNewText.TrimEnd('\n');
|
||||
RemainTag.Add(tNewText + "▲");
|
||||
@@ -2741,7 +2620,7 @@ namespace ExcelTest
|
||||
{
|
||||
if (dgv.Rows[a].Cells[0].Value == null)
|
||||
break;
|
||||
|
||||
|
||||
for (int b = 0; b < dgv.ColumnCount; b++)
|
||||
{
|
||||
if (dgv.Rows[a].Cells[b].Value == null)
|
||||
@@ -3021,7 +2900,8 @@ namespace ExcelTest
|
||||
|
||||
if (boxText[0] != "") result += "▼a" + boxText[0];
|
||||
if (boxText[1] != "") result += "▼n" + boxText[1];
|
||||
if (boxText[3] != "") {
|
||||
if (boxText[3] != "")
|
||||
{
|
||||
string[] splitText245b = boxText[3].Split('▽');
|
||||
foreach (string text in splitText245b)
|
||||
result += "▼b" + text;
|
||||
@@ -3089,7 +2969,8 @@ namespace ExcelTest
|
||||
|
||||
if (boxText[0] != "") result += "▼a" + Tag300a_Sub(boxText[0]);
|
||||
if (boxText[1] != "") result += "▼b" + boxText[1];
|
||||
if (boxText[2] != "") {
|
||||
if (boxText[2] != "")
|
||||
{
|
||||
result += "▼c" + boxText[2];
|
||||
if (boxText[3] == "") result += "cm";
|
||||
}
|
||||
@@ -3119,9 +3000,9 @@ namespace ExcelTest
|
||||
else if (Regex.IsMatch(GetMiddelString(result, "[", "]"), @"^[0-9]+$"))
|
||||
{
|
||||
string tTest = GetMiddelString(result, "[", "]");
|
||||
return result.Replace("p","").Trim()+ " p."; ;
|
||||
return result.Replace("p", "").Trim() + " p."; ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -3521,15 +3402,18 @@ namespace ExcelTest
|
||||
a041 = a041.Replace("▽", ", ");
|
||||
|
||||
// k로 번역된 h 원작을 a로 중역
|
||||
if (a041 != "" && k041 != "" && h041 != "") {
|
||||
if (a041 != "" && k041 != "" && h041 != "")
|
||||
{
|
||||
result = string.Format("{0}로 번역된 {1} 원작을 {2}로 중역", k041, h041, a041);
|
||||
}
|
||||
// h 원작을 a로 번역
|
||||
else if (a041 != "" && k041 == "" && h041 != "") {
|
||||
else if (a041 != "" && k041 == "" && h041 != "")
|
||||
{
|
||||
result = string.Format("{0} 원작을 {1}로 번역", h041, a041);
|
||||
}
|
||||
// 본문은 a1, a2 혼합수록됨.
|
||||
else if (a041.IndexOf(",") > 0) {
|
||||
else if (a041.IndexOf(",") > 0)
|
||||
{
|
||||
result = string.Format("본문은 {0} 혼합수록 됨.", a041);
|
||||
}
|
||||
|
||||
@@ -3651,6 +3535,79 @@ namespace ExcelTest
|
||||
sg.Print_Grid_Num(sender, e);
|
||||
}
|
||||
|
||||
|
||||
private void lbl_BookList_Click(object sender, EventArgs e)
|
||||
{
|
||||
LovCustom();
|
||||
|
||||
}
|
||||
|
||||
void LovCustom()
|
||||
{
|
||||
var inputsearch = "";// tbCustName.Text.Trim();
|
||||
var where = "";
|
||||
if (inputsearch.isEmpty() == false)
|
||||
{
|
||||
where = $"c_sangho like '%{inputsearch.Replace("'", "''")}%'";
|
||||
}
|
||||
var dt = DB2.GetDT("Client", columns: "idx,c_sangho", orders: "c_sangho", wheres: where);
|
||||
using (var f = new fSelectDT(dt))
|
||||
if (f.ShowDialog() == DialogResult.OK)
|
||||
{
|
||||
var dr = f.SelectedRow;
|
||||
if (dr == null) return;
|
||||
lbCustIDX.Text = dr["idx"]?.ToString() ?? string.Empty;
|
||||
tbCustName.Text = dr["c_sangho"]?.ToString() ?? string.Empty;
|
||||
|
||||
if (int.TryParse(lbCustIDX.Text, out int custidx) && custidx >= 0)
|
||||
{
|
||||
var sql = $"update Obj_List set customer={custidx} where idx = {l_idx} and comp_num={c_idx}";
|
||||
var cnt = DB2.ExcuteNonQuery(sql);
|
||||
if (cnt != 1)
|
||||
UTIL.MsgE($"데이터 저장시 오류가 발생했습니다. 영향을 받은 행 수 = {cnt}");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void Marc_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
if (UTIL.MsgQ("현재 화면을 닫을까요?") != DialogResult.Yes) return;
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 현재 데이터를 한줄 복사하고 ISBN 값을 삭제한다
|
||||
// 생성된 자료는 좌측 목록에 추가되어야하고, 그 목록이 선택되도록 한다.
|
||||
if (List_Book.SelectedRows.Count == 0)
|
||||
return;
|
||||
|
||||
DataGridViewRow selectedRow = List_Book.SelectedRows[0];
|
||||
int nRow = List_Book.Rows.Add();
|
||||
DataGridViewRow newRow = List_Book.Rows[nRow];
|
||||
|
||||
for (int i = 0; i < selectedRow.Cells.Count; i++)
|
||||
{
|
||||
newRow.Cells[i].Value = selectedRow.Cells[i].Value;
|
||||
}
|
||||
|
||||
newRow.Cells["ISBN13"].Value = "";
|
||||
newRow.Cells["marc_idx"].Value = "";
|
||||
newRow.Cells["list_idx"].Value = "";
|
||||
//newRow.Cells["grade"].Value = "3"; // 등급 초기화 (D)
|
||||
newRow.DefaultCellStyle.ForeColor = Color.Red; // 색상 초기화 (D급 색상)
|
||||
|
||||
List_Book.ClearSelection();
|
||||
newRow.Selected = true;
|
||||
List_Book.FirstDisplayedScrollingRowIndex = nRow;
|
||||
}
|
||||
|
||||
private void button1_Click_1(object sender, EventArgs e)
|
||||
{
|
||||
this.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
1763
unimarc/unimarc/마크/Marc.designer.cs
generated
1763
unimarc/unimarc/마크/Marc.designer.cs
generated
File diff suppressed because it is too large
Load Diff
@@ -117,6 +117,36 @@
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<metadata name="label31.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label30.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label33.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label32.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label29.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label28.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label24.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label25.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label26.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="label27.GenerateMember" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>False</value>
|
||||
</metadata>
|
||||
<metadata name="list_idx.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
@@ -168,37 +198,38 @@
|
||||
iVBORw0KGgoAAAANSUhEUgAAAOEAAADhCAMAAAAJbSJIAAAABGdBTUEAALGPC/xhBQAAAIFQTFRF////
|
||||
AAAAlJSU4ODgU1NT6enp+Pj4w8PDxMTEkpKS/Pz81tbW5eXlRERE3NzcmZmZzMzMZGRkTU1Nb29vg4OD
|
||||
urq6KioqW1tb8vLyf39/sbGxEhISPz8/i4uL0NDQZmZmIyMjoqKiNTU1tLS0GRkZp6end3d3Li4uOjo6
|
||||
Dg4OJSUlLUB5vgAABwxJREFUeF7tnX97ojAMx6ceIqDi/DXndJ47vZt7/y/wFOMUSKG0SWE8+fxz9zxl
|
||||
ZN8BaZq26ZMgCIIgCIIgCIIgCIIgCIIgCIIgCIIgCELrWHnDsb8+7uNuvD+u/fHQW0GLOT34t276kb99
|
||||
nn51siynu60f9eEqA7Zb+E+d9P1g9AaKcN42gR/C1dUIOl34X12E43gDMsrYxGP4IX26nZoVRtt/8Ovr
|
||||
8bmtJvIssE6Fq/3n9feuxOao73wuAutTGD0nv7AJM80HmQisS6E/TaybMh3AfYq4CqxH4ULXuagp1wgC
|
||||
61A4MPn88kzf4X44N4HuFQ5/gWV7dh7cE+FboGuF/S3YpSFWhQF3gY4VTqp1f+V8RnDnNA8C3Sr8C0Yp
|
||||
wcLOR4EuFUYnsEnLMjd4SAl0qDAGi/SswQKQFuhMYWgewpTzF4wkZAS6Ujj8DfZ4+LzHqlmBjhROwBob
|
||||
p1uomhPoRuEajJUzms3jtT+JxtHEP3bnM/3w7hrF5QU6UbgHW8V8BAsvl60I+8M/2w+4opjF+XJEoAuF
|
||||
mNkMy3lhIB0uZhrf8RG3xK8wAEtKvrZ4YJJmMitO5ZzB3TW7wrIn+OLrJtJWa73XNQO3wpJvcFYtmzkY
|
||||
wc9VgFnhHzCDMysY/iiYVNbIq/AdrKC8VE8OXlhUHJ+wKvTACMZJJ9WCEpb6rhScCsN8kv6bV7MU9pVe
|
||||
lTwPp8IZ2MhzmMAlpmj0sTcYFard6LP9jNKktHe8wadwDBbyBHCFFStdp8qnUBlnGbuYDJo5ETaFr2Ag
|
||||
y5tOiKaHnk/lUqjqCQ9DuIACrUELk8JQEUIe7H3MI8Uh0xUmhQpvTixQK7vFo1ARzLxRvqJntHpFHoU7
|
||||
uHsGOieToNftsyhUuBkfmonQjGtYFOLTn8SmdAM3DoV47vAZWonQFciiEH2ExG5UWyCHQvwR2o4m0ugL
|
||||
5FD4ArdO8QqNNFQQyKCwB3dOcbIZ8OaoIpBBIRryU40nEioJpFfYhxuneIFGEqoJpFeIzsKYZdVwKgqk
|
||||
V4h1FTNoo6CqQHKFqJ+pnvhVUi2TeIFaITaeIXyElZ8gvUIsP0S30tpAILVCbGBI50hNBFIrPMJtHyEb
|
||||
NBkJpFaIRGxLi4X2KcwEUiuEuz5CtRvAUCCxQmxwT5S6MBVIrBD5DP9BkyXGAokVIp/hHJrsMBdIrBCZ
|
||||
qyAZVVSPZO6QKhzCTR+BJitsBNIqRBzNBppssHhFz5AqRBwNwVyhnUBahcjw/rLazA6rV/QMqULElVoP
|
||||
nGwF0sw430AGFrYhWzjuWUKZp10dQNadETS1BGToRJm/aABId0gT0TQGJEcTQ1NLQCYsMlshfjoLkPUA
|
||||
8aRo3SAKaWecagdJdxPP3NcNEpZSpvMbQPufYfu/w/b70vb3h+2Padofl7Z/bNH+8SHHGL9hcORpmgVL
|
||||
rq1R8ORLmwRTzrtBcM1bNAiuuafmwDZ/2BgQV7OEppbAOI/fFEDVI+5e02D6Kwc00YFs+idbT1PGCqnw
|
||||
k6rrQgLyITob52PbvOhDKt51bcVgiwYZ3h9sAa2bKrARWHuEeBdLAvP60gKQvpglTcS9RliJO8Pc67xV
|
||||
YKVbdtBGC/tafRx0QyBPTMy/3wIFqzd5gjZq0D0z3H0ikm7nS9Zig0TifU850BenQ7yt+g7mton3rmVB
|
||||
3xv6iO2Gi/2HaQZgIw1joOFiD+kjWMjN1VVccbIP+AH0s+DtodCHyJZYxAv3cj5CRffL1WWgHUWnQ1y+
|
||||
IYubmgoJir8md2ZBURfjRP+HRQPuM+yJBcXKZXKH6inKRfHProeKuuvEEhXvSmcK7ZwoPg/aAi69/JTs
|
||||
FSdZBQd1opTlsx2tj1DW+qLqNHy4Xw5X813qem00+wPUi/idzTuz1txb4aHaBYfTzuq6iW+2I42Jysdw
|
||||
j9MyLMEoglXty1Dlxs64Xd+i6q4unMwdjl9wBMHB8fIWVa+YYFiDdqz+As84X7JLXkfYQxMW39Qwp05b
|
||||
C7qndl4JtazeKds9qF/PO/QL388zR7jSMaXb677mOoFcNC+tAb2HS52jsQe0pK7+02Be0PHcqOkJXtAq
|
||||
M9r5xM5GeOp7i0Cv8nOtC64rnW/RPSbnW7z763g+0y0WXPua+cJ+kYTa17R4BcXLCfjgSzdrEyrSbyQ0
|
||||
ZDU533lPNTrRNJF6xGPD7ybtHiuOKc1wOhwsh/zsvI/GbR0jPv8w4J1aNmNYFj7r88I8+2LMwP6c1Quj
|
||||
Ju9tJDhLdtT0jRy+fsCJMao5CtXC5kznn7Kw2tubvKyb+EdtpYo0z8W7sdRKBzSLcBzrfpIf8biJ3Z8O
|
||||
fT8YFR/9c9gE2gmrptKP/O3zNJ+N+Zrutovop6u7s/KG48H6uI+78X6/9qOh14ChrSAIgiAIgiAIgiAI
|
||||
giAIgiAIgiAIgiAIAilPT/8BzuZT5uV+S2QAAAAASUVORK5CYII=
|
||||
Dg4OJSUlLUB5vgAABzdJREFUeF7tne12ojAQhosuIqBiRa212q7dult7/xe4R6wKwwRCMhMoZ56fPSnj
|
||||
K8l8BeLDgyAIgiAIgiAIgiAIgiAIgiAIgiAIgiAIQt/Y+JNZsD0ekkFyOG6D2cTfwCGNGcI/tMQoDvaP
|
||||
iy8Psl687YN4BIfrs9/Dv7TAKAinL1BagZddGETw37QIvQH8k2OiWbKDehTskhn871oGXssK4/0/qKOS
|
||||
z30zkQOvVYWbwydUoMHuqO98zgLbUxg/ws+uTap5IzOBbSkMFvBjN2IxhhdEuAhsR+FK17moqdf4LbAN
|
||||
hWOT5Vdm8QovXOAq0L3Cya/iB7XgzYcXv3MT6FrhaF/4jLYkqjTgLtCxwnmz8FfPZwxNZOQEulX4N2eY
|
||||
CiztzAt0qTA+5Q2TsS4VDwWBDhUmBbuUbIuGigKdKYzMU5h6/uYtAYGuFE5+A7u0fN5zVSjQkcI5NEvN
|
||||
6ZqqlgS6UbiFVpVM02WyDebxLJ4Hx8Ey1U/vLllcWaAThQdoFOU9XPmlbkU0mvzZv8OhKCtcoAuFmFnA
|
||||
elmZSEerVGMdH3FL/ApDaBLytccTkyLztLqV43ke7q7ZFaLfa46noDQ1FWy2etMVwK2wZg2mpYSkkvEU
|
||||
XqAeZoV/oL0CaUX5o2DeWCOvwldoLs+TZrsFsGpYn7Aq9KG1HKdK71lFVOu7CnAqjMpN+hvPqtpVh6F+
|
||||
IsCrMIXGbnzM4diG1HnoHIwK1W70Ub+pq2JeGx2v8CmcQVM3QjjUhI2uU+VTqMyzjF0MQLMnwqbwGVr6
|
||||
5kUnRdNDz6dyKVRFwo8JHGmBeqXnYFIYKVLID3sfk6c6ZbrApFDhzYkFanW3eBQqkpkXyimq/h6L8Ch8
|
||||
g2Yu0DmZDC2BPAoVbiaA4+zQE8ijEN/+JDalKZDabAbeO3yEw+zQFciiEL2FxG5UWyCHQvwW2lYTRfQF
|
||||
cih8gjbOPMNRVjQQyKBwCE2cOdkUvCWaCGRQiKb8VPVERiOB9ApH0MKZJzjKhmYC6RWiuzBmXTWchgLp
|
||||
FWKhIoWDLGgqkFwh6meaN36V6FW9eagVYvUM4S1sfAfpFWL9oWZ7E1UYCKRWiBWGdI7URCC1wiO8PmXR
|
||||
ZCSQWiGSsa119wfrMBNIrRBeXvFYlgmGAokVYsU9UevCVCCxQmQZ/oNjzDAWSKwQWYZLOMYIc4HECpG9
|
||||
CpKqonkmc4dU4QRe3fM8OMYEG4G0ChFHs4NjDLCYotQKEUdDsFdoJ5BWIVLen582s8NqilIrRFypdeFk
|
||||
K5BiFt1BCgvblC2aDS2h7NNuPqA+bwrH/GyQ0omw+O0CSDikyWg6A9KjSeCYnw2yYQFehfjprKA+wvq+
|
||||
GyAKaXecWgdpdxOVv10BSUsp2/kdoP/3sP/rEFHYM1/a/3jY/5ym/3lp/2uL/teHHDV+x+Do03QLll5b
|
||||
p0ASU9JOV/sw9bw7BBIQSfYtOgTX3lN3QJxpz7IaxNWs4ZifDeJq+lYEQ3lOp2m4+FUCjrEGeemf7Hma
|
||||
OjbICT+Fc11IQBaiszofe82LPqVCCijC59qqQfJ+jsQfe4CW7tnEKmJolv4tlgzm50srQGIxS5sI6dW4
|
||||
KaHcGcamqYubiHhx7w0OIgFpfLto7mO5BlNOzP++BQp23uQJDiICKfT5YyLSbudr1mJFIvF7TyXQieNR
|
||||
PmdSAHPbxO+uQdB5Q5+xXUG2L5h3ocbQWAZjooEFDOp3SPNgKTdXqLiA30SODOoCuix4IxR6E9kai/jB
|
||||
vZy3UBF+uUIGGig8j/j4BoibMxUyFN8md2cBKxPPUZH+i0UTbp7CsIjiyWVyh+orjoviKJuKRIpz14kl
|
||||
KuaKt4ADGVAsD9oDXIblLdkLjMH+joNzopTHZ3Ol3ABkD+MCVdAI4IWvuNrvUp/XRvN+gPohfpbeBYb6
|
||||
JC6CM/c2eKp2hr5HqkR9buKLbaUxV/kY7joNsIbW71idfRmp3Jjz51tU4erMydzhBCofeg647MlMEVVU
|
||||
zDA8g3amXoHcNRMGtltyx+AcYR9tWNzg6R9WonaoGQ3Pgh6qnVeGQzd6R5GD39A/zzsKKudndip7K6gj
|
||||
8zdfS51ELl7WngF9gP/jirq7WH+u/sN4WRF4rrR0B8/UrMVvPrHfRngY+atQ7+Rn/pKwAnS3BmWaLgfH
|
||||
7PctXoNtskyxfV0c8/BKQmVcJEFnKbPiVxxeTsC7fSpvTaRov5HgYgdWA2yHn4YWnWiRWF3x2PDbeSpa
|
||||
QXVOaYbTcrAe8t/Oe7ctpckh/v3D0KaO5mJSlz7r80TZe6VkrJeF1THt3ATNQfBbstNWSsEGBPoJJ8a0
|
||||
5SxUC5vfdG49CdXEP5hM1l3SvLnTIrHm7+JdWWu1A7pFNEt0l+R7Muti+NNhFIRTxV7uNx+7ULth1VVG
|
||||
cbB/XJS7MV+Lt/0q/unq7mz8yWy8PR6SQXI4bIN44negtBUEQRAEQRAEQRAEQRAEQRAEQRAEQRAEQSDm
|
||||
P87mU+ZvyRQDAAAAAElFTkSuQmCC
|
||||
</value>
|
||||
</data>
|
||||
<metadata name="CheckSet.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
@@ -267,4 +298,7 @@
|
||||
<metadata name="text490v.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user