마크편집화면 : 색인, 등급 업데이트 오류 수정 및 불필요 코드 정리 작업, 중복실행코드 제거

This commit is contained in:
2026-01-21 23:20:16 +09:00
parent aa5f33eedb
commit 23cf444cba
9 changed files with 239 additions and 308 deletions

View File

@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
// 기본값으로 할 수 있습니다.
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2026.01.20.2130")]
[assembly: AssemblyFileVersion("2026.01.20.2130")]
[assembly: AssemblyVersion("2026.01.21.2318")]
[assembly: AssemblyFileVersion("2026.01.21.2318")]

View File

@@ -352,6 +352,7 @@
<Compile Include="마크\Help_008.Designer.cs">
<DependentUpon>Help_008.cs</DependentUpon>
</Compile>
<Compile Include="마크\MacEditorParameter.cs" />
<Compile Include="마크\Mac_List_Add.cs">
<SubType>Form</SubType>
</Compile>

View File

@@ -0,0 +1,22 @@
//using Microsoft.Office.Interop.Excel;
namespace ExcelTest
{
public class MacEditorParameter
{
public string ISBN13 { get; set; }
public string URL { get; set; }
public string MarcIdx { get; set; }
public string Grade { get; set; }
public string User { get; set; }
public string SaveDate { get; set; }
public string ListIdx { get; set; }
public string BookName { get; set; }
public string Author { get; set; }
public string Publisher { get; set; }
public string Price { get; set; }
}
}

View File

@@ -455,8 +455,8 @@ namespace ExcelTest
if (BaseText.IndexOf(lblisbn) < 0)
{
var dlg = UTIL.MsgQ("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다\n그래도 저장 할까요?");
if (dlg != DialogResult.Yes) return;
UTIL.MsgE("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다");
//if (dlg != DialogResult.Yes) return;
return;
}
@@ -921,8 +921,8 @@ namespace ExcelTest
data_book[0] = List_Book.Rows[row].Cells["ISBN13"].Value.ToString();
data_book[1] = List_Book.Rows[row].Cells["book_name"].Value.ToString();
data_book[2] = List_Book.Rows[row].Cells["author"].Value.ToString();
data_book[3] = List_Book.Rows[row].Cells["book_comp"].Value.ToString();
data_book[4] = List_Book.Rows[row].Cells["pay"].Value.ToString();
data_book[3] = List_Book.Rows[row].Cells["book_comp"].Value.ToString(); //publichser
data_book[4] = List_Book.Rows[row].Cells["pay"].Value.ToString(); //price
}
void input_picture(int row)
{
@@ -1229,47 +1229,48 @@ namespace ExcelTest
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
string name = ((CheckBox)sender).Name;
if (((CheckBox)sender).Checked == true)
var chk = sender as CheckBox;
string name = chk.Name;
if (chk.Checked == true)
{
switch (name)
{
case "checkBox1":
((CheckBox)sender).InvokeText("회의간행물o");
chk.InvokeText("회의간행물o");
break;
case "checkBox2":
((CheckBox)sender).InvokeText("기념논문집o");
chk.InvokeText("기념논문집o");
break;
case "checkBox4":
((CheckBox)sender).InvokeText("색인o");
chk.InvokeText("색인o");
break;
}
}
else if (((CheckBox)sender).Checked == false)
else if (chk.Checked == false)
{
switch (name)
{
case "checkBox1":
((CheckBox)sender).InvokeText("회의간행물x");
chk.InvokeText("회의간행물x");
break;
case "checkBox2":
((CheckBox)sender).InvokeText("기념논문집x");
chk.InvokeText("기념논문집x");
break;
case "checkBox4":
((CheckBox)sender).InvokeText("색인x");
chk.InvokeText("색인x");
break;
}
}
switch (name)
{
case "checkBox1":
Publication(checkBox1.Checked, 29);
case "checkBox1": //회의간행물
Publication(chk.Checked, 29);
break;
case "checkBox2":
Publication(checkBox2.Checked, 30);
case "checkBox2": //기념논문집
Publication(chk.Checked, 30);
break;
case "checkBox4":
Publication(checkBox4.Checked, 31);
case "checkBox4": //색인
Publication(chk.Checked, 31);
break;
}
}

