DB_Send_CMD_reVoid 를 ExecuteNoneQuery 로 대체

This commit is contained in:
2026-01-25 13:21:54 +09:00
parent 6c66cdb54a
commit e3d5674b0a
53 changed files with 200 additions and 210 deletions

View File

@@ -16,6 +16,32 @@ namespace UniMarc
public partial class Helper_DB
{
static string cs = "";
public static DataTable ExecuteQueryData(string query)
{
DataTable dt = new DataTable();
try
{
var cn = new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
using (MySqlDataAdapter adapter = new MySqlDataAdapter(cmd))
{
adapter.Fill(dt);
}
cmd.Dispose();
cn.Close();
cn.Dispose();
return dt;
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "ExecuteQueryData Error");
return null;
}
}
/// <summary>
/// 오류발생시 null을 반환합니다
/// </summary>
@@ -26,48 +52,34 @@ namespace UniMarc
/// <returns></returns>
public static DataTable GetDT(string tableName, string columns = "*", string wheres = "", string orders = "")
{
try
{
var sql = $"select {columns} from {tableName}";
if (wheres.isEmpty() == false) sql += " where " + wheres;
if (orders.isEmpty() == false) sql += " order by " + orders;
Helper_DB db = new Helper_DB();
var cn = db.CreateConnection();
var da = new MySql.Data.MySqlClient.MySqlDataAdapter(sql, cn);
var dt = new DataTable();
da.Fill(dt);
dt.AcceptChanges();
return dt;
}
catch
{
return null;
}
var sql = $"select {columns} from {tableName}";
if (wheres.isEmpty() == false) sql += " where " + wheres;
if (orders.isEmpty() == false) sql += " order by " + orders;
return ExecuteQueryData(sql);
}
/// <summary>
/// 오류발생시 -1을 반환합니다
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public static int ExcuteNonQuery(string query,out string errormessage)
public static (int applyCount, string errorMessage) ExcuteNonQuery(string query)
{
errormessage = string.Empty;
try
{
Helper_DB db = new Helper_DB();
var cn = db.CreateConnection();
var cn = new MySqlConnection(cs);
var cmd = new MySqlCommand(query, cn);
cn.Open();
var cnt = cmd.ExecuteNonQuery();
cmd.Dispose();
cn.Dispose();
return cnt;
return (cnt, string.Empty);
}
catch(Exception ex)
catch (Exception ex)
{
errormessage = ex.Message;
return -1;
return (-1, ex.Message);
}
}
}
@@ -118,13 +130,13 @@ namespace UniMarc
client.Connect();
if (client.IsConnected)
{
string strConnection = string.Format(
cs = string.Format(
"Server={0};" +
"Port={1};" +
"Database=unimarc;" +
"uid={2};" +
"pwd={3};", ServerData[0], DBData[0], DBData[1], DBData[2]);
conn = new MySqlConnection(strConnection);
conn = new MySqlConnection(cs);
}
}
}
@@ -183,30 +195,7 @@ namespace UniMarc
}
}
}
public DataTable ExecuteQueryData(string cmd)
{
DataTable dt = new DataTable();
try
{
conn.Open();
sqlcmd.CommandText = cmd;
sqlcmd.Connection = conn;
using (MySqlDataAdapter adapter = new MySqlDataAdapter(sqlcmd))
{
adapter.Fill(dt);
}
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString(), "ExecuteQueryData Error");
}
finally
{
if (conn.State == ConnectionState.Open) conn.Close();
}
return dt;
}
public string DB_Send_CMD_Search(string cmd)
{
@@ -308,10 +297,9 @@ namespace UniMarc
}
public int DB_Send_CMD_reVoid(string cmd)
{
var cnt = Helper_DB.ExcuteNonQuery(cmd,out string message);
if (cnt == -1) UTIL.MsgE($"데이터베이스 실행오류\n{message}");
return cnt;
var ret = Helper_DB.ExcuteNonQuery(cmd);
if (ret.applyCount == -1) UTIL.MsgE($"데이터베이스 실행오류\n{ret.errorMessage}");
return ret.applyCount;
}
public long DB_Send_CMD_Insert_GetIdx(string cmd)

View File

@@ -79,7 +79,7 @@ namespace UniMarc
return;
}
((Main)(this.Owner)).IPText.Text = string.Format("접속 아이피 : {0}", lbl_IP.Text);
db.DB_Send_CMD_reVoid(
Helper_DB.ExcuteNonQuery(
string.Format("UPDATE `User_Data` SET `lastIP` = \"{0}\", `lastDate` = \"{2}\" WHERE `ID` = \"{1}\"",
lbl_IP.Text, ID_text.Text, DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"))
);

View File

@@ -210,7 +210,7 @@ namespace UniMarc
string[] idx_col = { lbl_idx.Text };
string U_cmd = db.More_Update("Obj_List_Book", Table, List_book, idx_table, idx_col);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show("저장되었습니다.");
}
private void btn_close_Click(object sender, EventArgs e)
@@ -227,7 +227,7 @@ namespace UniMarc
string[] search_col = { PUB.user.CompanyIdx,
tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text };
string U_cmd = db.More_Update("Obj_List_Book", edit_tbl, edit_col, search_tbl, search_col);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(tb_book_name.Text + "가 입고처리되었습니다.");
mk_Grid();
}
@@ -243,7 +243,7 @@ namespace UniMarc
string[] search_col = { PUB.user.CompanyIdx,
tb_List_name.Text, tb_book_name.Text, tb_author.Text, tb_book_comp.Text, tb_isbn.Text };
string U_cmd = db.More_Update("Obj_List_Book", edit_tbl, edit_col, search_tbl, search_col);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(tb_book_name.Text + "가 미입고처리되었습니다.");
mk_Grid();

View File

@@ -93,7 +93,7 @@ namespace UniMarc
string[] edit_col = { "import", "etc" };
string[] edit_data = { "미입고", "반품처리 " + dataGridView1.Rows[a].Cells["etc"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List_Book", edit_col, edit_data, sear_col, sear_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
#endregion
private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)

View File

@@ -60,7 +60,7 @@ namespace UniMarc
string[] book_data = { date, New_Name.Text };
string U_cmd = DB.More_Update("Obj_List_Book", book_col, book_data, book_search_col, book_search_data);
DB.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
////////////////////////////////////////
@@ -71,7 +71,7 @@ namespace UniMarc
string[] list_data = { date, New_Clit.Text, New_Dlv.Text, New_User.Text, New_Name.Text };
U_cmd = DB.More_Update("Obj_List", list_col, list_data, list_search_col, list_search_data);
DB.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
Close();
}

