diff --git a/Test_Project/.vs/Test_Project/v16/.suo b/Test_Project/.vs/Test_Project/v16/.suo
index 6e00340..7595b94 100644
Binary files a/Test_Project/.vs/Test_Project/v16/.suo and b/Test_Project/.vs/Test_Project/v16/.suo differ
diff --git a/unimarc/.vs/unimarc/v16/.suo b/unimarc/.vs/unimarc/v16/.suo
index d8cf386..5d57ee4 100644
Binary files a/unimarc/.vs/unimarc/v16/.suo and b/unimarc/.vs/unimarc/v16/.suo differ
diff --git a/unimarc/unimarc/Login.cs b/unimarc/unimarc/Login.cs
index 6b79c21..f5656a1 100644
--- a/unimarc/unimarc/Login.cs
+++ b/unimarc/unimarc/Login.cs
@@ -96,7 +96,9 @@ namespace WindowsFormsApp1
if (Ary.Length < 1)
return;
- ID_text.Text = Ary[0].Replace("ID=", "");
+ //System.Text.RegularExpressions.Regex.Replace()
+ Ary[0] = Ary[0].Replace("ID=", "");
+ ID_text.Text = System.Text.RegularExpressions.Regex.Replace(Ary[0], @"[^a-zA-Z0-9]", "");
PW_text.Text = Ary[1].Replace("PW=", "");
}
#endregion
diff --git a/unimarc/unimarc/bin/Debug/UniMarc.exe b/unimarc/unimarc/bin/Debug/UniMarc.exe
index cafb9e1..93aff5e 100644
Binary files a/unimarc/unimarc/bin/Debug/UniMarc.exe and b/unimarc/unimarc/bin/Debug/UniMarc.exe differ
diff --git a/unimarc/unimarc/bin/Debug/UniMarc.pdb b/unimarc/unimarc/bin/Debug/UniMarc.pdb
index 4f924e5..c5d38b0 100644
Binary files a/unimarc/unimarc/bin/Debug/UniMarc.pdb and b/unimarc/unimarc/bin/Debug/UniMarc.pdb differ
diff --git a/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll b/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll
index 0781901..479bea4 100644
Binary files a/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll and b/unimarc/unimarc/bin/Debug/ko/UniMarc.resources.dll differ
diff --git a/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferences.cache b/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferences.cache
index e1a373c..46d06a0 100644
Binary files a/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferences.cache and b/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferences.cache differ
diff --git a/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
index e38ba92..c61869f 100644
Binary files a/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache and b/unimarc/unimarc/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache b/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache
index 6fd1a27..efee617 100644
Binary files a/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache and b/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache differ
diff --git a/unimarc/unimarc/obj/Debug/UniMarc.exe b/unimarc/unimarc/obj/Debug/UniMarc.exe
index cafb9e1..93aff5e 100644
Binary files a/unimarc/unimarc/obj/Debug/UniMarc.exe and b/unimarc/unimarc/obj/Debug/UniMarc.exe differ
diff --git a/unimarc/unimarc/obj/Debug/UniMarc.pdb b/unimarc/unimarc/obj/Debug/UniMarc.pdb
index 4f924e5..c5d38b0 100644
Binary files a/unimarc/unimarc/obj/Debug/UniMarc.pdb and b/unimarc/unimarc/obj/Debug/UniMarc.pdb differ
diff --git a/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll b/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll
index 0781901..479bea4 100644
Binary files a/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll and b/unimarc/unimarc/obj/Debug/ko/UniMarc.resources.dll differ
diff --git a/unimarc/unimarc/마크/Check_Copy_Sub_List.cs b/unimarc/unimarc/마크/Check_Copy_Sub_List.cs
index 693598d..a14a425 100644
--- a/unimarc/unimarc/마크/Check_Copy_Sub_List.cs
+++ b/unimarc/unimarc/마크/Check_Copy_Sub_List.cs
@@ -122,11 +122,14 @@ namespace UniMarc.마크
string cmd = db.More_DB_Search("Specs_Marc", search_col, search_data, area);
Result(db.DB_Send_CMD_Search(cmd));
cc.btn_SearchList.Text = list_name;
+ cc.SearchCount.Value = cc.dataGridView1.Rows.Count - 1;
this.Close();
}
void Result(string query)
{
+ cc.dataGridView1.Rows.Clear();
+
string[] ary = query.Split('|');
string[] grid = { "", "", "" };
diff --git a/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs b/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs
index 7d8774d..de2380a 100644
--- a/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs
+++ b/unimarc/unimarc/마크/Check_Copy_Sub_Search.cs
@@ -58,6 +58,7 @@ namespace UniMarc.마크
if (e.KeyCode == Keys.Enter)
{
int row = dataGridView1.CurrentRow.Index;
+ if (row < 0) return;
SetCode(row);
this.Close();
}
diff --git a/unimarc/unimarc/마크/Check_copy.Designer.cs b/unimarc/unimarc/마크/Check_copy.Designer.cs
index 742b1a0..6f07acf 100644
--- a/unimarc/unimarc/마크/Check_copy.Designer.cs
+++ b/unimarc/unimarc/마크/Check_copy.Designer.cs
@@ -28,8 +28,10 @@
///
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
+ this.rb_isNumber = new System.Windows.Forms.RadioButton();
+ this.rb_isHave = new System.Windows.Forms.RadioButton();
this.btn_SearchList = new System.Windows.Forms.Button();
this.btn_Start = new System.Windows.Forms.Button();
this.btn_Stop = new System.Windows.Forms.Button();
@@ -49,8 +51,11 @@
this.panel6 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.chk_RemoveBrit = new System.Windows.Forms.CheckBox();
+ this.btn_GridReset = new System.Windows.Forms.Button();
+ this.btn_OpenMemo = new System.Windows.Forms.Button();
this.chk_spChar = new System.Windows.Forms.CheckBox();
this.panel5 = new System.Windows.Forms.Panel();
+ this.btn_ResultEmpty = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.SearchCount)).BeginInit();
this.panel2.SuspendLayout();
@@ -64,6 +69,8 @@
// panel1
//
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.panel1.Controls.Add(this.rb_isNumber);
+ this.panel1.Controls.Add(this.rb_isHave);
this.panel1.Controls.Add(this.btn_SearchList);
this.panel1.Controls.Add(this.btn_Start);
this.panel1.Controls.Add(this.btn_Stop);
@@ -73,11 +80,34 @@
this.panel1.Size = new System.Drawing.Size(635, 34);
this.panel1.TabIndex = 0;
//
+ // rb_isNumber
+ //
+ this.rb_isNumber.AutoSize = true;
+ this.rb_isNumber.Location = new System.Drawing.Point(394, 8);
+ this.rb_isNumber.Name = "rb_isNumber";
+ this.rb_isNumber.Size = new System.Drawing.Size(71, 16);
+ this.rb_isNumber.TabIndex = 5;
+ this.rb_isNumber.TabStop = true;
+ this.rb_isNumber.Text = "숫자표출";
+ this.rb_isNumber.UseVisualStyleBackColor = true;
+ //
+ // rb_isHave
+ //
+ this.rb_isHave.AutoSize = true;
+ this.rb_isHave.Checked = true;
+ this.rb_isHave.Location = new System.Drawing.Point(318, 8);
+ this.rb_isHave.Name = "rb_isHave";
+ this.rb_isHave.Size = new System.Drawing.Size(71, 16);
+ this.rb_isHave.TabIndex = 5;
+ this.rb_isHave.TabStop = true;
+ this.rb_isHave.Text = "소장표출";
+ this.rb_isHave.UseVisualStyleBackColor = true;
+ //
// btn_SearchList
//
this.btn_SearchList.Location = new System.Drawing.Point(4, 4);
this.btn_SearchList.Name = "btn_SearchList";
- this.btn_SearchList.Size = new System.Drawing.Size(356, 24);
+ this.btn_SearchList.Size = new System.Drawing.Size(305, 24);
this.btn_SearchList.TabIndex = 3;
this.btn_SearchList.Text = "목록 검색";
this.btn_SearchList.UseVisualStyleBackColor = true;
@@ -139,7 +169,7 @@
//
this.tb_SearchTarget.Location = new System.Drawing.Point(66, 6);
this.tb_SearchTarget.Name = "tb_SearchTarget";
- this.tb_SearchTarget.Size = new System.Drawing.Size(294, 21);
+ this.tb_SearchTarget.Size = new System.Drawing.Size(243, 21);
this.tb_SearchTarget.TabIndex = 1;
this.tb_SearchTarget.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_SearchTarget_KeyDown);
//
@@ -172,14 +202,14 @@
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
- dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
- dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
- dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
- dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
- dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
- dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
- dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
- this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
+ 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.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.book_name,
@@ -189,7 +219,7 @@
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowTemplate.Height = 23;
- this.dataGridView1.Size = new System.Drawing.Size(635, 630);
+ this.dataGridView1.Size = new System.Drawing.Size(635, 636);
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);
@@ -219,12 +249,12 @@
this.webBrowser1.MinimumSize = new System.Drawing.Size(20, 20);
this.webBrowser1.Name = "webBrowser1";
this.webBrowser1.ScriptErrorsSuppressed = true;
- this.webBrowser1.Size = new System.Drawing.Size(717, 732);
+ this.webBrowser1.Size = new System.Drawing.Size(673, 738);
this.webBrowser1.TabIndex = 2;
//
// btn_ApplyFilter
//
- this.btn_ApplyFilter.Location = new System.Drawing.Point(473, 4);
+ this.btn_ApplyFilter.Location = new System.Drawing.Point(311, 4);
this.btn_ApplyFilter.Name = "btn_ApplyFilter";
this.btn_ApplyFilter.Size = new System.Drawing.Size(75, 24);
this.btn_ApplyFilter.TabIndex = 2;
@@ -241,7 +271,7 @@
this.panel3.Dock = System.Windows.Forms.DockStyle.Left;
this.panel3.Location = new System.Drawing.Point(0, 0);
this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(635, 732);
+ this.panel3.Size = new System.Drawing.Size(635, 738);
this.panel3.TabIndex = 3;
//
// panel6
@@ -250,13 +280,16 @@
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(0, 102);
this.panel6.Name = "panel6";
- this.panel6.Size = new System.Drawing.Size(635, 630);
+ this.panel6.Size = new System.Drawing.Size(635, 636);
this.panel6.TabIndex = 3;
//
// panel4
//
this.panel4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel4.Controls.Add(this.chk_RemoveBrit);
+ this.panel4.Controls.Add(this.btn_ResultEmpty);
+ this.panel4.Controls.Add(this.btn_GridReset);
+ this.panel4.Controls.Add(this.btn_OpenMemo);
this.panel4.Controls.Add(this.btn_ApplyFilter);
this.panel4.Controls.Add(this.chk_spChar);
this.panel4.Dock = System.Windows.Forms.DockStyle.Top;
@@ -275,6 +308,26 @@
this.chk_RemoveBrit.Text = "괄호안의 문자 제거";
this.chk_RemoveBrit.UseVisualStyleBackColor = true;
//
+ // btn_GridReset
+ //
+ this.btn_GridReset.Location = new System.Drawing.Point(553, 4);
+ this.btn_GridReset.Name = "btn_GridReset";
+ this.btn_GridReset.Size = new System.Drawing.Size(75, 24);
+ this.btn_GridReset.TabIndex = 2;
+ this.btn_GridReset.Text = "표 비우기";
+ this.btn_GridReset.UseVisualStyleBackColor = true;
+ this.btn_GridReset.Click += new System.EventHandler(this.btn_GridReset_Click);
+ //
+ // btn_OpenMemo
+ //
+ this.btn_OpenMemo.Location = new System.Drawing.Point(392, 4);
+ this.btn_OpenMemo.Name = "btn_OpenMemo";
+ this.btn_OpenMemo.Size = new System.Drawing.Size(75, 24);
+ this.btn_OpenMemo.TabIndex = 2;
+ this.btn_OpenMemo.Text = "메모장열기";
+ this.btn_OpenMemo.UseVisualStyleBackColor = true;
+ this.btn_OpenMemo.Click += new System.EventHandler(this.btn_OpenMemo_Click);
+ //
// chk_spChar
//
this.chk_spChar.AutoSize = true;
@@ -291,19 +344,30 @@
this.panel5.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel5.Location = new System.Drawing.Point(635, 0);
this.panel5.Name = "panel5";
- this.panel5.Size = new System.Drawing.Size(717, 732);
+ this.panel5.Size = new System.Drawing.Size(673, 738);
this.panel5.TabIndex = 4;
//
+ // btn_ResultEmpty
+ //
+ this.btn_ResultEmpty.Location = new System.Drawing.Point(473, 4);
+ this.btn_ResultEmpty.Name = "btn_ResultEmpty";
+ this.btn_ResultEmpty.Size = new System.Drawing.Size(75, 24);
+ this.btn_ResultEmpty.TabIndex = 2;
+ this.btn_ResultEmpty.Text = "결과 비움";
+ this.btn_ResultEmpty.UseVisualStyleBackColor = true;
+ this.btn_ResultEmpty.Click += new System.EventHandler(this.btn_ResultEmpty_Click);
+ //
// Check_copy
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(1352, 732);
+ this.ClientSize = new System.Drawing.Size(1308, 738);
this.Controls.Add(this.panel5);
this.Controls.Add(this.panel3);
this.Name = "Check_copy";
this.Text = "복본조사";
this.panel1.ResumeLayout(false);
+ this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.SearchCount)).EndInit();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
@@ -322,7 +386,6 @@
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
- private System.Windows.Forms.NumericUpDown SearchCount;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btn_Close;
private System.Windows.Forms.Button btn_Stop;
@@ -341,5 +404,11 @@
private System.Windows.Forms.DataGridViewTextBoxColumn book_name;
private System.Windows.Forms.DataGridViewTextBoxColumn book_comp;
private System.Windows.Forms.DataGridViewTextBoxColumn Count;
+ public System.Windows.Forms.NumericUpDown SearchCount;
+ private System.Windows.Forms.RadioButton rb_isNumber;
+ private System.Windows.Forms.RadioButton rb_isHave;
+ private System.Windows.Forms.Button btn_GridReset;
+ private System.Windows.Forms.Button btn_OpenMemo;
+ private System.Windows.Forms.Button btn_ResultEmpty;
}
}
\ No newline at end of file
diff --git a/unimarc/unimarc/마크/Check_copy.cs b/unimarc/unimarc/마크/Check_copy.cs
index 01d8b10..178893a 100644
--- a/unimarc/unimarc/마크/Check_copy.cs
+++ b/unimarc/unimarc/마크/Check_copy.cs
@@ -1,12 +1,7 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
using System.Drawing;
-using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
-using System.Threading.Tasks;
using System.Web;
using System.Windows.Forms;
using UniMarc.마크;
@@ -52,7 +47,7 @@ namespace WindowsFormsApp1.Mac
ccs.Show();
}
}
-
+
private void btn_SearchList_Click(object sender, EventArgs e)
{
Check_Copy_Sub_List cl = new Check_Copy_Sub_List(this);
@@ -69,9 +64,27 @@ namespace WindowsFormsApp1.Mac
private void btn_Start_Click(object sender, EventArgs e)
{
+ dataGridView1.CurrentCell = dataGridView1.Rows[0].Cells[0];
+
+ webBrowser1.Navigate("");
+
int SCount = Convert.ToInt32(SearchCount.Value);
- isStop = false;
+ if (URL is null)
+ return;
+
+ webBrowser1.Navigate(URL);
+
+ if (URL.IndexOf("") < 0 ||
+ URL.IndexOf("lib.jeonnam.go.kr") < 0)
+ {
+ webBrowser1.DocumentCompleted += this.webBrowser1_DocumentCompleted;
+ return;
+ }
+ else
+ {
+ webBrowser1.DocumentCompleted -= this.webBrowser1_DocumentCompleted;
+ }
for (int a = 0; a < SCount; a++)
{
@@ -86,90 +99,188 @@ namespace WindowsFormsApp1.Mac
string BookSearchCount = CopyCount(dataGridView1.Rows[a].Cells["book_name"].Value.ToString());
- if (BookSearchCount == "false") {
+ if (BookSearchCount == "false")
+ {
MessageBox.Show("검색대상이 설정되지않았습니다!");
return;
}
- if (BookSearchCount == "0" || BookSearchCount == "")
+ if (BookSearchCount == "0" || BookSearchCount == "" || BookSearchCount == "미소장")
+ {
+ dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.LightGray;
+ dataGridView1.Rows[a].DefaultCellStyle.ForeColor = Color.Red;
BookSearchCount = "미소장";
+ }
else
+ {
+ dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.Yellow;
+ dataGridView1.Rows[a].DefaultCellStyle.ForeColor = Color.Blue;
BookSearchCount = "소장";
+ }
dataGridView1.Rows[a].Cells["Count"].Value = BookSearchCount;
- dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.LightGray;
}
}
- public string CopyCount(string Text)
+ int RowCount = 0;
+ private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
- string result = "";
-
- if (lib_Category is null)
- return "false";
-
- string[] Detail = lib_Category.Split('_');
- switch (Detail[0])
+ if (RowCount == SearchCount.Value)
{
- case "광주":
- result = 광주(Detail[1], Text);
- break;
- case "전남":
- result = 전남(Detail[1], Text);
- break;
- default:
- break;
+ webBrowser1.DocumentCompleted -= this.webBrowser1_DocumentCompleted;
+ MessageBox.Show("조사가 완료되었습니다!");
+ RowCount = 0;
+ isJNLClick = false;
+ isKJKClick = false;
+ return;
}
- return result;
- }
- private void btn_Stop_Click(object sender, EventArgs e)
- {
- isStop = true;
- }
+ string URL = webBrowser1.Url.AbsoluteUri;
+ string BookCount = "";
+ string text = dataGridView1.Rows[RowCount].Cells["book_name"].Value.ToString();
- #region 광주
- string 광주(string detail, string Text)
- {
- string result = "";
- switch (detail)
+ // 광주 시립 (무등, 사직, 산수)
+ if (URL.IndexOf("citylib.gwangju.kr/main/bookSearch") > -1)
{
- case "시립":
- result = 광주시립(Text);
- break;
- case "교육청":
- result = 광주교육청(Text);
- break;
- case "동구":
- break;
- case "서구":
- break;
- case "남구":
- result = 광주남구(Text);
- break;
- case "북구":
- result = 광주북구(Text);
- break;
- case "광산구":
- result = 광주광산구(Text);
- break;
- default:
- break;
+ if (URL.IndexOf("keyword") > -1)
+ BookCount = 광주시립결과();
+
+ 광주시립입력(text);
}
- return result;
- }
- string 광주시립(string text)
- {
- string result = "";
+ // 광주 남구 (문화정보, 푸른길, 청소년)
+ else if (URL.IndexOf("searchlib.namgu.gwangju.kr") > -1)
+ {
+ if (URL.IndexOf("word") > -1)
+ BookCount = 광주남구결과();
- webBrowser1.Navigate(URL);
+ 광주남구입력(text);
+ }
- Delay(3000);
- webBrowser1.Document.GetElementById("searchKeyword").SetAttribute("value", text);
+ // 광주 북구 (일곡, 운암, 양산)
+ else if (URL.IndexOf("lib.bukgu.gwangju.kr") > -1)
+ {
+ BookCount = 광주북구입력(text);
+ }
+
+ // 광주 광산구 (장덕, 이야기꽃, 첨단, 신가, 운남어린이, 스마트)
+ else if (URL.IndexOf("lib.gwangsan.go.kr") > -1)
+ {
+ if (URL.IndexOf("bookSearch") > -1)
+ BookCount = 광주광산구결과();
+
+ 광주광산구입력(text);
+ }
+ // 광주 교육청 (학생독립, 중앙, 학생교육, 금호평생, 광주송정, 석봉)
+ else if (URL.IndexOf("lib.gen.go.kr") > -1)
+ {
+ if (URL.IndexOf("search_txt") > -1)
+ BookCount = 광주교육청결과();
+
+ 광주교육청입력(text);
+ }
+
+ // 전남 교육청 (목포, 나주, 남평, 광양, 담양 ... 순천만생채문화교육원 등 총 26개 도서관)
+ else if (URL.IndexOf("jnelib.jne.go.kr") > -1)
+ {
+ BookCount = 전남교육청입력(text);
+ }
+
+ // 전남 진도 (진도철마, 새섬작은, 의신백구)
+ else if (URL.IndexOf("lib.jindo.go.kr") > -1)
+ {
+ if (URL.IndexOf("simple") > -1)
+ BookCount = 전남진도결과();
+
+ 전남진도입력(text);
+ }
+
+ // 전남 완도 TODO: 작업해야함
+
+ // 전남 도립 TODO: 오류발생 (원인불명) [한번에 3개씩 검색결과가 표출됨]
+ /*
+ * else if (URL.IndexOf("lib.jeonnam.go.kr") > -1)
+ {
+ Delay(300);
+ if (URL.IndexOf("value") > -1)
+ BookCount = 전남도립결과();
+
+ 전남도립입력(text);
+ }
+ */
+
+ // 전남 고흥 (군립중앙, 군립남부, 군립북부 등 총 7개 도서관)
+ else if (URL.IndexOf("ghlib.go.kr/BookSearch") > -1)
+ {
+ if (URL.IndexOf("simple") > -1)
+ BookCount = 전남고흥결과();
+
+ 전남고흥입력(text);
+ }
+
+ // 전남 여수 (쌍봉, 현암, 환경, 돌산 등 총 31개 도서관)
+ // TODO: 방식이 다름. 다른 방법으로 돌아야함.
+ else if (URL.IndexOf("yslib.yeosu.go.kr") > -1)
+ {
+ if (URL.IndexOf("searchWord") > -1)
+ BookCount = 전남여수결과();
+
+ 전남여수입력(text);
+ }
+
+
+ // 전남 무안군 공공도서관
+ else if (URL.IndexOf("muan.go.kr/lib/data/search") > -1)
+ {
+ BookCount = 전남무안입력(text);
+ }
+
+
+ int tmp = RowCount - 1;
+ if (tmp < 0) tmp = 0;
+
+ BookCount = IsHave(BookCount, tmp);
+ dataGridView1.Rows[tmp].Cells["Count"].Value = BookCount;
+ RowCount++;
+ }
+
+ ///
+ /// 입력된 카운트를 소장/미소장으로 바꿔서 반환
+ ///
+ /// 소장 몇권인지
+ /// 소장 혹은 미소장으로 반환
+ private string IsHave(string Count, int RowCount)
+ {
+ if (Count == "" || Count == "0" || Count == "미소장")
+ {
+ dataGridView1.Rows[RowCount].DefaultCellStyle.BackColor = Color.LightGray;
+ dataGridView1.Rows[RowCount].DefaultCellStyle.ForeColor = Color.Red;
+
+ if (rb_isHave.Checked)
+ return "";
+ else
+ return Count;
+ }
+
+ dataGridView1.Rows[RowCount].DefaultCellStyle.BackColor = Color.Yellow;
+ dataGridView1.Rows[RowCount].DefaultCellStyle.ForeColor = Color.Blue;
+
+ if (rb_isHave.Checked)
+ return "소장";
+ else
+ return Count;
+ }
+
+
+ #region 광주 소재 도서관
+
+ #region 광주 시립
+ void 광주시립입력(string text)
+ {
+ webBrowser1.Document.GetElementById("searchKeyword").SetAttribute("value", text);
+
webBrowser1.Document.GetElementById("libCode").SetAttribute("value", Code);
- Delay(500);
HtmlElementCollection button = webBrowser1.Document.GetElementsByTagName("button");
foreach (HtmlElement SearchButton in button)
@@ -177,7 +288,11 @@ namespace WindowsFormsApp1.Mac
if (SearchButton.GetAttribute("className").IndexOf("bookSearchBtn") > -1)
SearchButton.InvokeMember("click");
}
- Delay(1500);
+ }
+
+ string 광주시립결과()
+ {
+ string result = "";
HtmlElementCollection hecDiv = webBrowser1.Document.GetElementsByTagName("div");
foreach (HtmlElement heDiv in hecDiv)
@@ -195,49 +310,14 @@ namespace WindowsFormsApp1.Mac
}
}
}
- Delay(500);
return result;
}
+ #endregion
- private string 광주교육청(string text)
+ #region 광주 남구
+
+ void 광주남구입력(string text)
{
- string result = "";
-
- webBrowser1.Navigate(URL);
- Delay(3000);
-
- webBrowser1.Document.GetElementById("manage_code").SetAttribute("value", Code);
-
- webBrowser1.Document.GetElementById("search_txt").SetAttribute("value", text);
-
- foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (Btn.GetAttribute("id").IndexOf("search_txt") > -1)
- Btn.SetAttribute("value", text);
- if (Btn.GetAttribute("className").IndexOf("btn-search") > -1)
- Btn.InvokeMember("click");
- }
- Delay(5000);
-
- HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("span");
- foreach (HtmlElement heTd in hecTd)
- {
- if (heTd.InnerText.IndexOf("전체") > -1)
- {
- result = Regex.Replace(heTd.InnerText, @"\D", "");
- }
- }
-
- return result;
- }
-
- private string 광주남구(string text)
- {
- string result = "";
-
- webBrowser1.Navigate(URL);
- Delay(13000);
-
foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
{
if (he.GetAttribute("id").IndexOf(Code) > -1)
@@ -253,7 +333,11 @@ namespace WindowsFormsApp1.Mac
if (Btn.GetAttribute("className").IndexOf("btn btn-search") > -1)
Btn.InvokeMember("click");
}
- Delay(5000);
+ }
+
+ string 광주남구결과()
+ {
+ string result = "";
HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("strong");
foreach (HtmlElement heTd in hecTd)
@@ -266,19 +350,20 @@ namespace WindowsFormsApp1.Mac
return result;
}
+ #endregion
- private string 광주북구(string text)
+ #region 광주 북구
+ bool isKJKClick = false;
+ string 광주북구입력(string text)
{
string result = "";
-
- webBrowser1.Navigate(URL);
- Delay(3000);
foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
{
if (he.Name.IndexOf("libCode") > -1)
{
- if (!he.Id.Contains(Code))
+ if (!he.Id.Contains(Code) && !isKJKClick)
{
+ isKJKClick = true;
he.InvokeMember("click");
}
}
@@ -290,7 +375,7 @@ namespace WindowsFormsApp1.Mac
if (Btn.GetAttribute("className").IndexOf("btn btn-lg") > -1)
Btn.InvokeMember("click");
}
- Delay(5000);
+ Delay(3000);
HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("p");
foreach (HtmlElement heTd in hecTd)
@@ -307,33 +392,37 @@ namespace WindowsFormsApp1.Mac
return result;
}
- private string 광주광산구(string text)
+ #endregion
+
+ #region 광주 광산구
+
+ void 광주광산구입력(string text)
+ {
+ foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("select"))
+ {
+ if (he.Name.IndexOf("globalSearchLib") > -1)
+ {
+ he.SetAttribute("value", Code);
+ }
+ }
+ webBrowser1.Document.GetElementById("globalSearchText").SetAttribute("value", text);
+
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("button"))
+ {
+ // if (Btn.GetAttribute("className").IndexOf("btn-search") > -1)
+ if (Btn.GetAttribute("className") == "btn-search")
+ Btn.InvokeMember("click");
+ }
+ }
+
+ string 광주광산구결과()
{
string result = "";
- webBrowser1.Navigate(URL);
- Delay(3000);
-
- foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (he.Name.IndexOf(Code) > -1)
- {
- he.InvokeMember("click");
- }
- }
- webBrowser1.Document.GetElementById("searchWord").SetAttribute("value", text);
-
- foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (Btn.GetAttribute("className").IndexOf("btn btn-search") > -1)
- Btn.InvokeMember("click");
- }
- Delay(5000);
-
- HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("strong");
+ HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("p");
foreach (HtmlElement heTd in hecTd)
{
- if (heTd.GetAttribute("className").IndexOf("cyan") > -1)
+ if (heTd.GetAttribute("className").IndexOf("totalCount") > -1)
{
result = Regex.Replace(heTd.InnerText, @"\D", "");
}
@@ -343,6 +432,348 @@ namespace WindowsFormsApp1.Mac
}
#endregion
+ #region 광주 교육청
+
+ void 광주교육청입력(string text)
+ {
+ webBrowser1.Document.GetElementById("manage_code").SetAttribute("value", Code);
+
+ webBrowser1.Document.GetElementById("search_txt").SetAttribute("value", text);
+
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (Btn.GetAttribute("id").IndexOf("search_txt") > -1)
+ Btn.SetAttribute("value", text);
+ if (Btn.GetAttribute("className").IndexOf("btn-search") > -1)
+ Btn.InvokeMember("click");
+ }
+ }
+
+ string 광주교육청결과()
+ {
+ string result = "";
+
+ HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("span");
+ foreach (HtmlElement heTd in hecTd)
+ {
+ if (heTd.InnerText.IndexOf("전체") > -1)
+ {
+ result = Regex.Replace(heTd.InnerText, @"\D", "");
+ }
+ }
+ return result;
+ }
+
+ #endregion
+
+ #endregion
+
+ #region 전남 소재 도서관
+
+ #region 전남 교육청
+ bool isJNLClick = false;
+ string 전남교육청입력(string text)
+ {
+ string result = "";
+
+ foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (he.Id != null && he.Id.IndexOf(Code) > -1 && !isJNLClick)
+ {
+ he.InvokeMember("click");
+ isJNLClick = true;
+ Delay(500);
+ }
+ if (he.Name.IndexOf("searchWordText") > -1)
+ {
+ he.SetAttribute("value", text);
+ }
+ }
+
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (Btn.GetAttribute("value") == "소장자료 검색")
+ Btn.InvokeMember("click");
+ }
+ Delay(3000);
+
+ HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("span");
+ foreach (HtmlElement heTd in hecTd)
+ {
+ if (heTd.GetAttribute("className").IndexOf("txt_bold") > -1)
+ {
+ result = Regex.Replace(heTd.InnerText, @"\D", "");
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ #endregion
+
+ #region 전남 진도
+
+ void 전남진도입력(string text)
+ {
+ foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (he.GetAttribute("value").IndexOf(Code) > -1)
+ {
+ he.InvokeMember("click");
+ }
+ if (he.Name.IndexOf("query") > -1)
+ {
+ he.SetAttribute("value", text);
+ }
+ }
+
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("button"))
+ {
+ if (Btn.GetAttribute("className").IndexOf("btn btn-lg") > -1)
+ Btn.InvokeMember("click");
+ }
+ }
+
+ string 전남진도결과()
+ {
+ string result = "";
+
+ HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("p");
+ foreach (HtmlElement heTd in hecTd)
+ {
+ if (heTd.GetAttribute("className").IndexOf("totalCount") > -1)
+ {
+ result = Regex.Replace(heTd.InnerText, @"\D", "");
+ }
+ }
+
+ return result;
+ }
+ #endregion
+
+ #region 전남 완도 (작업예정)
+
+ void 전남완도입력(string text)
+ {
+ webBrowser1.Document.GetElementById("value2").SetAttribute("value", text);
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("select"))
+ {
+ if (Btn.GetAttribute("name").IndexOf("local") > -1)
+ Btn.SetAttribute("value", Code);
+ }
+
+
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (Btn.GetAttribute("type") == "image")
+ Btn.InvokeMember("click");
+ }
+ }
+
+ string 전남완도결과()
+ {
+ string result = "";
+
+ HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("td");
+ foreach (HtmlElement heTd in hecTd)
+ {
+ if (heTd.GetAttribute("alrign").IndexOf("left") > -1)
+ {
+ result = Regex.Replace(heTd.InnerText, @"\D", "");
+ }
+ }
+
+ return result;
+ }
+ #endregion
+
+ #region 전남 도립 (오류발생)
+
+ void 전남도립입력(string text)
+ {
+ HtmlElementCollection hInput = webBrowser1.Document.GetElementsByTagName("input");
+ foreach (HtmlElement Input in hInput)
+ {
+ if (Input.GetAttribute("className").IndexOf("search_main") > -1)
+ Input.SetAttribute("value", text);
+ }
+
+ HtmlElementCollection hBtn = webBrowser1.Document.GetElementsByTagName("button");
+ foreach (HtmlElement Btn in hBtn)
+ {
+ if (Btn.InnerText == "검색")
+ Btn.InvokeMember("click");
+ }
+ }
+
+ string 전남도립결과()
+ {
+ string result = "";
+
+ Delay(300);
+
+ HtmlElementCollection hecDiv = webBrowser1.Document.GetElementsByTagName("div");
+ foreach (HtmlElement heDiv in hecDiv)
+ {
+ if (heDiv.GetAttribute("className").IndexOf("booksearch_info") > -1)
+ {
+ HtmlElementCollection hecLi = heDiv.GetElementsByTagName("font");
+ foreach (HtmlElement heLi in hecLi)
+ {
+ result = Regex.Replace(heLi.InnerText, @"\D", "");
+ break;
+ }
+ }
+ }
+
+ return result;
+ }
+ #endregion
+
+ #region 전남 고흥
+
+ void 전남고흥입력(string text)
+ {
+ foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (he.GetAttribute("id").IndexOf(Code) > -1)
+ {
+ he.InvokeMember("click");
+ }
+ }
+
+ webBrowser1.Document.GetElementById("query").SetAttribute("value", text);
+
+ foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("button"))
+ {
+ if (Btn.GetAttribute("className").IndexOf("btn-lg") > -1)
+ Btn.InvokeMember("click");
+ }
+ }
+
+ string 전남고흥결과()
+ {
+ string result = "";
+
+ HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("p");
+ foreach (HtmlElement heTd in hecTd)
+ {
+ if (heTd.GetAttribute("className").IndexOf("totalCount") > -1)
+ {
+ result = Regex.Replace(heTd.InnerText, @"\D", "");
+ }
+ }
+
+ return result;
+ }
+ #endregion
+
+ #region 전남 여수 (오류발생)
+ void 전남여수입력(string text)
+ {
+ foreach (HtmlElement DIV in webBrowser1.Document.GetElementsByTagName("div"))
+ {
+ if (DIV.GetAttribute("className").IndexOf("search") > -1)
+ {
+ HtmlElementCollection FindInput = DIV.GetElementsByTagName("input");
+ foreach (HtmlElement input in FindInput)
+ {
+ if (input.Name.IndexOf("searchWord") > -1)
+ {
+ input.SetAttribute("value", text);
+ }
+ }
+ foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
+ {
+ if (he.GetAttribute("className").IndexOf("btn-search") > -1)
+ {
+ he.InvokeMember("click");
+ }
+ }
+ }
+ }
+ }
+
+ string 전남여수결과()
+ {
+ string result = "";
+
+ foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("ul"))
+ {
+ if (he.Id != null && he.Id.IndexOf("multiChk1") > -1)
+ {
+ HtmlElementCollection FindLib = he.GetElementsByTagName("a");
+ foreach (HtmlElement Lib in FindLib)
+ {
+ if (Lib.GetAttribute("href").IndexOf(string.Format("ManageCode={0}", Code)) > -1)
+ result = Regex.Replace(Lib.InnerText, @"\D", "");
+ }
+ }
+ }
+
+ return result;
+ }
+
+ #endregion
+
+ #region 전남 무안
+
+ string 전남무안입력(string text)
+ {
+ string result = "소장";
+
+ webBrowser1.Document.GetElementById("search_word").SetAttribute("value", text);
+
+ HtmlElementCollection inputcol = webBrowser1.Document.GetElementsByTagName("input");
+ foreach (HtmlElement input in inputcol)
+ {
+ if (input.GetAttribute("className").IndexOf("btn-sch btn-gray") > -1)
+ {
+ input.InvokeMember("click");
+ }
+ }
+
+ Delay(3000);
+ HtmlElementCollection tdcol = webBrowser1.Document.GetElementsByTagName("td");
+ foreach (HtmlElement td in tdcol)
+ {
+ if (td.GetAttribute("className").IndexOf("list_empty") > -1)
+ {
+ result = "미소장";
+ }
+ }
+ return result;
+ }
+
+ #endregion
+
+ #endregion
+
+ public string CopyCount(string Text)
+ {
+ string result = "";
+
+ if (lib_Category is null)
+ return "false";
+
+ string[] Detail = lib_Category.Split('_');
+ switch (Detail[0])
+ {
+ case "전남":
+ result = 전남(Detail[1], Text);
+ break;
+ default:
+ break;
+ }
+ return result;
+ }
+
+ private void btn_Stop_Click(object sender, EventArgs e)
+ {
+ isStop = true;
+ }
+
#region 전남
string 전남(string detail, string Text)
{
@@ -352,24 +783,15 @@ namespace WindowsFormsApp1.Mac
case "도립":
result = 전남도립(Text);
break;
- case "교육청":
- result = 전남교육청(Text);
- break;
+
case "여수":
result = 전남여수(Text);
break;
- case "고흥":
- result = 전남고흥(Text);
- break;
+
case "완도":
result = 전남완도(Text);
break;
- case "진도":
- result = 전남진도(Text);
- break;
- case "무안":
- result = 전남무안(Text);
- break;
+
default:
break;
}
@@ -401,45 +823,6 @@ namespace WindowsFormsApp1.Mac
return result;
}
- private string 전남교육청(string text)
- {
- string result = "";
-
- webBrowser1.Navigate(URL);
- Delay(5000);
-
- foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (he.Id != null && he.Id.IndexOf(Code) > -1)
- {
- he.InvokeMember("click");
- }
- if (he.Name.IndexOf("searchWordText") > -1)
- {
- he.SetAttribute("value", text);
- }
- }
-
- foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (Btn.GetAttribute("value") == "소장자료 검색")
- Btn.InvokeMember("click");
- }
- Delay(5000);
-
- HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("span");
- foreach (HtmlElement heTd in hecTd)
- {
- if (heTd.GetAttribute("className").IndexOf("txt_bold") > -1)
- {
- result = Regex.Replace(heTd.InnerText, @"\D", "");
- break;
- }
- }
-
- return result;
- }
-
private string 전남여수(string text)
{
string result = "";
@@ -466,43 +849,6 @@ namespace WindowsFormsApp1.Mac
return result;
}
- private string 전남고흥(string text)
- {
- string result = "";
-
- webBrowser1.Navigate(URL);
- Delay(3000);
-
- foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (he.GetAttribute("id").IndexOf(Code) > -1)
- {
- he.InvokeMember("click");
- }
- }
-
- webBrowser1.Document.GetElementById("query").SetAttribute("value", text);
-
-
- foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("button"))
- {
- if (Btn.InnerText == "검색")
- Btn.InvokeMember("click");
- }
- Delay(3000);
-
- HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("p");
- foreach (HtmlElement heTd in hecTd)
- {
- if (heTd.GetAttribute("className").IndexOf("totalCount") > -1)
- {
- result = Regex.Replace(heTd.InnerText, @"\D", "");
- }
- }
-
- return result;
- }
-
private string 전남완도(string text)
{
string result = "";
@@ -538,74 +884,6 @@ namespace WindowsFormsApp1.Mac
return result;
}
- private string 전남진도(string text)
- {
- string result = "";
-
- webBrowser1.Navigate(URL);
- Delay(3000);
-
- foreach (HtmlElement he in webBrowser1.Document.GetElementsByTagName("input"))
- {
- if (he.GetAttribute("value").IndexOf(Code) > -1)
- {
- he.InvokeMember("click");
- }
- if (he.Name.IndexOf("query") > -1)
- {
- he.SetAttribute("value", text);
- }
- }
-
- foreach (HtmlElement Btn in webBrowser1.Document.GetElementsByTagName("button"))
- {
- if (Btn.GetAttribute("className").IndexOf("btn btn-lg") > -1)
- Btn.InvokeMember("click");
- }
- Delay(5000);
-
- HtmlElementCollection hecTd = webBrowser1.Document.GetElementsByTagName("p");
- foreach (HtmlElement heTd in hecTd)
- {
- if (heTd.GetAttribute("className").IndexOf("totalCount") > -1)
- {
- result = Regex.Replace(heTd.InnerText, @"\D", "");
- }
- }
-
- return result;
- }
-
- private string 전남무안(string text)
- {
- string result = "소장";
-
- webBrowser1.Navigate(URL);
- Delay(15000);
-
- webBrowser1.Document.GetElementById("search_word").SetAttribute("value", text);
-
- HtmlElementCollection inputcol = webBrowser1.Document.GetElementsByTagName("input");
- foreach (HtmlElement input in inputcol)
- {
- if (input.GetAttribute("className").IndexOf("btn-sch btn-gray") > -1)
- {
- input.InvokeMember("click");
- }
- }
-
- Delay(5000);
- HtmlElementCollection tdcol = webBrowser1.Document.GetElementsByTagName("td");
- foreach (HtmlElement td in tdcol)
- {
- if (td.GetAttribute("className").IndexOf("list_empty") > -1)
- {
- result = "미소장";
- }
- }
- return result;
- }
-
#endregion
///
@@ -617,6 +895,7 @@ namespace WindowsFormsApp1.Mac
DateTime dateTimeNow = DateTime.Now;
TimeSpan duration = new TimeSpan(0, 0, 0, 0, ms);
DateTime dateTimeAdd = dateTimeNow.Add(duration);
+
while (dateTimeAdd >= dateTimeNow)
{
Application.DoEvents();
@@ -628,9 +907,10 @@ namespace WindowsFormsApp1.Mac
private void btn_ApplyFilter_Click(object sender, EventArgs e)
{
int count = dataGridView1.Rows.Count;
+
if (count <= 1)
return;
-
+
if (chk_spChar.Checked) // 특수문자 제거
RemoveSpecialChar(count);
@@ -667,11 +947,71 @@ namespace WindowsFormsApp1.Mac
break;
string Target = dataGridView1.Rows[a].Cells["book_name"].Value.ToString();
-
+
dataGridView1.Rows[a].Cells["book_name"].Value = st.RemoveWordInBracket(Target).Trim();
}
}
+ private void btn_OpenMemo_Click(object sender, EventArgs e)
+ {
+ OpenFileDialog OpenFileDialog = new OpenFileDialog();
+ if (OpenFileDialog.ShowDialog() == DialogResult.OK)
+ {
+ dataGridView1.Rows.Clear();
+ string filePath = OpenFileDialog.FileName;
+ try
+ {
+ System.IO.StreamReader r = new System.IO.StreamReader(filePath, Encoding.GetEncoding("ks_c_5601-1987"));
+ OpenFileGrid(r.ReadToEnd());
+ r.Close();
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.ToString());
+ }
+ }
+ }
+ #region OpenMemo_Sub
+
+ void OpenFileGrid(string text)
+ {
+ string[] splitText = text.Split('\n');
+
+ foreach (string Line in splitText)
+ {
+ if (Line == "")
+ continue;
+
+ string[] GridData = { "", "" };
+ if (Line.IndexOf('\t') > -1)
+ {
+ string[] splitLine = Line.Split('\t');
+ GridData[0] = splitLine[0];
+ GridData[1] = splitLine[1];
+ }
+ else
+ GridData[0] = Line;
+
+ dataGridView1.Rows.Add(GridData);
+ }
+ }
+ #endregion
+
+ private void btn_GridReset_Click(object sender, EventArgs e)
+ {
+ dataGridView1.Rows.Clear();
+ }
+
+ private void btn_ResultEmpty_Click(object sender, EventArgs e)
+ {
+ for (int a = 0; a < dataGridView1.Rows.Count; a++)
+ {
+ dataGridView1.Rows[a].DefaultCellStyle.ForeColor = Color.Black;
+ dataGridView1.Rows[a].DefaultCellStyle.BackColor = Color.White;
+ dataGridView1.Rows[a].Cells["Count"].Value = "";
+ }
+ }
+
private void btn_Close_Click(object sender, EventArgs e)
{
this.Close();
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs
index eebe65d..8fb04d8 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.Designer.cs
@@ -29,7 +29,7 @@ namespace UniMarc.마크
///
private void InitializeComponent()
{
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
+ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.tb_Search = new System.Windows.Forms.TextBox();
this.cb_gu = new System.Windows.Forms.ComboBox();
@@ -49,8 +49,8 @@ namespace UniMarc.마크
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.panel2 = new System.Windows.Forms.Panel();
this.btn_Morge = new System.Windows.Forms.Button();
- this.panel3 = new System.Windows.Forms.Panel();
this.btn_OpenFile = new System.Windows.Forms.Button();
+ this.panel3 = new System.Windows.Forms.Panel();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
this.panel2.SuspendLayout();
@@ -172,14 +172,14 @@ namespace UniMarc.마크
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;
- 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.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
+ dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
+ dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
+ dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
+ dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
+ dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+ dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+ dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
+ this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.idx,
@@ -193,7 +193,7 @@ namespace UniMarc.마크
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
- this.dataGridView1.Size = new System.Drawing.Size(806, 324);
+ this.dataGridView1.Size = new System.Drawing.Size(805, 324);
this.dataGridView1.TabIndex = 2;
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint);
@@ -248,7 +248,7 @@ namespace UniMarc.마크
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 0);
this.panel2.Name = "panel2";
- this.panel2.Size = new System.Drawing.Size(806, 33);
+ this.panel2.Size = new System.Drawing.Size(805, 33);
this.panel2.TabIndex = 3;
//
// btn_Morge
@@ -261,17 +261,9 @@ namespace UniMarc.마크
this.btn_Morge.UseVisualStyleBackColor = true;
this.btn_Morge.Click += new System.EventHandler(this.btn_Morge_Click);
//
- // panel3
- //
- this.panel3.Controls.Add(this.dataGridView1);
- this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
- this.panel3.Location = new System.Drawing.Point(0, 33);
- this.panel3.Name = "panel3";
- this.panel3.Size = new System.Drawing.Size(806, 324);
- this.panel3.TabIndex = 4;
- //
// btn_OpenFile
//
+ this.btn_OpenFile.Enabled = false;
this.btn_OpenFile.Location = new System.Drawing.Point(680, 1);
this.btn_OpenFile.Name = "btn_OpenFile";
this.btn_OpenFile.Size = new System.Drawing.Size(61, 29);
@@ -280,11 +272,20 @@ namespace UniMarc.마크
this.btn_OpenFile.UseVisualStyleBackColor = true;
this.btn_OpenFile.Click += new System.EventHandler(this.btn_OpenFile_Click);
//
+ // panel3
+ //
+ this.panel3.Controls.Add(this.dataGridView1);
+ this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.panel3.Location = new System.Drawing.Point(0, 33);
+ this.panel3.Name = "panel3";
+ this.panel3.Size = new System.Drawing.Size(805, 324);
+ this.panel3.TabIndex = 4;
+ //
// Marc_Plan_Sub_SelectList
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
- this.ClientSize = new System.Drawing.Size(806, 357);
+ this.ClientSize = new System.Drawing.Size(805, 357);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel2);
this.Name = "Marc_Plan_Sub_SelectList";
diff --git a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs
index a2a5838..26c10c5 100644
--- a/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs
+++ b/unimarc/unimarc/마크/Marc_Plan_Sub_SelectList.cs
@@ -224,13 +224,13 @@ namespace UniMarc.마크
private void btn_OpenFile_Click(object sender, EventArgs e)
{
OpenFileDialog OpenFileDialog = new OpenFileDialog();
- string filePath = "";
if (OpenFileDialog.ShowDialog() == DialogResult.OK)
{
- filePath = OpenFileDialog.FileName;
+ string filePath = OpenFileDialog.FileName;
try
{
System.IO.StreamReader r = new System.IO.StreamReader(filePath, Encoding.Default);
+ InputGrid(r.ReadToEnd());
r.Close();
}
catch (Exception ex)
diff --git a/unimarc/unimarc/홈/Home_User_manage.cs b/unimarc/unimarc/홈/Home_User_manage.cs
index 0a2bb55..042c8d8 100644
--- a/unimarc/unimarc/홈/Home_User_manage.cs
+++ b/unimarc/unimarc/홈/Home_User_manage.cs
@@ -169,6 +169,13 @@ namespace WindowsFormsApp1.Home
private void btn_IDOverlap_Click(object sender, EventArgs e)
{
+ if (!System.Text.RegularExpressions.Regex.IsMatch(tb_ID.Text, @"^[a-zA-Z0-9]"))
+ {
+ MessageBox.Show("영어와 숫자 조합으로 작성해주세요!");
+ overlap = false;
+ return;
+ }
+
string cmd = _DB.DB_Search(Table_User, "id", tb_ID.Text);
string db_res = _DB.DB_Send_CMD_Search(cmd);
if (db_res == "") { MessageBox.Show("사용가능한 아이디입니다. [" + tb_ID.Text + "]"); overlap = true; }