Compare commits

...

2 Commits

Author SHA1 Message Date
90ed6e285f 마크목록에서 개별 마크데이터 지정시 해당 값이 자동업데이트되지 않는 현상 수정
권차, 권차서명, 판차 정보 추출하여 저장하게 함
마크선태고하면에서 마크삭제시 삭제할 인덱스값 표시
obj_list_book 에  품절컬럼 추가,
2026-03-02 16:35:37 +09:00
a226c370b2 인덱스 컬럼의 포맷변경 string -> int 2026-02-28 15:55:20 +09:00
34 changed files with 942 additions and 698 deletions

View File

@@ -0,0 +1,402 @@
using AR;
using MySql.Data.MySqlClient;
using OpenQA.Selenium;
using Renci.SshNet;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO.Ports;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI;
using System.Windows.Forms;
using UniMarc.BaroService_TI;
using UniMarc.Properties;
namespace UniMarc
{
public partial class Helper_DB
{
//static string cs = "";
public enum eDbType
{
unimarc,
cl_marc
}
public static MySqlConnection CreateConnection(eDbType dbtype)
{
var dbname = dbtype.ToString();
string strConnection = string.Format(
"Server={0};" +
"Port={1};" +
$"Database={dbname};" +
"uid={2};" +
"pwd={3};", ServerData[0], DBData[0], DBData[1], DBData[2]);
return new MySqlConnection(strConnection);
}
/// <summary>
/// 입력한 쿼리의 결과를 데이터테이블로 반환합니다
/// </summary>
/// <param name="query"></param>
/// <param name="cn"></param>
/// <returns></returns>
public static DataTable ExecuteDataTable(string query, MySqlConnection cn = null)
{
var bLocalCN = cn == null;
DataTable dt = new DataTable();
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);// new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
using (MySqlDataAdapter adapter = new MySqlDataAdapter(cmd))
{
adapter.Fill(dt);
}
cmd.Dispose();
cn.Close();
if (bLocalCN) cn.Dispose();
return dt;
}
catch (Exception ex)
{
UTIL.MsgE(ex.ToString());
return null;
}
}
/// <summary>
/// 오류발생시 null을 반환합니다
/// </summary>
/// <param name="tableName"></param>
/// <param name="columns"></param>
/// <param name="wheres"></param>
/// <param name="orders"></param>
/// <returns></returns>
public static DataTable ExecuteQueryData(string tableName, string columns = "*", string wheres = "", string orders = "", MySqlConnection cn = null)
{
var sql = $"select {columns} from {tableName}";
if (wheres.isEmpty() == false) sql += " where " + wheres;
if (orders.isEmpty() == false) sql += " order by " + orders;
return ExecuteDataTable(sql, cn);
}
/// <summary>
/// 오류발생시 -1을 반환합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static (int applyCount, string errorMessage) ExcuteNonQuery(string query, MySqlConnection cn = null)
{
try
{
var bLocalCN = cn == null;
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var cnt = cmd.ExecuteNonQuery();
cmd.Dispose();
if (bLocalCN) cn.Dispose();
return (cnt, string.Empty);
}
catch (Exception ex)
{
return (-1, ex.Message);
}
}
public static (long value, string errorMessage) ExcuteInsertGetIndex(string cmd, MySqlConnection cn = null)
{
long lastId = -1;
var bLocalCN = cn == null;
string message;
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
using (var sqlcmd = new MySqlCommand(cmd, cn))
{
cn.Open();
sqlcmd.ExecuteNonQuery();
lastId = sqlcmd.LastInsertedId;
}
if (bLocalCN) cn.Dispose();
message = "";
}
catch (Exception ex)
{
lastId = -1;
message = ex.Message;
}
return (lastId, message);
}
/// <summary>
/// 단일항목값을 반환 합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static (object value, string errorMessage) ExcuteScalar(string query, MySqlConnection cn = null)
{
try
{
var bLocalCN = cn == null;
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var val = cmd.ExecuteScalar();
cmd.Dispose();
if (bLocalCN) cn.Dispose();
return (val, string.Empty);
}
catch (Exception ex)
{
return (null, ex.Message);
}
}
/// <summary>
/// Insert 명령을 수행한 후 자동 생성된 index값을 반환합니다.
/// 오류발생시에는 -1을 반환합니다
/// </summary>
/// <param name="cmd"></param>
/// <param name="cn"></param>
/// <returns></returns>
public static long DB_Send_CMD_Insert_GetIdx(string cmd, MySqlConnection cn = null)
{
long lastId = -1;
var bLocalCN = cn == null;
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
using (var sqlcmd = new MySqlCommand(cmd, cn))
{
cn.Open();
sqlcmd.ExecuteNonQuery();
lastId = sqlcmd.LastInsertedId;
}
if (bLocalCN) cn.Dispose();
}
catch (Exception ex)
{
UTIL.MsgE($"데이터베이스 실행오류\n{ex.Message}");
}
return lastId;
}
public static MarcBasicInfo GetBasicMarcInfo(string FullMarc)
{
MarcBasicInfo retval = new MarcBasicInfo();
//상황에 맞게 업데이트 명령을 처리한다.
var parser = new MarcParser();
var ret = parser.ParseFullMarc(FullMarc);
if (ret.success == false)
{
retval.Success = false;
retval.Message = ret.message;
return retval;
}
//ISBN와 가격 (처음나오는 020태그의 값을 적용)
var tag_020 = parser.GetTag<MarcField>("020").FirstOrDefault();
if (tag_020 != null)
{
retval.ISBN = tag_020.GetSubfieldValue('a');
retval.Price = tag_020.GetSubfieldValue('c');
}
//저자(100 -> 110 -> 111 순으로 적용)
var tag_100 = parser.GetTag<MarcField>("100").FirstOrDefault();
var tag_110 = parser.GetTag<MarcField>("110").FirstOrDefault();
var tag_111 = parser.GetTag<MarcField>("111").FirstOrDefault();
if (tag_111 != null)
retval.Author = tag_111.GetSubfieldValue('a');
else if (tag_110 != null)
retval.Author = tag_110.GetSubfieldValue('a');
else if (tag_100 != null)
retval.Author = tag_100.GetSubfieldValue('a');
//서명
retval.Title = parser.GetTag<MarcSubfield>("245a").FirstOrDefault()?.Value ?? string.Empty;
//string x245 = parser.GetTag<MarcSubfield>("245x").FirstOrDefault()?.Value ?? string.Empty;
//string b245 = parser.GetTag<MarcSubfield>("245b").FirstOrDefault()?.Value ?? string.Empty;
//if (x245 != "") retval.Title += " = " + x245;
//if (b245 != "") retval.Title += " : " + b245;
//출판사
var tag_264b = parser.GetTag<MarcSubfield>("264b").FirstOrDefault();
var tag_260b = parser.GetTag<MarcSubfield>("260b").FirstOrDefault();
if (tag_264b != null)
retval.Publisher = tag_264b?.Value ?? string.Empty;
else if (tag_260b != null)
retval.Publisher = tag_260b?.Value ?? string.Empty;
//056a
retval.Tag056 = parser.GetTag("056a").FirstOrDefault() ?? string.Empty;
retval.Tag008 = parser.GetTag("008").FirstOrDefault() ?? string.Empty;
//총서명(440a)
retval.fulltitle = parser.GetTag("440a").FirstOrDefault() ?? string.Empty;
//총서번호(440v)
retval.fulltitleno = parser.GetTag("440v").FirstOrDefault() ?? string.Empty;
//권차(245n)
retval.kwoncha = parser.GetTag("245n").FirstOrDefault() ?? string.Empty;
//권차서명(245p)
retval.kwoncha_title = parser.GetTag("245p").FirstOrDefault() ?? string.Empty;
//판차(250a)
retval.pancha = parser.GetTag("250a").FirstOrDefault() ?? string.Empty;
retval.Success = true;
return retval;
}
public static string Make_InsertQuery(string tableName, Dictionary<string, object> column_and_values)
{
string columns = string.Join(", ", column_and_values.Keys.Select(k => $"`{k}`"));
string values = string.Join(", ", column_and_values.Values.Select(v =>
{
string s = v?.ToString() ?? "";
return $"\"{s.Replace("\"", "\"\"")}\"";
}));
return $"INSERT INTO `{tableName}` ({columns}) VALUES ({values});";
}
public static string Make_UpdateQuery(string tableName, Dictionary<string, object> column_and_values, Dictionary<string, object> where_column_and_values)
{
string setClause = string.Join(", ", column_and_values.Select(kv =>
{
string s = kv.Value?.ToString() ?? "";
return $"`{kv.Key}` = \"{s.Replace("\"", "\"\"")}\"";
}));
string whereClause = string.Join(" AND ", where_column_and_values.Select(kv =>
{
string s = kv.Value?.ToString() ?? "";
return $"`{kv.Key}` = \"{s.Replace("\"", "\"\"")}\"";
}));
return $"UPDATE `{tableName}` SET {setClause} WHERE {whereClause};";
}
public static (bool result, int newidx, string message) UpdateMarc(int midx, string FullMarc, int v_grade,
string etc1, string etc2, string url, string v_orgmarc)
{
var isUpdate = midx > 0;
var v_username = PUB.user.UserName;
var v_compidx = PUB.user.CompanyIdx;
string v_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//상황에 맞게 업데이트 명령을 처리한다.
var basicinfo = GetBasicMarcInfo(FullMarc);
if (basicinfo.Success == false) return (false, 0, basicinfo.Message);
// 1. DB 작업 (저장 전략 결정: Status 기준)
if (isUpdate == false)
{
var insertData = new Dictionary<string, object>
{
{ "compidx", v_compidx },
{ "ISBN", basicinfo.ISBN },
{ "서명", basicinfo.Title },
{ "저자", basicinfo.Author },
{ "출판사", basicinfo.Publisher },
{ "가격", basicinfo.Price },
{ "총서명", basicinfo.fulltitle },
{ "총서번호", basicinfo.fulltitleno },
{ "권차", basicinfo.kwoncha },
{ "권차서명", basicinfo.kwoncha_title },
{ "판차", basicinfo.pancha },
{ "marc", FullMarc },
{ "marc_chk", "1" },
{ "비고1", etc1 },
{ "비고2", etc2 },
{ "url", url },
{ "division", basicinfo.Tag056 },
{ "008tag", basicinfo.Tag008 },
{ "date", v_date },
{ "user", v_username },
{ "grade", v_grade.ToString() }
};
string Incmd = Make_InsertQuery("Marc", insertData);
PUB.log.Add("INSERT", string.Format("{0}({1}) : {2}", v_username, v_compidx, Incmd));
var newIdx = Helper_DB.DB_Send_CMD_Insert_GetIdx(Incmd);
if (newIdx > 0)
{
midx = (int)newIdx;
}
}
else
{
var updateData = new Dictionary<string, object>
{
{ "ISBN", basicinfo.ISBN },
{ "서명", basicinfo.Title },
{ "저자", basicinfo.Author },
{ "출판사", basicinfo.Publisher },
{ "가격", basicinfo.Price },
{ "총서명", basicinfo.fulltitle },
{ "총서번호", basicinfo.fulltitleno },
{ "권차", basicinfo.kwoncha },
{ "권차서명", basicinfo.kwoncha_title },
{ "판차", basicinfo.pancha },
{ "marc", FullMarc },
{ "marc1", v_orgmarc },
{ "marc_chk", "1" },
{ "marc_chk1", "0" },
{ "비고1", etc1 },
{ "비고2", etc2 },
{ "url", url },
{ "division", basicinfo.Tag056 },
{ "008tag", basicinfo.Tag008 },
{ "date", v_date },
{ "user", v_username },
{ "grade", v_grade.ToString() }
};
var whereClause = new Dictionary<string, object>
{
{ "idx", midx },
{ "compidx", v_compidx }
};
string U_cmd = Make_UpdateQuery("Marc", updateData, whereClause);
PUB.log.Add("Update", string.Format("{0}({1}) : {2}", v_username, v_compidx, U_cmd.Replace("\r", " ").Replace("\n", " ")));
var ret = Helper_DB.ExcuteNonQuery(U_cmd);
if (ret.applyCount != 1)
{
return (false, midx, $"업데이트된 행의 수가 1이 아닙니다. 적용된 행 수: {ret.applyCount}, 오류 메시지: {ret.errorMessage}");
}
}
return (true, midx, string.Empty);
}
}
}

View File

@@ -14,184 +14,6 @@ using UniMarc.Properties;
namespace UniMarc namespace UniMarc
{ {
public partial class Helper_DB
{
//static string cs = "";
public enum eDbType
{
unimarc,
cl_marc
}
public static MySqlConnection CreateConnection(eDbType dbtype)
{
var dbname = dbtype.ToString();
string strConnection = string.Format(
"Server={0};" +
"Port={1};" +
$"Database={dbname};" +
"uid={2};" +
"pwd={3};", ServerData[0], DBData[0], DBData[1], DBData[2]);
return new MySqlConnection(strConnection);
}
/// <summary>
/// 입력한 쿼리의 결과를 데이터테이블로 반환합니다
/// </summary>
/// <param name="query"></param>
/// <param name="cn"></param>
/// <returns></returns>
public static DataTable ExecuteDataTable(string query, MySqlConnection cn=null)
{
var bLocalCN = cn == null;
DataTable dt = new DataTable();
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);// new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
using (MySqlDataAdapter adapter = new MySqlDataAdapter(cmd))
{
adapter.Fill(dt);
}
cmd.Dispose();
cn.Close();
if (bLocalCN) cn.Dispose();
return dt;
}
catch (Exception ex)
{
UTIL.MsgE(ex.ToString());
return null;
}
}
/// <summary>
/// 오류발생시 null을 반환합니다
/// </summary>
/// <param name="tableName"></param>
/// <param name="columns"></param>
/// <param name="wheres"></param>
/// <param name="orders"></param>
/// <returns></returns>
public static DataTable ExecuteQueryData(string tableName, string columns = "*", string wheres = "", string orders = "", MySqlConnection cn = null)
{
var sql = $"select {columns} from {tableName}";
if (wheres.isEmpty() == false) sql += " where " + wheres;
if (orders.isEmpty() == false) sql += " order by " + orders;
return ExecuteDataTable(sql, cn);
}
/// <summary>
/// 오류발생시 -1을 반환합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static (int applyCount, string errorMessage) ExcuteNonQuery(string query, MySqlConnection cn = null)
{
try
{
var bLocalCN = cn == null;
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var cnt = cmd.ExecuteNonQuery();
cmd.Dispose();
if (bLocalCN) cn.Dispose();
return (cnt, string.Empty);
}
catch (Exception ex)
{
return (-1, ex.Message);
}
}
public static (long value, string errorMessage) ExcuteInsertGetIndex(string cmd, MySqlConnection cn = null)
{
long lastId = -1;
var bLocalCN = cn == null;
string message;
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
using (var sqlcmd = new MySqlCommand(cmd, cn))
{
cn.Open();
sqlcmd.ExecuteNonQuery();
lastId = sqlcmd.LastInsertedId;
}
if (bLocalCN) cn.Dispose();
message = "";
}
catch (Exception ex)
{
lastId = -1;
message = ex.Message;
}
return (lastId, message);
}
/// <summary>
/// 단일항목값을 반환 합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static (object value, string errorMessage) ExcuteScalar(string query, MySqlConnection cn = null)
{
try
{
var bLocalCN = cn == null;
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var val = cmd.ExecuteScalar();
cmd.Dispose();
if (bLocalCN) cn.Dispose();
return (val, string.Empty);
}
catch (Exception ex)
{
return (null, ex.Message);
}
}
/// <summary>
/// Insert 명령을 수행한 후 자동 생성된 index값을 반환합니다.
/// 오류발생시에는 -1을 반환합니다
/// </summary>
/// <param name="cmd"></param>
/// <param name="cn"></param>
/// <returns></returns>
public long DB_Send_CMD_Insert_GetIdx(string cmd, MySqlConnection cn = null)
{
long lastId = -1;
var bLocalCN = cn == null;
try
{
if (cn == null) cn = CreateConnection(eDbType.unimarc);//new MySqlConnection(cs);
using (var sqlcmd = new MySqlCommand(cmd, cn))
{
cn.Open();
sqlcmd.ExecuteNonQuery();
lastId = sqlcmd.LastInsertedId;
}
if (bLocalCN) cn.Dispose();
}
catch (Exception ex)
{
UTIL.MsgE($"데이터베이스 실행오류\n{ex.Message}");
}
return lastId;
}
}
/// <summary> /// <summary>
/// DB접속을 도와주는 클래스 /// DB접속을 도와주는 클래스
/// </summary> /// </summary>