View File

@@ -99,7 +99,7 @@ namespace UniMarc
string cmd = "";
cmd = DB.More_Update("Obj_List_Book", up_col, up_data1, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
int cout1 = Convert.ToInt32(list1[7]);
int cout2 = Convert.ToInt32(list2[7]);
int cout = cout1 + cout2;
@@ -111,17 +111,17 @@ namespace UniMarc
string[] edit_col = { "total", "compidx" };
string[] edit_data = { tol.ToString(), com.comp_idx };
cmd = DB.More_Update("Obj_List_Marc", edit_col, edit_data, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List_Marc", "compidx", com.comp_idx, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
edit_col[1] = "vol";
edit_data[1] = cout.ToString();
up_col[0] = "comp_num";
cmd = DB.More_Update("Obj_List", edit_col, edit_data, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List", "comp_num", com.comp_idx, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
}
/// <summary>
/// data1가 data2으로 적용됨. 1 => 2로
@@ -133,7 +133,7 @@ namespace UniMarc
string[] up_data2 = tmp2.ToArray();
string cmd = "";
cmd = DB.More_Update("Obj_List_Book", up_col, up_data2, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
int cout1 = Convert.ToInt32(list1[7]);
int cout2 = Convert.ToInt32(list2[7]);
int cout = cout1 + cout2;
@@ -145,17 +145,17 @@ namespace UniMarc
string[] edit_col = { "total", "compidx" };
string[] edit_data = { tol.ToString(), com.comp_idx };
cmd = DB.More_Update("Obj_List_Marc", edit_col, edit_data, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List_Marc", "compidx", com.comp_idx, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
edit_col[1] = "vol";
edit_data[1] = cout.ToString();
up_col[0] = "comp_num";
cmd = DB.More_Update("Obj_List", edit_col, edit_data, up_col, up_data2);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = DB.DB_Delete_More_term("Obj_List", "comp_num", com.comp_idx, up_col, up_data1);
DB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
}
}
}

View File

@@ -220,7 +220,7 @@ namespace UniMarc
data[12], PUB.user.CompanyIdx, data[7] };
string Incmd = db.DB_INSERT("Obj_List", col_name, setData);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
Grid1_total();
dataGridView2.Rows.Add(add_grid_data);
@@ -288,9 +288,9 @@ namespace UniMarc
string[] del_table = { "date", "list_name" };
string cmd = db.DB_Delete_More_term("Obj_List", "comp_num", PUB.user.CompanyIdx, del_table, del_target);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = db.DB_Delete_No_Limit("Obj_List_Book", "compidx", comp_idx, del_table, del_target);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
dataGridView2.Rows.Remove(dataGridView2.Rows[delcout]);
}
@@ -392,7 +392,7 @@ namespace UniMarc
}
}
string Incmd = db.DB_INSERT("Obj_List_Book", DB_col_name, setData);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
}
private void dataGridView2_CellClick(object sender, DataGridViewCellEventArgs e)
@@ -446,7 +446,7 @@ namespace UniMarc
string[] sear_name = { dataGridView2.Rows[a].Cells["list_date"].Value.ToString(),
dataGridView2.Rows[a].Cells["list_name"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List", edit_col, edit_name, seer_col, sear_name);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView2.Rows[a].Cells["stat2"].Value = "진행";
}
}
@@ -468,7 +468,7 @@ namespace UniMarc
string[] sear_name = { dataGridView2.Rows[a].Cells["list_date"].Value.ToString(),
dataGridView2.Rows[a].Cells["list_name"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List", edit_col, edit_name, seer_col, sear_name);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView2.Rows[a].Cells["stat2"].Value = "완료";
}
}

View File

