diff --git a/unimarc/.vs/unimarc/v16/.suo b/unimarc/.vs/unimarc/v16/.suo index 0eb163e..2b0021a 100644 Binary files a/unimarc/.vs/unimarc/v16/.suo and b/unimarc/.vs/unimarc/v16/.suo differ diff --git a/unimarc/unimarc/Main.Designer.cs b/unimarc/unimarc/Main.Designer.cs index 745664f..1206e4b 100644 --- a/unimarc/unimarc/Main.Designer.cs +++ b/unimarc/unimarc/Main.Designer.cs @@ -119,10 +119,10 @@ this.ShortCut1 = new System.Windows.Forms.Button(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel(); - this.botUserLabel = new System.Windows.Forms.ToolStripLabel(); this.VersionText = new System.Windows.Forms.ToolStripLabel(); - this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); + this.botUserLabel = new System.Windows.Forms.ToolStripLabel(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.menuStrip1.SuspendLayout(); this.panel1.SuspendLayout(); this.toolStrip1.SuspendLayout(); @@ -916,12 +916,6 @@ this.toolStripLabel2.Size = new System.Drawing.Size(43, 22); this.toolStripLabel2.Text = "회사명"; // - // botUserLabel - // - this.botUserLabel.Name = "botUserLabel"; - this.botUserLabel.Size = new System.Drawing.Size(43, 22); - this.botUserLabel.Text = "이용자"; - // // VersionText // this.VersionText.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; @@ -934,6 +928,12 @@ this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25); // + // botUserLabel + // + this.botUserLabel.Name = "botUserLabel"; + this.botUserLabel.Size = new System.Drawing.Size(43, 22); + this.botUserLabel.Text = "이용자"; + // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -942,6 +942,7 @@ this.Controls.Add(this.toolStrip1); this.Controls.Add(this.panel1); this.Controls.Add(this.menuStrip1); + this.HelpButton = true; this.IsMdiContainer = true; this.MainMenuStrip = this.menuStrip1; this.Name = "Main"; diff --git a/unimarc/unimarc/bin/Debug/UniMarc.exe b/unimarc/unimarc/bin/Debug/UniMarc.exe index 5fa1b1d..1880a89 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 6db8005..440f50b 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 77eb0e0..67793af 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/UniMarc.csproj.GenerateResource.cache b/unimarc/unimarc/obj/Debug/UniMarc.csproj.GenerateResource.cache index 4e26990..f709921 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 5fa1b1d..1880a89 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 6db8005..440f50b 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 77eb0e0..67793af 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/마크/Mac_Output.Designer.cs b/unimarc/unimarc/마크/Mac_Output.Designer.cs index 35231f4..d43f6b1 100644 --- a/unimarc/unimarc/마크/Mac_Output.Designer.cs +++ b/unimarc/unimarc/마크/Mac_Output.Designer.cs @@ -28,7 +28,7 @@ /// private void InitializeComponent() { - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); this.dataGridView1 = new System.Windows.Forms.DataGridView(); this.isbn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.book_name = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -46,6 +46,7 @@ this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.cb_EncodingType = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.panel1.SuspendLayout(); this.SuspendLayout(); @@ -54,14 +55,14 @@ // this.dataGridView1.AllowUserToAddRows = false; this.dataGridView1.AllowUserToDeleteRows = false; - dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); - dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1; + 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.False; + this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.isbn, @@ -123,6 +124,7 @@ // panel1 // this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel1.Controls.Add(this.cb_EncodingType); this.panel1.Controls.Add(this.btn_close); this.panel1.Controls.Add(this.cb_list); this.panel1.Controls.Add(this.btn_file_save); @@ -137,7 +139,7 @@ // // btn_close // - this.btn_close.Location = new System.Drawing.Point(826, 8); + this.btn_close.Location = new System.Drawing.Point(919, 8); this.btn_close.Name = "btn_close"; this.btn_close.Size = new System.Drawing.Size(75, 23); this.btn_close.TabIndex = 7; @@ -149,7 +151,7 @@ // this.cb_list.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_list.FormattingEnabled = true; - this.cb_list.Location = new System.Drawing.Point(308, 10); + this.cb_list.Location = new System.Drawing.Point(308, 9); this.cb_list.Name = "cb_list"; this.cb_list.Size = new System.Drawing.Size(375, 20); this.cb_list.TabIndex = 5; @@ -157,7 +159,7 @@ // // btn_file_save // - this.btn_file_save.Location = new System.Drawing.Point(731, 8); + this.btn_file_save.Location = new System.Drawing.Point(824, 8); this.btn_file_save.Name = "btn_file_save"; this.btn_file_save.Size = new System.Drawing.Size(89, 23); this.btn_file_save.TabIndex = 4; @@ -170,7 +172,7 @@ this.cb_years.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_years.Enabled = false; this.cb_years.FormattingEnabled = true; - this.cb_years.Location = new System.Drawing.Point(126, 10); + this.cb_years.Location = new System.Drawing.Point(126, 9); this.cb_years.Name = "cb_years"; this.cb_years.Size = new System.Drawing.Size(90, 20); this.cb_years.TabIndex = 2; @@ -179,7 +181,7 @@ // this.cb_state.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cb_state.FormattingEnabled = true; - this.cb_state.Location = new System.Drawing.Point(45, 10); + this.cb_state.Location = new System.Drawing.Point(45, 9); this.cb_state.Name = "cb_state"; this.cb_state.Size = new System.Drawing.Size(75, 20); this.cb_state.TabIndex = 2; @@ -188,7 +190,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(244, 14); + this.label2.Location = new System.Drawing.Point(244, 13); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(58, 12); this.label2.TabIndex = 1; @@ -197,12 +199,21 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(11, 14); + this.label1.Location = new System.Drawing.Point(11, 13); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(29, 12); this.label1.TabIndex = 1; this.label1.Text = "구분"; // + // cb_EncodingType + // + this.cb_EncodingType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_EncodingType.FormattingEnabled = true; + this.cb_EncodingType.Location = new System.Drawing.Point(737, 9); + this.cb_EncodingType.Name = "cb_EncodingType"; + this.cb_EncodingType.Size = new System.Drawing.Size(81, 20); + this.cb_EncodingType.TabIndex = 8; + // // Mac_Output // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); @@ -238,5 +249,6 @@ private System.Windows.Forms.Label label2; private System.Windows.Forms.SaveFileDialog saveFileDialog1; private System.Windows.Forms.Button btn_close; + private System.Windows.Forms.ComboBox cb_EncodingType; } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/Mac_Output.cs b/unimarc/unimarc/마크/Mac_Output.cs index ed1c2ef..870b37a 100644 --- a/unimarc/unimarc/마크/Mac_Output.cs +++ b/unimarc/unimarc/마크/Mac_Output.cs @@ -31,6 +31,10 @@ namespace WindowsFormsApp1.Mac string[] state = { "진행", "완료" }; cb_state.Items.AddRange(state); cb_state.SelectedIndex = 0; + + string[] Encoding = { "ANSI", "UTF-8", "UniCode" }; + cb_EncodingType.Items.AddRange(Encoding); + cb_EncodingType.SelectedIndex = 0; } private void cb_state_SelectedIndexChanged(object sender, EventArgs e) @@ -186,8 +190,21 @@ namespace WindowsFormsApp1.Mac if (saveFileDialog.ShowDialog() == DialogResult.OK) { - FileName = saveFileDialog.FileName; - File.WriteAllText(FileName, Marc_data, Encoding.Default); + if (cb_EncodingType.SelectedIndex == 0) + { + FileName = saveFileDialog.FileName; + File.WriteAllText(FileName, Marc_data, Encoding.Default); + } + else if (cb_EncodingType.SelectedIndex == 1) + { + FileName = saveFileDialog.FileName; + File.WriteAllText(FileName, Marc_data, Encoding.UTF8); + } + else if (cb_EncodingType.SelectedIndex == 2) + { + FileName = saveFileDialog.FileName; + File.WriteAllText(FileName, Marc_data, Encoding.Unicode); + } } } diff --git a/unimarc/unimarc/마크/Marc.cs b/unimarc/unimarc/마크/Marc.cs index c6eaa8f..24c5ea2 100644 --- a/unimarc/unimarc/마크/Marc.cs +++ b/unimarc/unimarc/마크/Marc.cs @@ -1442,7 +1442,7 @@ namespace ExcelTest #region 마크생성목록_Sub public bool Check_BackColor(int row) { - if (List_Book.Rows[row].DefaultCellStyle.BackColor != Color.LightGray) + if (List_Book.Rows[row].DefaultCellStyle.ForeColor != Color.Red) return true; return false; @@ -2159,7 +2159,7 @@ namespace ExcelTest /// /// 메모장 채우기 /// - /// [0]:태그번호, [1]:지시기호, [2]:마크내용 + /// 메모장에 있는 값
[0]:태그번호, [1]:지시기호, [2]:마크내용
private void InputMemo(string[] SplitTag) { dataGridView1.Rows.Clear(); @@ -2194,13 +2194,12 @@ namespace ExcelTest }; List RemainTag = new List(); - List BlankTag = MakeMarcLine(); // 칸채우기 변환 + List BlankTag = MakeMarcLine(); // 칸채우기의 값들이 여기로 저장이 되어 들어옴 foreach (string Content in SplitTag) { if (Content == "") continue; - string tagNum = Content.Substring(0, 3); bool isCopy = false; @@ -2214,12 +2213,13 @@ namespace ExcelTest if (isCopy) { + string AddText = ""; foreach (string Blank in BlankTag) { if (Blank.Length < 4) continue; - + string StrNum = Blank.Substring(0, 3); int Num = Convert.ToInt32(StrNum); int tagNumInt = Convert.ToInt32(tagNum); @@ -2230,7 +2230,6 @@ namespace ExcelTest AddText = AddText.Replace("▲", "▲\n"); break; } - } if (AddText == "") continue; @@ -2250,7 +2249,7 @@ namespace ExcelTest RemainTag = RemainTag.Distinct().ToList(); richTextBox1.Text = string.Join("\n", RemainTag); - #region BackUp2 + #region BackUp1 /* foreach (string Content in SplitTag) { @@ -2337,6 +2336,10 @@ namespace ExcelTest #endregion } + /// + /// 칸채우기에 채워진 값들을 메모장 형식으로 변환하여 반환 + /// + /// private List MakeMarcLine() { List LineMarc = new List(); diff --git a/unimarc/unimarc/마크/Marc_Plan.Designer.cs b/unimarc/unimarc/마크/Marc_Plan.Designer.cs index 83be6db..fdab0b2 100644 --- a/unimarc/unimarc/마크/Marc_Plan.Designer.cs +++ b/unimarc/unimarc/마크/Marc_Plan.Designer.cs @@ -36,6 +36,7 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); + this.cb_EncodingType = new System.Windows.Forms.ComboBox(); this.btn_Output = new System.Windows.Forms.Button(); this.btn_Excel = new System.Windows.Forms.Button(); this.panel3 = new System.Windows.Forms.Panel(); @@ -85,6 +86,7 @@ // panel1 // this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.panel1.Controls.Add(this.cb_EncodingType); this.panel1.Controls.Add(this.btn_Output); this.panel1.Controls.Add(this.btn_Excel); this.panel1.Controls.Add(this.panel3); @@ -97,12 +99,21 @@ this.panel1.Controls.Add(this.btn_Select_List); this.panel1.Location = new System.Drawing.Point(11, 12); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(1501, 36); + this.panel1.Size = new System.Drawing.Size(1592, 36); this.panel1.TabIndex = 0; // + // cb_EncodingType + // + this.cb_EncodingType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_EncodingType.FormattingEnabled = true; + this.cb_EncodingType.Location = new System.Drawing.Point(916, 7); + this.cb_EncodingType.Name = "cb_EncodingType"; + this.cb_EncodingType.Size = new System.Drawing.Size(81, 20); + this.cb_EncodingType.TabIndex = 9; + // // btn_Output // - this.btn_Output.Location = new System.Drawing.Point(907, 6); + this.btn_Output.Location = new System.Drawing.Point(1003, 6); this.btn_Output.Name = "btn_Output"; this.btn_Output.Size = new System.Drawing.Size(75, 23); this.btn_Output.TabIndex = 9; @@ -138,6 +149,7 @@ // cb_authorType // this.cb_authorType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_authorType.Enabled = false; this.cb_authorType.FormattingEnabled = true; this.cb_authorType.Location = new System.Drawing.Point(125, 4); this.cb_authorType.Name = "cb_authorType"; @@ -147,6 +159,7 @@ // cb_divType // this.cb_divType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_divType.Enabled = false; this.cb_divType.FormattingEnabled = true; this.cb_divType.Location = new System.Drawing.Point(402, 4); this.cb_divType.Name = "cb_divType"; @@ -157,6 +170,7 @@ // cb_divNum // this.cb_divNum.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_divNum.Enabled = false; this.cb_divNum.FormattingEnabled = true; this.cb_divNum.Location = new System.Drawing.Point(496, 4); this.cb_divNum.Name = "cb_divNum"; @@ -166,6 +180,7 @@ // cb_FirstBook // this.cb_FirstBook.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_FirstBook.Enabled = false; this.cb_FirstBook.FormattingEnabled = true; this.cb_FirstBook.Location = new System.Drawing.Point(302, 4); this.cb_FirstBook.Name = "cb_FirstBook"; @@ -175,6 +190,7 @@ // cb_FirstAuthor // this.cb_FirstAuthor.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_FirstAuthor.Enabled = false; this.cb_FirstAuthor.FormattingEnabled = true; this.cb_FirstAuthor.Location = new System.Drawing.Point(57, 4); this.cb_FirstAuthor.Name = "cb_FirstAuthor"; @@ -201,7 +217,7 @@ // // btn_ChangeTag // - this.btn_ChangeTag.Location = new System.Drawing.Point(1313, 6); + this.btn_ChangeTag.Location = new System.Drawing.Point(1409, 6); this.btn_ChangeTag.Name = "btn_ChangeTag"; this.btn_ChangeTag.Size = new System.Drawing.Size(86, 23); this.btn_ChangeTag.TabIndex = 5; @@ -211,7 +227,7 @@ // // btn_Close // - this.btn_Close.Location = new System.Drawing.Point(1405, 6); + this.btn_Close.Location = new System.Drawing.Point(1501, 6); this.btn_Close.Name = "btn_Close"; this.btn_Close.Size = new System.Drawing.Size(86, 23); this.btn_Close.TabIndex = 5; @@ -221,7 +237,7 @@ // // tb_SearchTag // - this.tb_SearchTag.Location = new System.Drawing.Point(1207, 7); + this.tb_SearchTag.Location = new System.Drawing.Point(1303, 7); this.tb_SearchTag.Name = "tb_SearchTag"; this.tb_SearchTag.Size = new System.Drawing.Size(100, 21); this.tb_SearchTag.TabIndex = 4; @@ -229,7 +245,7 @@ // // tb_ISBN // - this.tb_ISBN.Location = new System.Drawing.Point(1034, 7); + this.tb_ISBN.Location = new System.Drawing.Point(1130, 7); this.tb_ISBN.Name = "tb_ISBN"; this.tb_ISBN.Size = new System.Drawing.Size(100, 21); this.tb_ISBN.TabIndex = 4; @@ -237,7 +253,7 @@ // label2 // this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(1148, 11); + this.label2.Location = new System.Drawing.Point(1244, 11); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(57, 12); this.label2.TabIndex = 3; @@ -246,7 +262,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(999, 11); + this.label1.Location = new System.Drawing.Point(1095, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(33, 12); this.label1.TabIndex = 3; @@ -302,13 +318,14 @@ this.dataGridView1.Location = new System.Drawing.Point(11, 57); this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.RowTemplate.Height = 23; - this.dataGridView1.Size = new System.Drawing.Size(1501, 647); + this.dataGridView1.Size = new System.Drawing.Size(1592, 647); this.dataGridView1.TabIndex = 1; this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); this.dataGridView1.RowPostPaint += new System.Windows.Forms.DataGridViewRowPostPaintEventHandler(this.dataGridView1_RowPostPaint); this.dataGridView1.DragDrop += new System.Windows.Forms.DragEventHandler(this.dataGridView1_DragDrop); this.dataGridView1.DragOver += new System.Windows.Forms.DragEventHandler(this.dataGridView1_DragOver); + this.dataGridView1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.dataGridView1_KeyDown); this.dataGridView1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.dataGridView1_MouseDown); this.dataGridView1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.dataGridView1_MouseMove); // @@ -493,7 +510,7 @@ this.checkBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.None; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Location = new System.Drawing.Point(1435, 63); + this.checkBox1.Location = new System.Drawing.Point(1432, 63); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(15, 14); this.checkBox1.TabIndex = 2; @@ -505,7 +522,7 @@ // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1525, 716); + this.ClientSize = new System.Drawing.Size(1616, 716); this.Controls.Add(this.checkBox1); this.Controls.Add(this.dataGridView1); this.Controls.Add(this.panel1); @@ -566,5 +583,6 @@ private System.Windows.Forms.Label label4; private System.Windows.Forms.Button btn_Excel; private System.Windows.Forms.Button btn_Output; + private System.Windows.Forms.ComboBox cb_EncodingType; } } \ No newline at end of file diff --git a/unimarc/unimarc/마크/Marc_Plan.cs b/unimarc/unimarc/마크/Marc_Plan.cs index 8e65c4c..5a1a897 100644 --- a/unimarc/unimarc/마크/Marc_Plan.cs +++ b/unimarc/unimarc/마크/Marc_Plan.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -36,6 +37,10 @@ namespace WindowsFormsApp1.Mac string[] divNum = { "4", "5", "6" }; cb_divNum.Items.AddRange(divNum); + string[] Encoding = { "ANSI", "UTF-8", "UniCode" }; + cb_EncodingType.Items.AddRange(Encoding); + cb_EncodingType.SelectedIndex = 0; + } private void btn_Select_List_Click(object sender, EventArgs e) @@ -45,6 +50,7 @@ namespace WindowsFormsApp1.Mac Marc_Plan_Sub_SelectList sub = new Marc_Plan_Sub_SelectList(this); sub.TopMost = true; sub.Show(); + dataGridView1.CellValueChanged += new DataGridViewCellEventHandler(dataGridView1_CellValueChanged); } private void Btn_Search_Click(object sender, EventArgs e) @@ -232,6 +238,10 @@ namespace WindowsFormsApp1.Mac { string marc = dataGridView1.Rows[a].Cells["marc"].Value.ToString(); string changeTag = dataGridView1.Rows[a].Cells["search_tag"].Value.ToString(); + + if (changeTag == "") + continue; + if (dataGridView1.Rows[a].Cells["colCheck"].Value.ToString() == "T") dataGridView1.Rows[a].Cells["marc"].Value = marc.Replace(BackUpTag[a], changeTag); } @@ -296,12 +306,16 @@ namespace WindowsFormsApp1.Mac private void btn_Output_Click(object sender, EventArgs e) { string Marc_data = string.Empty; + for (int a = 0; a < dataGridView1.Rows.Count; a++) { if (dataGridView1.Rows[a].Cells["marc"].Value.ToString() == "" && dataGridView1.Rows[a].Cells["marc"].Value == null) continue; + if (dataGridView1.Rows[a].Cells["colCheck"].Value.ToString() != "T") + continue; + Marc_data += dataGridView1.Rows[a].Cells["marc"].Value.ToString().Replace("₩", "\\"); } @@ -310,12 +324,24 @@ namespace WindowsFormsApp1.Mac saveFileDialog.Title = "저장 경로를 지정하세요."; saveFileDialog.OverwritePrompt = true; saveFileDialog.Filter = "마크 파일 (*.mrc)|*.mrc|모든 파일 (*.*)|*.*"; - + if (saveFileDialog.ShowDialog() == DialogResult.OK) { - FileName = saveFileDialog.FileName; - System.IO.File.WriteAllText(FileName, Marc_data, Encoding.Default); + if (cb_EncodingType.SelectedIndex == 0) { + FileName = saveFileDialog.FileName; + File.WriteAllText(FileName, Marc_data, Encoding.Default); + } + else if (cb_EncodingType.SelectedIndex == 1) { + FileName = saveFileDialog.FileName; + File.WriteAllText(FileName, Marc_data, Encoding.UTF8); + } + else if (cb_EncodingType.SelectedIndex == 2) { + FileName = saveFileDialog.FileName; + File.WriteAllText(FileName, Marc_data, Encoding.Unicode); + } } + + MessageBox.Show("반출되었습니다!"); } #region Grid 드래그 앤 드랍 함수 (현재 사용 중지) (사용하려면 dataGridView1의 AllowDrop 활성화해야함) @@ -342,5 +368,147 @@ namespace WindowsFormsApp1.Mac sg.DragOver(sender, e); } #endregion + + private void dataGridView1_CellValueChanged(object sender, DataGridViewCellEventArgs e) + { + int row = e.RowIndex; + int col = dataGridView1.CurrentCell.ColumnIndex; + + if (col < 2 && col > 7) + return; + + if (dataGridView1.Rows[row].Cells["marc"].Value.ToString() == "" && + dataGridView1.Rows[row].Cells["marc"].Value == null) + { + MessageBox.Show("저장된 마크가 없습니다!"); + return; + } + + string Marc = dataGridView1.Rows[row].Cells["marc"].Value.ToString(); + + string AddTag = ""; + if (col == 2 || col == 5 || col == 6 || col == 7) + { + string I = dataGridView1.Rows[row].Cells[2].Value.ToString(); + string V = dataGridView1.Rows[row].Cells[5].Value.ToString(); + string C = dataGridView1.Rows[row].Cells[6].Value.ToString(); + string F = dataGridView1.Rows[row].Cells[7].Value.ToString(); + + if (I != "") + I = string.Format("▼i{0}", I); + + if (V != "") + V = string.Format("▼v{0}", V); + + if (C != "") + C = string.Format("▼c{0}", C); + + if (F != "") + F = string.Format("▼f{0}", F); + + AddTag = string.Format("049\t \t{0}{1}{2}{3}▲", I, V, C, F); + } + else if (col == 3 || col == 4) + { + string A = dataGridView1.Rows[row].Cells[3].Value.ToString(); + string B = dataGridView1.Rows[row].Cells[4].Value.ToString(); + + if (A != "") + A = string.Format("▼a{0}", A); + + if (B != "") + B = string.Format("▼b{0}", B); + + AddTag = string.Format("090\t \t{0}{1}▲", A, B); + } + string TypeView = ConvertMarcType(Marc); + + string AddMarc = AddTagInMarc(AddTag, TypeView); + + String_Text st = new String_Text(); + dataGridView1.Rows[row].Cells["marc"].Value = st.made_Ori_marc(AddMarc); + } + + /// + /// 한줄짜리 마크를 보기 쉬운 형태로 변환 + /// + /// 한줄짜리 마크 + /// + string ConvertMarcType(string Marc) + { + if (Marc.Length < 3) return ""; + + string result = ""; + + List TagNum = new List(); // 태그번호 저장용 + List Field = new List(); // 가변길이필드 저장용 + + // 특수기호 육안으로 확인하기 쉽게 변환 + Marc = Marc.Replace("", "▼"); + Marc = Marc.Replace("", "▲"); + Marc = Marc.Replace("₩", "\\"); + + int StartIdx = 0; + + // 리더부를 제외한 디렉토리, 가변길이필드 저장 + string[] data = Marc.Substring(24).Split('▲'); + for (int a = 1; a < data.Length - 1; a++) + { + TagNum.Add(data[0].Substring(StartIdx, 3)); + StartIdx += 12; + Field.Add(data[a] + "▲"); + } + + // List에 들어간 데이터를 메모장에 출력 + for (int a = 0; a < TagNum.Count; a++) + { + string res = TagNum[a]; + if (Field[a].IndexOf("▼") == -1) + { + res += "\t \t" + Field[a]; + } + else + { + string temp = Field[a].Insert(2, "\t"); + res += "\t" + temp; + } + result += res + "\n"; + } + return result; + } + + string AddTagInMarc(string Tag, string TypeView) + { + int TargetTagNum = Convert.ToInt32(Tag.Substring(0, 3)); + + string[] SplitView = TypeView.Split('\n'); + List View = new List(SplitView); + + int ViewCount = 0; + foreach (string LineMarc in View) + { + string LineTag = LineMarc.Substring(0, 3); + int TagNum = Convert.ToInt32(LineTag); + + if (TargetTagNum == TagNum) + { + View[ViewCount] = Tag; + break; + } + else if (TargetTagNum < TagNum) + { + View.Insert(ViewCount, Tag); + break; + } + ViewCount++; + } + return string.Join("\n", View); + } + + private void dataGridView1_KeyDown(object sender, KeyEventArgs e) + { + Skill_Grid sg = new Skill_Grid(); + sg.Excel_to_DataGridView(sender, e); + } } } diff --git a/unimarc/unimarc/마크/Marc_Plan.resx b/unimarc/unimarc/마크/Marc_Plan.resx index faa1653..1af7de1 100644 --- a/unimarc/unimarc/마크/Marc_Plan.resx +++ b/unimarc/unimarc/마크/Marc_Plan.resx @@ -117,58 +117,4 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - \ No newline at end of file