View File

@@ -8,12 +8,12 @@ namespace UniMarc
{ {
public class FillBlankItem public class FillBlankItem
{ {
public string Idx { get; set; } public int Idx { get; set; }
public string Isbn { get; set; } public string Isbn { get; set; }
public string BookName { get; set; } public string BookName { get; set; }
public string Author { get; set; } public string Author { get; set; }
public string Publisher { get; set; } public string Publisher { get; set; }
public string Price { get; set; } public int Price { get; set; }
public string BookMarc { get; set; } = ""; // Hidden column likely public string BookMarc { get; set; } = ""; // Hidden column likely
} }
} }

View File

@@ -30,7 +30,7 @@ namespace UniMarc
public string image { get; set; } public string image { get; set; }
public string api_data { get; set; } public string api_data { get; set; }
public string search_description { get; set; } public string search_description { get; set; }
public string search_link { get; set; } public string search_url { get; set; }

View File

@@ -6,15 +6,15 @@ namespace UniMarc
{ {
public string ISBN13 { get; set; } public string ISBN13 { get; set; }
public string URL { get; set; } public string URL { get; set; }
public string MarcIdx { get; set; } public int MarcIdx { get; set; }
public string User { get; set; } public string User { get; set; }
public string SaveDate { get; set; } public string SaveDate { get; set; }
public string ListIdx { get; set; } public int ListIdx { get; set; }
public string BookName { get; set; } public string BookName { get; set; }
public string Author { get; set; } public string Author { get; set; }
public string Publisher { get; set; } public string Publisher { get; set; }
public string Price { get; set; } public int Price { get; set; }
public string text008 { get; set; } public string text008 { get; set; }

View File

@@ -0,0 +1,40 @@
namespace UniMarc
{
public partial class Helper_DB
{
public class MarcBasicInfo
{
public string ISBN { get; set; }
public string Title { get; set; }
public string Author { get; set; }
public string Publisher { get; set; }
public string Price { get; set; }
public string Tag056 { get; set; }
public string Tag008 { get; set; }
public string kwoncha { get; set; }
public string kwoncha_title { get; set; }
public string pancha { get; set; }
/// <summary>
/// 총서명(440a)
/// </summary>
public string fulltitle { get; set; }
/// <summary>
/// 총서번호(440v)
/// </summary>
public string fulltitleno { get; set; }
public bool Success { get; set; }
public string Message { get; set; }
public MarcBasicInfo()
{
Success = false;
Message = string.Empty;
}
}
}
}

View File

@@ -15,16 +15,20 @@ namespace UniMarc
public class MarcBookItem public class MarcBookItem
{ {
public string ListIdx { get; set; } public int ListIdx { get; set; }
public string ISBN13 { get; set; } public string ISBN13 { get; set; }
public string Num { get; set; } public string Num { get; set; }
public string BookName { get; set; } public string BookName { get; set; }
public string Author { get; set; } public string Author { get; set; }
public string BookComp { get; set; } public string BookComp { get; set; }
public string Count { get; set; } public string Count { get; set; }
public string Pay { get; set; }
/// <summary>
/// 단가(정가는 price에 있다)
/// </summary>
public int Pay { get; set; }
public string Url { get; set; } public string Url { get; set; }
public string MarcIdx { get; set; } public int MarcIdx { get; set; }
public string DbMarc { get; set; } public string DbMarc { get; set; }
private MarcRecordStatus _status = MarcRecordStatus.None; private MarcRecordStatus _status = MarcRecordStatus.None;
public MarcRecordStatus Status public MarcRecordStatus Status
@@ -50,6 +54,8 @@ namespace UniMarc
public string search_description { get; set; } public string search_description { get; set; }
public string search_url { get; set; } public string search_url { get; set; }
public string category { get; set; }
public System.Drawing.Color ForeColor { get; set; } = System.Drawing.Color.Black; public System.Drawing.Color ForeColor { get; set; } = System.Drawing.Color.Black;
public System.Drawing.Color BackColor { get; set; } = System.Drawing.Color.White; public System.Drawing.Color BackColor { get; set; } = System.Drawing.Color.White;

View File

@@ -4,7 +4,7 @@ namespace UniMarc
{ {
public class MarcCopyItem public class MarcCopyItem
{ {
public string idx { get; set; } public int idx { get; set; }
public string compidx { get; set; } public string compidx { get; set; }
public string ISBN { get; set; } public string ISBN { get; set; }
public string Title { get; set; } public string Title { get; set; }
@@ -24,6 +24,12 @@ namespace UniMarc
public string marc2 { get; set; } public string marc2 { get; set; }
public string marc_chk2 { get; set; } public string marc_chk2 { get; set; }
public string kwoncha { get; set; }
public string kwoncha_title { get; set; }
public string KwonchaFull { get; set; } // Combined kwoncha + kwoncha_title
public string TotalTitleFull { get; set; } // Combined 총서명 + 총서번호
public string pancha { get; set; }
public string publishdate { get; set; }
public string remark1 { get; set; } public string remark1 { get; set; }
public string remark2 { get; set; } public string remark2 { get; set; }
public string DisplayGrade public string DisplayGrade

View File

@@ -8,7 +8,7 @@ namespace UniMarc
{ {
public class MarcPlanItem public class MarcPlanItem
{ {
public string Idx { get; set; } public int Idx { get; set; }
public string Num { get; set; } public string Num { get; set; }
public string RegNum { get; set; } public string RegNum { get; set; }
public string ClassCode { get; set; } public string ClassCode { get; set; }
@@ -25,8 +25,8 @@ namespace UniMarc
public string SBookNum2 { get; set; } public string SBookNum2 { get; set; }
public string Author { get; set; } public string Author { get; set; }
public string BookComp { get; set; } public string BookComp { get; set; }
public string Price { get; set; } public int Price { get; set; }
public string Midx { get; set; } public int Midx { get; set; }
public string Marc { get; set; } public string Marc { get; set; }
public string SearchTag2 { get; set; } public string SearchTag2 { get; set; }
public string ColCheck { get; set; } = "F"; public string ColCheck { get; set; } = "F";

View File

@@ -46,7 +46,7 @@ namespace UniMarc
/// <param name="Publisher"></param> /// <param name="Publisher"></param>
/// <param name="Price"></param> /// <param name="Price"></param>
/// <returns></returns> /// <returns></returns>
public static string MakeEmptyMarc(string ISBN13, string BookName, string Author, string Publisher, string Price) public static string MakeEmptyMarc(string ISBN13, string BookName, string Author, string Publisher, int Price)
{ {
string yyMMdd = DateTime.Now.ToString("yyMMdd"); string yyMMdd = DateTime.Now.ToString("yyMMdd");
string yyyy = DateTime.Now.ToString("yyyy"); string yyyy = DateTime.Now.ToString("yyyy");

View File

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

View File

@@ -225,6 +225,8 @@
<DependentUpon>Reference.svcmap</DependentUpon> <DependentUpon>Reference.svcmap</DependentUpon>
</Compile> </Compile>
<Compile Include="DB_Utils.cs" /> <Compile Include="DB_Utils.cs" />
<Compile Include="Helper\Database.cs" />
<Compile Include="Models\MarcBasicInfo.cs" />
<Compile Include="Helper\MarcParser.cs" /> <Compile Include="Helper\MarcParser.cs" />
<Compile Include="Helper_LibraryDelaySettings.cs" /> <Compile Include="Helper_LibraryDelaySettings.cs" />
<Compile Include="ListOfValue\fSelectDT.cs"> <Compile Include="ListOfValue\fSelectDT.cs">
@@ -318,7 +320,7 @@
<Compile Include="마크\AddMarc_FillBlank.Designer.cs"> <Compile Include="마크\AddMarc_FillBlank.Designer.cs">
<DependentUpon>AddMarc_FillBlank.cs</DependentUpon> <DependentUpon>AddMarc_FillBlank.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="마크\BookGridItem.cs" /> <Compile Include="Models\BookGridItem.cs" />
<Compile Include="마크\CD_LP.cs"> <Compile Include="마크\CD_LP.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -391,7 +393,7 @@
<Compile Include="마크\Check_ISBN_Yes242.Designer.cs"> <Compile Include="마크\Check_ISBN_Yes242.Designer.cs">
<DependentUpon>Check_ISBN_Yes242.cs</DependentUpon> <DependentUpon>Check_ISBN_Yes242.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="마크\FillBlankItem.cs" /> <Compile Include="Models\FillBlankItem.cs" />
<Compile Include="마크\Help_007.cs"> <Compile Include="마크\Help_007.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -404,9 +406,9 @@
<Compile Include="마크\Help_008.Designer.cs"> <Compile Include="마크\Help_008.Designer.cs">
<DependentUpon>Help_008.cs</DependentUpon> <DependentUpon>Help_008.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="마크\IsbnGridItem.cs" /> <Compile Include="Models\IsbnGridItem.cs" />
<Compile Include="마크\MacEditorParameter.cs" /> <Compile Include="Models\MacEditorParameter.cs" />
<Compile Include="마크\MacListItem.cs" /> <Compile Include="Models\MacListItem.cs" />
<Compile Include="마크\Mac_List_Add2.cs"> <Compile Include="마크\Mac_List_Add2.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -425,8 +427,8 @@
<Compile Include="마크\Mac_List_Edit.Designer.cs"> <Compile Include="마크\Mac_List_Edit.Designer.cs">
<DependentUpon>Mac_List_Edit.cs</DependentUpon> <DependentUpon>Mac_List_Edit.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="마크\MarcBookItem.cs" /> <Compile Include="Models\MarcBookItem.cs" />
<Compile Include="마크\MarcCopyItem.cs" /> <Compile Include="Models\MarcCopyItem.cs" />
<Compile Include="마크\MarcCopySelect2.cs"> <Compile Include="마크\MarcCopySelect2.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -451,7 +453,7 @@
<Compile Include="마크\Marc.designer.cs"> <Compile Include="마크\Marc.designer.cs">
<DependentUpon>Marc.cs</DependentUpon> <DependentUpon>Marc.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="마크\MarcPlanItem.cs" /> <Compile Include="Models\MarcPlanItem.cs" />
<Compile Include="마크\Marc_CopyForm.cs"> <Compile Include="마크\Marc_CopyForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
@@ -650,7 +652,7 @@
<Compile Include="마크\Marc_memo.Designer.cs"> <Compile Include="마크\Marc_memo.Designer.cs">
<DependentUpon>Marc_memo.cs</DependentUpon> <DependentUpon>Marc_memo.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="마크\SearchInforItem.cs" /> <Compile Include="Models\SearchInforItem.cs" />
<Compile Include="마크\Search_Infor2.cs"> <Compile Include="마크\Search_Infor2.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

View File

@@ -80,7 +80,7 @@ namespace UniMarc
/// 5:tag008 <br></br> /// 5:tag008 <br></br>
/// 6:LineMarc</param> /// 6:LineMarc</param>
var selected = mcs.SelectedItem; var selected = mcs.SelectedItem;
var defMarc = PUB.MakeEmptyMarc(selected.ISBN, "BookName", "Author", "Publisher", "Price"); var defMarc = PUB.MakeEmptyMarc(selected.ISBN, "BookName", "Author", "Publisher", 0);
this.marcEditorControl1.LoadBookData(selected.marc_db, selected.ISBN, defMarc); this.marcEditorControl1.LoadBookData(selected.marc_db, selected.ISBN, defMarc);
mOldMarc = selected.marc_db; mOldMarc = selected.marc_db;
@@ -93,7 +93,7 @@ namespace UniMarc
} }
else else
{ {
this.lbl_Midx.Text = selected.idx; this.lbl_Midx.Text = selected.idx.ToString();
this.lbl_Midx.Tag = selected.idx; this.lbl_Midx.Tag = selected.idx;
this.lbl_Midx.BackColor = Color.Lime; this.lbl_Midx.BackColor = Color.Lime;
@@ -131,7 +131,7 @@ namespace UniMarc
if (isDelete) if (isDelete)
{ {
var isbn = $"※{DateTime.Now.ToString("yyMMddhhmmss")}"; var isbn = $"※{DateTime.Now.ToString("yyMMddhhmmss")}";
var emptryMarc = PUB.MakeEmptyMarc(isbn, "title", "author", "publisher", "price"); var emptryMarc = PUB.MakeEmptyMarc(isbn, "title", "author", "publisher", 0);
var emptymarc = TextResetSub(); var emptymarc = TextResetSub();
marcEditorControl1.LoadBookData(string.Empty, isbn, defaultMarc: emptryMarc); marcEditorControl1.LoadBookData(string.Empty, isbn, defaultMarc: emptryMarc);
@@ -201,135 +201,31 @@ namespace UniMarc
/// <param name="v_date">저장시각 yyyy-MM-dd HH:mm:ss</param> /// <param name="v_date">저장시각 yyyy-MM-dd HH:mm:ss</param>
void UpdateMarc(string MarcIndex, string FullMarc, string grade) void UpdateMarc(string MarcIndex, string FullMarc, string grade)
{ {
//도서정보추출 int targetMarcIdx = 0;
var v_isbn = ""; int.TryParse(MarcIndex, out targetMarcIdx);
var v_price = ""; int targetGrade = 2;
var v_author = ""; if (int.TryParse(grade, out int parsedGrade)) targetGrade = parsedGrade;
var v_title = "";
var v_publisher = "";
var v_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
//파서를 사용해서 변경한다 // 3. 공통 저장 메서드 호출
var parser = new UniMarc.MarcParser(); var saveResult = Helper_DB.UpdateMarc(targetMarcIdx, FullMarc, targetGrade, rtEtc1.Text.Trim(), rtEtc2.Text.Trim(), "", mOldMarc);
parser.ParseFullMarc(FullMarc);
//ISBN와 가격 (처음나오는 020태그의 값을 적용) if (saveResult.result == false)
var tag_020 = parser.GetTag<MarcField>("020").FirstOrDefault();
if (tag_020 != null)
{ {
v_isbn = tag_020.GetSubfieldValue('a'); UTIL.MsgE(saveResult.message);
v_price = tag_020.GetSubfieldValue('c');
}
//저자(100 -> 110 -> 111 순으로 적용)
var tag_100 = parser.GetTag<MarcField>("100").FirstOrDefault();
var tag_110 = parser.GetTag<MarcField>("110").FirstOrDefault();
var tag_111 = parser.GetTag<MarcField>("111").FirstOrDefault();
if (tag_111 != null)
v_author = tag_111.GetSubfieldValue('a');
else if (tag_110 != null)
v_author = tag_110.GetSubfieldValue('a');
else if (tag_100 != null)
v_author = tag_100.GetSubfieldValue('a');
//서명
var tag_245 = parser.GetTag<MarcSubfield>("245a").FirstOrDefault();
v_title = tag_245?.Value ?? string.Empty;
//출판사
var tag_264b = parser.GetTag<MarcSubfield>("264b").FirstOrDefault();
var tag_260b = parser.GetTag<MarcSubfield>("260b").FirstOrDefault();
if(tag_264b != null)
v_publisher = tag_264b?.Value ?? string.Empty;
else if (tag_260b != null)
v_publisher = tag_260b?.Value ?? string.Empty;
//056a
var v_056 = parser.GetTag("056a").FirstOrDefault() ?? string.Empty;
var v_008 = parser.GetTag("008").FirstOrDefault() ?? string.Empty;
if (v_056.isEmpty() || v_008.isEmpty())
{
UTIL.MsgE("056a | 008 태그의 값을 확인할 수 없습니다\n1.마크데이터를 확인 해주세요\n2.개발자에 해당 내용을 문의하세요");
return; return;
} }
if (v_isbn.isEmpty() || v_title.isEmpty()) // 4. UI 결과 반영
{
UTIL.MsgE("ISBN과 서명을 추출하지 못했습니다\n1.마크데이터를 확인 해주세요\n2.개발자에 해당 내용을 문의하세요");
return;
}
var etc1 = rtEtc1.Text.Trim();
var etc2 = rtEtc2.Text.Trim();
if (grade.isEmpty()) grade = "2";
if (MarcIndex.isEmpty()) if (MarcIndex.isEmpty())
{ {
//insert lbl_Midx.Tag = saveResult.newidx.ToString();
string[] InsertTable = lbl_Midx.Text = saveResult.newidx.ToString();
{ lbl_Midx.BackColor = Color.Lime; // 저장 성공 후 색상 변경 (AddMarc2 특화)
"ISBN", "서명", "저자", "출판사", "가격", UTIL.MsgI($"저장 완료\n\nIDX:{saveResult.newidx}");
"marc", "비고1", "비고2", "grade", "marc_chk",
"user", "division", "008tag", "date", "compidx"
};
//데이터중복검사필요
//동일 isbnd있다면 그래도 저장할건지 한번 더 물어봐야 함
if (DB_Utils.ExistISBN(v_isbn))
{
if (UTIL.MsgQ("동일한 ISBN이 이미 존재합니다. 그래도 저장하시겠습니까?") == DialogResult.No)
return;
}
string[] InsertColumn =
{
v_isbn, v_title, v_author, v_publisher, v_price,
FullMarc, etc1, etc2, grade.ToString(), "1",
PUB.user.UserName, v_056, v_008, v_date, PUB.user.CompanyIdx
};
string InCMD = db.DB_INSERT("Marc", InsertTable, InsertColumn);
PUB.log.Add("ADDMarcINSERT", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, InCMD.Replace("\r", " ").Replace("\n", " ")));
var rlt = Helper_DB.ExcuteInsertGetIndex(InCMD);
if (rlt.errorMessage.isEmpty() == false)
UTIL.MsgE(rlt.errorMessage);
else
{
lbl_Midx.Tag = rlt.value.ToString();
lbl_Midx.Text = rlt.value.ToString();
UTIL.MsgI($"저장 완료\n\nIDX:{rlt.value}");
}
} }
else else
{ {
//update UTIL.MsgI("변경 완료");
string[] EditTable =
{
"compidx", "marc", "marc_chk","marc1", "marc_chk1", "비고1",
"비고2", "division", "008tag", "date", "user",
"grade"
};
string[] EditColumn =
{
PUB.user.CompanyIdx, FullMarc, "1",mOldMarc, "0", etc1,
etc2, v_056, v_008, v_date, PUB.user.UserName,
grade.ToString()
};
string[] SearchTable = { "idx", "compidx" };
string[] SearchColumn = { MarcIndex, PUB.user.CompanyIdx };
string UpCMD = db.More_Update("Marc", EditTable, EditColumn, SearchTable, SearchColumn);
PUB.log.Add("ADDMarcUPDATE", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, UpCMD.Replace("\r", " ").Replace("\n", " ")));
var rlt = Helper_DB.ExcuteNonQuery(UpCMD);
if (rlt.applyCount != 1)
UTIL.MsgE(rlt.errorMessage);
else
UTIL.MsgI("변경 완료");
} }
} }
@@ -400,12 +296,22 @@ namespace UniMarc
string midx = this.lbl_Midx.Tag?.ToString() ?? string.Empty; string midx = this.lbl_Midx.Tag?.ToString() ?? string.Empty;
if (isUpdate == false) midx = string.Empty; if (isUpdate == false) midx = string.Empty;
// ISBN 추출 및 중복 체크 추가
var tag_020 = parserF.GetTag<MarcField>("020").FirstOrDefault();
var v_isbn = tag_020?.GetSubfieldValue('a') ?? string.Empty;
// 신규 저장 시 중복 ISBN 체크
if (midx.isEmpty() && !v_isbn.isEmpty())
{
if (DB_Utils.ExistISBN(v_isbn))
{
if (UTIL.MsgQ("동일한 ISBN이 이미 존재합니다. 그래도 저장하시겠습니까?") == DialogResult.No)
return;
}
}
var v_grade = uC_SelectGrade1.Grade == -1 ? string.Empty : uC_SelectGrade1.Grade.ToString(); var v_grade = uC_SelectGrade1.Grade == -1 ? string.Empty : uC_SelectGrade1.Grade.ToString();
//if (radA.Checked) v_grade = "0";
//else if (radB.Checked) v_grade = "1";
//else if (radC.Checked) v_grade = "2";
//else if (radD.Checked) v_grade = "3";
//midx 값이 emptry 라면 insert , 아니라면 update //midx 값이 emptry 라면 insert , 아니라면 update
UpdateMarc(midx, fullMarc, v_grade); UpdateMarc(midx, fullMarc, v_grade);

View File

@@ -64,7 +64,7 @@ namespace UniMarc
db.DBcon(); db.DBcon();
string[] search_tbl = { "compidx", "l_idx" }; string[] search_tbl = { "compidx", "l_idx" };
string[] search_col = { compidx, l_idx }; string[] search_col = { compidx, l_idx };
string search_data = "`idx`, `header`, `num`, `isbn_marc`, `book_name`, `author`, `book_comp`, " + string search_data = "`idx`, `header`, `num`, `isbn_marc`, `book_name`, `author`, `book_comp`, sold_out," +
"`count`, `pay`, `total`, `import`, `price`, " + "`count`, `pay`, `total`, `import`, `price`, " +
"`etc`, `pubDate`, `persent`, `category`, `image_url`, `set_book_name`,`search_book_name`,`search_author`,`search_book_comp`,`search_description`,`search_url`"; "`etc`, `pubDate`, `persent`, `category`, `image_url`, `set_book_name`,`search_book_name`,`search_author`,`search_book_comp`,`search_description`,`search_url`";
@@ -101,12 +101,12 @@ namespace UniMarc
item.persent = row["persent"]?.ToString() ?? string.Empty; item.persent = row["persent"]?.ToString() ?? string.Empty;
item.category = row["category"]?.ToString() ?? string.Empty; item.category = row["category"]?.ToString() ?? string.Empty;
item.image = row["image_url"]?.ToString() ?? string.Empty; item.image = row["image_url"]?.ToString() ?? string.Empty;
item.sold_out = row["sold_out"]?.ToString() ?? string.Empty;
item.search_book_name = row["search_book_name"]?.ToString() ?? string.Empty; item.search_book_name = row["search_book_name"]?.ToString() ?? string.Empty;
item.search_author = row["search_author"]?.ToString() ?? string.Empty; item.search_author = row["search_author"]?.ToString() ?? string.Empty;
item.search_book_comp = row["search_book_comp"]?.ToString() ?? string.Empty; item.search_book_comp = row["search_book_comp"]?.ToString() ?? string.Empty;
item.search_description = row["search_description"]?.ToString() ?? string.Empty; item.search_description = row["search_description"]?.ToString() ?? string.Empty;
item.search_link = row["search_url"]?.ToString() ?? string.Empty; item.search_url = row["search_url"]?.ToString() ?? string.Empty;
string setBookName = row["set_book_name"]?.ToString() ?? string.Empty; string setBookName = row["set_book_name"]?.ToString() ?? string.Empty;
if (!string.IsNullOrEmpty(setBookName)) if (!string.IsNullOrEmpty(setBookName))
@@ -734,9 +734,9 @@ namespace UniMarc
item.search_description = string.Empty; item.search_description = string.Empty;
if (value.Length > 10) if (value.Length > 10)
item.search_link = value[10]; item.search_url = value[10];
else else
item.search_link = string.Empty; item.search_url = string.Empty;
dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow; dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow;
@@ -745,46 +745,56 @@ namespace UniMarc
private void btn_Save_Click(object sender, EventArgs e) private void btn_Save_Click(object sender, EventArgs e)
{ {
string[] Edit_tbl = { "isbn", "book_name", "author", "book_comp", "pay", "price", "pubDate", "category", "image_url", "sold_out", "etc",
"search_book_name","search_author","search_book_comp"};
for (int a = 0; a < bookList.Count; a++) for (int a = 0; a < bookList.Count; a++)
{ {
var item = bookList[a]; var item = bookList[a];
if (string.IsNullOrEmpty(item.isbn)) continue; if (string.IsNullOrEmpty(item.isbn)) continue;
string[] Edit_Col = { var updateData = new Dictionary<string, object>
item.isbn, {
item.book_name, { "isbn", item.isbn },
item.author, { "book_name", item.book_name },
item.book_comp, { "author", item.author },
item.unit, { "book_comp", item.book_comp },
item.price, { "pay", item.unit },
item.pubDate, { "price", item.price },
item.category, { "pubDate", item.pubDate },
item.image, { "category", item.category },
item.sold_out, { "image_url", item.image },
item.etc, { "sold_out", item.sold_out },
item.search_book_name, { "etc", item.etc },
item.search_author, { "search_book_name", item.search_book_name },
item.search_book_comp { "search_author", item.search_author },
{ "search_book_comp", item.search_book_comp },
{ "search_description", item.search_description },
{ "search_url", item.search_url }
}; };
string[] Search_tbl = { "idx", "list_name", "compidx" }; var whereClause = new Dictionary<string, object>
string[] Search_col = { item.idx, list_name, compidx }; {
{ item.etc.Contains("세트분할") ? "set_book_name" : "idx", item.idx },
{ "list_name", list_name },
{ "compidx", compidx }
};
if (item.etc.Contains("세트분할")) string U_cmd = Helper_DB.Make_UpdateQuery("Obj_List_Book", updateData, whereClause);
Search_tbl[0] = "set_book_name"; var ret = Helper_DB.ExcuteNonQuery(U_cmd);
if(ret.applyCount != 1)
string U_cmd = db.More_Update("Obj_List_Book", Edit_tbl, Edit_Col, Search_tbl, Search_col, 1); {
Helper_DB.ExcuteNonQuery(U_cmd); UTIL.MsgE($"{ret.applyCount} 건의 자료가 업데이트 되었습니다\n개발자 문의 하세요\n\n{ret.errorMessage}");
return;
}
if (Check_Marc.Checked) if (Check_Marc.Checked)
{ {
string CMcmd = string.Format("UPDATE `Obj_List_Book` SET `isbn_marc` = \"{0}\" WHERE `idx` = \"{1}\"", string CMcmd = string.Format("UPDATE `Obj_List_Book` SET `isbn_marc` = \"{0}\" WHERE `idx` = \"{1}\"",
Edit_Col[0], Search_col[0]); item.isbn, item.idx);
Helper_DB.ExcuteNonQuery(CMcmd); ret = Helper_DB.ExcuteNonQuery(CMcmd);
if (ret.applyCount != 1)
{
UTIL.MsgE($"{ret.applyCount} 건의 자료가 업데이트 되었습니다\n개발자 문의 하세요\n\n{ret.errorMessage}");
return;
}
} }
} }
UTIL.MsgI("저장되었습니다!"); UTIL.MsgI("저장되었습니다!");
@@ -952,7 +962,7 @@ namespace UniMarc
} }
else else
{ {
link_url.Text = item.search_link; link_url.Text = item.search_url;
} }
} }

View File

@@ -274,8 +274,7 @@ namespace UniMarc
{ {
if (chkEditorTest.Checked == false) if (chkEditorTest.Checked == false)
{ {
var marc = this.main.OpenFormInTab(() => new Marc2(this), allowMultiple: true); var marc = this.main.OpenFormInTab(() => new Marc2(item), allowMultiple: true);
marc.input_list(item);
} }
else else
{ {

View File

@@ -154,7 +154,7 @@ namespace UniMarc
InList_Col[5] = TotalCount.ToString(); InList_Col[5] = TotalCount.ToString();
string InList_Cmd = db.DB_INSERT("Obj_List", InList_Tbl, InList_Col); string InList_Cmd = db.DB_INSERT("Obj_List", InList_Tbl, InList_Col);
long listIdxLong = db.DB_Send_CMD_Insert_GetIdx(InList_Cmd); long listIdxLong = Helper_DB.DB_Send_CMD_Insert_GetIdx(InList_Cmd);
if (listIdxLong == -1) if (listIdxLong == -1)
{ {
UTIL.MsgE("목록 저장에 실패했습니다."); UTIL.MsgE("목록 저장에 실패했습니다.");

View File

@@ -508,7 +508,7 @@ namespace UniMarc
string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col); string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col);
PUB.log.Add("INSERT", string.Format("{0}({1},{2}) : {3}", PUB.user.UserName, PUB.user.CompanyIdx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, Incmd)); PUB.log.Add("INSERT", string.Format("{0}({1},{2}) : {3}", PUB.user.UserName, PUB.user.CompanyIdx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, Incmd));
long newIdx = db.DB_Send_CMD_Insert_GetIdx(Incmd); long newIdx = Helper_DB.DB_Send_CMD_Insert_GetIdx(Incmd);
if (newIdx > 0) if (newIdx > 0)
{ {
Midx = newIdx.ToString(); Midx = newIdx.ToString();
@@ -1571,12 +1571,12 @@ namespace UniMarc
{ {
var item = new FillBlankItem var item = new FillBlankItem
{ {
Idx = a.ToString(), Idx = a,
Isbn = List_Book.Rows[a].Cells["ISBN13"].Value.ToString(), Isbn = List_Book.Rows[a].Cells["ISBN13"].Value.ToString(),
BookName = List_Book.Rows[a].Cells["book_name"].Value.ToString(), BookName = List_Book.Rows[a].Cells["book_name"].Value.ToString(),
Author = List_Book.Rows[a].Cells["author"].Value.ToString(), Author = List_Book.Rows[a].Cells["author"].Value.ToString(),
Publisher = List_Book.Rows[a].Cells["book_comp"].Value.ToString(), Publisher = List_Book.Rows[a].Cells["book_comp"].Value.ToString(),
Price = List_Book.Rows[a].Cells["pay"].Value.ToString() Price = Convert.ToInt32( List_Book.Rows[a].Cells["pay"].Value?.ToString() ?? "0")
}; };
fb.InitFillBlank(item); fb.InitFillBlank(item);
} }
@@ -1591,7 +1591,7 @@ namespace UniMarc
{ {
if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; if (string.IsNullOrEmpty(fbItem.BookMarc)) continue;
int targetListIdx = int.Parse(fbItem.Idx); int targetListIdx = (fbItem.Idx);
if (targetListIdx >= 0 && targetListIdx < List_Book.Rows.Count) if (targetListIdx >= 0 && targetListIdx < List_Book.Rows.Count)
{ {
List_Book.Rows[targetListIdx].Cells["db_marc"].Value = fbItem.BookMarc; List_Book.Rows[targetListIdx].Cells["db_marc"].Value = fbItem.BookMarc;

View File

@@ -40,7 +40,7 @@ namespace UniMarc
Help008Tag tag008 = new Help008Tag(); Help008Tag tag008 = new Help008Tag();
Skill_Search_Text search_Text = new Skill_Search_Text(); Skill_Search_Text search_Text = new Skill_Search_Text();
String_Text st = new String_Text(); String_Text st = new String_Text();
Mac_List ml; MacListItem ml;
public SortableBindingList<MarcBookItem> dataList = new SortableBindingList<MarcBookItem>(); public SortableBindingList<MarcBookItem> dataList = new SortableBindingList<MarcBookItem>();
public MacEditorParameter Param; public MacEditorParameter Param;
MacListItem pItem = null; MacListItem pItem = null;
@@ -64,12 +64,13 @@ namespace UniMarc
bs1.MovePrevious(); bs1.MovePrevious();
} }
public Marc2(Mac_List _ml) public Marc2(MacListItem _ml)
{ {
InitializeComponent(); InitializeComponent();
ml = _ml; ml = _ml;
mUserName = PUB.user.UserName; mUserName = PUB.user.UserName;
marcEditorControl1.db = this.db; marcEditorControl1.db = this.db;
} }
@@ -80,7 +81,16 @@ namespace UniMarc
comboBox8.Items.AddRange(combo8); comboBox8.Items.AddRange(combo8);
comboBox8.SelectedIndex = 0; comboBox8.SelectedIndex = 0;
this.Show();
Application.DoEvents();
//refresh data
this.input_list(ml);
List_Book.RowPrePaint += List_Book_RowPrePaint; List_Book.RowPrePaint += List_Book_RowPrePaint;
} }
public void input_list() public void input_list()
@@ -108,7 +118,7 @@ namespace UniMarc
/// </summary> /// </summary>
/// <param name="date">목록일자</param> /// <param name="date">목록일자</param>
/// <param name="value">목록명</param> /// <param name="value">목록명</param>
public void input_list(MacListItem item)// ) private void input_list(MacListItem item)// )
{ {
this.pItem = item; this.pItem = item;
//string l_idx, string value, string C_idx, string custidx, string custname //string l_idx, string value, string C_idx, string custidx, string custname
@@ -140,9 +150,10 @@ namespace UniMarc
} }
string Area = "`idx`, `isbn_marc`, `header`, `num`, `book_name`, `author`, `book_comp`, `count`, `pay`, `image_url`, `m_idx`" + string Area = "LB.`idx`, LB.`isbn_marc`, LB.`header`, LB.`num`, LB.`book_name`, LB.`author`, LB.`book_comp`, LB.`count`, LB.`pay`, LB.`image_url`, LB.`m_idx`, LB.category " +
",search_book_name,search_author,search_book_comp,search_description,search_url"; ", LB.`search_book_name`, LB.`search_author`, LB.`search_book_comp`, LB.`search_description`, LB.`search_url` " +
string[] sear_tbl = { "l_idx", "compidx" }; ", M.`compidx` AS m_compidx, M.`marc`, M.`grade`, M.`user` AS m_user, M.`date` AS m_date, C.`comp_name` ";
string[] sear_tbl = { "LB.l_idx", "LB.compidx" };
string[] sear_col = { item.idx, PUB.user.CompanyIdx }; string[] sear_col = { item.idx, PUB.user.CompanyIdx };
lbl_BookDate.Text = $"{item.start_date}"; lbl_BookDate.Text = $"{item.start_date}";
@@ -152,15 +163,12 @@ namespace UniMarc
string cmd = string cmd =
string.Format("SELECT {0} " + string.Format("SELECT {0} " +
"FROM {1} " + "FROM {1} AS LB " +
"WHERE `{2}` = \"{4}\" AND `{3}` = \"{5}\"" + "LEFT JOIN `Marc` AS M ON LB.`m_idx` = M.`idx` " +
"ORDER BY `idx` ASC;", Area, "Obj_List_Book", sear_tbl[0], sear_tbl[1], sear_col[0], sear_col[1]); "LEFT JOIN `Comp` AS C ON M.`compidx` = C.`idx` " +
var db_res = Helper_DB.ExecuteDataTable(cmd);// db.DB_Send_CMD_Search(cmd); "WHERE {2} = \"{4}\" AND {3} = \"{5}\"" +
//string[] db_data = db_res.Split('|'); "ORDER BY LB.`idx` ASC;", Area, "Obj_List_Book", sear_tbl[0], sear_tbl[1], sear_col[0], sear_col[1]);
string[] grid = { var db_res = Helper_DB.ExecuteDataTable(cmd);
"", "", "", "", "",
"", "", "", "", "",
"", "", "V", "", "" };
mLoadCompleted = false; mLoadCompleted = false;
@@ -168,7 +176,7 @@ namespace UniMarc
foreach (DataRow dr in db_res.Rows)// (int a = 0; a < db_data.Length - 1; a += 11) foreach (DataRow dr in db_res.Rows)// (int a = 0; a < db_data.Length - 1; a += 11)
{ {
MarcBookItem bitem = new MarcBookItem(); MarcBookItem bitem = new MarcBookItem();
bitem.ListIdx = dr["idx"]?.ToString() ?? string.Empty; // db_data[a]; // 0: idx bitem.ListIdx = dr["idx"] != DBNull.Value ? Convert.ToInt32(dr["idx"]) : 0; // db_data[a]; // 0: idx
bitem.ISBN13 = dr["isbn_marc"]?.ToString() ?? string.Empty; // db_data[a + 1]; // 1: isbn bitem.ISBN13 = dr["isbn_marc"]?.ToString() ?? string.Empty; // db_data[a + 1]; // 1: isbn
bitem.Num = (dr["header"]?.ToString() ?? string.Empty) +( dr["num"]?.ToString() ?? string.Empty); bitem.Num = (dr["header"]?.ToString() ?? string.Empty) +( dr["num"]?.ToString() ?? string.Empty);
//; //db_data[a + 2] + db_data[a + 3]; // 2: header + num //; //db_data[a + 2] + db_data[a + 3]; // 2: header + num
@@ -176,104 +184,155 @@ namespace UniMarc
bitem.Author = dr["author"]?.ToString() ?? string.Empty; // db_data[a + 5]; // 4: author bitem.Author = dr["author"]?.ToString() ?? string.Empty; // db_data[a + 5]; // 4: author
bitem.BookComp = dr["book_comp"]?.ToString() ?? string.Empty; //db_data[a + 6]; // 5: book_comp bitem.BookComp = dr["book_comp"]?.ToString() ?? string.Empty; //db_data[a + 6]; // 5: book_comp
bitem.Count = dr["count"]?.ToString() ?? string.Empty; // db_data[a + 7]; // 6: count bitem.Count = dr["count"]?.ToString() ?? string.Empty; // db_data[a + 7]; // 6: count
bitem.Pay = dr["pay"]?.ToString() ?? string.Empty; //db_data[a + 8]; // 7: pay bitem.Pay = dr["pay"] != DBNull.Value ? Convert.ToInt32(dr["pay"]) : 0; //db_data[a + 8]; // 7: pay
bitem.Url = dr["image_url"]?.ToString() ?? string.Empty; //db_data[a + 9]; // 8: image_url bitem.Url = dr["image_url"]?.ToString() ?? string.Empty; //db_data[a + 9]; // 8: image_url
bitem.MarcIdx = dr["m_idx"]?.ToString() ?? string.Empty; //db_data[a + 10]; // 9: m_idx bitem.MarcIdx = dr["m_idx"] != DBNull.Value ? Convert.ToInt32(dr["m_idx"]) : 0; //db_data[a + 10]; // 9: m_idx
bitem.category = dr["category"]?.ToString() ?? string.Empty;
bitem.search_book_name = dr["search_book_name"]?.ToString() ?? string.Empty; //db_data[a + 11]; // 9: m_idx bitem.search_book_name = dr["search_book_name"]?.ToString() ?? string.Empty; //db_data[a + 11]; // 9: m_idx
bitem.search_author = dr["search_author"]?.ToString() ?? string.Empty; //db_data[a + 12]; // 9: m_idx bitem.search_author = dr["search_author"]?.ToString() ?? string.Empty; //db_data[a + 12]; // 9: m_idx
bitem.search_book_comp = dr["search_book_comp"]?.ToString() ?? string.Empty; //db_data[a + 13]; // 9: m_idx bitem.search_book_comp = dr["search_book_comp"]?.ToString() ?? string.Empty; //db_data[a + 13]; // 9: m_idx
bitem.search_description = dr["search_description"]?.ToString() ?? string.Empty; // db_data[a + 14]; // 9: m_idx bitem.search_description = dr["search_description"]?.ToString() ?? string.Empty; // db_data[a + 14]; // 9: m_idx
bitem.search_url = dr["search_url"]?.ToString() ?? string.Empty; //db_data[a + 15]; // 9: m_idx bitem.search_url = dr["search_url"]?.ToString() ?? string.Empty;
// Joined MARC data
if (bitem.MarcIdx > 0 && dr["marc"] != DBNull.Value)
{
SetMarcItemInfo(bitem,
bitem.MarcIdx,
dr["m_compidx"]?.ToString() ?? string.Empty,
dr["marc"]?.ToString() ?? string.Empty,
dr["grade"]?.ToString() ?? string.Empty,
dr["m_user"]?.ToString() ?? string.Empty,
dr["m_date"]?.ToString() ?? string.Empty,
dr["comp_name"]?.ToString() ?? string.Empty);
}
else
{
bitem.Grade = "3";
bitem.Status = MarcRecordStatus.None;
}
dataList.Add(bitem); dataList.Add(bitem);
} }
bs1.DataSource = dataList;
List_Book.AutoGenerateColumns = false;
List_Book.DataSource = bs1;
chk_Marc(); chk_Marc();
List_Book.ClearSelection(); List_Book.ClearSelection();
mLoadCompleted = true; mLoadCompleted = true;
if (this.List_Book.RowCount > 0) bs1.DataSource = dataList;
List_Book.Rows[0].Selected = true; List_Book.AutoGenerateColumns = false;
List_Book.DataSource = bs1;
} }
/// <summary> /// <summary>
/// 마크 유무 확인하는 함수 /// 모든 데이터의 마크 유무 확인하는 함수
/// </summary> /// </summary>
void chk_Marc() void chk_Marc()
{ {
// 1. 자사 마크 ISBN 매칭 (m_idx가 0인 항목들 대상)
string qMy = string.Format(
"SELECT LB.`idx` as list_idx, M.`idx` as m_idx, M.`marc`, M.`grade`, M.`user` as m_user, M.`date` as m_date " +
"FROM `Obj_List_Book` LB " +
"JOIN `Marc` M ON LB.`isbn_marc` = M.`ISBN` " +
"WHERE LB.`l_idx` = \"{0}\" AND LB.`compidx` = \"{1}\" AND LB.`m_idx` = 0 " +
"AND M.`compidx` = \"{1}\" " +
"GROUP BY LB.`idx`", ml.idx, mCompidx);
foreach (var dr in this.dataList) // (int a = 0; a < this.dataList.Count; a++) DataTable dtMy = Helper_DB.ExecuteDataTable(qMy);
UpdateFromMatchedTable(dtMy, true);
// 2. 타사 마크 ISBN 매칭 (여전히 m_idx가 0인 항목들 대상)
string qOther = string.Format(
"SELECT LB.`idx` as list_idx, M.`idx` as m_idx, M.`compidx` as m_compidx, M.`marc`, M.`grade`, M.`user` as m_user, M.`date` as m_date, C.`comp_name` " +
"FROM `Obj_List_Book` LB " +
"JOIN `Marc` M ON LB.`isbn_marc` = M.`ISBN` " +
"JOIN `Comp` C ON M.`compidx` = C.`idx` " +
"WHERE LB.`l_idx` = \"{0}\" AND LB.`compidx` = \"{1}\" AND LB.`m_idx` = 0 " +
"AND M.`compidx` != \"{1}\" " +
"GROUP BY LB.`idx`", ml.idx, mCompidx);
DataTable dtOther = Helper_DB.ExecuteDataTable(qOther);
UpdateFromMatchedTable(dtOther, false);
// 3. 최종 정리 (매칭되지 않은 항목들)
foreach (var item in dataList)
{ {
string Area = if (item.MarcIdx <= 0)
// 0 1
"`idx`, `compidx`, " +
// 2 3 4 5 6 7
"`marc`, `marc_chk`, `marc1`, `marc_chk1`, `marc2`, `marc_chk2`, " +
// 8 9 10 11
"`grade`, `008tag`, `user`, `date`";
string Table = "Marc";
string[] sear_tbl = { "ISBN" };
var isbn = dr.ISBN13;//.isbn List_Book.Rows[a].Cells["ISBN13"].Value?.ToString() ?? string.Empty;
string[] sear_col = { isbn };
//if (List_Book.Rows[a].Cells["marc_idx"].Value.ToString() != "0") {//여기 조건이 이상함.. 여기 조건때문에 순서가 잘 못 뜨는 경우 발생..
// sear_tbl[0] = "idx";
// sear_col[0] = List_Book.Rows[a].Cells["marc_idx"].Value.ToString();
//}
string Chk_Cmd = string.Format("SELECT {0} FROM {1} WHERE `{2}` = \"{3}\" ORDER BY FIELD(`compidx`, {4}) DESC;",
Area, Table, sear_tbl[0], sear_col[0], mCompidx);
string Chk_Res = db.DB_Send_CMD_Search(Chk_Cmd);
string[] Chk_Arr = Chk_Res.Split('|');
bool isMyData = true;
if (Chk_Arr.Length < 2) //마크DB에서 데이터가 없다면?
{ {
dr.Grade = "3"; //D등급으로 조정List_Book.Rows[a].Cells["grade"].Value = "3"; item.Grade = "3";
dr.Status = MarcRecordStatus.None; item.Status = MarcRecordStatus.None;
continue;
} }
}
}
if (Chk_Arr[1] != mCompidx) /// <summary>
/// 조인 결과 테이블을 바탕으로 dataList와 DB를 업데이트합니다.
/// </summary>
private void UpdateFromMatchedTable(DataTable dt, bool isMyData)
{
if (dt == null) return;
foreach (DataRow row in dt.Rows)
{
int listIdx = Convert.ToInt32(row["list_idx"]);
var item = dataList.FirstOrDefault(x => x.ListIdx == listIdx);
// 이미 매칭된 경우(MarcIdx > 0)는 건너뜀 (자사 우선순위 보장)
if (item != null && item.MarcIdx <= 0)
{ {
isMyData = false; int midx = Convert.ToInt32(row["m_idx"]);
dr.Status = MarcRecordStatus.OtherCompany; string compIdx = isMyData ? mCompidx : (row["m_compidx"]?.ToString() ?? string.Empty);
string user = row["m_user"]?.ToString() ?? string.Empty;
string compName = isMyData ? "" : (row["comp_name"]?.ToString() ?? string.Empty);
SetMarcItemInfo(item,
midx,
compIdx,
row["marc"]?.ToString() ?? string.Empty,
row["grade"]?.ToString() ?? string.Empty,
user,
row["m_date"]?.ToString() ?? string.Empty,
compName);
// DB에 m_idx 영구 저장
string updCmd = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1};", midx, listIdx);
Helper_DB.ExcuteNonQuery(updCmd);
}
}
}
/// <summary>
/// 마크 아이템의 상태, 등급, 배경색 등을 설정하는 공용 함수
/// </summary>
private void SetMarcItemInfo(MarcBookItem item, int marcIdx, string compIdx, string dbMarc, string grade, string user, string saveDate, string compName = "")
{
bool isMyData = (compIdx == mCompidx);
item.MarcIdx = marcIdx;
item.DbMarc = dbMarc;
item.Grade = grade;
item.SaveDate = saveDate;
item.Status = isMyData ? MarcRecordStatus.MyCompany : MarcRecordStatus.OtherCompany;
if (isMyData)
{
item.User = user;
if (!string.IsNullOrEmpty(saveDate))
{
item.BackColor = GetSaveDateColor(saveDate);
}
}
else
{
if (string.IsNullOrEmpty(compName))
{
string FindCompCmd = string.Format("SELECT `comp_name` FROM `Comp` WHERE `idx` = \"{0}\"", compIdx);
item.User = db.DB_Send_CMD_Search(FindCompCmd).Replace("|", "");
} }
else else
{ {
dr.Status = MarcRecordStatus.MyCompany; item.User = compName;
}
string[] MarcData = { Chk_Arr[2], Chk_Arr[4], Chk_Arr[6] };
string[] CheckData = { Chk_Arr[3], Chk_Arr[5], Chk_Arr[7] };
dr.MarcIdx = Chk_Arr[0]; //List_Book.Rows[a].Cells["marc_idx"].Value = Chk_Arr[0];
dr.DbMarc = MarcData[0];// List_Book.Rows[a].Cells["db_marc"].Value = MarcData[0];//NewestMarc(MarcData, CheckData);
dr.Grade = Chk_Arr[8];// List_Book.Rows[a].Cells["grade"].Value = Chk_Arr[8];
// text008.Text = Chk_Arr[9];
dr.User = Chk_Arr[10];// List_Book.Rows[a].Cells["user"].Value = Chk_Arr[10];
dr.SaveDate = Chk_Arr[11];// List_Book.Rows[a].Cells["SaveDate"].Value = Chk_Arr[11];
if (isMyData)
{
Color saveColor = GetSaveDateColor(Chk_Arr[11]);
dr.BackColor = saveColor;
}
else
{
string FindCompCmd = string.Format("SELECT `comp_name` FROM `Comp` WHERE `idx` = {0}", Chk_Arr[1]);
dr.User = db.DB_Send_CMD_Search(FindCompCmd).Replace("|", "");
dr.BackColor = Color.LightGray;
} }
item.BackColor = Color.LightGray;
} }
} }
@@ -329,6 +388,7 @@ namespace UniMarc
private string mOldMarc = string.Empty; private string mOldMarc = string.Empty;
private int mOldMarIdx = -1;
private void List_Book_SelectionChanged(object sender, EventArgs e) private void List_Book_SelectionChanged(object sender, EventArgs e)
{ {
if (!mLoadCompleted) return; if (!mLoadCompleted) return;
@@ -455,10 +515,12 @@ namespace UniMarc
var dr = this.bs1.Current as MarcBookItem; var dr = this.bs1.Current as MarcBookItem;
//isbn으로 검색을 하게한다.
using (var copySelect = new MarcCopySelect2("isbn", dr.ISBN13)) using (var copySelect = new MarcCopySelect2("isbn", dr.ISBN13))
{ {
if (copySelect.ShowDialog() == DialogResult.OK) if (copySelect.ShowDialog() == DialogResult.OK)
{ {
//사용자가 마크를 선택하면 해당 마크인덱스를 셋팅해준다
var selected = copySelect.SelectedItem; var selected = copySelect.SelectedItem;
dr.MarcIdx = selected.idx; dr.MarcIdx = selected.idx;
dr.User = selected.User; dr.User = selected.User;
@@ -466,6 +528,7 @@ namespace UniMarc
dr.Grade = selected.Grade; dr.Grade = selected.Grade;
// text008.Text = selected.Tag008; // text008.Text = selected.Tag008;
dr.DbMarc = selected.marc_db; dr.DbMarc = selected.marc_db;
dr.Status = PUB.user.CompanyIdx == selected.compidx ? MarcRecordStatus.MyCompany : MarcRecordStatus.OtherCompany;
mOldMarc = selected.marc_db; mOldMarc = selected.marc_db;
// row.ForeColor = SetGradeColor(row.Grade); // Handled by MarcBookItem automatically // row.ForeColor = SetGradeColor(row.Grade); // Handled by MarcBookItem automatically
@@ -474,9 +537,7 @@ namespace UniMarc
var currentitem = this.bs1.Current as MarcBookItem; var currentitem = this.bs1.Current as MarcBookItem;
if (currentitem != null && currentitem == dr) if (currentitem != null && currentitem == dr)
{ {
//List_Book_SelectionChanged(null, null);
bs1_CurrentChanged(null, null); bs1_CurrentChanged(null, null);
//bs1.ResetBindings(false);
} }
} }
} }
@@ -893,7 +954,7 @@ namespace UniMarc
var item = this.dataList.Where(t => t.ListIdx == this.Param.ListIdx).FirstOrDefault(); var item = this.dataList.Where(t => t.ListIdx == this.Param.ListIdx).FirstOrDefault();
if (item == null) return; if (item == null) return;
string table_name = "Marc"; //string table_name = "Marc";
string newsavedMarc = orimarc; string newsavedMarc = orimarc;
// cb_grade.SelectedIndex.ToString(); // 등급은 0~3의 숫자로 저장된다고 가정 // cb_grade.SelectedIndex.ToString(); // 등급은 0~3의 숫자로 저장된다고 가정
@@ -906,34 +967,18 @@ namespace UniMarc
var v_etc1 = this.etc1.Text.Trim(); var v_etc1 = this.etc1.Text.Trim();
var v_etc2 = this.etc2.Text.Trim(); var v_etc2 = this.etc2.Text.Trim();
// 1. DB 작업 (저장 전략 결정: Status 기준) // 1. DB 작업 (공용 메서드로 통합 관리)
if (item.Status == MarcRecordStatus.OtherCompany || item.Status == MarcRecordStatus.None) int targetMarcIdx = (item.Status == MarcRecordStatus.MyCompany) ? item.MarcIdx : 0;
var saveResult = Helper_DB.UpdateMarc(targetMarcIdx, orimarc, uC_SelectGrade1.Grade, v_etc1, v_etc2, this.Param.URL, this.Param.OriginalMarc);
if (saveResult.result == false)
{ {
string[] Insert_tbl = { "ISBN", "서명", "저자", "출판사", "가격", "marc", "비고1", "비고2", "url", "grade", "marc_chk", "user", "division", "008tag", "date", "compidx" }; UTIL.MsgE(saveResult.message);
string[] Insert_col = { this.Param.ISBN13, this.Param.BookName, this.Param.Author, this.Param.Publisher, this.Param.Price, newsavedMarc, this.etc1.Text, this.etc2.Text, this.Param.URL, v_grade, "1", mUserName, this.Param.tag056, this.Param.text008, date, mCompidx }; return;
string Incmd = db.DB_INSERT(table_name, Insert_tbl, Insert_col);
PUB.log.Add("INSERT", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, item.Status, Incmd));
long newIdx = db.DB_Send_CMD_Insert_GetIdx(Incmd);
if (newIdx > 0)
{
item.MarcIdx = newIdx.ToString();
}
} }
else
{
string[] Edit_tbl = { "compidx", "marc", "marc_chk", "marc1", "marc_chk1", "비고1", "비고2", "url", "division", "008tag", "date", "user", "grade" };
string[] Edit_col = { mCompidx, newsavedMarc, "1", this.Param.OriginalMarc, "0", v_etc1, v_etc2, this.Param.URL, this.Param.tag056, this.Param.text008, date, mUserName, v_grade };
string[] Sear_tbl = { "idx", "compidx" };
string[] Sear_col = { item.MarcIdx, mCompidx };
if (string.IsNullOrEmpty(this.Param.ISBN13)) { UTIL.MsgE("ISBN 데이터가 없습니다."); return; } // 새로 생성된 인덱스 반영
item.MarcIdx = saveResult.newidx;
string U_cmd = db.More_Update(table_name, Edit_tbl, Edit_col, Sear_tbl, Sear_col);
PUB.log.Add("Update", string.Format("{0}({1},{2}) : {3}", mUserName, mCompidx, item.Status, U_cmd.Replace("\r", " ").Replace("\n", " ")));
Helper_DB.ExcuteNonQuery(U_cmd);
}
// 2. 객체 데이터 업데이트 및 시각적 상태 계산 // 2. 객체 데이터 업데이트 및 시각적 상태 계산
@@ -942,11 +987,12 @@ namespace UniMarc
item.Grade = v_grade; //등급업데이트추가 item.Grade = v_grade; //등급업데이트추가
// 3. 목록 인덱스 연동 업데이트 (Obj_List_Book) // 3. 목록 인덱스 연동 업데이트 (Obj_List_Book)
string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND `compidx` ={2};", item.MarcIdx, item.ListIdx, mCompidx); string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND `compidx` = \"{2}\";", item.MarcIdx, item.ListIdx, mCompidx);
Helper_DB.ExcuteNonQuery(UpdateListIndex); Helper_DB.ExcuteNonQuery(UpdateListIndex);
// 4. BindingSource 갱신으로 UI 자동 업데이트 // 4. BindingSource 갱신으로 UI 자동 업데이트
bs1.ResetCurrentItem(); bs1.ResetCurrentItem();
bs1_CurrentChanged(null, null);
UTIL.MsgI("저장되었습니다!"); UTIL.MsgI("저장되었습니다!");
} }
@@ -975,7 +1021,7 @@ namespace UniMarc
BookName = item.BookName ?? "", BookName = item.BookName ?? "",
Author = item.Author ?? "", Author = item.Author ?? "",
Publisher = item.BookComp ?? "", Publisher = item.BookComp ?? "",
Price = item.Pay ?? "" Price = item.Pay
}; };
fb.InitFillBlank(fbItem); fb.InitFillBlank(fbItem);
} }
@@ -990,10 +1036,10 @@ namespace UniMarc
{ {
if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; if (string.IsNullOrEmpty(fbItem.BookMarc)) continue;
int targetListIdx = int.Parse(fbItem.Idx); int targetListIdx = fbItem.Idx;
foreach (MarcBookItem item in this.dataList) foreach (MarcBookItem item in this.dataList)
{ {
if (item.ListIdx != null && Convert.ToInt32(item.ListIdx) == targetListIdx) if (item.ListIdx == targetListIdx)
{ {
item.DbMarc = fbItem.BookMarc; item.DbMarc = fbItem.BookMarc;
item.Status = MarcRecordStatus.NewFetched; item.Status = MarcRecordStatus.NewFetched;
@@ -1048,8 +1094,11 @@ namespace UniMarc
//if (row_idx == -1 || col_idx == -1) { return; } //if (row_idx == -1 || col_idx == -1) { return; }
//SaveRowIdx = row_idx; //SaveRowIdx = row_idx;
if (dr.DbMarc != null && dr.DbMarc.Equals(mOldMarc) && dr.MarcIdx.Equals(this.mOldMarIdx)) return;
mOldMarc = dr.DbMarc ?? string.Empty;// List_Book.Rows[row_idx].Cells["db_marc"].Value?.ToString() ?? string.Empty;
mOldMarIdx = dr.MarcIdx;
mOldMarc = dr.DbMarc;// List_Book.Rows[row_idx].Cells["db_marc"].Value?.ToString() ?? string.Empty;
string isbn = dr.ISBN13;// List_Book.Rows[row_idx].Cells["ISBN13"].Value.ToString(); string isbn = dr.ISBN13;// List_Book.Rows[row_idx].Cells["ISBN13"].Value.ToString();
if (isbn != "") if (isbn != "")
{ {
@@ -1074,21 +1123,20 @@ namespace UniMarc
} }
string isbn13 = dr.ISBN13;// List_Book.Rows[row_idx].Cells["ISBN13"].Value?.ToString() ?? ""; string isbn13 = dr.ISBN13;// List_Book.Rows[row_idx].Cells["ISBN13"].Value?.ToString() ?? "";
string bookName = dr.BookName;// List_Book.Rows[row_idx].Cells["book_name"].Value?.ToString() ?? ""; string bookName = dr.BookName;// List_Book.Rows[row_idx].Cells["book_name"].Value?.ToString() ?? "";
string author = dr.Author;// List_Book.Rows[row_idx].Cells["author"].Value?.ToString() ?? ""; string author = dr.Author;// List_Book.Rows[row_idx].Cells["author"].Value?.ToString() ?? "";
string publisher = dr.BookComp;// List_Book.Rows[row_idx].Cells["book_comp"].Value?.ToString() ?? ""; string publisher = dr.BookComp;// List_Book.Rows[row_idx].Cells["book_comp"].Value?.ToString() ?? "";
string price = dr.Pay;// List_Book.Rows[row_idx].Cells["pay"].Value?.ToString() ?? ""; var price = dr.Pay;// List_Book.Rows[row_idx].Cells["pay"].Value?.ToString() ?? "";
string url = dr.Url;// List_Book.Rows[row_idx].Cells["url"].Value?.ToString() ?? ""; // or image_url? string url = dr.Url;// List_Book.Rows[row_idx].Cells["url"].Value?.ToString() ?? ""; // or image_url?
string marcIdx = dr.MarcIdx;// List_Book.Rows[row_idx].Cells["marc_idx"].Value?.ToString() ?? ""; var marcIdx = dr.MarcIdx;// List_Book.Rows[row_idx].Cells["marc_idx"].Value?.ToString() ?? "";
string dbMarc = dr.DbMarc;// List_Book.Rows[row_idx].Cells["db_marc"].Value?.ToString() ?? ""; string dbMarc = dr.DbMarc ?? string.Empty;// List_Book.Rows[row_idx].Cells["db_marc"].Value?.ToString() ?? "";
string grade = dr.Grade;// List_Book.Rows[row_idx].Cells["grade"].Value?.ToString() ?? ""; string grade = dr.Grade;// List_Book.Rows[row_idx].Cells["grade"].Value?.ToString() ?? "";
string user = dr.User;// List_Book.Rows[row_idx].Cells["user"].Value?.ToString() ?? ""; string user = dr.User;// List_Book.Rows[row_idx].Cells["user"].Value?.ToString() ?? "";
string saveDate = dr.SaveDate;// List_Book.Rows[row_idx].Cells["SaveDate"].Value?.ToString() ?? ""; string saveDate = dr.SaveDate;// List_Book.Rows[row_idx].Cells["SaveDate"].Value?.ToString() ?? "";
string listIdx = dr.ListIdx;// List_Book.Rows[row_idx].Cells["list_idx"].Value?.ToString() ?? ""; // verify this column name in input_list var listIdx = dr.ListIdx;// List_Book.Rows[row_idx].Cells["list_idx"].Value?.ToString() ?? ""; // verify this column name in input_list
this.lbListIdx.Text = $"Row:{SaveRowIdx},List:{listIdx}"; this.lbListIdx.Text = $"Row:{bs1.Position},List:{listIdx},Marc:{marcIdx}";
var remark = ReadRemark(dr.MarcIdx); var remark = ReadRemark(dr.MarcIdx.ToString());
this.Param = new MacEditorParameter this.Param = new MacEditorParameter
{ {
ISBN13 = isbn13, ISBN13 = isbn13,
@@ -1126,7 +1174,8 @@ namespace UniMarc
uC_SelectGrade1.Grade = gradeNo; uC_SelectGrade1.Grade = gradeNo;
lbl_SaveData.Text = $"[{user}] [{saveDate}]\n{dr.search_book_name}\n{dr.search_author}\n{dr.search_book_comp}\n{dr.search_description}"; lbl_SaveData.Multiline = true;
lbl_SaveData.Text = $"[{user}-{saveDate}]\r\n{dr.search_book_name}\r\n{dr.search_author}\r\n{dr.search_book_comp}\r\n{dr.category}";
if (dr.search_url.isEmpty()) if (dr.search_url.isEmpty())
{ {
linkLabel1.Enabled = false; linkLabel1.Enabled = false;

View File

@@ -39,10 +39,10 @@
System.Windows.Forms.Label label25; System.Windows.Forms.Label label25;
System.Windows.Forms.Label label26; System.Windows.Forms.Label label26;
System.Windows.Forms.Label label27; System.Windows.Forms.Label label27;
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Marc2)); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Marc2));
this.List_Book = new System.Windows.Forms.DataGridView(); this.List_Book = new System.Windows.Forms.DataGridView();
this.list_idx = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.list_idx = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -79,10 +79,15 @@
this.lbl_BookDate = new System.Windows.Forms.Label(); this.lbl_BookDate = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.bn1 = new System.Windows.Forms.BindingNavigator(this.components); this.bn1 = new System.Windows.Forms.BindingNavigator(this.components);
this.bs1 = new System.Windows.Forms.BindingSource(this.components);
this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel(); this.bindingNavigatorCountItem = new System.Windows.Forms.ToolStripLabel();
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator(); this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox(); this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.bindingNavigatorSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel(); this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
this.lbListIdx = new System.Windows.Forms.ToolStripLabel(); this.lbListIdx = new System.Windows.Forms.ToolStripLabel();
@@ -91,6 +96,7 @@
this.etc1 = new System.Windows.Forms.RichTextBox(); this.etc1 = new System.Windows.Forms.RichTextBox();
this.etc2 = new System.Windows.Forms.RichTextBox(); this.etc2 = new System.Windows.Forms.RichTextBox();
this.panel6 = new System.Windows.Forms.Panel(); this.panel6 = new System.Windows.Forms.Panel();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.btCopy = new System.Windows.Forms.Button(); this.btCopy = new System.Windows.Forms.Button();
this.btn_FillBlank = new System.Windows.Forms.Button(); this.btn_FillBlank = new System.Windows.Forms.Button();
@@ -100,13 +106,7 @@
this.lbl_SaveData = new System.Windows.Forms.TextBox(); this.lbl_SaveData = new System.Windows.Forms.TextBox();
this.btn_Save = new System.Windows.Forms.Button(); this.btn_Save = new System.Windows.Forms.Button();
this.marcEditorControl1 = new UniMarc.MarcEditorControl(); this.marcEditorControl1 = new UniMarc.MarcEditorControl();
this.bs1 = new System.Windows.Forms.BindingSource(this.components);
this.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorMoveNextItem = new System.Windows.Forms.ToolStripButton();
this.bindingNavigatorMoveLastItem = new System.Windows.Forms.ToolStripButton();
this.uC_SelectGrade1 = new UniMarc.UC_SelectGrade(); this.uC_SelectGrade1 = new UniMarc.UC_SelectGrade();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
label31 = new System.Windows.Forms.Label(); label31 = new System.Windows.Forms.Label();
label30 = new System.Windows.Forms.Label(); label30 = new System.Windows.Forms.Label();
label33 = new System.Windows.Forms.Label(); label33 = new System.Windows.Forms.Label();
@@ -123,11 +123,11 @@
this.panel4.SuspendLayout(); this.panel4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bn1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bn1)).BeginInit();
this.bn1.SuspendLayout(); this.bn1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bs1)).BeginInit();
this.panel5.SuspendLayout(); this.panel5.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout();
this.panel6.SuspendLayout(); this.panel6.SuspendLayout();
this.tableLayoutPanel2.SuspendLayout(); this.tableLayoutPanel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.bs1)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// label31 // label31
@@ -207,14 +207,14 @@
this.List_Book.AllowUserToDeleteRows = false; this.List_Book.AllowUserToDeleteRows = false;
this.List_Book.BackgroundColor = System.Drawing.Color.SkyBlue; this.List_Book.BackgroundColor = System.Drawing.Color.SkyBlue;
this.List_Book.BorderStyle = System.Windows.Forms.BorderStyle.None; this.List_Book.BorderStyle = System.Windows.Forms.BorderStyle.None;
dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle29.BackColor = System.Drawing.SystemColors.Control; dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle29.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle29.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle29.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle29.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.List_Book.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle29; this.List_Book.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.List_Book.ColumnHeadersHeight = 29; this.List_Book.ColumnHeadersHeight = 29;
this.List_Book.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.List_Book.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.list_idx, this.list_idx,
@@ -238,14 +238,14 @@
this.List_Book.MultiSelect = false; this.List_Book.MultiSelect = false;
this.List_Book.Name = "List_Book"; this.List_Book.Name = "List_Book";
this.List_Book.ReadOnly = true; this.List_Book.ReadOnly = true;
dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.ControlDark; dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.ControlDark;
dataGridViewCellStyle32.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); dataGridViewCellStyle4.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText; dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight; dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText; dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.List_Book.RowHeadersDefaultCellStyle = dataGridViewCellStyle32; this.List_Book.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.List_Book.RowHeadersWidth = 51; this.List_Book.RowHeadersWidth = 51;
this.List_Book.RowTemplate.Height = 23; this.List_Book.RowTemplate.Height = 23;
this.List_Book.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; this.List_Book.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
@@ -371,8 +371,8 @@
// colCheck // colCheck
// //
this.colCheck.DataPropertyName = "ColCheck"; this.colCheck.DataPropertyName = "ColCheck";
dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colCheck.DefaultCellStyle = dataGridViewCellStyle30; this.colCheck.DefaultCellStyle = dataGridViewCellStyle2;
this.colCheck.HeaderText = "V"; this.colCheck.HeaderText = "V";
this.colCheck.MinimumWidth = 6; this.colCheck.MinimumWidth = 6;
this.colCheck.Name = "colCheck"; this.colCheck.Name = "colCheck";
@@ -403,9 +403,9 @@
// grade // grade
// //
this.grade.DataPropertyName = "Grade"; this.grade.DataPropertyName = "Grade";
dataGridViewCellStyle31.Format = "N0"; dataGridViewCellStyle3.Format = "N0";
dataGridViewCellStyle31.NullValue = null; dataGridViewCellStyle3.NullValue = null;
this.grade.DefaultCellStyle = dataGridViewCellStyle31; this.grade.DefaultCellStyle = dataGridViewCellStyle3;
this.grade.HeaderText = "등급"; this.grade.HeaderText = "등급";
this.grade.MinimumWidth = 6; this.grade.MinimumWidth = 6;
this.grade.Name = "grade"; this.grade.Name = "grade";
@@ -646,6 +646,10 @@
this.bn1.TabIndex = 326; this.bn1.TabIndex = 326;
this.bn1.Text = "bindingNavigator1"; this.bn1.Text = "bindingNavigator1";
// //
// bs1
//
this.bs1.CurrentChanged += new System.EventHandler(this.bs1_CurrentChanged);
//
// bindingNavigatorCountItem // bindingNavigatorCountItem
// //
this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem"; this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
@@ -653,6 +657,24 @@
this.bindingNavigatorCountItem.Text = "/{0}"; this.bindingNavigatorCountItem.Text = "/{0}";
this.bindingNavigatorCountItem.ToolTipText = "전체 항목 수"; this.bindingNavigatorCountItem.ToolTipText = "전체 항목 수";
// //
// bindingNavigatorMoveFirstItem
//
this.bindingNavigatorMoveFirstItem.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.bindingNavigatorMoveFirstItem.Image = ((System.Drawing.Image)(resources.GetObject("bindingNavigatorMoveFirstItem.Image")));
this.bindingNavigatorMoveFirstItem.Name = "bindingNavigatorMoveFirstItem";
this.bindingNavigatorMoveFirstItem.RightToLeftAutoMirrorImage = true;
this.bindingNavigatorMoveFirstItem.Size = new System.Drawing.Size(24, 24);
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(24, 24);
this.bindingNavigatorMovePreviousItem.Text = "이전으로 이동";
//
// bindingNavigatorSeparator // bindingNavigatorSeparator
// //
this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator"; this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
@@ -662,7 +684,6 @@
// //
this.bindingNavigatorPositionItem.AccessibleName = "위치"; this.bindingNavigatorPositionItem.AccessibleName = "위치";
this.bindingNavigatorPositionItem.AutoSize = false; this.bindingNavigatorPositionItem.AutoSize = false;
this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("맑은 고딕", 9F);
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem"; this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23); this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
this.bindingNavigatorPositionItem.Text = "0"; this.bindingNavigatorPositionItem.Text = "0";
@@ -673,6 +694,24 @@
this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1"; this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 27); this.bindingNavigatorSeparator1.Size = new System.Drawing.Size(6, 27);
// //
// 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(24, 24);
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(24, 24);
this.bindingNavigatorMoveLastItem.Text = "마지막으로 이동";
//
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
@@ -755,6 +794,17 @@
this.panel6.TabIndex = 1; this.panel6.TabIndex = 1;
this.panel6.Paint += new System.Windows.Forms.PaintEventHandler(this.panel6_Paint); this.panel6.Paint += new System.Windows.Forms.PaintEventHandler(this.panel6_Paint);
// //
// linkLabel1
//
this.linkLabel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.linkLabel1.Location = new System.Drawing.Point(0, 201);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(266, 14);
this.linkLabel1.TabIndex = 408;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "search url";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// tableLayoutPanel2 // tableLayoutPanel2
// //
this.tableLayoutPanel2.ColumnCount = 2; this.tableLayoutPanel2.ColumnCount = 2;
@@ -830,12 +880,12 @@
// lbl_SaveData // lbl_SaveData
// //
this.lbl_SaveData.BackColor = System.Drawing.Color.SkyBlue; this.lbl_SaveData.BackColor = System.Drawing.Color.SkyBlue;
this.lbl_SaveData.Font = new System.Drawing.Font("굴림체", 11F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129))); this.lbl_SaveData.Font = new System.Drawing.Font("굴림체", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.lbl_SaveData.ForeColor = System.Drawing.Color.Black; this.lbl_SaveData.ForeColor = System.Drawing.Color.Black;
this.lbl_SaveData.Location = new System.Drawing.Point(13, 78); this.lbl_SaveData.Location = new System.Drawing.Point(5, 78);
this.lbl_SaveData.Multiline = true; this.lbl_SaveData.Multiline = true;
this.lbl_SaveData.Name = "lbl_SaveData"; this.lbl_SaveData.Name = "lbl_SaveData";
this.lbl_SaveData.Size = new System.Drawing.Size(241, 114); this.lbl_SaveData.Size = new System.Drawing.Size(255, 119);
this.lbl_SaveData.TabIndex = 319; this.lbl_SaveData.TabIndex = 319;
this.lbl_SaveData.Text = "[] []"; this.lbl_SaveData.Text = "[] []";
// //
@@ -859,46 +909,6 @@
this.marcEditorControl1.Size = new System.Drawing.Size(1030, 658); this.marcEditorControl1.Size = new System.Drawing.Size(1030, 658);
this.marcEditorControl1.TabIndex = 0; this.marcEditorControl1.TabIndex = 0;
// //
// bs1
//
this.bs1.CurrentChanged += new System.EventHandler(this.bs1_CurrentChanged);
//
// 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(24, 24);
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(24, 24);
this.bindingNavigatorMovePreviousItem.Text = "이전으로 이동";
//
// 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(24, 24);
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(24, 24);
this.bindingNavigatorMoveLastItem.Text = "마지막으로 이동";
//
// uC_SelectGrade1 // uC_SelectGrade1
// //
this.uC_SelectGrade1.BackColor = System.Drawing.Color.White; this.uC_SelectGrade1.BackColor = System.Drawing.Color.White;
@@ -909,17 +919,6 @@
this.uC_SelectGrade1.Size = new System.Drawing.Size(241, 28); this.uC_SelectGrade1.Size = new System.Drawing.Size(241, 28);
this.uC_SelectGrade1.TabIndex = 407; this.uC_SelectGrade1.TabIndex = 407;
// //
// linkLabel1
//
this.linkLabel1.Dock = System.Windows.Forms.DockStyle.Bottom;
this.linkLabel1.Location = new System.Drawing.Point(0, 201);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(266, 14);
this.linkLabel1.TabIndex = 408;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "search url";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// Marc2 // Marc2
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
@@ -943,12 +942,12 @@
((System.ComponentModel.ISupportInitialize)(this.bn1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bn1)).EndInit();
this.bn1.ResumeLayout(false); this.bn1.ResumeLayout(false);
this.bn1.PerformLayout(); this.bn1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.bs1)).EndInit();
this.panel5.ResumeLayout(false); this.panel5.ResumeLayout(false);
this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false);
this.panel6.ResumeLayout(false); this.panel6.ResumeLayout(false);
this.panel6.PerformLayout(); this.panel6.PerformLayout();
this.tableLayoutPanel2.ResumeLayout(false); this.tableLayoutPanel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.bs1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);
} }

View File

@@ -195,9 +195,6 @@
<metadata name="bn1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="bn1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>218, 13</value> <value>218, 13</value>
</metadata> </metadata>
<metadata name="bn1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>218, 13</value>
</metadata>
<metadata name="bs1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="bs1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>108, 13</value> <value>108, 13</value>
</metadata> </metadata>

View File

@@ -87,7 +87,7 @@ namespace UniMarc
this.dataGridView1.Name = "dataGridView1"; this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true; this.dataGridView1.ReadOnly = true;
this.dataGridView1.RowTemplate.Height = 23; this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1293, 210); this.dataGridView1.Size = new System.Drawing.Size(1571, 210);
this.dataGridView1.TabIndex = 0; this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick); this.dataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick); this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
@@ -106,7 +106,7 @@ namespace UniMarc
this.panel1.Dock = System.Windows.Forms.DockStyle.Top; this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1"; this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1293, 33); this.panel1.Size = new System.Drawing.Size(1571, 33);
this.panel1.TabIndex = 1; this.panel1.TabIndex = 1;
// //
// progressBar1 // progressBar1
@@ -185,7 +185,7 @@ namespace UniMarc
this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
this.panel2.Location = new System.Drawing.Point(0, 33); this.panel2.Location = new System.Drawing.Point(0, 33);
this.panel2.Name = "panel2"; this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1293, 237); this.panel2.Size = new System.Drawing.Size(1571, 237);
this.panel2.TabIndex = 2; this.panel2.TabIndex = 2;
// //
// bindingNavigator1 // bindingNavigator1
@@ -213,7 +213,7 @@ namespace UniMarc
this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem; this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
this.bindingNavigator1.Name = "bindingNavigator1"; this.bindingNavigator1.Name = "bindingNavigator1";
this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem; this.bindingNavigator1.PositionItem = this.bindingNavigatorPositionItem;
this.bindingNavigator1.Size = new System.Drawing.Size(1293, 27); this.bindingNavigator1.Size = new System.Drawing.Size(1571, 27);
this.bindingNavigator1.TabIndex = 4; this.bindingNavigator1.TabIndex = 4;
this.bindingNavigator1.Text = "bindingNavigator1"; this.bindingNavigator1.Text = "bindingNavigator1";
// //
@@ -251,7 +251,6 @@ namespace UniMarc
// //
this.bindingNavigatorPositionItem.AccessibleName = "위치"; this.bindingNavigatorPositionItem.AccessibleName = "위치";
this.bindingNavigatorPositionItem.AutoSize = false; this.bindingNavigatorPositionItem.AutoSize = false;
this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("맑은 고딕", 9F);
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem"; this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23); this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
this.bindingNavigatorPositionItem.Text = "0"; this.bindingNavigatorPositionItem.Text = "0";
@@ -293,7 +292,7 @@ namespace UniMarc
this.richTextBox1.Font = new System.Drawing.Font("굴림체", 11.25F); this.richTextBox1.Font = new System.Drawing.Font("굴림체", 11.25F);
this.richTextBox1.Location = new System.Drawing.Point(0, 0); this.richTextBox1.Location = new System.Drawing.Point(0, 0);
this.richTextBox1.Name = "richTextBox1"; this.richTextBox1.Name = "richTextBox1";
this.richTextBox1.Size = new System.Drawing.Size(1050, 528); this.richTextBox1.Size = new System.Drawing.Size(1328, 611);
this.richTextBox1.TabIndex = 0; this.richTextBox1.TabIndex = 0;
this.richTextBox1.Text = ""; this.richTextBox1.Text = "";
// //
@@ -304,7 +303,7 @@ namespace UniMarc
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel3.Location = new System.Drawing.Point(0, 270); this.panel3.Location = new System.Drawing.Point(0, 270);
this.panel3.Name = "panel3"; this.panel3.Name = "panel3";
this.panel3.Size = new System.Drawing.Size(1293, 528); this.panel3.Size = new System.Drawing.Size(1571, 611);
this.panel3.TabIndex = 3; this.panel3.TabIndex = 3;
// //
// tableLayoutPanel1 // tableLayoutPanel1
@@ -314,12 +313,12 @@ namespace UniMarc
this.tableLayoutPanel1.Controls.Add(this.rtEtc1, 0, 0); this.tableLayoutPanel1.Controls.Add(this.rtEtc1, 0, 0);
this.tableLayoutPanel1.Controls.Add(this.rtEtc2, 0, 1); this.tableLayoutPanel1.Controls.Add(this.rtEtc2, 0, 1);
this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Right; this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Right;
this.tableLayoutPanel1.Location = new System.Drawing.Point(1050, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(1328, 0);
this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.Name = "tableLayoutPanel1";
this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowCount = 2;
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(243, 528); this.tableLayoutPanel1.Size = new System.Drawing.Size(243, 611);
this.tableLayoutPanel1.TabIndex = 1; this.tableLayoutPanel1.TabIndex = 1;
// //
// rtEtc1 // rtEtc1
@@ -329,7 +328,7 @@ namespace UniMarc
this.rtEtc1.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); this.rtEtc1.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.rtEtc1.Location = new System.Drawing.Point(3, 3); this.rtEtc1.Location = new System.Drawing.Point(3, 3);
this.rtEtc1.Name = "rtEtc1"; this.rtEtc1.Name = "rtEtc1";
this.rtEtc1.Size = new System.Drawing.Size(237, 258); this.rtEtc1.Size = new System.Drawing.Size(237, 299);
this.rtEtc1.TabIndex = 32; this.rtEtc1.TabIndex = 32;
this.rtEtc1.Text = "Remark1"; this.rtEtc1.Text = "Remark1";
// //
@@ -338,9 +337,9 @@ namespace UniMarc
this.rtEtc2.BackColor = System.Drawing.SystemColors.ScrollBar; this.rtEtc2.BackColor = System.Drawing.SystemColors.ScrollBar;
this.rtEtc2.Dock = System.Windows.Forms.DockStyle.Fill; this.rtEtc2.Dock = System.Windows.Forms.DockStyle.Fill;
this.rtEtc2.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129))); this.rtEtc2.Font = new System.Drawing.Font("굴림체", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
this.rtEtc2.Location = new System.Drawing.Point(3, 267); this.rtEtc2.Location = new System.Drawing.Point(3, 308);
this.rtEtc2.Name = "rtEtc2"; this.rtEtc2.Name = "rtEtc2";
this.rtEtc2.Size = new System.Drawing.Size(237, 258); this.rtEtc2.Size = new System.Drawing.Size(237, 300);
this.rtEtc2.TabIndex = 32; this.rtEtc2.TabIndex = 32;
this.rtEtc2.Text = "Remark2"; this.rtEtc2.Text = "Remark2";
// //
@@ -348,7 +347,7 @@ namespace UniMarc
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1293, 798); this.ClientSize = new System.Drawing.Size(1571, 881);
this.Controls.Add(this.panel3); this.Controls.Add(this.panel3);
this.Controls.Add(this.panel2); this.Controls.Add(this.panel2);
this.Controls.Add(this.panel1); this.Controls.Add(this.panel1);