@@ -85,7 +85,7 @@ namespace UniMarc
string[] where = { "book_name", "isbn", "book_comp", "author", "pay",
"order", "count", "import_date", "compidx" };
string Incmd = db.DB_INSERT(table_name, where, input);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
MessageBox.Show("저장되었습니다!");
}
private bool grid_text_savechk()
@@ -181,7 +181,7 @@ namespace UniMarc
string[] edit_where = { "book_name", "isbn", "book_comp", "author", "pay",
"order", "count" };
string U_cmd = db.More_Update(table_name, edit_where, edit_data, ser_where, ser_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView1.Rows[rowidx].Cells["book_name"].Value = tb_book_name.Text;
dataGridView1.Rows[rowidx].Cells["isbn"].Value = tb_isbn.Text;

View File

@@ -105,7 +105,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["book_name"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List_Book", edit_col, edit_data, search_col, search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
}
/// <summary>

View File

@@ -244,7 +244,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["idx"].Value.ToString()
};
string U_cmd = db.More_Update(table, Edit_col, Edit_Data, Search_col, Search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
MessageBox.Show("저장되었습니다.");
}
@@ -272,10 +272,10 @@ namespace UniMarc
Sales(db_res, value);
string U_cmd = db.More_Update("Obj_List_Marc", Edit_col, Edit_data, Search_col, Search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
Search_col[0] = "comp_num";
U_cmd = db.More_Update("Obj_List", Edit_col, Edit_data, Search_col, Search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show("정상적으로 완료처리 되었습니다.");
}
@@ -323,7 +323,7 @@ namespace UniMarc
book[5], out_per, total[0], total[1], total[2], book[6], etc };
string Incmd = db.DB_INSERT("Sales", col_name, insert_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
private string[] Cal_out_price(string price_st, string count_st, string out_per_st, string in_per_st)
{

View File

@@ -279,7 +279,7 @@ namespace UniMarc
if (edit_data[1] == "") { edit_data[1] = "0"; }
else if (edit_data[1] == "V") { edit_data[1] = "1"; }
string U_cmd = db.More_Update("Obj_List_Book", edit_col, edit_data, sear_col, sear_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
MessageBox.Show("저장되었습니다!");
}
@@ -638,12 +638,12 @@ namespace UniMarc
string Fax_Key = fax.Send_BaroFax(filename, fax_param);
string U_cmd = db.DB_Update("Comp", "fax_Key", Fax_Key, "idx", compidx);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
string[] col_Name = { "compidx", "구분", "팩스전송키", "날짜", "시간", "전송파일명" };
string[] set_Data = { compidx, "팩스", Fax_Key, Date, Time, filename };
string Incmd = db.DB_INSERT("Send_Order", col_Name, set_Data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
return true;
}
@@ -701,7 +701,7 @@ namespace UniMarc
string[] col_Name = { "compidx", "구분", "거래처명", "날짜", "시간", "보낸이", "받는이", "전송파일명", "전송결과" };
string[] set_Data = { compidx, "메일", pur, Date, Time, arr_db[0], m_send, filename, "성공" };
string Incmd = db.DB_INSERT("Send_Order", col_Name, set_Data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
lbl_OrderStat.Text = "메일 전송 성공!";
return true;
}

View File

@@ -651,7 +651,7 @@ namespace UniMarc
string[] edit_Data = { "입고", dataGridView2.Rows[a].Cells["Date"].Value.ToString(),
dataGridView2.Rows[a].Cells["isbn2"].Value.ToString() };
string U_cmd = db.More_Update("Obj_List_Book", edit_Col, edit_Data, search_Col, search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
/* 입고작업을 하려는 책이 재고에 있을 경우, 재고 -1이 되어야함.
* 만약 재고수보다 입고수가 더 많을경우는?
@@ -694,7 +694,7 @@ namespace UniMarc
string[] Edit_col = { "input_count" };
string[] Edit_data = { Inven_count(db_data[0], dataGridView2.Rows[a].Cells["count2"].Value.ToString(), a) };
string U_cmd = db.More_Update("Obj_List_Book", Edit_col, Edit_data, Search_col, Search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
}
/// <summary>
@@ -736,7 +736,7 @@ namespace UniMarc
dataGridView2.Rows[row].Cells["list_name2"].Value.ToString()
};
string U_cmd = db.More_Update("Obj_List_Book", Edit_Col, Edit_Data, Search_Name, Search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
dataGridView2.Rows[row].Cells["edasd"].Value = res.ToString();
}
@@ -791,7 +791,7 @@ namespace UniMarc
if (db_res.Length < 3)
{
string Incmd = db.DB_INSERT("Inven", input_col, input_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
MessageBox.Show("DB 새로 추가");
return;
}
@@ -804,7 +804,7 @@ namespace UniMarc
count += data;
MessageBox.Show("DB 수정");
string U_cmd = db.DB_Update("Inven", "count", count.ToString(), "idx", cout[0]);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
}
@@ -833,7 +833,7 @@ namespace UniMarc
tata[9] = "재고가감";
}
string Incmd = db.DB_INSERT("Buy_ledger", Area, tata);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
}
/// <summary>

View File

@@ -70,13 +70,13 @@ namespace UniMarc
,nudCompIDX.Value.ToString(),tbIP.Text
}; // 15
tCmd = mDb.DB_INSERT("Comp", tInsertCol, tInsertData);
mDb.DB_Send_CMD_reVoid(tCmd);
Helper_DB.ExcuteNonQuery(tCmd);
//// IP 적용
//string[] IP_Col = { "compidx", "comp", "IP" };
//string[] IP_Data = { mDb.chk_comp(tb_sangho.Text), tb_sangho.Text, tbIP.Text };//cb_IPList.Text
//tCmd = mDb.DB_INSERT("Comp_IP", IP_Col, IP_Data);
//mDb.DB_Send_CMD_reVoid(tCmd);
//Helper_DB.ExcuteNonQuery(tCmd);
RefreshList();
@@ -106,7 +106,7 @@ namespace UniMarc
string[] tSearch_col = { dgvList.SelectedRows[0].Cells["dbIDX"].Value.ToString() };
string U_cmd = mDb.More_Update("Comp", tEdit_tbl, tEdit_col, tSearch_tbl, tSearch_col);
mDb.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
RefreshList();
}
@@ -123,7 +123,7 @@ namespace UniMarc
if (UTIL.MsgQ(tText) == DialogResult.Yes)
{
string tD_cmd = mDb.DB_Delete("Comp", "idx", dgvList.SelectedRows[0].Cells["dbIDX"].Value.ToString(), "comp_name", dgvList.SelectedRows[0].Cells["comp_name"].Value.ToString());
mDb.DB_Send_CMD_reVoid(tD_cmd);
Helper_DB.ExcuteNonQuery(tD_cmd);
TextClear();
}
RefreshList();

View File

@@ -106,13 +106,13 @@ namespace UniMarc
tb_bank_comp.Text, tb_bank_no.Text, tb_email.Text, tb_barea.Text, "외부업체"
}; // 15
db.DB_Send_CMD_reVoid(db.DB_INSERT("Comp", InsertCol, InsertData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("Comp", InsertCol, InsertData));
// IP 적용
string[] IP_Col = { "compidx","comp", "IP" };
string[] IP_Data = { db.chk_comp(tb_sangho.Text), tb_sangho.Text,tbIP.Text };//cb_IPList.Text
db.DB_Send_CMD_reVoid(db.DB_INSERT("Comp_IP", IP_Col, IP_Data));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("Comp_IP", IP_Col, IP_Data));
InsertAccount(tb_sangho.Text);
}
@@ -129,11 +129,11 @@ namespace UniMarc
string[] InsertUserSubData = { ID };
string[] InsertUserSubCol = { "id" };
db.DB_Send_CMD_reVoid(db.DB_INSERT("User_Data", InsertCol, InsertData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("User_Data", InsertCol, InsertData));
// User_ShortCut, User_Access 추가.
db.DB_Send_CMD_reVoid(db.DB_INSERT("User_ShortCut", InsertUserSubCol, InsertUserSubData));
db.DB_Send_CMD_reVoid(db.DB_INSERT("User_Access", InsertUserSubCol, InsertUserSubData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("User_ShortCut", InsertUserSubCol, InsertUserSubData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("User_Access", InsertUserSubCol, InsertUserSubData));
}
private void btn_close_Click(object sender, EventArgs e)

View File

@@ -335,7 +335,7 @@ namespace UniMarc
//}
string UpCMD = db.More_Update(Table, EditTable, EditColumn, SearchTable, SearchColumn);
PUB.log.Add("ADDMarcUPDATE", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, UpCMD.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(UpCMD);
Helper_DB.ExcuteNonQuery(UpCMD);
}
@@ -365,7 +365,7 @@ namespace UniMarc
string InCMD = db.DB_INSERT(Table, InsertTable, InsertColumn);
PUB.log.Add("ADDMarcINSERT", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, InCMD.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(InCMD);
Helper_DB.ExcuteNonQuery(InCMD);
}
/// <summary>

View File

@@ -265,7 +265,7 @@ namespace UniMarc
//}
string UpCMD = db.More_Update(Table, EditTable, EditColumn, SearchTable, SearchColumn);
PUB.log.Add("ADDMarcUPDATE", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, UpCMD.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(UpCMD);
Helper_DB.ExcuteNonQuery(UpCMD);
}
/// <summary>
@@ -294,7 +294,7 @@ namespace UniMarc
string InCMD = db.DB_INSERT(Table, InsertTable, InsertColumn);
PUB.log.Add("ADDMarcINSERT", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, InCMD.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(InCMD);
Helper_DB.ExcuteNonQuery(InCMD);
}
/// <summary>

View File

@@ -172,7 +172,7 @@ namespace UniMarc
dataGridView1.Rows[V_idx].Cells["set_price"].Value.ToString() };
string cmd = db.DB_Delete_No_Limit("Set_Book", "compidx", PUB.user.CompanyIdx, delete_area, delete_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
}
btn_Search_Click(null, null);

View File

@@ -85,7 +85,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["price"].Value.ToString(), PUB.user.UserName };
string Incmd = db.DB_INSERT("Set_Book", insert_tbl, insert_col);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
MessageBox.Show("저장완료");

View File

@@ -57,7 +57,7 @@ namespace UniMarc
tb_set_price_new.Text };
string U_cmd = db.More_Update(table, edit_tbl, edit_col, sear_tbl, sear_col);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show("변경되었습니다!");
manage.btn_Search_Click(null, null);
this.Close();

View File

@@ -164,7 +164,7 @@ namespace UniMarc
string[] SearchCol = { "idx" };
string[] SearchData = { midx };
db.DB_Send_CMD_reVoid(db.More_Update("DVD_Marc", EditCol, EditData, SearchCol, SearchData));
Helper_DB.ExcuteNonQuery(db.More_Update("DVD_Marc", EditCol, EditData, SearchCol, SearchData));
dataGridView1.Rows[row].Cells["marc"].Value = orimarc;
}
@@ -333,7 +333,7 @@ namespace UniMarc
string[] InsertCol = { "Code", "user", "date", "Marc", "etc1", "etc2" };
string[] InsertData = { code, user, date, orimarc, etcData1, etcData2 };
db.DB_Send_CMD_reVoid(db.DB_INSERT("DVD_Marc", InsertCol, InsertData));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("DVD_Marc", InsertCol, InsertData));
dataGridView1.Rows[row].Cells["m_idx"].Value =
db.DB_Send_CMD_Search(
@@ -519,7 +519,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["comp"].Value.ToString(),
dataGridView1.Rows[a].Cells["price"].Value.ToString()
};
db.DB_Send_CMD_reVoid(db.DB_INSERT("DVD_List_Product", Insert_col, Insert_data));
Helper_DB.ExcuteNonQuery(db.DB_INSERT("DVD_List_Product", Insert_col, Insert_data));
}
}
@@ -527,7 +527,7 @@ namespace UniMarc
for (int a = 0; a < DeleteIndex.Count; a++)
{
db.DB_Send_CMD_reVoid(db.DB_Delete("DVD_List_Product", "compidx", PUB.user.CompanyIdx, "idx", DeleteIndex[a]));
Helper_DB.ExcuteNonQuery(db.DB_Delete("DVD_List_Product", "compidx", PUB.user.CompanyIdx, "idx", DeleteIndex[a]));
}
}

View File

@@ -84,8 +84,8 @@ namespace UniMarc
ProductCMD = ProductCMD.TrimEnd(',');
ProductCMD += ";";
db.DB_Send_CMD_reVoid(listCMD);
db.DB_Send_CMD_reVoid(ProductCMD);
Helper_DB.ExcuteNonQuery(listCMD);
Helper_DB.ExcuteNonQuery(ProductCMD);
MessageBox.Show("저장되었습니다.");
}

View File

@@ -363,7 +363,7 @@ namespace UniMarc
for (int a = SelectIndex.Count - 1; a >= 0; a--)
{
dataGridView1.Rows.RemoveAt(SelectIndex[a]);
db.DB_Send_CMD_reVoid(
Helper_DB.ExcuteNonQuery(
db.DB_Delete("DVD_List_Product", "idx", dataGridView1.Rows[SelectIndex[a]].Cells["idx"].Value.ToString(), "compidx", compidx)
);
}

View File

@@ -105,7 +105,7 @@ namespace UniMarc
string compidx = Properties.Settings.Default.compidx;
string cmd = db.DB_Delete("DVD_List", "compidx", compidx, "idx", idx);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("삭제되었습니다.");
}

View File

@@ -727,12 +727,12 @@ namespace UniMarc
Search_tbl[0] = "set_book_name";
string U_cmd = db.More_Update("Obj_List_Book", Edit_tbl, Edit_Col, Search_tbl, Search_col, 1);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
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]);
db.DB_Send_CMD_reVoid(CMcmd);
Helper_DB.ExcuteNonQuery(CMcmd);
}
}
MessageBox.Show("저장되었습니다!");

View File

@@ -141,7 +141,7 @@ namespace UniMarc
};
// 정가 != 단가 일경우 INSERT 오류 발생.
string Incmd = db.DB_INSERT("Obj_List_Book", Insert_col, tmp_db);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
#endregion

View File

@@ -23,6 +23,7 @@ namespace UniMarc
public string text008 { get; set; }
public string tag056 { get; set; }
public bool NewMake { get; set; }
public string OriginalMarc { get; set; }
}
}

View File

@@ -165,7 +165,7 @@ namespace UniMarc
// string Incmd = db.DB_INSERT_DUPLICATE(table, col, data);
string Incmd = db.DB_INSERT(table, col, data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
catch (Exception ex) { MessageBox.Show(ex.Message); }
}

View File

@@ -72,7 +72,7 @@ namespace UniMarc
"AND `chk_marc` > 0;",
Area, table, compidx, search, state);
DataTable dt = db.ExecuteQueryData(cmd);
DataTable dt = Helper_DB.ExecuteQueryData(cmd);
List<MacListItem> items = new List<MacListItem>();
if (dt == null || dt.Rows.Count == 0)
@@ -132,7 +132,7 @@ namespace UniMarc
string[] sear_tbl = { item.idx, compidx };
string U_cmd = db.More_Update(table, edit_col, edit_tbl, sear_col, sear_tbl);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
item.check = "";
}
@@ -226,7 +226,7 @@ namespace UniMarc
string[] sear_col = { "idx", "comp_num" };
string[] sear_tbl = { item.idx, compidx };
string U_cmd = db.More_Update("Obj_List", edit_col, edit_tbl, sear_col, sear_tbl);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
void state_Save(int row)
@@ -244,12 +244,12 @@ namespace UniMarc
{
string l_idx = item.idx;
string D_cmd = db.DB_Delete("Obj_List", "comp_num", compidx, "idx", l_idx);
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
string[] delete_tbl = { "l_idx" };
string[] deleteData = { l_idx };
D_cmd = db.DB_Delete_No_Limit("Obj_List_Book", "compidx", compidx, delete_tbl, deleteData);
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
}
MessageBox.Show("삭제되었습니다.");

View File

@@ -143,13 +143,13 @@ namespace UniMarc
InList_Col[5] = TotalCount.ToString();
string InList_Cmd = db.DB_INSERT("Obj_List", InList_Tbl, InList_Col);
db.DB_Send_CMD_reVoid(InList_Cmd);
Helper_DB.ExcuteNonQuery(InList_Cmd);
string listIdx = db.DB_Send_CMD_Search(db.More_DB_Search("Obj_List", InList_Tbl, InList_Col, "`idx`")).Replace("|", "");
string InBook_Col = string.Join(", ", InBook_List).Replace(InList_Idx, listIdx);
string InBook_Cmd = string.Format("INSERT INTO `Obj_List_Book` ({0}) VALUES {1};", InBook_Area, InBook_Col);
db.DB_Send_CMD_reVoid(InBook_Cmd);
Helper_DB.ExcuteNonQuery(InBook_Cmd);
MessageBox.Show("저장되었습니다!");
ml.btn_Lookup_Click(null, null);

View File

@@ -110,7 +110,7 @@ namespace UniMarc
};
string Incmd = db.DB_INSERT(table, in_col, in_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
void book_Insert(int row)
@@ -158,7 +158,7 @@ namespace UniMarc
string InsertData = string.Join(", ", tmpList);
string InCmd = string.Format("INSERT INTO `{0}` ({1}) VALUES {2};", table, Insert_Col, InsertData);
db.DB_Send_CMD_reVoid(InCmd);
Helper_DB.ExcuteNonQuery(InCmd);
}
string Find_ListIndex()
@@ -180,7 +180,7 @@ namespace UniMarc
{
target[0] = dataGridView1.Rows[a].Cells["idx"].Value.ToString();
string cmd = db.DB_Delete_More_term(table, "comp_num", ml.compidx, target_area, target);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
book_Delete(a);
}
@@ -199,7 +199,7 @@ namespace UniMarc
};
string cmd = db.DB_Delete_No_Limit(table, "compidx", ml.compidx, target_Col, targetData);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
}
bool chk_Overlap()

View File

@@ -283,7 +283,7 @@ namespace UniMarc
return Color.Gray;
case "3": // D
return Color.Red;
return Color.DarkViolet;
default:
return Color.Black;
@@ -533,7 +533,7 @@ namespace UniMarc
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}", PUB.user.UserName, PUB.user.CompanyIdx, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
isNewData = false;
}
@@ -550,7 +550,7 @@ namespace UniMarc
string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND 'compidx' ={2};",
Midx, List_Book.Rows[SaveRowIdx].Cells["list_idx"].Value.ToString(), PUB.user.CompanyIdx);
PUB.log.Add("MarcUpdate", string.Format("{0}({1}) : {2}", PUB.user.UserName, PUB.user.CompanyIdx, UpdateListIndex));
db.DB_Send_CMD_reVoid(UpdateListIndex);
Helper_DB.ExcuteNonQuery(UpdateListIndex);
MessageBox.Show("저장되었습니다!");
}
@@ -3585,9 +3585,9 @@ namespace UniMarc
if (int.TryParse(lbCustIDX.Text, out int custidx) && custidx >= 0)
{
var sql = $"update Obj_List set customer={custidx} where idx = {l_idx} and comp_num={c_idx}";
var cnt = Helper_DB.ExcuteNonQuery(sql, out string msg);
if (cnt != 1)
UTIL.MsgE($"데이터 저장시 오류가 발생했습니다. 영향을 받은 행 수 = {cnt},메세지={msg}");
var ret = Helper_DB.ExcuteNonQuery(sql);
if (ret.applyCount != 1)
UTIL.MsgE($"데이터 저장시 오류가 발생했습니다. 영향을 받은 행 수 = {ret.applyCount},메세지={ret.errorMessage}");
}
}

View File

@@ -413,7 +413,8 @@ namespace UniMarc
Publisher = publisher,
Price = price,
Remark1 = remark.remark1,
Remark2 = remark.remark2
Remark2 = remark.remark2,
OriginalMarc = dbMarc,
};
marcEditorControl1.LoadBookData(dbMarc, p);
}
@@ -630,7 +631,7 @@ namespace UniMarc
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, List_Book.Rows[SaveRowIdx].DefaultCellStyle.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
isNewData = false;
}
@@ -650,24 +651,25 @@ namespace UniMarc
string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND 'compidx' ={2};",
Midx, List_Book.Rows[SaveRowIdx].Cells["list_idx"].Value.ToString(), mCompidx);
PUB.log.Add("MarcUpdate", string.Format("{0}({1}) : {2}", mUserName, mCompidx, UpdateListIndex));
db.DB_Send_CMD_reVoid(UpdateListIndex);
Helper_DB.ExcuteNonQuery(UpdateListIndex);
MessageBox.Show("저장되었습니다!");
*/
// [신규 방식: 데이터 객체(Item) 중심 로직]
var item = this.dataList.Where(t => t.ListIdx == e.Param.ListIdx).FirstOrDefault();
if (item == null) return;
string table_name = "Marc";
string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
string orimarc = e.DBMarc;
string Midx = item.MarcIdx;
string newsavedMarc = e.DBMarc;
//string Midx = item.MarcIdx;
// 1. DB 작업 (저장 전략 결정: Foreground 색상 기준)
if (item.ForeColor == Color.Orange || item.ForeColor == Color.Red)
{
string[] Insert_tbl = { "ISBN", "서명", "저자", "출판사", "가격", "marc", "비고1", "비고2", "url", "grade", "marc_chk", "user", "division", "008tag", "date", "compidx" };
string[] Insert_col = { e.Param.ISBN13, e.Param.BookName, e.Param.Author, e.Param.Publisher, e.Param.Price, orimarc, e.Param.Remark1, e.Param.Remark2, e.Param.URL, e.Param.Grade, "1", mUserName, e.Param.tag056, e.Param.text008, date, mCompidx };
string[] Insert_col = { e.Param.ISBN13, e.Param.BookName, e.Param.Author, e.Param.Publisher, e.Param.Price, newsavedMarc, e.Param.Remark1, e.Param.Remark2, e.Param.URL, e.Param.Grade, "1", mUserName, e.Param.tag056, e.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.ForeColor, Incmd));
@@ -675,22 +677,21 @@ namespace UniMarc
long newIdx = db.DB_Send_CMD_Insert_GetIdx(Incmd);
if (newIdx > 0)
{
Midx = newIdx.ToString();
item.MarcIdx = Midx;
item.MarcIdx = newIdx.ToString();
}
}
else
{
string[] Edit_tbl = { "compidx", "marc", "marc_chk", "marc1", "marc_chk1", "비고1", "비고2", "url", "division", "008tag", "date", "user", "grade" };
string[] Edit_col = { mCompidx, orimarc, "1", mOldMarc , "0", e.Param.Remark1, e.Param.Remark2, e.Param.URL, e.Param.tag056,e.Param.text008, date, mUserName, e.Param.Grade };
string[] Edit_col = { mCompidx, newsavedMarc, "1", e.Param.OriginalMarc , "0", e.Param.Remark1, e.Param.Remark2, e.Param.URL, e.Param.tag056,e.Param.text008, date, mUserName, e.Param.Grade };
string[] Sear_tbl = { "idx", "compidx" };
string[] Sear_col = { Midx, mCompidx };
string[] Sear_col = { item.MarcIdx, mCompidx };
if (string.IsNullOrEmpty(e.Param.ISBN13)) { MessageBox.Show("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.ForeColor, U_cmd.Replace("\r", " ").Replace("\n", " ")));
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
// 2. 객체 데이터 업데이트 및 시각적 상태 계산
@@ -702,8 +703,8 @@ namespace UniMarc
item.BackColor = GetSaveDateColor(date);
// 3. 목록 인덱스 연동 업데이트 (Obj_List_Book)
string UpdateListIndex = string.Format("UPDATE `Obj_List_Book` SET `m_idx` = {0} WHERE `idx` = {1} AND `compidx` ={2};", Midx, item.ListIdx, mCompidx);
db.DB_Send_CMD_reVoid(UpdateListIndex);
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();
@@ -990,9 +991,9 @@ namespace UniMarc
if (int.TryParse(lbCustIDX.Text, out int custidx) && custidx >= 0)
{
var sql = $"update Obj_List set customer={custidx} where idx = {pItem.idx} and comp_num={PUB.user.CompanyIdx}";
var cnt = Helper_DB.ExcuteNonQuery(sql, out string msg);
if (cnt != 1)
UTIL.MsgE($"데이터 저장시 오류가 발생했습니다. 영향을 받은 행 수 = {cnt},메세지={msg}");
var ret = Helper_DB.ExcuteNonQuery(sql);
if (ret.applyCount != 1)
UTIL.MsgE($"데이터 저장시 오류가 발생했습니다. 영향을 받은 행 수 = {ret.applyCount},메세지={ret.errorMessage}");
}
}

View File

@@ -500,10 +500,10 @@ namespace UniMarc
};
string InsertCmd = db.DB_INSERT("Marc_Del", InsertCol, InsertData);
db.DB_Send_CMD_reVoid(InsertCmd);
Helper_DB.ExcuteNonQuery(InsertCmd);
string DeleteCmd = string.Format("DELETE FROM `Marc` WHERE `idx` = {0};", idx);
db.DB_Send_CMD_reVoid(DeleteCmd);
Helper_DB.ExcuteNonQuery(DeleteCmd);
dataGridView1.Rows.Remove(dataGridView1.Rows[row]);
}

View File

@@ -146,7 +146,7 @@ namespace UniMarc
string[] Search_col = { "work_list", "date" };
string[] Search_data = { ListName, date };
string cmd = db.More_DB_Search(Table, Search_col, Search_data, Area);
var res = db.ExecuteQueryData(cmd); // Assumed called above
var res = Helper_DB.ExecuteQueryData(cmd); // Assumed called above
var list = new List<MarcPlanItem>();
int tCnt = 1;
@@ -662,7 +662,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["idx"].Value.ToString() };
string Ucmd = db.More_Update(table, Edit_Col, Edit_Data, Where_Col, Where_Data);
db.DB_Send_CMD_reVoid(Ucmd);
Helper_DB.ExcuteNonQuery(Ucmd);
}
MessageBox.Show("저장되었습니다.");