View File

@@ -170,9 +170,10 @@ namespace ExcelTest
//}
}
chk_Marc();
mLoadCompleted = true;
List_Book.ClearSelection();
mLoadCompleted = true;
if (this.List_Book.RowCount > 0)
List_Book.Rows[0].Selected = true;
}
@@ -351,7 +352,21 @@ namespace ExcelTest
string saveDate = List_Book.Rows[row_idx].Cells["SaveDate"].Value?.ToString() ?? "";
string listIdx = List_Book.Rows[row_idx].Cells["list_idx"].Value?.ToString() ?? ""; // verify this column name in input_list
marcEditorControl1.LoadBookData(isbn13, url, marcIdx, dbMarc, grade, user, saveDate, listIdx);
var p = new MacEditorParameter
{
ISBN13 = isbn13,
URL = url,
Grade = grade,
ListIdx = listIdx,
MarcIdx = marcIdx,
SaveDate = saveDate,
User = user,
BookName = bookName,
Author = author,
Publisher = publisher,
Price = price
};
marcEditorControl1.LoadBookData(dbMarc, p);
}
@@ -520,9 +535,9 @@ namespace ExcelTest
"grade", "marc_chk", "user", "division", "008tag",
"date", "compidx" };
string[] Insert_col = {
e.griddata[0], e.griddata[1], e.griddata[2], e.griddata[3],
e.griddata[4], orimarc, e.etc1, e.etc2, e.griddata[5],
e.Grade, "1", mUserName, e.tag056, e.text008,
e.griddata.ISBN13, e.griddata.BookName, e.griddata.Author, e.griddata.Publisher,
e.griddata.Price, orimarc, e.etc1, e.etc2, e.griddata.URL,
e.griddata.Grade, "1", mUserName, e.tag056, e.text008,
date, mCompidx };
string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col);
@@ -538,11 +553,11 @@ namespace ExcelTest
"user", "grade" };
string[] Edit_col = {
mCompidx, orimarc, "1", mOldMarc , "0", e.etc1,
e.etc2, e.griddata[5], e.tag056,e.text008, date,
mUserName, e.Grade };
e.etc2, e.griddata.URL, e.tag056,e.text008, date,
mUserName, e.griddata.Grade };
string[] Sear_tbl = { "idx", "compidx" };
string[] Sear_col = { Midx, mCompidx };
if (e.griddata[0] == null || e.griddata[0] == "")
if (e.griddata.ISBN13 == null || e.griddata.ISBN13 == "")
{
MessageBox.Show("ISBN 데이터가 없습니다.");
return;
@@ -554,7 +569,7 @@ namespace ExcelTest
isNewData = false;
}
List_Book.Rows[SaveRowIdx].Cells["grade"].Value = e.Grade;
List_Book.Rows[SaveRowIdx].Cells["grade"].Value = e.griddata.Grade;
List_Book.Rows[SaveRowIdx].Cells["SaveDate"].Value = e.SaveDate;
List_Book.Rows[SaveRowIdx].Cells["user"].Value = mUserName;
List_Book.Rows[SaveRowIdx].Cells["db_marc"].Value = e.DBMarc;
@@ -563,7 +578,7 @@ namespace ExcelTest
if (isNewData)
{
string MidxQuery = string.Format("SELECT `idx` FROM Marc WHERE isbn = {0} AND `compidx` = {1};", e.griddata[0], mCompidx);
string MidxQuery = string.Format("SELECT `idx` FROM Marc WHERE isbn = {0} AND `compidx` = {1};", e.griddata.ISBN13, mCompidx);
PUB.log.Add("MarcInsert", string.Format("{0}({1}) : {2}", mUserName, mCompidx, MidxQuery));
Midx = db.DB_Send_CMD_Search(MidxQuery).Replace("|", "");
List_Book.Rows[SaveRowIdx].Cells["marc_idx"].Value = Midx;

View File

@@ -550,14 +550,6 @@
// marcEditorControl1
//
this.marcEditorControl1.BackColor = System.Drawing.Color.Gray;
this.marcEditorControl1.CurrentDBMarc = null;
this.marcEditorControl1.CurrentGrade = null;
this.marcEditorControl1.CurrentISBN13 = null;
this.marcEditorControl1.CurrentListIdx = null;
this.marcEditorControl1.CurrentMarcIdx = null;
this.marcEditorControl1.CurrentSaveDate = null;
this.marcEditorControl1.CurrentURL = null;
this.marcEditorControl1.CurrentUser = null;
this.marcEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.marcEditorControl1.Font = new System.Drawing.Font("돋움", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.marcEditorControl1.Location = new System.Drawing.Point(0, 0);

View File

@@ -28,14 +28,14 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle137 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle138 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle139 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle140 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle141 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle142 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle143 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle144 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.label31 = new System.Windows.Forms.Label();
this.label30 = new System.Windows.Forms.Label();
this.label33 = new System.Windows.Forms.Label();
@@ -782,7 +782,7 @@
this.tabPage2.Location = new System.Drawing.Point(4, 23);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(941, 783);
this.tabPage2.Size = new System.Drawing.Size(941, 785);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "마크 칸채우기";
//
@@ -835,7 +835,7 @@
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(3, 3);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(935, 777);
this.panel4.Size = new System.Drawing.Size(935, 779);
this.panel4.TabIndex = 0;
//
// Btn_interlock
@@ -877,8 +877,8 @@
this.GridView020.Name = "GridView020";
this.GridView020.RowHeadersVisible = false;
this.GridView020.RowHeadersWidth = 30;
dataGridViewCellStyle137.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView020.RowsDefaultCellStyle = dataGridViewCellStyle137;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView020.RowsDefaultCellStyle = dataGridViewCellStyle1;
this.GridView020.RowTemplate.Height = 23;
this.GridView020.Size = new System.Drawing.Size(408, 80);
this.GridView020.TabIndex = 0;
@@ -952,8 +952,8 @@
this.GridView505.Name = "GridView505";
this.GridView505.RowHeadersVisible = false;
this.GridView505.RowHeadersWidth = 30;
dataGridViewCellStyle138.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView505.RowsDefaultCellStyle = dataGridViewCellStyle138;
dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView505.RowsDefaultCellStyle = dataGridViewCellStyle2;
this.GridView505.RowTemplate.Height = 23;
this.GridView505.Size = new System.Drawing.Size(401, 71);
this.GridView505.TabIndex = 2;
@@ -1092,14 +1092,14 @@
this.GridView246.AllowDrop = true;
this.GridView246.AllowUserToAddRows = false;
this.GridView246.AllowUserToResizeRows = false;
dataGridViewCellStyle139.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle139.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle139.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle139.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle139.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle139.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle139.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.GridView246.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle139;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle3.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle3.Font = new System.Drawing.Font("돋움", 9.75F, 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.GridView246.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle3;
this.GridView246.ColumnHeadersHeight = 29;
this.GridView246.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.Text246Jisi,
@@ -1112,8 +1112,8 @@
this.GridView246.Name = "GridView246";
this.GridView246.RowHeadersVisible = false;
this.GridView246.RowHeadersWidth = 30;
dataGridViewCellStyle140.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView246.RowsDefaultCellStyle = dataGridViewCellStyle140;
dataGridViewCellStyle4.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView246.RowsDefaultCellStyle = dataGridViewCellStyle4;
this.GridView246.RowTemplate.Height = 23;
this.GridView246.Size = new System.Drawing.Size(493, 138);
this.GridView246.TabIndex = 31;
@@ -1272,14 +1272,14 @@
this.GridView440.AllowDrop = true;
this.GridView440.AllowUserToAddRows = false;
this.GridView440.AllowUserToResizeRows = false;
dataGridViewCellStyle141.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle141.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle141.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle141.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle141.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle141.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle141.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.GridView440.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle141;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.GridView440.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
this.GridView440.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.GridView440.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.text440a,
@@ -1292,8 +1292,8 @@
this.GridView440.Name = "GridView440";
this.GridView440.RowHeadersVisible = false;
this.GridView440.RowHeadersWidth = 30;
dataGridViewCellStyle142.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView440.RowsDefaultCellStyle = dataGridViewCellStyle142;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView440.RowsDefaultCellStyle = dataGridViewCellStyle6;
this.GridView440.RowTemplate.Height = 23;
this.GridView440.Size = new System.Drawing.Size(597, 71);
this.GridView440.TabIndex = 18;
@@ -1401,14 +1401,14 @@
this.GridView490.AllowDrop = true;
this.GridView490.AllowUserToAddRows = false;
this.GridView490.AllowUserToResizeRows = false;
dataGridViewCellStyle143.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle143.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle143.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle143.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle143.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle143.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle143.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.GridView490.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle143;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("돋움", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.GridView490.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.GridView490.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.GridView490.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.text490a,
@@ -1417,8 +1417,8 @@
this.GridView490.Name = "GridView490";
this.GridView490.RowHeadersVisible = false;
this.GridView490.RowHeadersWidth = 30;
dataGridViewCellStyle144.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView490.RowsDefaultCellStyle = dataGridViewCellStyle144;
dataGridViewCellStyle8.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(224)))), ((int)(((byte)(224)))), ((int)(((byte)(224)))));
this.GridView490.RowsDefaultCellStyle = dataGridViewCellStyle8;
this.GridView490.RowTemplate.Height = 23;
this.GridView490.Size = new System.Drawing.Size(321, 71);
this.GridView490.TabIndex = 19;
@@ -2305,6 +2305,7 @@
//
// btNext
//
this.btNext.Enabled = false;
this.btNext.Location = new System.Drawing.Point(274, 266);
this.btNext.Name = "btNext";
this.btNext.Size = new System.Drawing.Size(107, 33);
@@ -2315,6 +2316,7 @@
//
// btPrev
//
this.btPrev.Enabled = false;
this.btPrev.Location = new System.Drawing.Point(98, 266);
this.btPrev.Name = "btPrev";
this.btPrev.Size = new System.Drawing.Size(107, 33);