View File

@@ -1,4 +1,5 @@
using AR; using AR;
using Microsoft.Office.Interop.Excel;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel; using System.ComponentModel;
@@ -65,11 +66,14 @@ namespace UniMarc
// 5 6 7 8 9 // 5 6 7 8 9
"`출판사` AS Comp, `user`, `date`, `grade`, `008tag`, " + "`출판사` AS Comp, `user`, `date`, `grade`, `008tag`, " +
// 10 11 12 13 14 15 // 10 11 12 13 14 15
"`marc` AS marc_db, `marc_chk`, `marc1`, `marc_chk1`, `marc2`, `marc_chk2`, `비고1` as remark1, `비고2` as remark2"; "`marc` AS marc_db, `marc_chk`, `marc1`, `marc_chk1`, `marc2`, `marc_chk2`, `비고1` as remark1, `비고2` as remark2," +
"권차,권차서명, `총서명`, `총서번호`, `출판년월`, `판차` as pancha, " +
"TRIM(CONCAT(IFNULL(권차, ''), ' ', IFNULL(권차서명, ''))) AS KwonchaFull, " +
"TRIM(CONCAT(IFNULL(`총서명`, ''), ' ', IFNULL(`총서번호`, ''))) AS TotalTitleFull";
string Table = "Marc"; string Table = "Marc";
string Query = string.Format("SELECT {0} FROM {1} WHERE `{2}` like \"%{3}%\";", Area, Table, search_col, search_Target); string Query = string.Format("SELECT {0} FROM {1} WHERE `{2}` like \"%{3}%\";", Area, Table, search_col, search_Target);
DataTable dt = db.DB_Send_CMD_Search_DataTable(Query); var dt = db.DB_Send_CMD_Search_DataTable(Query);
InputGrid(dt); InputGrid(dt);
} }
@@ -85,7 +89,11 @@ namespace UniMarc
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "ISBN", HeaderText = "ISBN", Name = "isbn", Width = 100 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "ISBN", HeaderText = "ISBN", Name = "isbn", Width = 100 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Title", HeaderText = "서명", Name = "Title", Width = 200 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Title", HeaderText = "서명", Name = "Title", Width = 200 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Author", HeaderText = "저자", Name = "Author", Width = 150 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Author", HeaderText = "저자", Name = "Author", Width = 150 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "KwonchaFull", HeaderText = "권차", Name = "KwonchaFull", Width = 150 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "TotalTitleFull", HeaderText = "총서명", Name = "TotalTitleFull", Width = 180 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Comp", HeaderText = "출판사", Name = "Comp", Width = 150 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Comp", HeaderText = "출판사", Name = "Comp", Width = 150 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "pancha", HeaderText = "판차", Name = "pancha", Width = 100 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "publishdate", HeaderText = "출판년월", Name = "publishdate", Width = 150 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "User", HeaderText = "수정자", Name = "user", Width = 120 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "User", HeaderText = "수정자", Name = "user", Width = 120 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Date", HeaderText = "수정시각", Name = "date", Width = 150 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Date", HeaderText = "수정시각", Name = "date", Width = 150 });
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "DisplayGrade", HeaderText = "등급", Name = "grade", Width = 60 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "DisplayGrade", HeaderText = "등급", Name = "grade", Width = 60 });
@@ -93,7 +101,7 @@ namespace UniMarc
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Marc", HeaderText = "Marc", Name = "marc", Width = 200 }); dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "Marc", HeaderText = "Marc", Name = "marc", Width = 200 });
} }
private void InputGrid(DataTable dt) private void InputGrid(System.Data.DataTable dt)
{ {
_list.Clear(); _list.Clear();
if (dt == null || dt.Rows.Count == 0) return; if (dt == null || dt.Rows.Count == 0) return;
@@ -105,11 +113,17 @@ namespace UniMarc
{ {
var item = new MarcCopyItem var item = new MarcCopyItem
{ {
idx = row["idx"].ToString(), idx = Convert.ToInt32( row["idx"]),
compidx = row["compidx"].ToString(), compidx = row["compidx"].ToString(),
ISBN = row["ISBN"].ToString(), ISBN = row["ISBN"].ToString(),
Title = row["Title"].ToString(), Title = row["Title"].ToString(),
Author = row["Author"].ToString(), Author = row["Author"].ToString(),
KwonchaFull = row["KwonchaFull"].ToString(),
TotalTitleFull = row["TotalTitleFull"].ToString(),
pancha = row["pancha"].ToString(),
publishdate = row["출판년월"].ToString(),
Comp = row["Comp"].ToString(), Comp = row["Comp"].ToString(),
User = row["user"].ToString(), User = row["user"].ToString(),
Date = row["date"].ToString(), Date = row["date"].ToString(),
@@ -306,7 +320,7 @@ namespace UniMarc
var item = (MarcCopyItem)dataGridView1.Rows[row].DataBoundItem; var item = (MarcCopyItem)dataGridView1.Rows[row].DataBoundItem;
if (item == null) return; if (item == null) return;
string idx = item.idx; var idx = item.idx;
string compidx = item.compidx; string compidx = item.compidx;
if (compidx != PUB.user.CompanyIdx) if (compidx != PUB.user.CompanyIdx)
@@ -315,7 +329,7 @@ namespace UniMarc
return; return;
} }
if (UTIL.MsgQ("삭제하시겠습니까?") == DialogResult.Cancel) if (UTIL.MsgQ($"삭제하시겠습니까?\nIDX:{item.idx}") == DialogResult.Cancel)
return; return;
string User = PUB.user.UserName; string User = PUB.user.UserName;

View File

@@ -127,7 +127,7 @@
<data name="bindingNavigatorMoveFirstItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="bindingNavigatorMoveFirstItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAATFJREFUOE9jYBg0oHDW8/9NC57/z5z4+D+6HAyEtz/AKceQO/PZ/1VH3v/HpSi+ wAAADsABataJCQAAATFJREFUOE9jYBg0oHDW8/9NC57/z5z4+D+6HAyEtz/AKceQO/PZ/1VH3v/HpSi+
+8H/4IZrWOXAIGPK0/8L933Aqii+5+H/pfv///evvoAhBwcJPU/+T9vyHkNRRPt9sObMWf//e5WewG1A +8H/4IZrWOXAIGPK0/8L933Aqii+5+H/pfv///evvoAhBwcJPU/+T9vyHkNRRPt9sObMWf//e5WewG1A
ZNej/72rP6AoCm29B9bcuu7/f//Ov/9d8g/gNiCw+eH/uvnv4IqCW+7+X7T3//+Odf//Z8z5+d+u7ud/ ZNej/72rP6AoCm29B9bcuu7/f//Ov/9d8g/gNiCw+eH/uvnv4IqCW+7+X7T3//+Odf//Z8z5+d+u7ud/
+4ztuA3wqLr/P3/aGxRFdsW3/6fP+f3fv+vbf53Cd/8tEtbjNsC+9O7/7MmvMRTpp5z/b1L04r9K1qf/ +4ztuA3wqLr/P3/aGxRFdsW3/6fP+f3fv+vbf53Cd/8tEtbjNsC+9O7/7MmvMRTpp5z/b1L04r9K1qf/
@@ -138,7 +138,7 @@
<data name="bindingNavigatorMovePreviousItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="bindingNavigatorMovePreviousItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAALtJREFUOE9jYBgyILz9wX90MaJBfPeD/8EN18gzIL7n4f+l+///96++QLoBEe33 wAAADsABataJCQAAALtJREFUOE9jYBgyILz9wX90MaJBfPeD/8EN18gzIL7n4f+l+///96++QLoBEe33
wZozZ/3/71V6gjQDQlvvgTW3rvv/37/z73+X/APEGxDccvf/or3//3es+/8/Y87P/3Z1P//bZ2wn3gAQ wZozZ/3/71V6gjQDQlvvgTW3rvv/37/z73+X/APEGxDccvf/or3//3es+/8/Y87P/3Z1P//bZ2wn3gAQ
sCu+/T99zu///l3f/usUvvtvkbCeNANAQD/l/H+Tohf/VbI+/TeOXEa6ASBgkHTiv2za1/+6wfPIMwAE sCu+/T99zu///l3f/usUvvtvkbCeNANAQD/l/H+Tohf/VbI+/TeOXEa6ASBgkHTiv2za1/+6wfPIMwAE
9FMv/9fwnUa+ASCg4jGBMgMGLwAA0BRgmCws/7cAAAAASUVORK5CYII= 9FMv/9fwnUa+ASCg4jGBMgMGLwAA0BRgmCws/7cAAAAASUVORK5CYII=
@@ -147,7 +147,7 @@
<data name="bindingNavigatorMoveNextItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="bindingNavigatorMoveNextItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5 wAAADsABataJCQAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5
8n/2vl//O7f+/e9Wepl0QyK7Hv2fsu3X/5Klf/8nTP/73yb3LGmGBDY//N+69j1Ys3HJl//S0df+G0cu 8n/2vl//O7f+/e9Wepl0QyK7Hv2fsu3X/5Klf/8nTP/73yb3LGmGBDY//N+69j1Ys3HJl//S0df+G0cu
I94Qj6r7/0vmvoNrVnTpIV4zCNiX3v0f2PKMPM0gYJF3579NwRXyNIOAYdZt8jWDgE7aDfI1D00AAKB+ I94Qj6r7/0vmvoNrVnTpIV4zCNiX3v0f2PKMPM0gYJF3579NwRXyNIOAYdZt8jWDgE7aDfI1D00AAKB+
X6Bjq5qXAAAAAElFTkSuQmCC X6Bjq5qXAAAAAElFTkSuQmCC
@@ -156,7 +156,7 @@
<data name="bindingNavigatorMoveLastItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="bindingNavigatorMoveLastItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
wQAADsEBuJFr7QAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe wAAADsABataJCQAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe
/w9vf4BVHgwypjz9P2//7/8JXXcwFIHkFu778D+44RqGHBwk9Dz5P3vfr/+dW//+dyu9jKIQJDdty/v/ /w9vf4BVHgwypjz9P2//7/8JXXcwFIHkFu778D+44RqGHBwk9Dz5P3vfr/+dW//+dyu9jKIQJDdty/v/
/tUXcBsQ2fXo/5Rtv/6XLP37P2H63/82uWfhikFyvas//PcqPYHbgMDmh/9b174HazYu+fJfOvraf+PI /tUXcBsQ2fXo/5Rtv/6XLP37P2H63/82uWfhikFyvas//PcqPYHbgMDmh/9b174HazYu+fJfOvraf+PI
ZWANILm6+e/+u+QfwG2AR9X9/yVz38E1K7r0wBWD5PKnvflvn7EdtwH2pXf/B7Y8w9AMk8ue/Pq/RcJ6 ZWANILm6+e/+u+QfwG2AR9X9/yVz38E1K7r0wBWD5PKnvflvn7EdtwH2pXf/B7Y8w9AMk8ue/Pq/RcJ6

View File

@@ -569,8 +569,8 @@ namespace UniMarc
{ {
// 마크 데이터 // 마크 데이터
//string Marc_data = List_Book.Rows[row].Cells["db_marc"].Value.ToString(); //string Marc_data = List_Book.Rows[row].Cells["db_marc"].Value.ToString();
var marclen = Marc_data?.Length ?? 0;
if (Marc_data.Length < 3) return false; if (marclen < 3) return false;
string result = string.Empty; string result = string.Empty;

View File

@@ -301,10 +301,10 @@ namespace UniMarc
var rlt = Helper_DB.ExcuteNonQuery(cmd); var rlt = Helper_DB.ExcuteNonQuery(cmd);
if (rlt.applyCount == 1) if (rlt.applyCount == 1)
{ {
UTIL.MsgI("저장되었습니다."); UTIL.MsgI("저장되었습니다.");
this.DialogResult = DialogResult.OK; this.DialogResult = DialogResult.OK;
this.Close(); this.Close();
} }
else else
{ {
UTIL.MsgE(rlt.errorMessage); UTIL.MsgE(rlt.errorMessage);

View File

@@ -289,7 +289,7 @@ namespace UniMarc
isBreak = false; isBreak = false;
var item = (FillBlankItem)bs1.List[a]; var item = (FillBlankItem)bs1.List[a];
int idx = int.Parse(item.Idx); int idx = item.Idx;
string isbn = item.Isbn; string isbn = item.Isbn;
if (string.IsNullOrEmpty(isbn)) if (string.IsNullOrEmpty(isbn))

View File

@@ -106,7 +106,7 @@ namespace UniMarc
{ {
bs1.DataSource = sub.ResultItems; bs1.DataSource = sub.ResultItems;
} }
else if (!string.IsNullOrEmpty(sub.ResultIdx)) else if (sub.ResultIdx >= 0)
{ {
mk_Grid(sub.ResultListName, sub.ResultDate); mk_Grid(sub.ResultListName, sub.ResultDate);
mk_Panel(sub.ResultIdx, sub.ResultListName, sub.ResultDate); mk_Panel(sub.ResultIdx, sub.ResultListName, sub.ResultDate);
@@ -154,7 +154,7 @@ namespace UniMarc
foreach (DataRow dr in res.Rows) foreach (DataRow dr in res.Rows)
{ {
MarcPlanItem item = new MarcPlanItem(); MarcPlanItem item = new MarcPlanItem();
item.Idx = dr["idx"].ToString(); item.Idx = dr["idx"] != DBNull.Value ? Convert.ToInt32(dr["idx"]) : 0;
item.Num = dr["num"].ToString(); item.Num = dr["num"].ToString();
if (string.IsNullOrEmpty(item.Num)) if (string.IsNullOrEmpty(item.Num))
{ {
@@ -173,8 +173,8 @@ namespace UniMarc
item.SBookNum2 = dr["s_book_num2"].ToString(); item.SBookNum2 = dr["s_book_num2"].ToString();
item.Author = dr["author"].ToString(); item.Author = dr["author"].ToString();
item.BookComp = dr["book_comp"].ToString(); item.BookComp = dr["book_comp"].ToString();
item.Price = dr["price"].ToString(); item.Price = dr["price"] != DBNull.Value ? Convert.ToInt32(dr["price"]) : 0;
item.Midx = dr["midx"].ToString(); item.Midx = dr["midx"] != DBNull.Value ? Convert.ToInt32(dr["midx"]) : 0;
item.etc1 = dr["etc1"]?.ToString() ?? string.Empty; item.etc1 = dr["etc1"]?.ToString() ?? string.Empty;
item.etc2 = dr["etc2"]?.ToString() ?? string.Empty; item.etc2 = dr["etc2"]?.ToString() ?? string.Empty;
item.grade = dr["grade"] != DBNull.Value ? Convert.ToInt32(dr["grade"]) : -1; item.grade = dr["grade"] != DBNull.Value ? Convert.ToInt32(dr["grade"]) : -1;
@@ -212,12 +212,12 @@ namespace UniMarc
} }
public void mk_Panel(string idx, string ListName, string date) public void mk_Panel(int idx, string ListName, string date)
{ {
string Table = "Specs_List"; string Table = "Specs_List";
string Area = "`first_Author`, `symbol_Author`,`symbol_AuthorE`, `book_Author`, `divType`, `divNum`"; string Area = "`first_Author`, `symbol_Author`,`symbol_AuthorE`, `book_Author`, `divType`, `divNum`";
string[] Search_col = { "idx", "work_list", "date" }; string[] Search_col = { "idx", "work_list", "date" };
string[] Search_data = { idx, ListName, date }; string[] Search_data = { idx.ToString(), ListName, date };
string cmd = db.More_DB_Search(Table, Search_col, Search_data, Area); string cmd = db.More_DB_Search(Table, Search_col, Search_data, Area);
string res = db.DB_Send_CMD_Search(cmd); string res = db.DB_Send_CMD_Search(cmd);
@@ -257,10 +257,10 @@ namespace UniMarc
string bookName = item.BookName; string bookName = item.BookName;
string author = item.Author; string author = item.Author;
string publisher = item.BookComp; string publisher = item.BookComp;
string price = item.Price; var price = item.Price;
string isbn = item.Isbn; string isbn = item.Isbn;
string idx = item.Idx; var idx = item.Idx;
string midx = item.Midx; var midx = item.Midx;
string marc = item.Marc; string marc = item.Marc;
string cmd = string.Format("SELECT `user`, `editDate`, `etc1`, `etc2` FROM `Specs_Marc` WHERE `idx` = \"{0}\"", midx); string cmd = string.Format("SELECT `user`, `editDate`, `etc1`, `etc2` FROM `Specs_Marc` WHERE `idx` = \"{0}\"", midx);
@@ -384,12 +384,12 @@ namespace UniMarc
{ {
var item = new FillBlankItem var item = new FillBlankItem
{ {
Idx = a.ToString(), Idx = a,
Isbn = mItem.Isbn ?? "", Isbn = mItem.Isbn ?? "",
BookName = mItem.BookName ?? "", BookName = mItem.BookName ?? "",
Author = mItem.Author ?? "", Author = mItem.Author ?? "",
Publisher = mItem.BookComp ?? "", Publisher = mItem.BookComp ?? "",
Price = mItem.Price ?? "" Price = mItem.Price
}; };
dataList.Add(item); dataList.Add(item);
} }
@@ -407,7 +407,7 @@ namespace UniMarc
{ {
if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; if (string.IsNullOrEmpty(fbItem.BookMarc)) continue;
int rowIdx = int.Parse(fbItem.Idx); int rowIdx = fbItem.Idx;
if (rowIdx >= 0 && rowIdx < bs1.Count) if (rowIdx >= 0 && rowIdx < bs1.Count)
{ {
var mItem = (MarcPlanItem)bs1.List[rowIdx]; var mItem = (MarcPlanItem)bs1.List[rowIdx];
@@ -1692,12 +1692,12 @@ namespace UniMarc
{ {
var fbItem = new FillBlankItem var fbItem = new FillBlankItem
{ {
Idx = a.ToString(), // 그리드 순서를 인덱스로 사용 Idx = a, // 그리드 순서를 인덱스로 사용
Isbn = item.Isbn ?? "", Isbn = item.Isbn ?? "",
BookName = item.BookName ?? "", BookName = item.BookName ?? "",
Author = item.Author ?? "", Author = item.Author ?? "",
Publisher = item.BookComp ?? "", Publisher = item.BookComp ?? "",
Price = item.Price ?? "" Price = item.Price
}; };
fb.InitFillBlank(fbItem); fb.InitFillBlank(fbItem);
} }
@@ -1711,7 +1711,7 @@ namespace UniMarc
{ {
if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; if (string.IsNullOrEmpty(fbItem.BookMarc)) continue;
int targetIdx = int.Parse(fbItem.Idx); int targetIdx = fbItem.Idx;
if (targetIdx >= 0 && targetIdx < bs1.Count) if (targetIdx >= 0 && targetIdx < bs1.Count)
{ {
var item = bs1.List[targetIdx] as MarcPlanItem; var item = bs1.List[targetIdx] as MarcPlanItem;

View File

@@ -16,7 +16,7 @@ namespace UniMarc
Helper_DB db = new Helper_DB(); Helper_DB db = new Helper_DB();
//string compidx; //string compidx;
public string ResultIdx { get; private set; } public int ResultIdx { get; private set; }
public string ResultListName { get; private set; } public string ResultListName { get; private set; }
public string ResultDate { get; private set; } public string ResultDate { get; private set; }
public List<MarcPlanItem> ResultItems { get; private set; } public List<MarcPlanItem> ResultItems { get; private set; }
@@ -89,7 +89,7 @@ namespace UniMarc
MarcPlanItem item = new MarcPlanItem MarcPlanItem item = new MarcPlanItem
{ {
Idx = grid[0], Idx = int.Parse(grid[0]),
ListName = grid[1], ListName = grid[1],
Date = grid[2], Date = grid[2],
User = grid[3], User = grid[3],
@@ -292,10 +292,10 @@ namespace UniMarc
continue; continue;
} }
// string[] Search_Res = st.Take_Tag(grid[a], Search); // string[] Search_Res = st.Take_Tag(grid[a], Search);
//저자기호목록 마지막것을 우선시한다 ("100a", "110a", "111a") //저자기호목록 마지막것을 우선시한다 ("100a", "110a", "111a")
// string[] Author_Search = { "100a", "110a", "111a" }; // string[] Author_Search = { "100a", "110a", "111a" };
//저자기호확인 //저자기호확인
var v_author = string.Empty; var v_author = string.Empty;
@@ -324,7 +324,7 @@ namespace UniMarc
SBookNum2 = fullparser.GetTag("490v").FirstOrDefault(),//Search_Res[11],총서번호2 SBookNum2 = fullparser.GetTag("490v").FirstOrDefault(),//Search_Res[11],총서번호2
Author = v_author, Author = v_author,
BookComp = fullparser.GetTag("260b").FirstOrDefault(),//Search_Res[12],출판사 BookComp = fullparser.GetTag("260b").FirstOrDefault(),//Search_Res[12],출판사
Price = fullparser.GetTag("950b").FirstOrDefault(),//Search_Res[13],정가 Price = Convert.ToInt32(fullparser.GetTag("950b").FirstOrDefault()),//Search_Res[13],정가
Marc = fullmarc, Marc = fullmarc,
ColCheck = "T" ColCheck = "T"
}; };

View File

@@ -278,7 +278,7 @@ namespace UniMarc
else else
insert_marc_data[17] = num.ToString(); insert_marc_data[17] = num.ToString();
insert_marc_data[18] = outnum; insert_marc_data[18] = outnum;
insert_marc_data[19] = dr.MarcIdx;// Convert.ToString(marc.List_Book.Rows[row[a]].Cells["marc_idx"].Value); insert_marc_data[19] = dr.MarcIdx.ToString();// Convert.ToString(marc.List_Book.Rows[row[a]].Cells["marc_idx"].Value);
insert_marc_data[20] = dr.SaveDate;// Convert.ToString(marc.List_Book.Rows[row[a]].Cells["SaveDate"].Value); insert_marc_data[20] = dr.SaveDate;// Convert.ToString(marc.List_Book.Rows[row[a]].Cells["SaveDate"].Value);
insert_marc_data[21] = dr.User;// Convert.ToString(marc.List_Book.Rows[row[a]].Cells["user"].Value); insert_marc_data[21] = dr.User;// Convert.ToString(marc.List_Book.Rows[row[a]].Cells["user"].Value);

View File

@@ -365,11 +365,11 @@ namespace UniMarc
Author = currentItem.author, Author = currentItem.author,
BookName = currentItem.book_name, BookName = currentItem.book_name,
ISBN13 = currentItem.ISBN, ISBN13 = currentItem.ISBN,
MarcIdx = currentItem.idx, MarcIdx = int.TryParse(currentItem.idx, out int midx) ? midx : 0,
User = currentItem.User, User = currentItem.User,
SaveDate = currentItem.date, SaveDate = currentItem.date,
Publisher = currentItem.book_comp, Publisher = currentItem.book_comp,
Price = currentItem.price, Price = int.TryParse(currentItem.price, out int pr) ? pr : 0,
text008 = "", text008 = "",
tag056 = "", tag056 = "",
NewMake = false, NewMake = false,
@@ -426,12 +426,12 @@ namespace UniMarc
{ {
var itemfb = new FillBlankItem var itemfb = new FillBlankItem
{ {
Idx = a.ToString(), Idx = a,
Isbn = mItem.ISBN ?? "", Isbn = mItem.ISBN ?? "",
BookName = mItem.book_name ?? "", BookName = mItem.book_name ?? "",
Author = mItem.author ?? "", Author = mItem.author ?? "",
Publisher = mItem.book_comp ?? "", Publisher = mItem.book_comp ?? "",
Price = mItem.price ?? "" Price = int.TryParse(mItem.price, out int prfb) ? prfb : 0
}; };
dataList.Add(itemfb); dataList.Add(itemfb);
} }
@@ -450,7 +450,7 @@ namespace UniMarc
{ {
if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; if (string.IsNullOrEmpty(fbItem.BookMarc)) continue;
int rowIdx = int.Parse(fbItem.Idx); int rowIdx = fbItem.Idx;
if (rowIdx >= 0 && rowIdx < bs1.Count) if (rowIdx >= 0 && rowIdx < bs1.Count)
{ {
var mItem = (SearchInforItem)bs1.List[rowIdx]; var mItem = (SearchInforItem)bs1.List[rowIdx];
@@ -604,11 +604,11 @@ namespace UniMarc
Author = currentItem.author, Author = currentItem.author,
BookName = currentItem.book_name, BookName = currentItem.book_name,
ISBN13 = currentItem.ISBN, ISBN13 = currentItem.ISBN,
MarcIdx = currentItem.idx, MarcIdx = int.TryParse(currentItem.idx, out int midx) ? midx : 0,
User = currentItem.User, User = currentItem.User,
SaveDate = currentItem.date, SaveDate = currentItem.date,
Publisher = currentItem.book_comp, Publisher = currentItem.book_comp,
Price = currentItem.price, Price = int.TryParse(currentItem.price, out int pr) ? pr : 0,
text008 = "", text008 = "",
tag056 = "", tag056 = "",
NewMake = false, NewMake = false,
@@ -662,12 +662,12 @@ namespace UniMarc
{ {
var itemfb = new FillBlankItem var itemfb = new FillBlankItem
{ {
Idx = a.ToString(), Idx = a,
Isbn = mItem.ISBN ?? "", Isbn = mItem.ISBN ?? "",
BookName = mItem.book_name ?? "", BookName = mItem.book_name ?? "",
Author = mItem.author ?? "", Author = mItem.author ?? "",
Publisher = mItem.book_comp ?? "", Publisher = mItem.book_comp ?? "",
Price = mItem.price ?? "" Price = int.TryParse(mItem.price, out int prfb) ? prfb : 0
}; };
dataList.Add(itemfb); dataList.Add(itemfb);
} }
@@ -686,7 +686,7 @@ namespace UniMarc
{ {
if (string.IsNullOrEmpty(fbItem.BookMarc)) continue; if (string.IsNullOrEmpty(fbItem.BookMarc)) continue;
int rowIdx = int.Parse(fbItem.Idx); int rowIdx = fbItem.Idx;
if (rowIdx >= 0 && rowIdx < bs1.Count) if (rowIdx >= 0 && rowIdx < bs1.Count)
{ {
var mItem = (SearchInforItem)bs1.List[rowIdx]; var mItem = (SearchInforItem)bs1.List[rowIdx];

View File

@@ -161,21 +161,11 @@ namespace UniMarc
if (marcEditorControl1.CheckValidation() == false) return; if (marcEditorControl1.CheckValidation() == false) return;
string oriMarc = marcEditorControl1.MakeMarcString(); string oriMarc = marcEditorControl1.MakeMarcString();
string etc1Value = ""; string etc1Value = etc1.Text.Trim();
string etc2Value = ""; string etc2Value = etc2.Text.Trim();
// Use TryGet to avoid issues if controls don't exist in all contexts,
// but assuming inherited/designer has them for now as per user snippet.
try { etc1Value = etc1.Text.Trim(); } catch { }
try { etc2Value = etc2.Text.Trim(); } catch { }
string tag008Value = marcEditorControl1.text008.Text; string tag008Value = marcEditorControl1.text008.Text;
var v_grade = uC_SelectGrade1.Grade == -1 ? "2" : uC_SelectGrade1.Grade.ToString() ; var v_grade = uC_SelectGrade1.Grade < 0 ? "2" : uC_SelectGrade1.Grade.ToString() ;
//if (radA.Checked) v_grade = "0";
//else if (radB.Checked) v_grade = "1";
//else if (radC.Checked) v_grade = "2";
//else if (radD.Checked) v_grade = "3";
// Extract tags for metadata // Extract tags for metadata
string[] Search_Tag = { string[] Search_Tag = {
@@ -190,53 +180,56 @@ namespace UniMarc
string[] BookNameTag = st.Take_Tag(oriMarc, BookTag); string[] BookNameTag = st.Take_Tag(oriMarc, BookTag);
string BookName = mk_BookName(BookNameTag); string BookName = mk_BookName(BookNameTag);
var updateData = new Dictionary<string, object>();
var whereClause = new Dictionary<string, object>();
string Table = ""; string Table = "";
string[] Update_Col;
string[] Update_data;
string[] Search_Col = { "idx" };
string[] Search_data;
var idx = (Target == SaveTarget.SpecsMarc ? _param.ListIdx : _param.MarcIdx);
if (Target == SaveTarget.SpecsMarc) if (Target == SaveTarget.SpecsMarc)
{ {
Table = "Specs_Marc"; Table = "Specs_Marc";
Search_data = new string[] { _param.ListIdx }; whereClause.Add("idx", idx);
Update_Col = new string[] {
"marc", "book_name", "etc1", "etc2",
"r_num", "class_symbol", "author_symbol", "prefix", "s_book_name1",
"s_book_num1", "author", "book_comp", "price", "ISBN", "tag008","grade"
};
if (v_grade.isEmpty())
Array.Resize(ref Update_Col, Update_Col.Length - 1);
Update_data = new string[] { updateData.Add("marc", oriMarc);
oriMarc, BookName, etc1Value, etc2Value, updateData.Add("book_name", BookName);
SearchBookTag[0], SearchBookTag[1], SearchBookTag[2], SearchBookTag[5], SearchBookTag[6], updateData.Add("etc1", etc1Value);
SearchBookTag[7], SearchBookTag[8], SearchBookTag[9], SearchBookTag[10], SearchBookTag[11], tag008Value, v_grade updateData.Add("etc2", etc2Value);
}; updateData.Add("r_num", SearchBookTag[0]);
if (v_grade.isEmpty()) updateData.Add("class_symbol", SearchBookTag[1]);
Array.Resize(ref Update_data, Update_data.Length - 1); updateData.Add("author_symbol", SearchBookTag[2]);
updateData.Add("prefix", SearchBookTag[5]);
updateData.Add("s_book_name1", SearchBookTag[6]);
updateData.Add("s_book_num1", SearchBookTag[7]);
updateData.Add("author", SearchBookTag[8]);
updateData.Add("book_comp", SearchBookTag[9]);
updateData.Add("price", SearchBookTag[10]);
updateData.Add("ISBN", SearchBookTag[11]);
updateData.Add("tag008", tag008Value);
if (!v_grade.isEmpty())
updateData.Add("grade", v_grade);
} }
else // MasterMarc else // MasterMarc
{ {
Table = "Marc"; Table = "Marc";
Search_data = new string[] { _param.MarcIdx }; whereClause.Add("idx", idx);
// Using bits of logic from Marc_Plan_Sub_MarcEdit.Save_si whereClause.Add("compidx", PUB.user.CompanyIdx);
string today = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); string today = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
Update_Col = new string[] { updateData.Add("marc", oriMarc);
"marc", "marc_chk", "marc1", "marc_chk2", "date", "user", updateData.Add("marc_chk", "1");
"비고1", "비고2", "grade"//, "ISBN", "book_name", "author", "book_comp", "price" updateData.Add("marc1", _param.OriginalMarc);
}; updateData.Add("marc_chk2", "0");
if (v_grade.isEmpty()) updateData.Add("date", today);
Array.Resize(ref Update_Col, Update_Col.Length - 1); updateData.Add("user", PUB.user.UserName);
Update_data = new string[] { updateData.Add("비고1", etc1Value);
oriMarc, "1", _param.OriginalMarc, "0", today, PUB.user.UserName, updateData.Add("비고2", etc2Value);
etc1Value, etc2Value, v_grade//, SearchBookTag[11], BookName, SearchBookTag[8], SearchBookTag[9], SearchBookTag[10]
}; if (!v_grade.isEmpty())
if (v_grade.isEmpty()) updateData.Add("grade", v_grade);
Array.Resize(ref Update_data, Update_data.Length - 1);
} }
string cmd = db.More_Update(Table, Update_Col, Update_data, Search_Col, Search_data); string cmd = Helper_DB.Make_UpdateQuery(Table, updateData, whereClause);
var rlt = Helper_DB.ExcuteNonQuery(cmd); var rlt = Helper_DB.ExcuteNonQuery(cmd);
if (rlt.applyCount == 1) if (rlt.applyCount == 1)
{ {
@@ -260,11 +253,11 @@ namespace UniMarc
} }
else if (rlt.applyCount == 0) else if (rlt.applyCount == 0)
{ {
UTIL.MsgE($"저장된 자료가 없습니다\nIDX:{Search_data[0]}\n\n개발자 문의 하세요"); UTIL.MsgE($"저장된 자료가 없습니다\nTable:{Table}, IDX:{idx}\n\n개발자 문의 하세요");
} }
else if (rlt.applyCount > 1) else if (rlt.applyCount > 1)
{ {
UTIL.MsgE($"복수({rlt.applyCount})의 자료가 업데이트 되었습니다\nIDX:{Search_data[0]}\n\n개발자 문의 하세요"); UTIL.MsgE($"복수({rlt.applyCount})의 자료가 업데이트 되었습니다\nTable:{Table}, IDX:{idx}\n\n개발자 문의 하세요");
} }
} }