View File

@@ -181,7 +181,7 @@ namespace UniMarc
string idx = dataGridView1.Rows[row].Cells["idx"].Value.ToString();
string cmd = string.Format("DELETE FROM `PrintLabel` WHERE `idx` = {0}", idx);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
dataGridView1.Rows.Remove(dataGridView1.Rows[row]);
}
@@ -232,7 +232,7 @@ namespace UniMarc
string U_cmd = db.More_Update("PrintLabel", editCol, editData, SearchCol, SearchData);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(tb_ListName.Text + "가 성공적으로 수정되었습니다!", "수정완료");
}
@@ -255,7 +255,7 @@ namespace UniMarc
string Incmd = db.DB_INSERT("PrintLabel", InsertCol, InsertData);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
MessageBox.Show(tb_ListName.Text + "가 성공적으로 저장되었습니다!", "저장완료");
}

View File

@@ -487,7 +487,7 @@ namespace UniMarc
string cmd = db.More_Update(Table, Update_Col, Update_data, Search_Col, Search_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
InputBookData(SearchBookTag);
MessageBox.Show("저장되었습니다!");
@@ -543,7 +543,7 @@ namespace UniMarc
//}
string Ucmd = db.More_Update(Table, Update_Col, Update_data, Search_Col, Search_data);
db.DB_Send_CMD_reVoid(Ucmd);
Helper_DB.ExcuteNonQuery(Ucmd);
MessageBox.Show("저장되었습니다!");
@@ -704,7 +704,7 @@ namespace UniMarc
string[] Update_col = { "midx", "num" };
string[] Update_Data = { tb_Mcode.Text, tb_num.Text };
string cmd = db.More_Update(Table, Update_col, Update_Data, Search_col, Search_Data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("적용되었습니다!");
}

View File

@@ -140,7 +140,7 @@ namespace UniMarc
};
string cmd = db.More_Update(Table, Update_Col, Update_data, Search_Col, Search_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
// Notify Parent
BookUpdated?.Invoke(this, new BookUpdatedEventArgs { BookName = BookName, Marc = oriMarc });

View File

@@ -135,7 +135,7 @@ namespace UniMarc
update_data[0] = "진행";
string cmd = db.More_Update("Specs_List", update_col, update_data, search_col, search_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
btn_Search_Click(null, e);
}
@@ -211,11 +211,11 @@ namespace UniMarc
// 목록 제거
string cmd = db.DB_Delete_More_term("Specs_List", "idx", idx, search_col, search_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
// 목록 내 마크 제거
cmd = db.DB_Delete_No_Limit("Specs_Marc", "compidx", compidx, search_col, search_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("삭제되었습니다.");
btn_Search_Click(null, null);

View File

@@ -92,7 +92,7 @@ namespace UniMarc
string[] search_col = { "idx" };
string[] search_data = { IDX };
string cmd = db.More_Update("Specs_List", update_col, update_data, search_col, search_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("저장완료되었습니다.");
sub.btn_Search_Click(null, null);
this.Close();

View File

@@ -66,7 +66,7 @@ namespace UniMarc
string[] Update_Data = { tb_ListName.Text, NowDate, MorgeUser };
string U_cmd = db.More_Update("Specs_List", Update_Col, Update_Data, Search_Col, Search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
// 마크 수정
for (int a = 0; a < dataGridView1.Rows.Count; a++)
@@ -80,13 +80,13 @@ namespace UniMarc
};
string cmd = db.More_Update("Specs_Marc", Update_Col, Update_Data, Col, Data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
if (a != 0) {
string listIdx = dataGridView1.Rows[a].Cells["idx"].Value.ToString();
string listDate = dataGridView1.Rows[a].Cells["ListDate"].Value.ToString();
string D_cmd = db.DB_Delete("Specs_List", "idx", listIdx, "date", listDate);
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
}
}

View File

@@ -360,8 +360,8 @@ namespace UniMarc
cmdByMarc = cmdByMarc.TrimEnd(',');
cmdByMarc += ";";
db.DB_Send_CMD_reVoid(cmdByList);
db.DB_Send_CMD_reVoid(cmdByMarc);
Helper_DB.ExcuteNonQuery(cmdByList);
Helper_DB.ExcuteNonQuery(cmdByMarc);
progressBar1.PerformStep();
if (progressBar1.Value == progressBar1.Maximum)

View File

@@ -202,7 +202,7 @@ namespace UniMarc
string[] Insert_Col = { compidx, value, user, MacroIndex };
string cmd = db.DB_INSERT(Table, Insert_Tbl, Insert_Col);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
//cb_SearchList.Items.Add(value);
Refresh_Macro_List();
}
@@ -245,7 +245,7 @@ namespace UniMarc
string[] Update_T = { "Macroidx" };
string[] Update_C = { MacroIndex };
db.DB_Send_CMD_reVoid(db.More_Update(Table, Update_T, Update_C, Search_T, Search_C));
Helper_DB.ExcuteNonQuery(db.More_Update(Table, Update_T, Update_C, Search_T, Search_C));
MessageBox.Show("저장되었습니다!");
}
@@ -267,7 +267,7 @@ namespace UniMarc
return;
}
db.DB_Send_CMD_reVoid(db.DB_Delete_More_term(Table, "compidx", compidx, Search_T, Search_C));
Helper_DB.ExcuteNonQuery(db.DB_Delete_More_term(Table, "compidx", compidx, Search_T, Search_C));
MessageBox.Show("삭제되었습니다!");
Refresh_Macro_List();
}

