diff --git a/ISBN_Client/App.config b/ISBN_Client/App.config deleted file mode 100644 index 56efbc7..0000000 --- a/ISBN_Client/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/ISBN_Client/ISBN_Client.Designer.cs b/ISBN_Client/ISBN_Client.Designer.cs deleted file mode 100644 index f8108d6..0000000 --- a/ISBN_Client/ISBN_Client.Designer.cs +++ /dev/null @@ -1,280 +0,0 @@ - -namespace ISBN_Client -{ - partial class Client - { - /// - /// 필수 디자이너 변수입니다. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// 사용 중인 모든 리소스를 정리합니다. - /// - /// 관리되는 리소스를 삭제해야 하면 true이고, 그렇지 않으면 false입니다. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form 디자이너에서 생성한 코드 - - /// - /// 디자이너 지원에 필요한 메서드입니다. - /// 이 메서드의 내용을 코드 편집기로 수정하지 마세요. - /// - 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; - } -} - diff --git a/ISBN_Client/ISBN_Client.cs b/ISBN_Client/ISBN_Client.cs deleted file mode 100644 index 41d740e..0000000 --- a/ISBN_Client/ISBN_Client.cs +++ /dev/null @@ -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(); - } - } -} diff --git a/ISBN_Client/ISBN_Client.csproj b/ISBN_Client/ISBN_Client.csproj deleted file mode 100644 index 2d519b8..0000000 --- a/ISBN_Client/ISBN_Client.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Debug - AnyCPU - {1A792D56-127B-446B-8B01-0A60902E0086} - WinExe - ISBN_Client - ISBN_Client - v4.7.2 - 512 - true - true - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - LocalIntranet - - - false - - - Properties\app.manifest - - - - - - - - - - - - - - - - - Form - - - ISBN_Client.cs - - - - - ISBN_Client.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - - - \ No newline at end of file diff --git a/ISBN_Client/ISBN_Client.resx b/ISBN_Client/ISBN_Client.resx deleted file mode 100644 index 94a7231..0000000 --- a/ISBN_Client/ISBN_Client.resx +++ /dev/null @@ -1,126 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - True - - - True - - \ No newline at end of file diff --git a/ISBN_Client/Program.cs b/ISBN_Client/Program.cs deleted file mode 100644 index 25162b0..0000000 --- a/ISBN_Client/Program.cs +++ /dev/null @@ -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 - { - /// - /// 해당 애플리케이션의 주 진입점입니다. - /// - [STAThread] - static void Main() - { - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Client()); - } - } -} diff --git a/ISBN_Client/Properties/AssemblyInfo.cs b/ISBN_Client/Properties/AssemblyInfo.cs deleted file mode 100644 index f44e488..0000000 --- a/ISBN_Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -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")] diff --git a/ISBN_Client/Properties/Resources.Designer.cs b/ISBN_Client/Properties/Resources.Designer.cs deleted file mode 100644 index b71df47..0000000 --- a/ISBN_Client/Properties/Resources.Designer.cs +++ /dev/null @@ -1,70 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 이 코드는 도구를 사용하여 생성되었습니다. -// 런타임 버전:4.0.30319.42000 -// -// 파일 내용을 변경하면 잘못된 동작이 발생할 수 있으며, 코드를 다시 생성하면 -// 이러한 변경 내용이 손실됩니다. -// -//------------------------------------------------------------------------------ - - -namespace ISBN_Client.Properties -{ - /// - /// 지역화된 문자열 등을 찾기 위한 강력한 형식의 리소스 클래스입니다. - /// - // 이 클래스는 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() - { - } - - /// - /// 이 클래스에서 사용하는 캐시된 ResourceManager 인스턴스를 반환합니다. - /// - [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; - } - } - - /// - /// 이 강력한 형식의 리소스 클래스를 사용하여 모든 리소스 조회에 대해 현재 스레드의 CurrentUICulture 속성을 - /// 재정의합니다. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture - { - get - { - return resourceCulture; - } - set - { - resourceCulture = value; - } - } - } -} diff --git a/ISBN_Client/Properties/Resources.resx b/ISBN_Client/Properties/Resources.resx deleted file mode 100644 index af7dbeb..0000000 --- a/ISBN_Client/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/ISBN_Client/Properties/Settings.Designer.cs b/ISBN_Client/Properties/Settings.Designer.cs deleted file mode 100644 index 6561db6..0000000 --- a/ISBN_Client/Properties/Settings.Designer.cs +++ /dev/null @@ -1,29 +0,0 @@ -//------------------------------------------------------------------------------ -// -// 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. -// -//------------------------------------------------------------------------------ - - -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; - } - } - } -} diff --git a/ISBN_Client/Properties/Settings.settings b/ISBN_Client/Properties/Settings.settings deleted file mode 100644 index 3964565..0000000 --- a/ISBN_Client/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/ISBN_Client/Properties/app.manifest b/ISBN_Client/Properties/app.manifest deleted file mode 100644 index 6d3988c..0000000 --- a/ISBN_Client/Properties/app.manifest +++ /dev/null @@ -1,73 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/unimarc/unimarc/Main.cs b/unimarc/unimarc/Main.cs index 689f39f..dc9de30 100644 --- a/unimarc/unimarc/Main.cs +++ b/unimarc/unimarc/Main.cs @@ -1531,7 +1531,7 @@ namespace WindowsFormsApp1 { master_batch_Processing = new Batch_processing(this); master_batch_Processing.MdiParent = this; - master_batch_Processing.WindowState = FormWindowState.Maximized; + //master_batch_Processing.WindowState = FormWindowState.Maximized; master_batch_Processing.FormClosed += (o, ea) => master_batch_Processing = null; master_batch_Processing.Show(); } diff --git a/unimarc/unimarc/UniMarc.csproj.user b/unimarc/unimarc/UniMarc.csproj.user index f0d6d75..a66c462 100644 --- a/unimarc/unimarc/UniMarc.csproj.user +++ b/unimarc/unimarc/UniMarc.csproj.user @@ -9,7 +9,7 @@ ko-KR false - ShowAllFiles + ProjectFiles false diff --git a/unimarc/unimarc/마스터/Batch_processing.Designer.cs b/unimarc/unimarc/마스터/Batch_processing.Designer.cs index 7e69a23..467ef36 100644 --- a/unimarc/unimarc/마스터/Batch_processing.Designer.cs +++ b/unimarc/unimarc/마스터/Batch_processing.Designer.cs @@ -28,26 +28,190 @@ /// 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; } } \ No newline at end of file diff --git a/unimarc/unimarc/마스터/Batch_processing.cs b/unimarc/unimarc/마스터/Batch_processing.cs index 0e1d844..cb2c717 100644 --- a/unimarc/unimarc/마스터/Batch_processing.cs +++ b/unimarc/unimarc/마스터/Batch_processing.cs @@ -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(); } } } diff --git a/unimarc/unimarc/마스터/Batch_processing.resx b/unimarc/unimarc/마스터/Batch_processing.resx index 1af7de1..2918598 100644 --- a/unimarc/unimarc/마스터/Batch_processing.resx +++ b/unimarc/unimarc/마스터/Batch_processing.resx @@ -117,4 +117,105 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + 156, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAFXSURBVDhPzc9LSwJhFAZgd5FkaAlFRCEhVCRm9TssIiqw + 7CKWXZCQJA1Lw0JIo1Ckm1SL2rSoTYvaBEUQBhEF4YyXaex3fN/3hrNo4SxkNtELZ3U4D+9Rqf5tCmdV + yJ5U4zOlxvuBBuX7ismk1CDfGyDFENIJrXLgbV/zCzzE9MqB57gOpLgOIq7iNtJQGfg4rMFrshbpuA5P + u3W4j+pBxBVQwYPrUDMuAy248Btw6m3DkccoB18SWpBiEERcAxH9IMIyiOAGLcyB5h2gOTsYPwrGDyG+ + 2CEHHnfqpbr0ywsiLIEWFkDzTtDcJFjWBsYPg3GDYBkrtmdMcuAu0oibcBOupLqtOPcZQLNjYPwIku52 + 7M13IuoyIeI0IzxlkQ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nfru7nf/uM7bgN8Ki6/z9/2hsURXbFt/+nz/n937/r23+dwnf/LRLW4zbAvvTu/+zJrzEU + 6aec/29S9OK/Stan/8aRy3AbYJF3539q/2usigySTvyXTfv6Xzd4HoYcHBhm3f4f1vISpyL91Mv/NXyn + YZUDA520G//9qh/iVaTiMQGnHINT7pX/IAV4FQ1KAADwdsCrWJS2HgAAAABJRU5ErkJggg== + + + + + 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 + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACkSURBVDhPY2AYdKBw1vP/6GIkgdyZz/4ndN8j35CMKU// + z9v/+39C1x3yDEnoefJ/9r5f/zu3/v3vVnqZdEMiux79n7Lt1/+SpX//J0z/+98m9yxphgQ2P/zfuvY9 + WLNxyZf/0tHX/htHLiPeEI+q+/9L5r6Da1Z06SFeMwjYl979H9jyjDzNIGCRd+e/TcEV8jSDgGHWbfI1 + g4BO2g3yNQ9NAACgfl+gY6ualwAAAABJRU5ErkJggg== + + + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJ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at end of file diff --git a/unimarc/unimarc/마크/Marc_Macro_Sub.cs b/unimarc/unimarc/마크/Marc_Macro_Sub.cs index 1f7ff54..ffae550 100644 --- a/unimarc/unimarc/마크/Marc_Macro_Sub.cs +++ b/unimarc/unimarc/마크/Marc_Macro_Sub.cs @@ -7,6 +7,7 @@ using System.Web.UI.WebControls; using System.Diagnostics; using System.Windows.Forms; using WindowsFormsApp1; +using AR; namespace UniMarc.마크 { @@ -18,16 +19,16 @@ namespace UniMarc.마크 public Macro(string pIDX, string pTagArr, string pRuncode) { - mIDX= pIDX; - mTagArr= pTagArr; - mRuncode= pRuncode; + mIDX = pIDX; + mTagArr = pTagArr; + mRuncode = pRuncode; } } internal class Macro_Gudu { String_Text st = new String_Text(); Helper_DB db; - + public Macro_Gudu(Helper_DB db) { this.db = db; @@ -36,7 +37,7 @@ namespace UniMarc.마크 bool isAuthorTag = false; string Author_Idx_6768 = ""; public string FileType = "ANSI"; - + public string MacroMarc(string ViewMarc, List idx, List TagArray, List RunCode) { @@ -60,7 +61,7 @@ namespace UniMarc.마크 string tContentTag = string.Empty; for (int i = 0; i < tMacroList.Count; i++) { - if (tMacroList[i].mRuncode == "etc" || tMacroList[i].mRuncode.Contains("jisi") || (tMacroList[i].mRuncode.Contains("del")&& !tMacroList[i].mRuncode.Contains("/"))) + if (tMacroList[i].mRuncode == "etc" || tMacroList[i].mRuncode.Contains("jisi") || (tMacroList[i].mRuncode.Contains("del") && !tMacroList[i].mRuncode.Contains("/"))) { if ((tMacroList[i].mIDX == "110" || tMacroList[i].mIDX == "111" || tMacroList[i].mIDX == "112") && (tMacroList[i].mTagArr == "256" || tMacroList[i].mTagArr == "500") @@ -163,7 +164,7 @@ namespace UniMarc.마크 string TargetTag = CodeSplit[0].Substring(3, 1); string MoveTagNum = CodeSplit[1].Substring(0, 3); string MoveTag = CodeSplit[1].Substring(3, 1); - + ViewMarc = TagToOtherTag(TargetTagNum, TargetTag, MoveTagNum, MoveTag, ViewMarc, isDelete); #region 코드 간소화 작업진행중으로 주석처리 (나중에 삭제) @@ -221,7 +222,8 @@ namespace UniMarc.마크 if (TakeTag[0] != "") Tag += "▼a" + TakeTag[0]; - if (TakeTag[1] == "" && TakeTag[2] == "" && TakeTag[3] == "") { + if (TakeTag[1] == "" && TakeTag[2] == "" && TakeTag[3] == "") + { Tag += "▲"; return st.AddTagInMarc(Tag, ViewMarc); } @@ -268,13 +270,16 @@ namespace UniMarc.마크 { Jisi = ChangeJisi(idx, RunCode[cout], TagArray[cout], ContentTag, Jisi, Target); - if (RunCode[cout] == "del") { - if (TagArray[cout] == ContentTag) { + if (RunCode[cout] == "del") + { + if (TagArray[cout] == ContentTag) + { Target = ""; break; } } - if (ContentTag == "020" && Jisi == "1 " && idx == "75") { + if (ContentTag == "020" && Jisi == "1 " && idx == "75") + { Target = ""; } switch (ContentTag) @@ -475,7 +480,7 @@ namespace UniMarc.마크 { if (TMP[a].Contains("▲")) TMP[a - 1] += "▲"; - + TMP.RemoveAt(a); continue; } @@ -521,7 +526,7 @@ namespace UniMarc.마크 { if (SplitContent[a].StartsWith("a") && idx == "67") Author_Idx_6768 = SplitContent[a].Substring(1).Replace("▲", ""); - + if (a <= 1) continue; } @@ -578,6 +583,25 @@ namespace UniMarc.마크 List TMP = new List(SplitContent); for (int a = 0; a < TMP.Count; a++) { + + //빈데이터는 처리하지 않음 + if (TMP[a].isEmpty()) continue; + + //각 요소뒤에 ; 붙이기 , 로 끝나지않는 경우에만 ,; 문자가 있다면 삭제한다. + //아래 1보다 작다로 인해 a가 미처리되는 현상이 있어 위에다가 붙인다 2508014 + if (idx == "113" && (TMP[a].StartsWith("d") || TMP[a].StartsWith("e"))) + { + var subfieldata = TMP[a].Trim(); + var endsignal = subfieldata.EndsWith("▲"); + if (endsignal) subfieldata = subfieldata.Substring(0, subfieldata.Length - 1); + if (subfieldata.EndsWith(",") == false && subfieldata.EndsWith(";") == false) + subfieldata += ";"; + subfieldata = subfieldata.Replace(",;", ";"); //두개붙은건 세미쿨론으로 + if (endsignal) subfieldata += "▲"; + TMP[a] = subfieldata; + } + + if (a <= 1) continue; #region 구두점 적용 @@ -587,7 +611,7 @@ namespace UniMarc.마크 if (TMP[a].StartsWith("a")) if (!TMP[a - 1].EndsWith(":")) TMP[a - 1] += ":"; - + // $b 앞에 ":"적용 if (TMP[a].StartsWith("b") && idx == "3") if (!TMP[a - 1].EndsWith(":")) @@ -648,7 +672,7 @@ namespace UniMarc.마크 // 245h [대활자본] 문구적용 if (TMP[a].StartsWith("h") && idx == "91") TMP[a] = "h[대활자본]" + TMP[a].Substring(1); - + // 245h [음악자료] 문구적용 if (TMP[a].StartsWith("h") && idx == "92") TMP[a] = "h[음악자료]" + TMP[a].Substring(1); @@ -681,74 +705,76 @@ namespace UniMarc.마크 if (end) TMP[a] += "▲"; } - + } - + #endregion #region 식별기호 삭제 // 245e 삭제 if (TMP[a].StartsWith("e") && idx == "80") - { - if (TMP[a].Contains("▲")) - TMP[a - 1] += "▲"; + { + if (TMP[a].Contains("▲")) + TMP[a - 1] += "▲"; - TMP.RemoveAt(a); - continue; - } + TMP.RemoveAt(a); + continue; + } - // 245b 삭제 - if (TMP[a].StartsWith("b") && idx == "81") - { - if (TMP[a].Contains("▲")) - TMP[a - 1] += "▲"; + // 245b 삭제 + if (TMP[a].StartsWith("b") && idx == "81") + { + if (TMP[a].Contains("▲")) + TMP[a - 1] += "▲"; - TMP.RemoveAt(a); - continue; - } + TMP.RemoveAt(a); + continue; + } - // 245x 삭제 - if (TMP[a].StartsWith("x") && idx == "82") - { - if (TMP[a].Contains("▲")) - TMP[a - 1] += "▲"; + // 245x 삭제 + if (TMP[a].StartsWith("x") && idx == "82") + { + if (TMP[a].Contains("▲")) + TMP[a - 1] += "▲"; - TMP.RemoveAt(a); - continue; - } + TMP.RemoveAt(a); + continue; + } - // 245n 삭제 - if (TMP[a].StartsWith("n") && idx == "83") - { - if (TMP[a].Contains("▲")) - TMP[a - 1] += "▲"; + // 245n 삭제 + if (TMP[a].StartsWith("n") && idx == "83") + { + if (TMP[a].Contains("▲")) + TMP[a - 1] += "▲"; - TMP.RemoveAt(a); - continue; - } + TMP.RemoveAt(a); + continue; + } - // 245p 삭제 - if (TMP[a].StartsWith("p") && idx == "84") - { - if (TMP[a].Contains("▲")) - TMP[a - 1] += "▲"; + // 245p 삭제 + if (TMP[a].StartsWith("p") && idx == "84") + { + if (TMP[a].Contains("▲")) + TMP[a - 1] += "▲"; - TMP.RemoveAt(a); - continue; - } + TMP.RemoveAt(a); + continue; + } - // 245h 삭제 - if (TMP[a].StartsWith("h") && idx == "85") - { - if (TMP[a].Contains("▲")) - TMP[a - 1] += "▲"; + // 245h 삭제 + if (TMP[a].StartsWith("h") && idx == "85") + { + if (TMP[a].Contains("▲")) + TMP[a - 1] += "▲"; - TMP.RemoveAt(a); - continue; - } + TMP.RemoveAt(a); + continue; + } - #endregion + + + #endregion } SplitContent = TMP.ToArray(); return string.Join("▼", SplitContent); @@ -880,7 +906,8 @@ namespace UniMarc.마크 if (idx == "101") SplitContent[a] = SplitContent[a].Replace("p.", ""); // 300 a 맨 앞이 [ 로 시작 될 경우 300a를 [1책] 으로 수정 - if (idx == "105") { + if (idx == "105") + { string tmp = SplitContent[a].Substring(1); if (tmp.StartsWith("[")) SplitContent[a] = "a[1책]"; @@ -919,7 +946,8 @@ namespace UniMarc.마크 SplitContent[a] = SplitContent[a].Replace("천연색삽화", "채색삽화"); // 300b "천연색, 유성" 으로 덮어 씌움 - if (idx == "109") { + if (idx == "109") + { SplitContent[a] = "b천연색, 유성"; if (SplitContent[a].Contains("▲")) SplitContent[a] += "▲"; @@ -929,12 +957,13 @@ namespace UniMarc.마크 if (SplitContent[a].StartsWith("c")) { // $c 앞에는 ";" 적용 - if( idx == "19") + if (idx == "19") if (!SplitContent[a - 1].EndsWith(";")) SplitContent[a - 1] += ";"; // $c X포함 뒷부분 삭제 - if (idx == "73") { + if (idx == "73") + { SplitContent[a] = SplitContent[a].ToLower(); string[] tmp = SplitContent[a].Split('x'); SplitContent[a] = tmp[0] + "cm▲"; @@ -942,9 +971,10 @@ namespace UniMarc.마크 } // $e 앞에는 "+" 적용 - if (SplitContent[a].StartsWith("e") ) + if (SplitContent[a].StartsWith("e")) { - if (idx == "20") { + if (idx == "20") + { if (!SplitContent[a - 1].EndsWith("+")) SplitContent[a - 1] += "+"; } @@ -969,11 +999,13 @@ namespace UniMarc.마크 // $p 앞에 $n이 나온 경우 "," 적용, $p앞에 $n이 없는 경우 "."적용 if (SplitContent[a].StartsWith("p") && idx == "22") { - if (SplitContent[a - 1].StartsWith("n")) { + if (SplitContent[a - 1].StartsWith("n")) + { if (SplitContent[a - 1].EndsWith(",")) SplitContent[a - 1] += ","; } - else { + else + { if (SplitContent[a - 1].EndsWith(".")) SplitContent[a - 1] += "."; } @@ -1108,7 +1140,7 @@ namespace UniMarc.마크 string TagToOtherTag(string TargetTagNum, string TargetTagAccount, string ApplyTagNum, string ApplyTagAccount, string ViewMarc, bool isDelete = false, string jisi = " ") { List SplitMarc = new List(ViewMarc.Split('\n')); - + string Target = ""; // 가져올 태그 정보 추출 @@ -1141,7 +1173,7 @@ namespace UniMarc.마크 if (SplitMarc[a].StartsWith(TargetTagNum) && SplitMarc[a].Contains(Target)) { SplitMarc.RemoveAt(a); - + // string RemoveTarget = string.Format("▼{0}{1}", TargetTagAccount, Target); // SplitMarc[a] = SplitMarc[a].Replace(RemoveTarget, ""); break; diff --git a/unimarc/unimarc/마크/Set_Macro.cs b/unimarc/unimarc/마크/Set_Macro.cs index 98612b4..ce1a42c 100644 --- a/unimarc/unimarc/마크/Set_Macro.cs +++ b/unimarc/unimarc/마크/Set_Macro.cs @@ -162,11 +162,11 @@ namespace WindowsFormsApp1.Mac int count = 0; for (int a = 0; a < TargetGrid.Rows.Count; a++) { - if (TargetGrid.Rows[a].Cells["marc"].Value.ToString() == "" && - TargetGrid.Rows[a].Cells["marc"].Value == null) + var marcstring = TargetGrid.Rows[a].Cells["marc"].Value?.ToString() ?? string.Empty; + if (string.IsNullOrEmpty(marcstring)) continue; - if (TargetGrid.Rows[a].Cells["colCheck"].Value.ToString() != "T") + if ((TargetGrid.Rows[a].Cells["colCheck"].Value?.ToString() ?? string.Empty) != "T") continue; TargetGrid.Rows[a].Cells["marc"].Value = macro.MacroMarc(ViewMarcArray[count], tMacroList);