마크목록에서 개별 마크데이터 지정시 해당 값이 자동업데이트되지 않는 현상 수정
권차, 권차서명, 판차 정보 추출하여 저장하게 함 마크선태고하면에서 마크삭제시 삭제할 인덱스값 표시 obj_list_book 에 품절컬럼 추가,
This commit is contained in:
402
unimarc/unimarc/Helper/Database.cs
Normal file
402
unimarc/unimarc/Helper/Database.cs
Normal 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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,184 +14,6 @@ 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 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>
|
||||
/// DB접속을 도와주는 클래스
|
||||
/// </summary>
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace UniMarc
|
||||
public string image { get; set; }
|
||||
public string api_data { get; set; }
|
||||
public string search_description { get; set; }
|
||||
public string search_link { get; set; }
|
||||
public string search_url { get; set; }
|
||||
|
||||
|
||||
|
||||
40
unimarc/unimarc/Models/MarcBasicInfo.cs
Normal file
40
unimarc/unimarc/Models/MarcBasicInfo.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,8 @@ namespace UniMarc
|
||||
public string search_description { 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 BackColor { get; set; } = System.Drawing.Color.White;
|
||||
|
||||
@@ -24,6 +24,12 @@ namespace UniMarc
|
||||
public string marc2 { 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 remark2 { get; set; }
|
||||
public string DisplayGrade
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// 모든 값을 지정하거나 아래와 같이 '*'를 사용하여 빌드 번호 및 수정 번호를
|
||||
// 기본값으로 할 수 있습니다.
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2026.02.23.2400")]
|
||||
[assembly: AssemblyFileVersion("2026.02.23.2400")]
|
||||
[assembly: AssemblyVersion("2026.03.02.1630")]
|
||||
[assembly: AssemblyFileVersion("2026.03.02.1630")]
|
||||
|
||||
@@ -225,6 +225,8 @@
|
||||
<DependentUpon>Reference.svcmap</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DB_Utils.cs" />
|
||||
<Compile Include="Helper\Database.cs" />
|
||||
<Compile Include="Models\MarcBasicInfo.cs" />
|
||||
<Compile Include="Helper\MarcParser.cs" />
|
||||
<Compile Include="Helper_LibraryDelaySettings.cs" />
|
||||
<Compile Include="ListOfValue\fSelectDT.cs">
|
||||
@@ -318,7 +320,7 @@
|
||||
<Compile Include="마크\AddMarc_FillBlank.Designer.cs">
|
||||
<DependentUpon>AddMarc_FillBlank.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\BookGridItem.cs" />
|
||||
<Compile Include="Models\BookGridItem.cs" />
|
||||
<Compile Include="마크\CD_LP.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -391,7 +393,7 @@
|
||||
<Compile Include="마크\Check_ISBN_Yes242.Designer.cs">
|
||||
<DependentUpon>Check_ISBN_Yes242.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\FillBlankItem.cs" />
|
||||
<Compile Include="Models\FillBlankItem.cs" />
|
||||
<Compile Include="마크\Help_007.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -404,9 +406,9 @@
|
||||
<Compile Include="마크\Help_008.Designer.cs">
|
||||
<DependentUpon>Help_008.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\IsbnGridItem.cs" />
|
||||
<Compile Include="마크\MacEditorParameter.cs" />
|
||||
<Compile Include="마크\MacListItem.cs" />
|
||||
<Compile Include="Models\IsbnGridItem.cs" />
|
||||
<Compile Include="Models\MacEditorParameter.cs" />
|
||||
<Compile Include="Models\MacListItem.cs" />
|
||||
<Compile Include="마크\Mac_List_Add2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -425,8 +427,8 @@
|
||||
<Compile Include="마크\Mac_List_Edit.Designer.cs">
|
||||
<DependentUpon>Mac_List_Edit.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\MarcBookItem.cs" />
|
||||
<Compile Include="마크\MarcCopyItem.cs" />
|
||||
<Compile Include="Models\MarcBookItem.cs" />
|
||||
<Compile Include="Models\MarcCopyItem.cs" />
|
||||
<Compile Include="마크\MarcCopySelect2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -451,7 +453,7 @@
|
||||
<Compile Include="마크\Marc.designer.cs">
|
||||
<DependentUpon>Marc.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\MarcPlanItem.cs" />
|
||||
<Compile Include="Models\MarcPlanItem.cs" />
|
||||
<Compile Include="마크\Marc_CopyForm.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@@ -650,7 +652,7 @@
|
||||
<Compile Include="마크\Marc_memo.Designer.cs">
|
||||
<DependentUpon>Marc_memo.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="마크\SearchInforItem.cs" />
|
||||
<Compile Include="Models\SearchInforItem.cs" />
|
||||
<Compile Include="마크\Search_Infor2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -201,135 +201,31 @@ namespace UniMarc
|
||||
/// <param name="v_date">저장시각 yyyy-MM-dd HH:mm:ss</param>
|
||||
void UpdateMarc(string MarcIndex, string FullMarc, string grade)
|
||||
{
|
||||
//도서정보추출
|
||||
var v_isbn = "";
|
||||
var v_price = "";
|
||||
var v_author = "";
|
||||
var v_title = "";
|
||||
var v_publisher = "";
|
||||
var v_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
int targetMarcIdx = 0;
|
||||
int.TryParse(MarcIndex, out targetMarcIdx);
|
||||
int targetGrade = 2;
|
||||
if (int.TryParse(grade, out int parsedGrade)) targetGrade = parsedGrade;
|
||||
|
||||
//파서를 사용해서 변경한다
|
||||
var parser = new UniMarc.MarcParser();
|
||||
parser.ParseFullMarc(FullMarc);
|
||||
// 3. 공통 저장 메서드 호출
|
||||
var saveResult = Helper_DB.UpdateMarc(targetMarcIdx, FullMarc, targetGrade, rtEtc1.Text.Trim(), rtEtc2.Text.Trim(), "", mOldMarc);
|
||||
|
||||
//ISBN와 가격 (처음나오는 020태그의 값을 적용)
|
||||
var tag_020 = parser.GetTag<MarcField>("020").FirstOrDefault();
|
||||
if (tag_020 != null)
|
||||
if (saveResult.result == false)
|
||||
{
|
||||
v_isbn = tag_020.GetSubfieldValue('a');
|
||||
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.개발자에 해당 내용을 문의하세요");
|
||||
UTIL.MsgE(saveResult.message);
|
||||
return;
|
||||
}
|
||||
|
||||
if (v_isbn.isEmpty() || v_title.isEmpty())
|
||||
{
|
||||
UTIL.MsgE("ISBN과 서명을 추출하지 못했습니다\n1.마크데이터를 확인 해주세요\n2.개발자에 해당 내용을 문의하세요");
|
||||
return;
|
||||
}
|
||||
|
||||
var etc1 = rtEtc1.Text.Trim();
|
||||
var etc2 = rtEtc2.Text.Trim();
|
||||
|
||||
if (grade.isEmpty()) grade = "2";
|
||||
|
||||
|
||||
// 4. UI 결과 반영
|
||||
if (MarcIndex.isEmpty())
|
||||
{
|
||||
//insert
|
||||
string[] InsertTable =
|
||||
{
|
||||
"ISBN", "서명", "저자", "출판사", "가격",
|
||||
"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}");
|
||||
}
|
||||
lbl_Midx.Tag = saveResult.newidx.ToString();
|
||||
lbl_Midx.Text = saveResult.newidx.ToString();
|
||||
lbl_Midx.BackColor = Color.Lime; // 저장 성공 후 색상 변경 (AddMarc2 특화)
|
||||
UTIL.MsgI($"저장 완료\n\nIDX:{saveResult.newidx}");
|
||||
}
|
||||
else
|
||||
{
|
||||
//update
|
||||
|
||||
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("변경 완료");
|
||||
UTIL.MsgI("변경 완료");
|
||||
}
|
||||
|
||||
}
|
||||
@@ -400,12 +296,22 @@ namespace UniMarc
|
||||
string midx = this.lbl_Midx.Tag?.ToString() ?? 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();
|
||||
|
||||
//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
|
||||
UpdateMarc(midx, fullMarc, v_grade);
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace UniMarc
|
||||
db.DBcon();
|
||||
string[] search_tbl = { "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`, " +
|
||||
"`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.category = row["category"]?.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_author = row["search_author"]?.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_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;
|
||||
if (!string.IsNullOrEmpty(setBookName))
|
||||
@@ -734,9 +734,9 @@ namespace UniMarc
|
||||
item.search_description = string.Empty;
|
||||
|
||||
if (value.Length > 10)
|
||||
item.search_link = value[10];
|
||||
item.search_url = value[10];
|
||||
else
|
||||
item.search_link = string.Empty;
|
||||
item.search_url = string.Empty;
|
||||
|
||||
|
||||
dataGridView1.Rows[idx].DefaultCellStyle.BackColor = Color.Yellow;
|
||||
@@ -745,46 +745,56 @@ namespace UniMarc
|
||||
|
||||
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++)
|
||||
{
|
||||
var item = bookList[a];
|
||||
if (string.IsNullOrEmpty(item.isbn)) continue;
|
||||
|
||||
string[] Edit_Col = {
|
||||
item.isbn,
|
||||
item.book_name,
|
||||
item.author,
|
||||
item.book_comp,
|
||||
item.unit,
|
||||
item.price,
|
||||
item.pubDate,
|
||||
item.category,
|
||||
item.image,
|
||||
item.sold_out,
|
||||
item.etc,
|
||||
item.search_book_name,
|
||||
item.search_author,
|
||||
item.search_book_comp
|
||||
var updateData = new Dictionary<string, object>
|
||||
{
|
||||
{ "isbn", item.isbn },
|
||||
{ "book_name", item.book_name },
|
||||
{ "author", item.author },
|
||||
{ "book_comp", item.book_comp },
|
||||
{ "pay", item.unit },
|
||||
{ "price", item.price },
|
||||
{ "pubDate", item.pubDate },
|
||||
{ "category", item.category },
|
||||
{ "image_url", item.image },
|
||||
{ "sold_out", item.sold_out },
|
||||
{ "etc", item.etc },
|
||||
{ "search_book_name", item.search_book_name },
|
||||
{ "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" };
|
||||
string[] Search_col = { item.idx, list_name, compidx };
|
||||
var whereClause = new Dictionary<string, object>
|
||||
{
|
||||
{ item.etc.Contains("세트분할") ? "set_book_name" : "idx", item.idx },
|
||||
{ "list_name", list_name },
|
||||
{ "compidx", compidx }
|
||||
};
|
||||
|
||||
if (item.etc.Contains("세트분할"))
|
||||
Search_tbl[0] = "set_book_name";
|
||||
|
||||
string U_cmd = db.More_Update("Obj_List_Book", Edit_tbl, Edit_Col, Search_tbl, Search_col, 1);
|
||||
Helper_DB.ExcuteNonQuery(U_cmd);
|
||||
string U_cmd = Helper_DB.Make_UpdateQuery("Obj_List_Book", updateData, whereClause);
|
||||
var ret = Helper_DB.ExcuteNonQuery(U_cmd);
|
||||
if(ret.applyCount != 1)
|
||||
{
|
||||
UTIL.MsgE($"{ret.applyCount} 건의 자료가 업데이트 되었습니다\n개발자 문의 하세요\n\n{ret.errorMessage}");
|
||||
return;
|
||||
}
|
||||
|
||||
if (Check_Marc.Checked)
|
||||
{
|
||||
string CMcmd = string.Format("UPDATE `Obj_List_Book` SET `isbn_marc` = \"{0}\" WHERE `idx` = \"{1}\"",
|
||||
Edit_Col[0], Search_col[0]);
|
||||
Helper_DB.ExcuteNonQuery(CMcmd);
|
||||
item.isbn, item.idx);
|
||||
ret = Helper_DB.ExcuteNonQuery(CMcmd);
|
||||
if (ret.applyCount != 1)
|
||||
{
|
||||
UTIL.MsgE($"{ret.applyCount} 건의 자료가 업데이트 되었습니다\n개발자 문의 하세요\n\n{ret.errorMessage}");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
UTIL.MsgI("저장되었습니다!");
|
||||
@@ -952,7 +962,7 @@ namespace UniMarc
|
||||
}
|
||||
else
|
||||
{
|
||||
link_url.Text = item.search_link;
|
||||
link_url.Text = item.search_url;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ namespace UniMarc
|
||||
InList_Col[5] = TotalCount.ToString();
|
||||
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)
|
||||
{
|
||||
UTIL.MsgE("목록 저장에 실패했습니다.");
|
||||
|
||||
@@ -508,7 +508,7 @@ namespace UniMarc
|
||||
|
||||
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));
|
||||
long newIdx = db.DB_Send_CMD_Insert_GetIdx(Incmd);
|
||||
long newIdx = Helper_DB.DB_Send_CMD_Insert_GetIdx(Incmd);
|
||||
if (newIdx > 0)
|
||||
{
|
||||
Midx = newIdx.ToString();
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace UniMarc
|
||||
ml = _ml;
|
||||
mUserName = PUB.user.UserName;
|
||||
marcEditorControl1.db = this.db;
|
||||
this.input_list(ml);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,16 @@ namespace UniMarc
|
||||
comboBox8.Items.AddRange(combo8);
|
||||
|
||||
comboBox8.SelectedIndex = 0;
|
||||
|
||||
this.Show();
|
||||
Application.DoEvents();
|
||||
|
||||
//refresh data
|
||||
this.input_list(ml);
|
||||
|
||||
List_Book.RowPrePaint += List_Book_RowPrePaint;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void input_list()
|
||||
@@ -141,9 +150,10 @@ namespace UniMarc
|
||||
}
|
||||
|
||||
|
||||
string Area = "`idx`, `isbn_marc`, `header`, `num`, `book_name`, `author`, `book_comp`, `count`, `pay`, `image_url`, `m_idx`" +
|
||||
",search_book_name,search_author,search_book_comp,search_description,search_url";
|
||||
string[] sear_tbl = { "l_idx", "compidx" };
|
||||
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 " +
|
||||
", LB.`search_book_name`, LB.`search_author`, LB.`search_book_comp`, LB.`search_description`, LB.`search_url` " +
|
||||
", 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 };
|
||||
|
||||
lbl_BookDate.Text = $"{item.start_date}";
|
||||
@@ -153,10 +163,12 @@ namespace UniMarc
|
||||
|
||||
string cmd =
|
||||
string.Format("SELECT {0} " +
|
||||
"FROM {1} " +
|
||||
"WHERE `{2}` = \"{4}\" AND `{3}` = \"{5}\"" +
|
||||
"ORDER BY `idx` ASC;", Area, "Obj_List_Book", sear_tbl[0], sear_tbl[1], sear_col[0], sear_col[1]);
|
||||
var db_res = Helper_DB.ExecuteDataTable(cmd);// db.DB_Send_CMD_Search(cmd);
|
||||
"FROM {1} AS LB " +
|
||||
"LEFT JOIN `Marc` AS M ON LB.`m_idx` = M.`idx` " +
|
||||
"LEFT JOIN `Comp` AS C ON M.`compidx` = C.`idx` " +
|
||||
"WHERE {2} = \"{4}\" AND {3} = \"{5}\"" +
|
||||
"ORDER BY LB.`idx` ASC;", Area, "Obj_List_Book", sear_tbl[0], sear_tbl[1], sear_col[0], sear_col[1]);
|
||||
var db_res = Helper_DB.ExecuteDataTable(cmd);
|
||||
|
||||
mLoadCompleted = false;
|
||||
|
||||
@@ -175,26 +187,43 @@ namespace UniMarc
|
||||
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.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_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_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);
|
||||
}
|
||||
bs1.DataSource = dataList;
|
||||
List_Book.AutoGenerateColumns = false;
|
||||
List_Book.DataSource = bs1;
|
||||
|
||||
chk_Marc();
|
||||
|
||||
List_Book.ClearSelection();
|
||||
mLoadCompleted = true;
|
||||
|
||||
if (this.List_Book.RowCount > 0)
|
||||
List_Book.Rows[0].Selected = true;
|
||||
bs1.DataSource = dataList;
|
||||
List_Book.AutoGenerateColumns = false;
|
||||
List_Book.DataSource = bs1;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -202,74 +231,108 @@ namespace UniMarc
|
||||
/// </summary>
|
||||
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 =
|
||||
// 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에서 데이터가 없다면?
|
||||
if (item.MarcIdx <= 0)
|
||||
{
|
||||
dr.Grade = "3"; //D등급으로 조정List_Book.Rows[a].Cells["grade"].Value = "3";
|
||||
dr.Status = MarcRecordStatus.None;
|
||||
continue;
|
||||
item.Grade = "3";
|
||||
item.Status = MarcRecordStatus.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
dr.Status = MarcRecordStatus.OtherCompany;
|
||||
int midx = Convert.ToInt32(row["m_idx"]);
|
||||
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
|
||||
{
|
||||
dr.Status = MarcRecordStatus.MyCompany;
|
||||
}
|
||||
|
||||
string[] MarcData = { Chk_Arr[2], Chk_Arr[4], Chk_Arr[6] };
|
||||
string[] CheckData = { Chk_Arr[3], Chk_Arr[5], Chk_Arr[7] };
|
||||
|
||||
dr.MarcIdx = int.TryParse(Chk_Arr[0], out int midx) ? midx : 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.User = compName;
|
||||
}
|
||||
item.BackColor = Color.LightGray;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -325,6 +388,7 @@ namespace UniMarc
|
||||
|
||||
|
||||
private string mOldMarc = string.Empty;
|
||||
private int mOldMarIdx = -1;
|
||||
private void List_Book_SelectionChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!mLoadCompleted) return;
|
||||
@@ -464,6 +528,7 @@ namespace UniMarc
|
||||
dr.Grade = selected.Grade;
|
||||
// text008.Text = selected.Tag008;
|
||||
dr.DbMarc = selected.marc_db;
|
||||
dr.Status = PUB.user.CompanyIdx == selected.compidx ? MarcRecordStatus.MyCompany : MarcRecordStatus.OtherCompany;
|
||||
mOldMarc = selected.marc_db;
|
||||
|
||||
// row.ForeColor = SetGradeColor(row.Grade); // Handled by MarcBookItem automatically
|
||||
@@ -889,7 +954,7 @@ namespace UniMarc
|
||||
var item = this.dataList.Where(t => t.ListIdx == this.Param.ListIdx).FirstOrDefault();
|
||||
if (item == null) return;
|
||||
|
||||
string table_name = "Marc";
|
||||
//string table_name = "Marc";
|
||||
string newsavedMarc = orimarc;
|
||||
|
||||
// cb_grade.SelectedIndex.ToString(); // 등급은 0~3의 숫자로 저장된다고 가정
|
||||
@@ -902,34 +967,18 @@ namespace UniMarc
|
||||
var v_etc1 = this.etc1.Text.Trim();
|
||||
var v_etc2 = this.etc2.Text.Trim();
|
||||
|
||||
// 1. DB 작업 (저장 전략 결정: Status 기준)
|
||||
if (item.Status == MarcRecordStatus.OtherCompany || item.Status == MarcRecordStatus.None)
|
||||
// 1. DB 작업 (공용 메서드로 통합 관리)
|
||||
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" };
|
||||
string[] Insert_col = { this.Param.ISBN13, this.Param.BookName, this.Param.Author, this.Param.Publisher, this.Param.Price.ToString(), newsavedMarc, this.etc1.Text, this.etc2.Text, this.Param.URL, v_grade, "1", mUserName, this.Param.tag056, this.Param.text008, date, mCompidx };
|
||||
|
||||
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 = (int)newIdx;
|
||||
}
|
||||
UTIL.MsgE(saveResult.message);
|
||||
return;
|
||||
}
|
||||
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.ToString(), mCompidx };
|
||||
|
||||
if (string.IsNullOrEmpty(this.Param.ISBN13)) { UTIL.MsgE("ISBN 데이터가 없습니다."); return; }
|
||||
|
||||
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);
|
||||
}
|
||||
// 새로 생성된 인덱스 반영
|
||||
item.MarcIdx = saveResult.newidx;
|
||||
|
||||
|
||||
// 2. 객체 데이터 업데이트 및 시각적 상태 계산
|
||||
@@ -938,11 +987,12 @@ namespace UniMarc
|
||||
item.Grade = v_grade; //등급업데이트추가
|
||||
|
||||
// 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);
|
||||
|
||||
// 4. BindingSource 갱신으로 UI 자동 업데이트
|
||||
bs1.ResetCurrentItem();
|
||||
bs1_CurrentChanged(null, null);
|
||||
UTIL.MsgI("저장되었습니다!");
|
||||
}
|
||||
|
||||
@@ -1044,8 +1094,11 @@ namespace UniMarc
|
||||
|
||||
//if (row_idx == -1 || col_idx == -1) { return; }
|
||||
//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();
|
||||
if (isbn != "")
|
||||
{
|
||||
@@ -1070,7 +1123,6 @@ namespace UniMarc
|
||||
}
|
||||
|
||||
|
||||
|
||||
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 author = dr.Author;// List_Book.Rows[row_idx].Cells["author"].Value?.ToString() ?? "";
|
||||
@@ -1078,12 +1130,12 @@ namespace UniMarc
|
||||
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?
|
||||
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 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() ?? "";
|
||||
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.ToString());
|
||||
this.Param = new MacEditorParameter
|
||||
{
|
||||
@@ -1122,7 +1174,8 @@ namespace UniMarc
|
||||
|
||||
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())
|
||||
{
|
||||
linkLabel1.Enabled = false;
|
||||
|
||||
175
unimarc/unimarc/마크/Marc2.designer.cs
generated
175
unimarc/unimarc/마크/Marc2.designer.cs
generated
@@ -39,10 +39,10 @@
|
||||
System.Windows.Forms.Label label25;
|
||||
System.Windows.Forms.Label label26;
|
||||
System.Windows.Forms.Label label27;
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Marc2));
|
||||
this.List_Book = new System.Windows.Forms.DataGridView();
|
||||
this.list_idx = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -79,10 +79,15 @@
|
||||
this.lbl_BookDate = new System.Windows.Forms.Label();
|
||||
this.button1 = new System.Windows.Forms.Button();
|
||||
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.bindingNavigatorMoveFirstItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorMovePreviousItem = new System.Windows.Forms.ToolStripButton();
|
||||
this.bindingNavigatorSeparator = new System.Windows.Forms.ToolStripSeparator();
|
||||
this.bindingNavigatorPositionItem = new System.Windows.Forms.ToolStripTextBox();
|
||||
this.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.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
|
||||
this.lbListIdx = new System.Windows.Forms.ToolStripLabel();
|
||||
@@ -91,6 +96,7 @@
|
||||
this.etc1 = new System.Windows.Forms.RichTextBox();
|
||||
this.etc2 = new System.Windows.Forms.RichTextBox();
|
||||
this.panel6 = new System.Windows.Forms.Panel();
|
||||
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
|
||||
this.btCopy = 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.btn_Save = new System.Windows.Forms.Button();
|
||||
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.linkLabel1 = new System.Windows.Forms.LinkLabel();
|
||||
label31 = new System.Windows.Forms.Label();
|
||||
label30 = new System.Windows.Forms.Label();
|
||||
label33 = new System.Windows.Forms.Label();
|
||||
@@ -123,11 +123,11 @@
|
||||
this.panel4.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bn1)).BeginInit();
|
||||
this.bn1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs1)).BeginInit();
|
||||
this.panel5.SuspendLayout();
|
||||
this.tableLayoutPanel1.SuspendLayout();
|
||||
this.panel6.SuspendLayout();
|
||||
this.tableLayoutPanel2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs1)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// label31
|
||||
@@ -207,14 +207,14 @@
|
||||
this.List_Book.AllowUserToDeleteRows = false;
|
||||
this.List_Book.BackgroundColor = System.Drawing.Color.SkyBlue;
|
||||
this.List_Book.BorderStyle = System.Windows.Forms.BorderStyle.None;
|
||||
dataGridViewCellStyle29.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle29.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle29.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle29.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle29.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle29.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.List_Book.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle29;
|
||||
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
|
||||
dataGridViewCellStyle1.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.List_Book.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
|
||||
this.List_Book.ColumnHeadersHeight = 29;
|
||||
this.List_Book.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
|
||||
this.list_idx,
|
||||
@@ -238,14 +238,14 @@
|
||||
this.List_Book.MultiSelect = false;
|
||||
this.List_Book.Name = "List_Book";
|
||||
this.List_Book.ReadOnly = true;
|
||||
dataGridViewCellStyle32.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle32.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
dataGridViewCellStyle32.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle32.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle32.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle32.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.List_Book.RowHeadersDefaultCellStyle = dataGridViewCellStyle32;
|
||||
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
|
||||
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.ControlDark;
|
||||
dataGridViewCellStyle4.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
|
||||
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
|
||||
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
|
||||
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
|
||||
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.List_Book.RowHeadersDefaultCellStyle = dataGridViewCellStyle4;
|
||||
this.List_Book.RowHeadersWidth = 51;
|
||||
this.List_Book.RowTemplate.Height = 23;
|
||||
this.List_Book.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
|
||||
@@ -371,8 +371,8 @@
|
||||
// colCheck
|
||||
//
|
||||
this.colCheck.DataPropertyName = "ColCheck";
|
||||
dataGridViewCellStyle30.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.colCheck.DefaultCellStyle = dataGridViewCellStyle30;
|
||||
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
|
||||
this.colCheck.DefaultCellStyle = dataGridViewCellStyle2;
|
||||
this.colCheck.HeaderText = "V";
|
||||
this.colCheck.MinimumWidth = 6;
|
||||
this.colCheck.Name = "colCheck";
|
||||
@@ -403,9 +403,9 @@
|
||||
// grade
|
||||
//
|
||||
this.grade.DataPropertyName = "Grade";
|
||||
dataGridViewCellStyle31.Format = "N0";
|
||||
dataGridViewCellStyle31.NullValue = null;
|
||||
this.grade.DefaultCellStyle = dataGridViewCellStyle31;
|
||||
dataGridViewCellStyle3.Format = "N0";
|
||||
dataGridViewCellStyle3.NullValue = null;
|
||||
this.grade.DefaultCellStyle = dataGridViewCellStyle3;
|
||||
this.grade.HeaderText = "등급";
|
||||
this.grade.MinimumWidth = 6;
|
||||
this.grade.Name = "grade";
|
||||
@@ -646,6 +646,10 @@
|
||||
this.bn1.TabIndex = 326;
|
||||
this.bn1.Text = "bindingNavigator1";
|
||||
//
|
||||
// bs1
|
||||
//
|
||||
this.bs1.CurrentChanged += new System.EventHandler(this.bs1_CurrentChanged);
|
||||
//
|
||||
// bindingNavigatorCountItem
|
||||
//
|
||||
this.bindingNavigatorCountItem.Name = "bindingNavigatorCountItem";
|
||||
@@ -653,6 +657,24 @@
|
||||
this.bindingNavigatorCountItem.Text = "/{0}";
|
||||
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
|
||||
//
|
||||
this.bindingNavigatorSeparator.Name = "bindingNavigatorSeparator";
|
||||
@@ -662,7 +684,6 @@
|
||||
//
|
||||
this.bindingNavigatorPositionItem.AccessibleName = "위치";
|
||||
this.bindingNavigatorPositionItem.AutoSize = false;
|
||||
this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("맑은 고딕", 9F);
|
||||
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
|
||||
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
|
||||
this.bindingNavigatorPositionItem.Text = "0";
|
||||
@@ -673,6 +694,24 @@
|
||||
this.bindingNavigatorSeparator1.Name = "bindingNavigatorSeparator1";
|
||||
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
|
||||
//
|
||||
this.toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
@@ -755,6 +794,17 @@
|
||||
this.panel6.TabIndex = 1;
|
||||
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
|
||||
//
|
||||
this.tableLayoutPanel2.ColumnCount = 2;
|
||||
@@ -830,12 +880,12 @@
|
||||
// lbl_SaveData
|
||||
//
|
||||
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.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.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.Text = "[] []";
|
||||
//
|
||||
@@ -859,46 +909,6 @@
|
||||
this.marcEditorControl1.Size = new System.Drawing.Size(1030, 658);
|
||||
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
|
||||
//
|
||||
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.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
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
@@ -943,12 +942,12 @@
|
||||
((System.ComponentModel.ISupportInitialize)(this.bn1)).EndInit();
|
||||
this.bn1.ResumeLayout(false);
|
||||
this.bn1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs1)).EndInit();
|
||||
this.panel5.ResumeLayout(false);
|
||||
this.tableLayoutPanel1.ResumeLayout(false);
|
||||
this.panel6.ResumeLayout(false);
|
||||
this.panel6.PerformLayout();
|
||||
this.tableLayoutPanel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.bs1)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
@@ -195,9 +195,6 @@
|
||||
<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="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">
|
||||
<value>108, 13</value>
|
||||
</metadata>
|
||||
|
||||
25
unimarc/unimarc/마크/MarcCopySelect2.Designer.cs
generated
25
unimarc/unimarc/마크/MarcCopySelect2.Designer.cs
generated
@@ -87,7 +87,7 @@ namespace UniMarc
|
||||
this.dataGridView1.Name = "dataGridView1";
|
||||
this.dataGridView1.ReadOnly = true;
|
||||
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.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellClick);
|
||||
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.Location = new System.Drawing.Point(0, 0);
|
||||
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;
|
||||
//
|
||||
// progressBar1
|
||||
@@ -185,7 +185,7 @@ namespace UniMarc
|
||||
this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
|
||||
this.panel2.Location = new System.Drawing.Point(0, 33);
|
||||
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;
|
||||
//
|
||||
// bindingNavigator1
|
||||
@@ -213,7 +213,7 @@ namespace UniMarc
|
||||
this.bindingNavigator1.MovePreviousItem = this.bindingNavigatorMovePreviousItem;
|
||||
this.bindingNavigator1.Name = "bindingNavigator1";
|
||||
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.Text = "bindingNavigator1";
|
||||
//
|
||||
@@ -251,7 +251,6 @@ namespace UniMarc
|
||||
//
|
||||
this.bindingNavigatorPositionItem.AccessibleName = "위치";
|
||||
this.bindingNavigatorPositionItem.AutoSize = false;
|
||||
this.bindingNavigatorPositionItem.Font = new System.Drawing.Font("맑은 고딕", 9F);
|
||||
this.bindingNavigatorPositionItem.Name = "bindingNavigatorPositionItem";
|
||||
this.bindingNavigatorPositionItem.Size = new System.Drawing.Size(50, 23);
|
||||
this.bindingNavigatorPositionItem.Text = "0";
|
||||
@@ -293,7 +292,7 @@ namespace UniMarc
|
||||
this.richTextBox1.Font = new System.Drawing.Font("굴림체", 11.25F);
|
||||
this.richTextBox1.Location = new System.Drawing.Point(0, 0);
|
||||
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.Text = "";
|
||||
//
|
||||
@@ -304,7 +303,7 @@ namespace UniMarc
|
||||
this.panel3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.panel3.Location = new System.Drawing.Point(0, 270);
|
||||
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;
|
||||
//
|
||||
// tableLayoutPanel1
|
||||
@@ -314,12 +313,12 @@ namespace UniMarc
|
||||
this.tableLayoutPanel1.Controls.Add(this.rtEtc1, 0, 0);
|
||||
this.tableLayoutPanel1.Controls.Add(this.rtEtc2, 0, 1);
|
||||
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.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.Size = new System.Drawing.Size(243, 528);
|
||||
this.tableLayoutPanel1.Size = new System.Drawing.Size(243, 611);
|
||||
this.tableLayoutPanel1.TabIndex = 1;
|
||||
//
|
||||
// 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.Location = new System.Drawing.Point(3, 3);
|
||||
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.Text = "Remark1";
|
||||
//
|
||||
@@ -338,9 +337,9 @@ namespace UniMarc
|
||||
this.rtEtc2.BackColor = System.Drawing.SystemColors.ScrollBar;
|
||||
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.Location = new System.Drawing.Point(3, 267);
|
||||
this.rtEtc2.Location = new System.Drawing.Point(3, 308);
|
||||
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.Text = "Remark2";
|
||||
//
|
||||
@@ -348,7 +347,7 @@ namespace UniMarc
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
|
||||
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.panel2);
|
||||
this.Controls.Add(this.panel1);
|
||||
|
||||
@@ -66,7 +66,10 @@ namespace UniMarc
|
||||
// 5 6 7 8 9
|
||||
"`출판사` AS Comp, `user`, `date`, `grade`, `008tag`, " +
|
||||
// 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 Query = string.Format("SELECT {0} FROM {1} WHERE `{2}` like \"%{3}%\";", Area, Table, search_col, search_Target);
|
||||
@@ -86,7 +89,11 @@ namespace UniMarc
|
||||
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 = "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 = "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 = "Date", HeaderText = "수정시각", Name = "date", Width = 150 });
|
||||
dgv.Columns.Add(new DataGridViewTextBoxColumn { DataPropertyName = "DisplayGrade", HeaderText = "등급", Name = "grade", Width = 60 });
|
||||
@@ -111,6 +118,12 @@ namespace UniMarc
|
||||
ISBN = row["ISBN"].ToString(),
|
||||
Title = row["Title"].ToString(),
|
||||
Author = row["Author"].ToString(),
|
||||
|
||||
KwonchaFull = row["KwonchaFull"].ToString(),
|
||||
TotalTitleFull = row["TotalTitleFull"].ToString(),
|
||||
pancha = row["pancha"].ToString(),
|
||||
publishdate = row["출판년월"].ToString(),
|
||||
|
||||
Comp = row["Comp"].ToString(),
|
||||
User = row["user"].ToString(),
|
||||
Date = row["date"].ToString(),
|
||||
@@ -316,7 +329,7 @@ namespace UniMarc
|
||||
return;
|
||||
}
|
||||
|
||||
if (UTIL.MsgQ("삭제하시겠습니까?") == DialogResult.Cancel)
|
||||
if (UTIL.MsgQ($"삭제하시겠습니까?\nIDX:{item.idx}") == DialogResult.Cancel)
|
||||
return;
|
||||
|
||||
string User = PUB.user.UserName;
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<data name="bindingNavigatorMoveFirstItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
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
|
||||
ZNej/72rP6AoCm29B9bcuu7/f//Ov/9d8g/gNiCw+eH/uvnv4IqCW+7+X7T3//+Odf//Z8z5+d+u7ud/
|
||||
+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">
|
||||
<value>
|
||||
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
|
||||
sCu+/T99zu///l3f/usUvvtvkbCeNANAQD/l/H+Tohf/VbI+/TeOXEa6ASBgkHTiv2za1/+6wfPIMwAE
|
||||
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">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wQAADsEBuJFr7QAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5
|
||||
wAAADsABataJCQAAAKRJREFUOE9jYBh0oHDW8//oYiSB3JnP/id03yPfkIwpT//P2//7f0LXHfIMSeh5
|
||||
8n/2vl//O7f+/e9Wepl0QyK7Hv2fsu3X/5Klf/8nTP/73yb3LGmGBDY//N+69j1Ys3HJl//S0df+G0cu
|
||||
I94Qj6r7/0vmvoNrVnTpIV4zCNiX3v0f2PKMPM0gYJF3579NwRXyNIOAYdZt8jWDgE7aDfI1D00AAKB+
|
||||
X6Bjq5qXAAAAAElFTkSuQmCC
|
||||
@@ -156,7 +156,7 @@
|
||||
<data name="bindingNavigatorMoveLastItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>
|
||||
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAO
|
||||
wQAADsEBuJFr7QAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe
|
||||
wAAADsABataJCQAAAStJREFUOE9jYBhUoHDW8//oYjAAkmta8Px/5sTHONUw5M589j+h+x5WBSC5VUfe
|
||||
/w9vf4BVHgwypjz9P2//7/8JXXcwFIHkFu778D+44RqGHBwk9Dz5P3vfr/+dW//+dyu9jKIQJDdty/v/
|
||||
/tUXcBsQ2fXo/5Rtv/6XLP37P2H63/82uWfhikFyvas//PcqPYHbgMDmh/9b174HazYu+fJfOvraf+PI
|
||||
ZWANILm6+e/+u+QfwG2AR9X9/yVz38E1K7r0wBWD5PKnvflvn7EdtwH2pXf/B7Y8w9AMk8ue/Pq/RcJ6
|
||||
|
||||
@@ -569,8 +569,8 @@ namespace UniMarc
|
||||
{
|
||||
// 마크 데이터
|
||||
//string Marc_data = List_Book.Rows[row].Cells["db_marc"].Value.ToString();
|
||||
|
||||
if (Marc_data.Length < 3) return false;
|
||||
var marclen = Marc_data?.Length ?? 0;
|
||||
if (marclen < 3) return false;
|
||||
|
||||
string result = string.Empty;
|
||||
|
||||
|
||||
@@ -301,10 +301,10 @@ namespace UniMarc
|
||||
var rlt = Helper_DB.ExcuteNonQuery(cmd);
|
||||
if (rlt.applyCount == 1)
|
||||
{
|
||||
UTIL.MsgI("저장되었습니다.");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
UTIL.MsgI("저장되었습니다.");
|
||||
this.DialogResult = DialogResult.OK;
|
||||
this.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
UTIL.MsgE(rlt.errorMessage);
|
||||
|
||||
@@ -161,21 +161,11 @@ namespace UniMarc
|
||||
if (marcEditorControl1.CheckValidation() == false) return;
|
||||
|
||||
string oriMarc = marcEditorControl1.MakeMarcString();
|
||||
string etc1Value = "";
|
||||
string etc2Value = "";
|
||||
|
||||
// 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 etc1Value = etc1.Text.Trim();
|
||||
string etc2Value = etc2.Text.Trim();
|
||||
string tag008Value = marcEditorControl1.text008.Text;
|
||||
|
||||
var v_grade = uC_SelectGrade1.Grade == -1 ? "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";
|
||||
var v_grade = uC_SelectGrade1.Grade < 0 ? "2" : uC_SelectGrade1.Grade.ToString() ;
|
||||
|
||||
// Extract tags for metadata
|
||||
string[] Search_Tag = {
|
||||
@@ -190,53 +180,56 @@ namespace UniMarc
|
||||
string[] BookNameTag = st.Take_Tag(oriMarc, BookTag);
|
||||
string BookName = mk_BookName(BookNameTag);
|
||||
|
||||
var updateData = new Dictionary<string, object>();
|
||||
var whereClause = new Dictionary<string, object>();
|
||||
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)
|
||||
{
|
||||
Table = "Specs_Marc";
|
||||
Search_data = new string[] { _param.ListIdx.ToString() };
|
||||
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);
|
||||
whereClause.Add("idx", idx);
|
||||
|
||||
Update_data = new string[] {
|
||||
oriMarc, BookName, etc1Value, etc2Value,
|
||||
SearchBookTag[0], SearchBookTag[1], SearchBookTag[2], SearchBookTag[5], SearchBookTag[6],
|
||||
SearchBookTag[7], SearchBookTag[8], SearchBookTag[9], SearchBookTag[10], SearchBookTag[11], tag008Value, v_grade
|
||||
};
|
||||
if (v_grade.isEmpty())
|
||||
Array.Resize(ref Update_data, Update_data.Length - 1);
|
||||
updateData.Add("marc", oriMarc);
|
||||
updateData.Add("book_name", BookName);
|
||||
updateData.Add("etc1", etc1Value);
|
||||
updateData.Add("etc2", etc2Value);
|
||||
updateData.Add("r_num", SearchBookTag[0]);
|
||||
updateData.Add("class_symbol", SearchBookTag[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
|
||||
{
|
||||
Table = "Marc";
|
||||
Search_data = new string[] { _param.MarcIdx.ToString() };
|
||||
// Using bits of logic from Marc_Plan_Sub_MarcEdit.Save_si
|
||||
whereClause.Add("idx", idx);
|
||||
whereClause.Add("compidx", PUB.user.CompanyIdx);
|
||||
|
||||
string today = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||
Update_Col = new string[] {
|
||||
"marc", "marc_chk", "marc1", "marc_chk2", "date", "user",
|
||||
"비고1", "비고2", "grade"//, "ISBN", "book_name", "author", "book_comp", "price"
|
||||
};
|
||||
if (v_grade.isEmpty())
|
||||
Array.Resize(ref Update_Col, Update_Col.Length - 1);
|
||||
Update_data = new string[] {
|
||||
oriMarc, "1", _param.OriginalMarc, "0", today, PUB.user.UserName,
|
||||
etc1Value, etc2Value, v_grade//, SearchBookTag[11], BookName, SearchBookTag[8], SearchBookTag[9], SearchBookTag[10]
|
||||
};
|
||||
if (v_grade.isEmpty())
|
||||
Array.Resize(ref Update_data, Update_data.Length - 1);
|
||||
updateData.Add("marc", oriMarc);
|
||||
updateData.Add("marc_chk", "1");
|
||||
updateData.Add("marc1", _param.OriginalMarc);
|
||||
updateData.Add("marc_chk2", "0");
|
||||
updateData.Add("date", today);
|
||||
updateData.Add("user", PUB.user.UserName);
|
||||
updateData.Add("비고1", etc1Value);
|
||||
updateData.Add("비고2", etc2Value);
|
||||
|
||||
if (!v_grade.isEmpty())
|
||||
updateData.Add("grade", v_grade);
|
||||
}
|
||||
|
||||
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);
|
||||
if (rlt.applyCount == 1)
|
||||
{
|
||||
@@ -260,11 +253,11 @@ namespace UniMarc
|
||||
}
|
||||
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)
|
||||
{
|
||||
UTIL.MsgE($"복수({rlt.applyCount})의 자료가 업데이트 되었습니다\nIDX:{Search_data[0]}\n\n개발자 문의 하세요");
|
||||
UTIL.MsgE($"복수개({rlt.applyCount})의 자료가 업데이트 되었습니다\nTable:{Table}, IDX:{idx}\n\n개발자 문의 하세요");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user