View File

@@ -185,7 +185,7 @@ namespace UniMarc
}
string cmd = InCmd + UpCmd;
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("저장완료!");

View File

@@ -258,11 +258,11 @@ namespace UniMarc
string[] Insert_Data = { tb_ID.Text, tb_PW.Text, tb_Name.Text, cbCompany.Text, tb_position.Text, tb_Phone.Text };
tCmd = mDB.DB_INSERT("User_Data", Insert_Col, Insert_Data);
mDB.DB_Send_CMD_reVoid(tCmd);
Helper_DB.ExcuteNonQuery(tCmd);
tCmd = mDB.DB_INSERT("User_Access", tUserAcess_Col, Update_Data);
mDB.DB_Send_CMD_reVoid(tCmd);
Helper_DB.ExcuteNonQuery(tCmd);
tCmd = string.Format("INSERT INTO `User_ShortCut` (`id`) VALUES ('{0}')", tb_ID.Text);
mDB.DB_Send_CMD_reVoid(tCmd);
Helper_DB.ExcuteNonQuery(tCmd);
MessageBox.Show("저장되었습니다!");
main.isAccess();
@@ -313,11 +313,11 @@ namespace UniMarc
tAuthData.AddRange(tCheckBoxData);
string[] tCheckBox = tAuthData.ToArray();
cmd = mDB.More_Update("User_ShortCut", tAccess_Col, tAccess_Data, tSearch_Col, tSearch_Data);
mDB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = mDB.More_Update("User_Access", tUserAcess_Col, tCheckBox, tSearch_Col, tSearch_Data);
mDB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
cmd = mDB.More_Update("User_Data", tAccess_Col, tAccess_Data, tSearch_Col, tSearch_Data);
mDB.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("저장되었습니다!");
RefreshList();
}
@@ -370,11 +370,11 @@ namespace UniMarc
string tID = dataGridView1.SelectedRows[0].Cells["id"].Value.ToString();
string tPW = dataGridView1.SelectedRows[0].Cells["pw"].Value.ToString();
string D_cmd = string.Format("DELETE FROM User_ShortCut WHERE `ID`=\"{0}\" LIMIT 1;", tID);
mDB.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
D_cmd = string.Format("DELETE FROM User_Access WHERE `ID`=\"{0}\" LIMIT 1;", tID);
mDB.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
D_cmd = mDB.DB_Delete("User_Data", "ID", tID, "PW", tPW);
mDB.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
MessageBox.Show("삭제 완료되었습니다!");
RefreshList();
}