View File

@@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.UI.WebControls.WebParts;
using System.Windows.Forms;
using UniMarc;
using UniMarc.ListOfValue;
@@ -19,9 +20,8 @@ namespace ExcelTest
/// <summary>
/// isbn / 도서명 / 저자 / 출판사 / 가격
/// </summary>
string[] data_book = { "", "", "", "", "" };
//string[] data_book = { "", "", "", "", "" };
int SaveRowIdx = -1; // Keep for now but might be unused if we rely on properties
public string mUserName;
string mCompidx = UniMarc.Properties.Settings.Default.compidx;
string mListIdx = "";
public string find;
@@ -35,29 +35,30 @@ namespace ExcelTest
Help008Tag tag008 = new Help008Tag();
Skill_Search_Text search_Text = new Skill_Search_Text();
String_Text st = new String_Text();
public string CurrentISBN13 { get; set; }
string l_idx = string.Empty;
string c_idx = string.Empty;
MacEditorParameter Param = null;
//public string CurrentISBN13 { get; set; }
public string CurrentURL { get; set; } // image_url?
public string CurrentMarcIdx { get; set; }
public string CurrentDBMarc { get; set; } // db_marc
public string CurrentGrade { get; set; }
public string CurrentUser { get; set; }
public string CurrentSaveDate { get; set; }
public string CurrentListIdx { get; set; }
//public string CurrentMarcIdx { get; set; }
//public string CurrentUser { get; set; }
//public string CurrentSaveDate { get; set; }
//public string CurrentListIdx { get; set; }
public event EventHandler FillBlankClicked;
public event EventHandler PrevButton;
public event EventHandler NextButton;
public MarcEditorControl()
{
InitializeComponent();
mUserName = string.Empty;
}
public void SetUser(string userName)
{
mUserName = userName;
}
string l_idx = string.Empty;
string c_idx = string.Empty;
private void Marc_Load(object sender, EventArgs e)
{
#region ComboBox Item Setting
@@ -95,110 +96,68 @@ namespace ExcelTest
#endregion
}
private string RealMarc(string[] MarcData)
/// <summary>
/// 입력된 자료를 표시합니다.
/// </summary>
/// <param name="isbn13"></param>
/// <param name="url"></param>
/// <param name="marcIdx"></param>
/// <param name="dbMarc"></param>
/// <param name="grade"></param>
/// <param name="user"></param>
/// <param name="saveDate"></param>
/// <param name="listIdx"></param>
public void LoadBookData(string dbMarc,MacEditorParameter _param)
{
string result = "";
if (MarcData[1] == "1")
result = MarcData[0];
mLoadCompleted = false;
Param = _param;
if (MarcData[3] == "1")
result = MarcData[2];
if (MarcData[5] == "1")
result = MarcData[4];
lbl_SaveData.Text = $"[{Param.User}] [{Param.SaveDate}]";
lbl_ISBN.Text = $"[{Param.ISBN13}]";
return result;
LoadMarc(dbMarc); //여기에서도 008을 설정한다
try
{
//픽쳐박스이미지 업데이트
string isbn = _param.ISBN13;
string isbn3 = isbn.Substring(isbn.Length - 3, 3);
string tFilePath = string.Format("https://contents.kyobobook.co.kr/sih/fit-in/458x0/pdt/{0}.jpg", isbn);
pictureBox1.ImageLocation = tFilePath;
}
catch
{
pictureBox1.Image = null;
pictureBox1.ImageLocation = null;
}
finally
{
pictureBox1.Tag = _param.URL;
}
public void LoadBookData(string isbn13, string url, string marcIdx, string dbMarc, string grade, string user, string saveDate, string listIdx)
{
CurrentISBN13 = isbn13;
CurrentURL = url;
CurrentMarcIdx = marcIdx;
CurrentDBMarc = dbMarc;
CurrentGrade = grade;
CurrentUser = user;
CurrentSaveDate = saveDate;
CurrentListIdx = listIdx;
lbl_SaveData.Text = $"[{user}] [{saveDate}]";
lbl_ISBN.Text = $"[{CurrentISBN13}]";
// Update data_book for Create_008 or Empty logic
data_book[0] = CurrentISBN13;
data_book[1] = "";// CurrentBookName;
data_book[2] ="";//CurrentAuthor;
data_book[3] ="";//CurrentPublisher;
data_book[4] = "";//CurrentPrice;
LoadMarc(CurrentDBMarc);
input_picture();
richTextBox1.Text = "";
bool check_Marc = click_Marc(dbMarc);
bool check_Marc = click_Marc(dbMarc); //여기안에서 또 008을 설정한다
if (!check_Marc)
richTextBox1.Text = Make_Empty();
else
ReadRemark();
Create_008();
st.Color_change("▼", richTextBox1);
st.Color_change("▲", richTextBox1);
//자료의 등급 다시 선택
if (int.TryParse(this.Param.Grade, out int gradeNo) == false)
gradeNo = 2;
cb_grade.SelectedIndex = gradeNo;
mLoadCompleted = true;
}
/// <summary>
/// 마크 유무 확인하는 함수
/// </summary>
private string NewestMarc(string[] marc, string[] marc_chk)
{
string result = "";
int count = 0;
foreach (string chk in marc_chk)
{
if (chk == "1")
result = marc[count];
count++;
}
return result;
}
private Color SetGradeColor(string Grade, bool isMyData = true)
{
if (!isMyData)
return Color.Orange;
switch (Grade)
{
case "0": // A
return Color.Blue;
case "1": // B
return Color.Black;
case "2": // C
return Color.Gray;
case "3": // D
return Color.Red;
default:
return Color.Black;
}
}
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
call = ((RichTextBox)sender).Name;
@@ -300,36 +259,32 @@ namespace ExcelTest
private void Btn_preview_Click(object sender, EventArgs e)
{
Marc_Preview mp = new Marc_Preview();
mp.isbn = data_book[0];
mp.isbn = Param.ISBN13;
mp.richTextBox1.Text = richTextBox1.Text;
mp.Show();
}
public class BookSavedEventArgs : EventArgs
{
public string ListIdx { get; set; }
public string Grade { get; set; }
public string SaveDate { get; set; }
public string User { get; set; }
public string DBMarc { get; set; }
public string MarcIdx { get; set; }
public string etc1 { get; set; } //remark1
public string etc2 { get; set; } //remark2
public string tag056 { get; set; }
public string text008 { get; set; }
public string[] griddata { get; set; }
public MacEditorParameter griddata { get; set; }
}
public event EventHandler<BookSavedEventArgs> BookSaved;
private void Btn_Save_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(CurrentISBN13))
if (string.IsNullOrEmpty(Param.ISBN13))
{
MessageBox.Show("마크가 선택되지않았습니다.");
return;
}
int TabIndex = tabControl1.SelectedIndex;
int grade = cb_grade.SelectedIndex;
Param.Grade = cb_grade.SelectedIndex.ToString();
if (TabIndex == 1)
{
MessageBox.Show("[칸채우기]가 아닌 [마크 편집] 탭에서 저장해주세요!");
@@ -337,7 +292,7 @@ namespace ExcelTest
}
string BaseText = richTextBox1.Text;
string lblisbn = CurrentISBN13; // lbl_ISBN.Text.Replace("[", "").Replace("]", "");
string lblisbn = Param.ISBN13; // lbl_ISBN.Text.Replace("[", "").Replace("]", "");
if (!BaseText.EndsWith("\n"))
BaseText += "\n";
@@ -351,21 +306,20 @@ namespace ExcelTest
//ISBN이 변경되었다면 저장하지 못하게 한다 (경고 후 저장 가능하게 한다 26010?)
if (BaseText.IndexOf(lblisbn) < 0)
{
var dlg = UTIL.MsgQ("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다\n그래도 저장 할까요?");
if (dlg != DialogResult.Yes) return;
//return;
UTIL.MsgE("저장된 ISBN이 마크데이터에 없습니다.\nISBN값이 변경되었습니다");
return;
}
string tag056 = Tag056();
string[] grid_data = {
CurrentISBN13,
"",//CurrentBookName,
"",// CurrentAuthor,
"",// CurrentPublisher,
"",// CurrentPrice,
CurrentURL };
//string[] grid_data = {
// Param.ISBN13,
// "",//CurrentBookName,
// "",// CurrentAuthor,
// "",// CurrentPublisher,
// "",// CurrentPrice,
// "" };// CurrentURL"" };
string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string orimarc = st.made_Ori_marc(richTextBox1).Replace(@"\", "₩");
string marcIDX = CurrentMarcIdx;
// 필수태그 확인
if (!isMustTag(orimarc))
{
@@ -373,55 +327,22 @@ namespace ExcelTest
return;
}
string SaveDate = CurrentSaveDate;
string SaveUser = CurrentUser;
// true일 경우 INSERT, false일 경우 UPDATE
bool isNewData = marcIDX != "" ? false : true;
// Raise Event to Update List_Book in Parent
BookSaved?.Invoke(this, new BookSavedEventArgs
{
ListIdx = CurrentListIdx,
Grade = grade.ToString(),
SaveDate = date,
User = mUserName,
DBMarc = orimarc,
MarcIdx = marcIDX,
etc1 = etc1.Text,
etc2 = etc2.Text,
tag056 = tag056,
text008 = text008.Text,
griddata = grid_data
griddata = this.Param
});
}
#region Save_Click_Sub
/// <summary>
/// 마크 저장시 사용하며, 마지막 수정일과 수정자를 가져와 덮어씌울지 백업데이터를 만들지 구분
/// </summary>
/// <param name="TimeSpanDaysValue">저장할 마크의 마지막 수정일</param>
/// <param name="user">저장할 마크의 마지막 수정자</param>
/// <returns>마지막 수정일로부터 2일이 지나지않고, 마지막 수정자와 해당 유저가 동일 할 경우 true 반환</returns>
private bool IsCoverData(int TimeSpanDaysValue, string user)
{
if (TimeSpanDaysValue < -1)
return false;
if (user != mUserName)
return false;
return true;
}
private TimeSpan spspsp(string LastDate, string SaveDate)
{
DateTime date1 = Convert.ToDateTime(LastDate);
DateTime date2 = Convert.ToDateTime(SaveDate);
TimeSpan result = date1 - date2;
return result;
}
/// <summary>
/// 마크 오류체크 (형식체크)
@@ -699,12 +620,9 @@ namespace ExcelTest
return true;
}
void OnSaveData(int row)
{
}
void ReadRemark()
{
var CurrentMarcIdx = Param.MarcIdx;
if (string.IsNullOrEmpty(CurrentMarcIdx) || CurrentMarcIdx == "0")
{
etc1.Text = "";
@@ -767,8 +685,9 @@ namespace ExcelTest
string res = TagNum[a];
if (TagNum[a] == "008")
{
text008.Text = field[a].Replace("▲", "");
data008 = text008.Text;
//0008은 click_marc 에서 실제 적용되므로 제거한다 260121 - chi
//text008.Text = field[a].Replace("▲", "");
//data008 = text008.Text;
continue;
}
else { }
@@ -787,23 +706,7 @@ namespace ExcelTest
return true;
}
/// <summary>
/// 픽쳐박스 이미지 갱신
/// </summary>
void input_picture()
{
try
{
string isbn = CurrentISBN13;
string isbn3 = isbn.Substring(isbn.Length - 3, 3);
string tFilePath = string.Format("https://contents.kyobobook.co.kr/sih/fit-in/458x0/pdt/{0}.jpg", isbn);
pictureBox1.ImageLocation = tFilePath;
}
catch
{
pictureBox1.Image = null;
}
}
private string Make_Empty()
{
string yyMMdd = DateTime.Now.ToString("yyMMdd");
@@ -821,7 +724,7 @@ namespace ExcelTest
"653\t \t▼a▲\n" +
"700\t \t▼a▲\n" +
"950\t \t▼b\\{5}▲\n",
Empty_008, data_book[0], data_book[1], data_book[2], data_book[3], data_book[4]);
Empty_008, Param.ISBN13, Param.BookName, Param.Author, Param.Publisher, Param.Price);
etc1.Text = "";
etc2.Text = "";
return Empty_text;
@@ -896,6 +799,7 @@ namespace ExcelTest
checkBox1.Checked = tag008.CheckBox_008(Tag008[12]); // 회의간행물
checkBox2.Checked = tag008.CheckBox_008(Tag008[13]); // 기념논문집
checkBox4.Checked = tag008.CheckBox_008(Tag008[14]); // 색인 260121
col008res.Text = Tag008[10];
gov008res.Text = Tag008[19];
@@ -961,9 +865,9 @@ namespace ExcelTest
text008.Text = tag008.Combo_Change(text008.Text, comboBox5.Name, comboBox5.SelectedIndex); // 전기 (34) v
text008.Text = tag008.Combo_Change(text008.Text, comboBox6.Name, comboBox6.SelectedIndex); // 언어 (35-37) v
Publication(checkBox1.Checked, 29);// 회의간행물 (29) c
Publication(checkBox2.Checked, 30);// 기념논문집 (30) c
Publication(checkBox4.Checked, 31);// 색인 (31)
Publication_008(checkBox1.Checked, 29);// 회의간행물 (29) c
Publication_008(checkBox2.Checked, 30);// 기념논문집 (30) c
Publication_008(checkBox4.Checked, 31);// 색인 (31)
textArray = text008.Text.ToCharArray();
@@ -1042,7 +946,7 @@ namespace ExcelTest
int comboIdx = ((ComboBox)sender).SelectedIndex;
text008.Text = tag008.Combo_Change(text, comboName, comboIdx);
Apply_Main_marc();
Apply_Main_marc_008();
}
private void col008res_TextChanged(object sender, EventArgs e)
@@ -1067,11 +971,16 @@ namespace ExcelTest
}
text = new string(textArray);
text008.Text = text;
Apply_Main_marc();
Apply_Main_marc_008();
}
private void input_date_ValueChanged(object sender, EventArgs e)
{
if (mLoadCompleted == false)
{
Console.WriteLine("초기화중이므로 처리하지 않습니다");
return;
}
if (text008.Text.Length < 3) { return; }
string date = input_date.Value.ToString();
date = date.Substring(0, 10);
@@ -1081,70 +990,71 @@ namespace ExcelTest
text008.Text = text008.Text.Remove(0, 6);
text008.Text = date + text008.Text;
Apply_Main_marc();
Apply_Main_marc_008();
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
string name = ((CheckBox)sender).Name;
if (((CheckBox)sender).Checked == true)
var chk = sender as CheckBox;
string name = chk.Name;
if (chk.Checked == true)
{
switch (name)
{
case "checkBox1":
((CheckBox)sender).InvokeText("회의간행물o");
chk.InvokeText("회의간행물o");
break;
case "checkBox2":
((CheckBox)sender).InvokeText("기념논문집o");
chk.InvokeText("기념논문집o");
break;
case "checkBox4":
((CheckBox)sender).InvokeText("색인o");
chk.InvokeText("색인o");
break;
}
}
else if (((CheckBox)sender).Checked == false)
else if (chk.Checked == false)
{
switch (name)
{
case "checkBox1":
((CheckBox)sender).InvokeText("회의간행물x");
chk.InvokeText("회의간행물x");
break;
case "checkBox2":
((CheckBox)sender).InvokeText("기념논문집x");
chk.InvokeText("기념논문집x");
break;
case "checkBox4":
((CheckBox)sender).InvokeText("색인x");
chk.InvokeText("색인x");
break;
}
}
switch (name)
{
case "checkBox1":
Publication(checkBox1.Checked, 29);
case "checkBox1": //회의간행물
Publication_008(chk.Checked, 29);
break;
case "checkBox2":
Publication(checkBox2.Checked, 30);
case "checkBox2": //기념논문집
Publication_008(chk.Checked, 30);
break;
case "checkBox4":
Publication(checkBox4.Checked, 31);
case "checkBox4": //색인
Publication_008(chk.Checked, 31);
break;
}
}
void Publication(bool check, int idx)
void Publication_008(bool check, int idx)
{
if (text008.Text == "") { return; }
char[] ArrayChar = text008.Text.ToCharArray();
if (check == false) { ArrayChar[idx] = '0'; }
else if (check == true) { ArrayChar[idx] = '1'; }
text008.Text = new string(ArrayChar);
Apply_Main_marc();
Apply_Main_marc_008();
}
/// <summary>
/// 008text가 메인 텍스트박스에 적용됨.
/// </summary>
private void Apply_Main_marc()
private void Apply_Main_marc_008()
{
string text = text008.Text;
richTextBox1.Text = richTextBox1.Text.Replace(data008, text);
@@ -1164,17 +1074,13 @@ namespace ExcelTest
private void pictureBox1_DoubleClick(object sender, EventArgs e)
{
Zoom_Picture zp = new Zoom_Picture();
var CurrentURL = pictureBox1.Tag.ToString();
zp.url = pictureBox1.ImageLocation ?? CurrentURL;
zp.ISBN = CurrentISBN13;
zp.ISBN = Param.ISBN13;
zp.Show();
}
public event EventHandler FillBlankClicked;
public event EventHandler PrevButton;
public event EventHandler NextButton;
private void FillTextBox_KeyDown(object sender, KeyEventArgs e)
{
TextBox tb = sender as TextBox;

View File

@@ -35,14 +35,6 @@ namespace UniMarc.마크
// marcEditorControl1
//
this.marcEditorControl1.BackColor = System.Drawing.Color.Gray;
this.marcEditorControl1.CurrentDBMarc = null;
this.marcEditorControl1.CurrentGrade = null;
this.marcEditorControl1.CurrentISBN13 = null;
this.marcEditorControl1.CurrentListIdx = null;
this.marcEditorControl1.CurrentMarcIdx = null;
this.marcEditorControl1.CurrentSaveDate = null;
this.marcEditorControl1.CurrentURL = null;
this.marcEditorControl1.CurrentUser = null;
this.marcEditorControl1.Dock = System.Windows.Forms.DockStyle.Fill;
this.marcEditorControl1.Font = new System.Drawing.Font("돋움", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.marcEditorControl1.Location = new System.Drawing.Point(0, 0);