=====* UniMarc [0.0147] 버전 업데이트 내용 *=====

** ERP 작업 전면 중단 (마크우선) **

1. ISBN 조회
ㄴ> Yes24방식 반출에서 Yes24 로그인하는 작업 추가 구현 완료
This commit is contained in:
SeungHo Yang
2022-05-02 08:43:15 +09:00
parent a944c04e1c
commit ff56bc526e
22 changed files with 5284 additions and 53 deletions

Binary file not shown.

View File

@@ -0,0 +1,524 @@
using System;
using System.Collections.Generic;
using System.IO.Ports;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using Renci.SshNet;
namespace WindowsFormsApp1
{
/// <summary>
/// DB접속을 도와주는 클래스
/// </summary>
class Helper_DB
{
// 접속
MySqlConnection conn;
// 쿼리
MySqlCommand sqlcmd = new MySqlCommand();
MySqlDataReader sd;
public string comp_idx { get; internal set; }
/// <summary>
/// DB를 사용하고 싶을 때 미리 저장된 DB의 기본 접속정보를 이용하여 DB에 접근한다.
/// </summary>
public void DBcon() // DB접속 함수
{
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo("1.215.250.130", 815, "gloriabook", "admin@!@#$");
connectionInfo.Timeout = TimeSpan.FromSeconds(30);
using (var client = new SshClient(connectionInfo))
{
client.Connect();
if (client.IsConnected)
{
string strConnection = "Server=1.215.250.130;"
+ "Port=3306;"
+ "Database=unimarc;"
+ "uid=root;"
+ "pwd=Admin21234;";
conn = new MySqlConnection(strConnection);
}
}
}
/// <summary>
/// 국중DB를 사용하고 싶을 때 미리 저장된 DB의 기본 접속정보를 이용하여 DB에 접근한다.
/// </summary>
public void DBcon_cl() // DB접속 함수
{
PasswordConnectionInfo connectionInfo = new PasswordConnectionInfo("1.215.250.130", 815, "gloriabook", "admin@!@#$");
connectionInfo.Timeout = TimeSpan.FromSeconds(30);
using (var client = new SshClient(connectionInfo))
{
client.Connect();
if (client.IsConnected)
{
string strConnection = "Server=1.215.250.130;"
+ "Port=3306;"
+ "Database=cl_marc;"
+ "uid=root;"
+ "pwd=Admin21234;";
conn = new MySqlConnection(strConnection);
}
}
}
public string DB_Send_CMD_Search(string cmd)
{
// DB 연결
conn.Open();
// 쿼리 맵핑
sqlcmd.CommandText = cmd;
// 쿼리 날릴 곳은 conn
sqlcmd.Connection = conn;
// 쿼리 날리기, sqlDataReader에 결과값 저장
sd = sqlcmd.ExecuteReader();
string result = "";
string change;
// 한줄씩 불러와 한개의 값으로 변환
while (sd.Read())
{
for (int count = 0; count < sd.FieldCount; count++)
{
change = sd[count].ToString().Replace("|", "");
result += change + "|";
}
}
conn.Close();
return result;
}
public void DB_Send_CMD_reVoid(string cmd)
{
using (conn)
{
conn.Open();
MySqlTransaction tran = conn.BeginTransaction();
sqlcmd.Connection = conn;
sqlcmd.Transaction = tran;
try
{
sqlcmd.CommandText = cmd;
sqlcmd.ExecuteNonQuery();
tran.Commit();
}
catch (Exception ex)
{
tran.Rollback();
MessageBox.Show(ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
}
/// <summary>
/// DBcon이 선진행되어야함.
/// SELECT * FROM [DB_Table_Name] WHERE [DB_Where_Table] LIKE \"%DB_Search_Data%\"
/// <summary>
/// <param name="compidx"/>이용자 회사의 idx번호 단.none일 경우 다른 DB를 가져옴</param>
/// <param name="DB_Table_Name">테이블명</param>
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Contains(string DB_Table_Name, string compidx,
string DB_Where_Table = "", string DB_Search_Data = "",
string Search_col = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "" )
{
string cmd = "SELECT ";
if (Search_col == "") { cmd += "*"; }
else { cmd += Search_col; }
cmd += " FROM ";
cmd += DB_Table_Name;
if (DB_Table_Name == "Obj_List") { cmd += " WHERE `comp_num` = \"" + compidx + "\""; }
else if (DB_Table_Name == "Client") { cmd += " WHERE `campanyidx` = \"" + compidx + "\""; }
else if (DB_Table_Name == "Purchase") { cmd += " WHERE `comparyidx` = \"" + compidx + "\""; }
else if(compidx == "none") { cmd += " WHERE `grade` = \"2\""; }
else { cmd += " WHERE `compidx` = \"" + compidx + "\""; }
if(DB_Search_Data != "")
{
cmd += " AND "+ DB_Where_Table + " LIKE\"%" + DB_Search_Data + "%\"";
}
if(DB_Search_Data1 != "")
{
cmd += " AND "+ DB_Where_Table1 + " LIKE\"%" + DB_Search_Data1 + "%\"";
}
cmd += ";";
return cmd;
}
/// <summary>
/// DBcon이 선진행되어야함. / SELECT * FROM DB_Table_Name WHERE DB_Where_Table = \"DB_Search_Data\";
/// <summary>
/// <param name="Search_Area">가져올 데이터의 위치</param>
/// <param name="DB_Table_Name">테이블명</param>
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Select_Search(string Search_Area, string DB_Table_Name,
string DB_Where_Table = "", string DB_Search_Data = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "")
{
string cmd = string.Format("SELECT {0} FROM ", Search_Area);
cmd += DB_Table_Name;
if(DB_Where_Table != "" && DB_Search_Data != "")
{
cmd += string.Format(" WHERE `{0}` = \"{1}\"", DB_Where_Table, DB_Search_Data);
}
if(DB_Where_Table1 != "" && DB_Search_Data1 != "")
{
cmd += string.Format(" AND `{0}` = \"{1}\"", DB_Where_Table1, DB_Search_Data1);
}
cmd += ";";
return cmd;
}
/// <summary>
/// DBcon이 선진행되어야함. / SELECT * FROM DB_Table_Name WHERE DB_Where_Table = \"DB_Search_Data\";
/// <summary>
/// <param name="DB_Table_Name">테이블명</param>
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Search(string DB_Table_Name,
string DB_Where_Table = "", string DB_Search_Data = "",
string DB_Where_Table1 = "", string DB_Search_Data1 = "")
{
string cmd = "SELECT * FROM ";
cmd += DB_Table_Name;// + " where id=\"id\"";
if(DB_Search_Data != "")
{
cmd += " WHERE "+ DB_Where_Table + "=\"" + DB_Search_Data +"\"";
}
if (DB_Where_Table1 != "" && DB_Search_Data1 != "")
{
cmd += " AND `" + DB_Where_Table1 + "` =\"" + DB_Search_Data1 + "\"";
}
cmd += ";";
return cmd;
}
/// <summary>
/// 여러 조건이 있을때 사용 (단, Where_Table과 Search_Date의 배열길이는 같아야함)
/// </summary>
/// <param name="DB_Table_Name"></param>
/// <param name="DB_Where_Table"></param>
/// <param name="DB_Search_Data"></param>
/// <param name="Search_Table">추출할 열의 이름."`num1`, `num2`" 이런식으로</param>
/// <returns></returns>
public string More_DB_Search(String DB_Table_Name, String[] DB_Where_Table,
String[] DB_Search_Data, String Search_Table = "")
{
if(DB_Where_Table.Length != DB_Search_Data.Length) { return "오류발생"; }
string cmd = "SELECT ";
if(Search_Table == "") { cmd += "*"; }
else { cmd += Search_Table; }
cmd += " FROM " + DB_Table_Name + " WHERE ";
for(int a = 0; a < DB_Where_Table.Length; a++)
{
cmd += "`" + DB_Where_Table[a] + "` = \"" + DB_Search_Data[a] + "\" ";
if(a == DB_Where_Table.Length - 1) { cmd += ";"; }
else { cmd += " AND "; }
}
return cmd;
}
/// <summary>
/// DB상의 날짜의 사이값을 가져오기 위한 함수
/// </summary>
/// <param name="Table_name">가져올 테이블의 이름</param>
/// <param name="Search_Table">프로그램상으로 가져올 DB데이터</param>
/// <param name="Search_date">DB상의 날짜가 저장된 컬럼명</param>
/// <param name="start_date">시작할 날짜 0000-00-00</param>
/// <param name="end_date">끝낼 날짜 0000-00-00</param>
/// <param name="compidx">회사 인덱스 main.com_idx</param>
/// <returns></returns>
public string Search_Date(string Table_name, string Search_Table, string Search_date,
string start_date, string end_date, string compidx)
{
if (Search_Table == "") { Search_Table = "*"; }
// select * from `table_name` where `날짜 컬럼` between date('start_date') and date('end_date')+1;
string cmd = "SELECT " + Search_Table + " FROM `" + Table_name + "` " +
"WHERE `comp_num` = '" + compidx + "' AND `" +
Search_date + "` >= '" + start_date + "'";
if(Table_name != "Obj_List") { cmd = cmd.Replace("`comp_num`", "`compidx`"); }
if (end_date != "") { cmd += " AND `" + Search_date + "` <= '" + end_date + "';"; }
else { cmd += ";"; }
return cmd;
}
public string DB_INSERT(String DB_Table_name, String[] DB_col_name, String[] setData)
{
string cmd = "INSERT INTO " + DB_Table_name + "(";
for(int a = 0; a < DB_col_name.Length; a++)
{
if (a == DB_col_name.Length - 1) { cmd += "`" + DB_col_name[a] + "`) "; }
else { cmd += "`" + DB_col_name[a] + "`, "; }
}
cmd += "values(";
for(int a = 0; a < setData.Length; a++)
{
setData[a] = setData[a].Replace("\"", "\"\"");
if (a == setData.Length - 1) { cmd += "\"" + setData[a] + "\")"; }
else { cmd += "\"" + setData[a] + "\", "; }
}
cmd += ";";
cmd = cmd.Replace("|", "");
return cmd;
}
public string DB_INSERT_SUB(string value, string[] setData)
{
string cmd = string.Format("(");
if (value == "")
{
for (int a = 0; a < setData.Length; a++)
{
if (a == setData.Length - 1) { cmd += "`" + setData[a] + "`) "; }
else { cmd += "`" + setData[a] + "`, "; }
}
return cmd;
}
for (int a = 0; a < setData.Length; a++)
{
setData[a] = setData[a].Replace("\"", "\"\"");
if (a == setData.Length - 1) { cmd += "\"" + setData[a] + "\")"; }
else { cmd += "\"" + setData[a] + "\", "; }
}
return cmd;
}
/// <summary>
/// 대상 컬럼 삭제 / DELETE FROM "DB_Table_Name" WHERE "target_idx"="comp_idx" AND "target_area"="target";
/// </summary>
/// <param name="DB_Table_Name">삭제할 대상이 있는 테이블명</param>
/// <param name="target_idx">인덱스 대상이 있는 열명</param>
/// <param name="comp_idx">삭제할 대상의 인덱스</param>
/// <param name="target_area">삭제할 대상이 있는 열명</param>
/// <param name="target">삭제할 대상</param>
public string DB_Delete(string DB_Table_Name,
string target_idx, string comp_idx,
string target_area, string target)
{
string cmd = "DELETE FROM " + DB_Table_Name + " WHERE " +
"`" + target_idx + "`=\"" + comp_idx + "\" AND" +
"`" + target_area + "`=\"" + target + "\" LIMIT 1;";
return cmd;
}
/// <summary>
/// 대상 컬럼 삭제(리미트 없음) / DELETE FROM "DB_Table_Name" WHERE "target_idx"="comp_idx" AND "target_area"="target";
/// </summary>
/// <param name="DB_Table">대상 테이블명</param>
/// <param name="target_idx">회사 인덱스 컬럼명</param>
/// <param name="comp_idx">회사 인덱스</param>
/// <param name="target_area">삭제 대상의 컬럼명</param>
/// <param name="target">삭제 대상</param>
public string DB_Delete_No_Limit(string DB_Table,
string target_idx, string comp_idx,
string[] target_area, string[] target)
{
string cmd = string.Format("DELETE FROM {0} WHERE `{1}`= \"{2}\" AND", DB_Table, target_idx, comp_idx);
for(int a= 0; a < target_area.Length; a++)
{
cmd += string.Format("`{0}`=\"{1}\"", target_area[a], target[a]);
if (a != target_area.Length - 1) { cmd += " AND"; }
}
cmd += ";";
return cmd;
}
/// <summary>
/// 대상 컬럼 삭제 / DELETE FROM "DB_Table_Name" WHERE "target_idx"="comp_idx" AND "target_area"="target";
/// </summary>
public string DB_Delete_More_term(string DB_Table_Name,
string target_idx, string comp_idx,
string[] target_area, string[] target)
{
string cmd = "DELETE FROM " + DB_Table_Name + " WHERE " +
"`" + target_idx + "`=\"" + comp_idx + "\" AND";
for(int a = 0; a < target_area.Length; a++)
{
cmd += " `" + target_area[a] + "`=\"" + target[a] + "\" ";
if (a == target_area.Length - 1) { cmd += "LIMIT 1;"; }
else { cmd += "AND"; }
}
return cmd;
}
/// <summary>
/// "UPDATE \"" + DB_Tabel_Name + "\" SET \"" + Edit_colum + "\"=\"" + Edit_Name + "\" WHERE \""+Search_Name+"\"=\"" + Search_Data + "\";"
/// </summary>
/// <param name="DB_Tabel_Name">테이블명</param>
/// <param name="Edit_colum">수정할 컬럼명</param>
/// <param name="Edit_Name">수정하고 싶은 문구</param>
/// <param name="Search_Name">검색할 컬럼명</param>
/// <param name="Search_Data">검색할 데이터</param>
public string DB_Update(string DB_Tabel_Name, string Edit_colum, string Edit_Name, string Search_Name, string Search_Data)
{
string cmd = "UPDATE `" + DB_Tabel_Name + "` SET `" + Edit_colum + "`=\"" + Edit_Name + "\" WHERE `"+Search_Name+"`=\"" + Search_Data + "\";";
cmd = cmd.Replace("|", "");
return cmd;
}
/// <summary>
/// 많은 곳의 데이터를 변화시키고 싶을때. 테이블명을 제외하곤 다 배열. Edit와 Search끼리의 배열 인덱스값이 각자 서로 같아야함.
/// </summary>
/// <param name="DB_Table_Name">바꿀 데이터가 있는 테이블명</param>
/// <param name="Edit_col">대상 테이블명</param>
/// <param name="Edit_name">바꿀 데이터값</param>
/// <param name="Search_col">대상 테이블명</param>
/// <param name="Search_Name">대상 데이터값</param>
public string More_Update(String DB_Table_Name,
String[] Edit_col, String[] Edit_name,
String[] Search_col, String[] Search_Name, int limit = 0)
{
string cmd = "UPDATE `" + DB_Table_Name + "` SET ";
for(int a = 0; a < Edit_col.Length; a++)
{
Edit_name[a] = Edit_name[a].Replace("\"", "\"\"");
cmd += "`" + Edit_col[a] + "` = \"" + Edit_name[a] + "\"";
if (a != Edit_col.Length - 1) { cmd += ", "; }
else { cmd += " "; }
}
cmd += "WHERE ";
for(int a = 0; a < Search_col.Length; a++)
{
cmd += "`" + Search_col[a] + "` = \"" + Search_Name[a] + "\" ";
if (a != Search_col.Length - 1) { cmd += "AND "; }
}
if(limit != 0) { cmd += string.Format("LIMIT {0}", limit); }
cmd += ";";
cmd = cmd.Replace("|", "");
return cmd;
}
/// <summary>
/// DB에 회사이름을 검색하여 만약 있는 회사일 경우 False 반환 / 없을경우 True반환
/// </summary>
/// <param name="Search_Data">검색할 회사 명</param>
/// <returns></returns>
public bool chk_comp(string Search_Data)
{
string cmd = "SELECT `comp_name` FROM `Comp`;";
// DB연결
conn.Open();
// 쿼리 맵핑
sqlcmd.CommandText = cmd;
// 쿼리 날릴 곳은 conn, 즉 아까 연결한 DB
sqlcmd.Connection = conn;
// 쿼리 날리기, sqlDataReader에 결과값 저장
sd = sqlcmd.ExecuteReader();
// 한줄씩 불러오기
while (sd.Read())
{
for (int cout = 0; cout < sd.FieldCount; cout++)
{
if(sd[cout].ToString() == Search_Data) { conn.Close(); return false; }
}
}
conn.Close();
return true;
}
/// <summary>
/// SQL문을 직접 만들어서 작성하여 사용해야함. (단, DELETE문/UPDATE문은 사용하지말 것!)
/// </summary>
/// <param name="cmd">등록할 SQL문</param>
/// <returns></returns>
public string self_Made_Cmd(string cmd)
{
cmd = cmd.Replace("|", "");
string result = "";
if (cmd.Contains("DELETE") == true || cmd.Contains("UPDATE") == true) { return ""; }
conn.Open();
try
{
sqlcmd.CommandText = cmd;
sqlcmd.Connection = conn;
sd = sqlcmd.ExecuteReader();
while (sd.Read())
{
for (int cout = 0; cout < sd.FieldCount; cout++)
{
result += sd[cout].ToString() + "|";
}
}
}
catch(Exception e)
{
MessageBox.Show("{0} Exception caught.\n"+ e.ToString());
MessageBox.Show(cmd);
}
conn.Close();
return result;
}
#region
/// <summary>
/// DBcon이 선진행되어야함. / SELECT * FROM DB_Table_Name WHERE DB_Where_Table = \"DB_Search_Data\";
/// <summary>
/// <param name="DB_Table_Name">테이블명</param>
/// <param name="DB_Where_Table">검색할 테이블</param>
/// <param name="DB_Search_Data">검색할 텍스트</param>
/// <returns>검색된 결과값이 반환됨.</returns>
public string DB_Search_Author(string DB_Table_Name, string Search_Area, string DB_Where_Table, string DB_Search_Data)
{
if (Search_Area == "") { Search_Area = "*"; }
string result = "";
// SELECT * FROM `Author_Symbol` WHERE `Author` <= '겐서' ORDER BY `Author` DESC LIMIT 1
string cmd = string.Format("SELECT `{0}` FROM `{1}` WHERE `{2}` <= \'{3}\' ORDER BY `{2}` DESC LIMIT 1;",
Search_Area, DB_Table_Name, DB_Where_Table, DB_Search_Data);
// DB연결
conn.Open();
// 쿼리 맵핑
sqlcmd.CommandText = cmd;
// 쿼리 날릴 곳은 conn, 즉 아까 연결한 DB
sqlcmd.Connection = conn;
// 쿼리 날리기, sqlDataReader에 결과값 저장
sd = sqlcmd.ExecuteReader();
// 한줄씩 불러오기
while (sd.Read())
{
for (int cout = 0; cout < sd.FieldCount; cout++)
{
result += sd[cout].ToString() + "|";
}
}
conn.Close();
return result;
}
/// <summary>
/// insert선 실행. 만약 값이 있을 경우 update로 전환
/// </summary>
/// <param name="Table"></param>
/// <param name="InsertCol"></param>
/// <param name="InsertData"></param>
/// <returns></returns>
public string DB_INSERT_DUPLICATE(string Table, string[] InsertCol, string[] InsertData)
{
string cmd = "INSERT INTO " + Table + "(";
for (int a = 0; a < InsertCol.Length; a++)
{
if (a == InsertCol.Length - 1) { cmd += "`" + InsertCol[a] + "`) "; }
else { cmd += "`" + InsertCol[a] + "`, "; }
}
cmd += "values(";
for (int a = 0; a < InsertData.Length; a++)
{
InsertData[a] = InsertData[a].Replace("\"", "\"\"");
if (a == InsertData.Length - 1) { cmd += "\"" + InsertData[a] + "\")"; }
else { cmd += "\"" + InsertData[a] + "\", "; }
}
cmd = cmd.Replace("|", "");
cmd += "ON DUPLICATE KEY UPDATE";
string sub_cmd = "";
for (int a = 0; a < InsertCol.Length; a++)
{
if (a == InsertCol.Length - 1)
sub_cmd += string.Format("`{0}` = \"{1}\";", InsertCol[a], InsertData[a]);
else
sub_cmd += string.Format("`{0}` = \"{1}\",", InsertCol[a], InsertData[a]);
}
cmd += sub_cmd;
return cmd;
}
#endregion
}
}

3402
unimarc/unimarc/Skill.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -29,8 +29,8 @@ namespace UniMarc.마크
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
this.btn_change = new System.Windows.Forms.Button();
this.btn_Close = new System.Windows.Forms.Button();
this.dataGridView1 = new System.Windows.Forms.DataGridView();
@@ -85,14 +85,14 @@ namespace UniMarc.마크
this.dataGridView1.BackgroundColor = System.Drawing.SystemColors.Control;
this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle5.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.before_book_name,
@@ -106,14 +106,14 @@ namespace UniMarc.마크
this.dataGridView1.Location = new System.Drawing.Point(0, 0);
this.dataGridView1.Name = "dataGridView1";
this.dataGridView1.ReadOnly = true;
dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle6.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle6.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle6.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle6.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle8;
this.dataGridView1.RowHeadersWidth = 30;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(579, 666);
@@ -242,7 +242,7 @@ namespace UniMarc.마크
//
// tb_PW
//
this.tb_PW.Location = new System.Drawing.Point(761, 12);
this.tb_PW.Location = new System.Drawing.Point(754, 12);
this.tb_PW.Name = "tb_PW";
this.tb_PW.Size = new System.Drawing.Size(100, 21);
this.tb_PW.TabIndex = 6;
@@ -259,7 +259,7 @@ namespace UniMarc.마크
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(736, 16);
this.label2.Location = new System.Drawing.Point(729, 16);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(23, 12);
this.label2.TabIndex = 7;

View File

@@ -58,7 +58,7 @@ namespace UniMarc.마크
{
int count = isbn.dataGridView1.Rows.Count;
for(int a= 0; a < count; a++)
for (int a = 0; a < count; a++)
{
string book_name = isbn.dataGridView1.Rows[a].Cells["book_name"].Value.ToString();
string author = isbn.dataGridView1.Rows[a].Cells["author"].Value.ToString();
@@ -67,7 +67,7 @@ namespace UniMarc.마크
string[] grid = {
book_name, Replace_target(book_name, "book_name"),
author, Replace_target(author, "author"),
book_comp, Replace_target(book_comp, "book_comp"),
book_comp, Replace_target(book_comp, "book_comp"),
unit
};
dataGridView1.Rows.Add(grid);

View File

@@ -163,14 +163,12 @@ namespace WindowsFormsApp1.Mac
if (row < 0) return;
string idx = dataGridView1.Rows[row].Cells["idx"].Value.ToString();
if (dataGridView1.Rows[row].Cells[col].ReadOnly) {
string[] Marc = {
dataGridView1.Rows[row].Cells["marc"].Value.ToString(),
dataGridView1.Rows[row].Cells["midx"].Value.ToString(),
dataGridView1.Rows[row].Cells["num"].Value.ToString(),
idx,
dataGridView1.Rows[row].Cells["idx"].Value.ToString(),
dataGridView1.Rows[row].Cells["ISBN"].Value.ToString()
};
string[] symbol_Type = {

View File

@@ -733,7 +733,7 @@ namespace UniMarc.마크
this.etcBox1.Dock = System.Windows.Forms.DockStyle.Fill;
this.etcBox1.Location = new System.Drawing.Point(4, 4);
this.etcBox1.Name = "etcBox1";
this.etcBox1.Size = new System.Drawing.Size(233, 218);
this.etcBox1.Size = new System.Drawing.Size(233, 220);
this.etcBox1.TabIndex = 0;
this.etcBox1.Text = "";
//
@@ -741,7 +741,7 @@ namespace UniMarc.마크
//
this.etcBox2.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.etcBox2.Dock = System.Windows.Forms.DockStyle.Fill;
this.etcBox2.Location = new System.Drawing.Point(4, 229);
this.etcBox2.Location = new System.Drawing.Point(4, 231);
this.etcBox2.Name = "etcBox2";
this.etcBox2.Size = new System.Drawing.Size(233, 223);
this.etcBox2.TabIndex = 0;
@@ -754,19 +754,19 @@ namespace UniMarc.마크
this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F));
this.tableLayoutPanel1.Controls.Add(this.etcBox2, 0, 1);
this.tableLayoutPanel1.Controls.Add(this.etcBox1, 0, 0);
this.tableLayoutPanel1.Location = new System.Drawing.Point(859, 267);
this.tableLayoutPanel1.Location = new System.Drawing.Point(859, 266);
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.Absolute, 229F));
this.tableLayoutPanel1.Size = new System.Drawing.Size(241, 456);
this.tableLayoutPanel1.Size = new System.Drawing.Size(241, 458);
this.tableLayoutPanel1.TabIndex = 0;
//
// Marc_Plan_Sub_MarcEdit
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1109, 736);
this.ClientSize = new System.Drawing.Size(1111, 736);
this.Controls.Add(this.tableLayoutPanel1);
this.Controls.Add(this.panel4);
this.Controls.Add(this.panel2);

View File

@@ -29,7 +29,7 @@ namespace UniMarc.마크
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
this.panel1 = new System.Windows.Forms.Panel();
this.tb_Search = new System.Windows.Forms.TextBox();
this.cb_gu = new System.Windows.Forms.ComboBox();
@@ -92,20 +92,20 @@ namespace UniMarc.마크
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(105, 6);
this.label2.Location = new System.Drawing.Point(103, 6);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(29, 12);
this.label2.Size = new System.Drawing.Size(33, 12);
this.label2.TabIndex = 0;
this.label2.Text = "검색";
this.label2.Text = "검 색";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(6, 6);
this.label1.Location = new System.Drawing.Point(4, 6);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(29, 12);
this.label1.Size = new System.Drawing.Size(33, 12);
this.label1.TabIndex = 0;
this.label1.Text = "구분";
this.label1.Text = "구 분";
//
// btn_Search
//
@@ -172,14 +172,14 @@ namespace UniMarc.마크
this.dataGridView1.AllowUserToAddRows = false;
this.dataGridView1.AllowUserToDeleteRows = false;
this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCellsExceptHeaders;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("굴림", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(129)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
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.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.idx,
@@ -263,7 +263,6 @@ namespace UniMarc.마크
//
// btn_OpenFile
//
this.btn_OpenFile.Enabled = false;
this.btn_OpenFile.Location = new System.Drawing.Point(680, 1);
this.btn_OpenFile.Name = "btn_OpenFile";
this.btn_OpenFile.Size = new System.Drawing.Size(61, 29);
@@ -288,6 +287,8 @@ namespace UniMarc.마크
this.ClientSize = new System.Drawing.Size(805, 357);
this.Controls.Add(this.panel3);
this.Controls.Add(this.panel2);
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "Marc_Plan_Sub_SelectList";
this.Text = "마크정리_목록선택";
this.Load += new System.EventHandler(this.Marc_Plan_Sub_SelectList_Load);

View File

@@ -230,7 +230,7 @@ namespace UniMarc.마크
try
{
System.IO.StreamReader r = new System.IO.StreamReader(filePath, Encoding.Default);
InputGrid(r.ReadToEnd());
InputGridByFileData(r.ReadToEnd());
r.Close();
}
catch (Exception ex)
@@ -239,17 +239,60 @@ namespace UniMarc.마크
}
}
}
#region OpenFileSub
void InputGrid(string text)
void InputGridByFileData(string text)
{
String_Text st = new String_Text();
/* "TODO: 마크 파일 내 마크만 표출하여 수정할 수 있게 추가작업 시작할 것."
1. 목록을 만든다. (목록명은 파일명)
ㄴ> 굳이 저장해서 더 보관할 필요가 있을까? 파일이 있는데?
2. 마크 파일내의 마크만 표출한다. ****
ㄴ> 현재 소스파일 분석결과 idx가 없을 경우 몇몇 기능에 장애가 생김.
ㄴ> 만약 저장기능만 제외하고 전부 쓸 수 있게 변경이 된다면?
ㄴ> 현재로썬 가장 가능성있음. DB에 저장할 필요 자체가 없이 로컬로 작업하는 것도 필요하다고 느낌.
*/
string[] grid = text.Split('');
for (int a = 0; a < grid.Length - 1; a++)
{
string[] Search = {
// 등록번호, 분류기호, 저자기호, 볼륨v, 복본c, 별치f
"049i", "090a", "090b", "049v", "049c", "049f",
// ISBN, 도서명, 총서명1, 총서번호1, 총서명2, 총서번호2, 출판사, 정가
"020a", "245a", "440a", "440n", "490a", "490n", "260b", "950b" };
string[] Search_Res = st.Take_Tag(grid[a], Search);
string[] Author_Search = { "100a", "110", "111a" };
string[] Author_Res = st.Take_Tag(grid[a], Author_Search);
string author_Fin = "";
foreach (string author in Author_Res)
{
if (author != "") {
author_Fin = author;
break;
}
}
string[] AddGrid = {
// idx, 연번, 등록번호, 분류, 저자기호
"", "", Search_Res[0], Search_Res[1], Search_Res[2],
// 볼륨v, 복본c, 별치f, 구분, isbn
Search_Res[3], Search_Res[4], Search_Res[5], "", Search_Res[6],
// 도서명, 총서명1, 총서번호1, 총서명1, 총서번호2
Search_Res[7], Search_Res[8], Search_Res[9], Search_Res[10], Search_Res[11],
// 저자, 출판사, 정가, midx, 마크
author_Fin, Search_Res[12], Search_Res[13], "", grid[a],
// 검색태그
"" };
mp.dataGridView1.Rows.Add(AddGrid);
this.Close();
}
}
#endregion
private void btn_Close_Click(object sender, EventArgs e)

View File

@@ -112,7 +112,7 @@
this.dataGridView1.RowHeadersWidth = 20;
this.dataGridView1.RowTemplate.Height = 23;
this.dataGridView1.Size = new System.Drawing.Size(1449, 630);
this.dataGridView1.TabIndex = 49;
this.dataGridView1.TabIndex = 0;
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);
//
// idx
@@ -278,7 +278,7 @@
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1449, 36);
this.panel1.TabIndex = 54;
this.panel1.TabIndex = 0;
//
// panel5
//