View File

@@ -243,13 +243,13 @@ namespace UniMarc
if (Isinsert)
{
string Incmd = db.DB_INSERT("Purchase", Insert_Table, Insert_Data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
MessageBox.Show(tb_sangho.Text + " 저장 완료");
}
else
{
string U_cmd = db.More_Update(Table, Insert_Table, Insert_Data, Search_Table, Search_Data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(tb_sangho.Text + " 수정 완료");
}
}
@@ -260,7 +260,7 @@ namespace UniMarc
string idx = dataGridView1.Rows[row].Cells["idx"].Value.ToString();
string sangho = dataGridView1.Rows[row].Cells["sangho"].Value.ToString();
string D_cmd = db.DB_Delete("Purchase", "idx", idx, "sangho", sangho);
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
MessageBox.Show(sangho + " 삭제 완료");
}
private void tb_memo_Click(object sender, EventArgs e)
@@ -351,7 +351,7 @@ namespace UniMarc
else
InCmd = db.More_Update(Table, Insert_Col, Insert_Data, Search_Table, Search_Data);
db.DB_Send_CMD_reVoid(InCmd);
Helper_DB.ExcuteNonQuery(InCmd);
}
private void btn_ExcelIW_Click(object sender, EventArgs e)
@@ -382,7 +382,7 @@ namespace UniMarc
MessageBox.Show(cmd);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
dgv_IndexWord.Rows.RemoveAt(row);
}

View File

@@ -211,7 +211,7 @@ namespace UniMarc
};
string Incmd = db.DB_INSERT("Client", tmpdb, tmpdb1);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
SearchList();
MessageBox.Show(string.Format("[{0}]가 성공적으로 저장되었습니다.", tb_sangho.Text));
}
@@ -276,7 +276,7 @@ namespace UniMarc
string U_cmd = db.More_Update("Client", editcol, editname, searchcol, searchname);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(tb_sangho.Text + "가 성공적으로 수정되었습니다.");
//}
//else
@@ -295,7 +295,7 @@ namespace UniMarc
// };
// string Incmd = db.DB_INSERT("Client", tmpdb, tmpdb1);
// db.DB_Send_CMD_reVoid(Incmd);
// Helper_DB.ExcuteNonQuery(Incmd);
// MessageBox.Show(string.Format("[{0}]가 성공적으로 저장되었습니다.", tb_sangho.Text));
//}
@@ -312,7 +312,7 @@ namespace UniMarc
string tText = string.Format("{0} 를 삭제 하시겠습니까?", dv1.Rows[RowIndex].Cells["sangho"].Value.ToString());
if (UTIL.MsgQ(tText) != DialogResult.Yes) return;
string D_cmd = db.DB_Delete("Client", "idx", dv1.Rows[RowIndex].Cells["idx"].Value.ToString(), "c_sangho", tb_sangho.Text);
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
Made_Grid();
SearchList();
MessageBox.Show("삭제되었습니다.");
@@ -562,7 +562,7 @@ namespace UniMarc
return;
string Dcmd = string.Format("DELETE FROM custm_tbl WHERE cm_midx = {0}", idx);
db.DB_Send_CMD_reVoid(Dcmd);
Helper_DB.ExcuteNonQuery(Dcmd);
MakeInsertCommend(marcGrid, 1, idx);
MakeInsertCommend(gearGrid, 2, idx);
@@ -592,7 +592,7 @@ namespace UniMarc
string Icmd = string.Format("INSERT INTO custm_tbl (cm_m1, cm_m2, cm_m3, cm_sq, cm_opt, cm_midx)" +
" values(\"{0}\", \"{1}\", \"{2}\", {3}, {4}, {5});", m1, m2, m3, a, gridNum, idx);
db.DB_Send_CMD_reVoid(Icmd);
Helper_DB.ExcuteNonQuery(Icmd);
}
}

View File

@@ -90,7 +90,7 @@ namespace UniMarc
string[] search_col = { "idx", "comp_name" };
string[] search_name = { PUB.user.CompanyIdx, tb_sangho.Text };
string U_cmd = db.More_Update("Comp", Area, temp, search_col, search_name);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show("저장되었습니다.");
}
private void tb_port_KeyPress(object sender, KeyPressEventArgs e)

View File

@@ -162,7 +162,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["work"].Value.ToString()
};
string Incmd = db.DB_INSERT("Part_Time", input_area, input_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
MessageBox.Show("저장되었습니다!");
}

View File

@@ -87,7 +87,7 @@ namespace UniMarc
{
string where_col = dataGridView1.Rows[row_count[a]].Cells[0].Value.ToString();
string U_cmd = db.DB_Update("Remit_reg", update_tbl, update_col, where_tbl, where_col);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
MessageBox.Show(where_col);
}
}

View File

@@ -91,7 +91,7 @@ namespace UniMarc
tb_bank_num.Text, tb_bank_boss.Text, tb_send_money.Text, tb_etc.Text, "False",
PUB.user.UserName };
string Incmd = db.DB_INSERT("Remit_reg", input_table, input_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
MessageBox.Show("성공적으로 저장되었습니다.");
Add_Grid();
@@ -115,7 +115,7 @@ namespace UniMarc
if (MessageBox.Show("정말 삭제하시겠습니까?", "경고", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
string cmd = db.DB_Delete_More_term("Remit_reg", target_idx, compidx, target_table, target_data);
db.DB_Send_CMD_reVoid(cmd);
Helper_DB.ExcuteNonQuery(cmd);
MessageBox.Show("삭제되었습니다.");
}
}

View File

@@ -111,7 +111,7 @@ namespace UniMarc
dataGridView1.Rows[a].Cells["out_price"].Value.ToString() };
string U_cmd = db.More_Update("Sales", edit_col, edit_data, search_col, search_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
}
MessageBox.Show("저장되었습니다.", "저장", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
@@ -123,7 +123,7 @@ namespace UniMarc
for (int a = 0; a < dataGridView1.Rows.Count; a++)
{
string D_cmd = db.DB_Delete("Sales", "compidx", compidx, "idx", dataGridView1.Rows[a].Cells["idx"].Value.ToString());
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
}
MessageBox.Show("삭제되었습니다.", "삭제", MessageBoxButtons.OK, MessageBoxIcon.Information);
}

View File

@@ -52,7 +52,7 @@ namespace UniMarc
string[] Data = { compidx, date, tb_clt.Text, tb_price.Text, cb_gubun.Text, tb_etc.Text };
string Incmd = db.DB_INSERT("Sales", Area, Data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
insert_data(date);
}
else {
@@ -62,7 +62,7 @@ namespace UniMarc
string[] sear_data = { dataGridView1.Rows[row].Cells["idx"].Value.ToString() };
string U_cmd = db.More_Update("Sales", edit_col, edit_data, sear_col, sear_data);
db.DB_Send_CMD_reVoid(U_cmd);
Helper_DB.ExcuteNonQuery(U_cmd);
update_data(date);
}
add_chk = false;
@@ -88,7 +88,7 @@ namespace UniMarc
if(MessageBox.Show("삭제하시겠습니까?", "삭제", MessageBoxButtons.YesNo) == DialogResult.No) { return; }
string D_cmd = db.DB_Delete("Sales", "compidx", compidx, "idx", dataGridView1.Rows[row].Cells["idx"].Value.ToString());
db.DB_Send_CMD_reVoid(D_cmd);
Helper_DB.ExcuteNonQuery(D_cmd);
dataGridView1.Rows.Remove(dataGridView1.Rows[row]);
add_chk = false;

View File

@@ -104,7 +104,7 @@ namespace UniMarc
out_price(a)
};
string Incmd = db.DB_INSERT("Sales", col_name, set_data);
db.DB_Send_CMD_reVoid(Incmd);
Helper_DB.ExcuteNonQuery(Incmd);
}
}
private string out_price(int idx)