From f6dcd5630a60389e5d4c2efc9654b761b7f97d1f Mon Sep 17 00:00:00 2001 From: LGram16 Date: Sat, 14 Feb 2026 21:58:29 +0900 Subject: [PATCH] =?UTF-8?q?=EB=AA=A9=EB=A1=9D=20=EC=83=9D=EC=84=B1=20?= =?UTF-8?q?=EC=9D=B4=ED=9B=84=20=EC=88=98=EC=A0=95=20=ED=95=A0=20=EC=88=98?= =?UTF-8?q?=20=EC=9E=88=EB=8A=94=20=EA=B8=B0=EB=8A=A5=EC=9D=B4=20=ED=95=84?= =?UTF-8?q?=EC=9A=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ex) 목록일, 완료일, 목록명, 납품처, 담당자 등 --- unimarc/unimarc/UniMarc.csproj | 9 + unimarc/unimarc/마크/Mac_List.cs | 15 +- .../unimarc/마크/Mac_List_Edit.Designer.cs | 256 ++++++++++++++++++ unimarc/unimarc/마크/Mac_List_Edit.cs | 159 +++++++++++ unimarc/unimarc/마크/Mac_List_Edit.resx | 120 ++++++++ 5 files changed, 558 insertions(+), 1 deletion(-) create mode 100644 unimarc/unimarc/마크/Mac_List_Edit.Designer.cs create mode 100644 unimarc/unimarc/마크/Mac_List_Edit.cs create mode 100644 unimarc/unimarc/마크/Mac_List_Edit.resx diff --git a/unimarc/unimarc/UniMarc.csproj b/unimarc/unimarc/UniMarc.csproj index 1bc996c..5c86ad9 100644 --- a/unimarc/unimarc/UniMarc.csproj +++ b/unimarc/unimarc/UniMarc.csproj @@ -373,6 +373,12 @@ Mac_List_Add.cs + + Form + + + Mac_List_Edit.cs + Form @@ -1105,6 +1111,9 @@ Mac_List_Add.cs + + Mac_List_Edit.cs + MarcCopySelect2.cs diff --git a/unimarc/unimarc/마크/Mac_List.cs b/unimarc/unimarc/마크/Mac_List.cs index e3f0ba2..f48869b 100644 --- a/unimarc/unimarc/마크/Mac_List.cs +++ b/unimarc/unimarc/마크/Mac_List.cs @@ -333,7 +333,20 @@ namespace UniMarc private void btEdit_Click(object sender, EventArgs e) { - //정보편집 다이얼로그를 표시하고 Ok 했을 대 해당 정보를 업데이트한다. + var item = bs1.Current as MacListItem; + if (item == null) + { + MessageBox.Show("대상을 먼저 선택하세요."); + return; + } + + using (var edit = new Mac_List_Edit(this, item)) + { + if (edit.ShowDialog() == DialogResult.OK) + { + btn_Lookup_Click(null, null); + } + } } } } diff --git a/unimarc/unimarc/마크/Mac_List_Edit.Designer.cs b/unimarc/unimarc/마크/Mac_List_Edit.Designer.cs new file mode 100644 index 0000000..6c3b624 --- /dev/null +++ b/unimarc/unimarc/마크/Mac_List_Edit.Designer.cs @@ -0,0 +1,256 @@ + +namespace UniMarc +{ + partial class Mac_List_Edit + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.tb_ListName = new System.Windows.Forms.TextBox(); + this.btCustom = new System.Windows.Forms.Button(); + this.tb_divComp = new System.Windows.Forms.TextBox(); + this.tbCustomIDX = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.cb_User = new System.Windows.Forms.ComboBox(); + this.label3 = new System.Windows.Forms.Label(); + this.cb_State = new System.Windows.Forms.ComboBox(); + this.label4 = new System.Windows.Forms.Label(); + this.tb_WorkName = new System.Windows.Forms.TextBox(); + this.label5 = new System.Windows.Forms.Label(); + this.tb_Etc = new System.Windows.Forms.TextBox(); + this.dtp_DateRes = new System.Windows.Forms.DateTimePicker(); + this.chk_DateRes = new System.Windows.Forms.CheckBox(); + this.btSave = new System.Windows.Forms.Button(); + this.btClose = new System.Windows.Forms.Button(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(7, 17); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(41, 12); + this.label1.TabIndex = 0; + this.label1.Text = "목록명"; + // + // tb_ListName + // + this.tb_ListName.Location = new System.Drawing.Point(89, 14); + this.tb_ListName.Name = "tb_ListName"; + this.tb_ListName.Size = new System.Drawing.Size(248, 21); + this.tb_ListName.TabIndex = 1; + // + // btCustom + // + this.btCustom.Location = new System.Drawing.Point(7, 41); + this.btCustom.Name = "btCustom"; + this.btCustom.Size = new System.Drawing.Size(62, 23); + this.btCustom.TabIndex = 2; + this.btCustom.Text = "납품처"; + this.btCustom.UseVisualStyleBackColor = true; + this.btCustom.Click += new System.EventHandler(this.btCustom_Click); + // + // tb_divComp + // + this.tb_divComp.Location = new System.Drawing.Point(89, 41); + this.tb_divComp.Name = "tb_divComp"; + this.tb_divComp.Size = new System.Drawing.Size(167, 21); + this.tb_divComp.TabIndex = 3; + this.tb_divComp.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tb_divComp_KeyDown); + // + // tbCustomIDX + // + this.tbCustomIDX.Location = new System.Drawing.Point(262, 41); + this.tbCustomIDX.Name = "tbCustomIDX"; + this.tbCustomIDX.ReadOnly = true; + this.tbCustomIDX.Size = new System.Drawing.Size(75, 21); + this.tbCustomIDX.TabIndex = 4; + this.tbCustomIDX.TabStop = false; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(7, 71); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(41, 12); + this.label2.TabIndex = 5; + this.label2.Text = "담당자"; + // + // cb_User + // + this.cb_User.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_User.FormattingEnabled = true; + this.cb_User.Location = new System.Drawing.Point(89, 68); + this.cb_User.Name = "cb_User"; + this.cb_User.Size = new System.Drawing.Size(121, 20); + this.cb_User.TabIndex = 6; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(7, 97); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(29, 12); + this.label3.TabIndex = 7; + this.label3.Text = "상태"; + // + // cb_State + // + this.cb_State.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; + this.cb_State.FormattingEnabled = true; + this.cb_State.Location = new System.Drawing.Point(89, 94); + this.cb_State.Name = "cb_State"; + this.cb_State.Size = new System.Drawing.Size(121, 20); + this.cb_State.TabIndex = 8; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(7, 123); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(41, 12); + this.label4.TabIndex = 9; + this.label4.Text = "작업명"; + // + // tb_WorkName + // + this.tb_WorkName.Location = new System.Drawing.Point(89, 120); + this.tb_WorkName.Name = "tb_WorkName"; + this.tb_WorkName.Size = new System.Drawing.Size(248, 21); + this.tb_WorkName.TabIndex = 10; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(7, 149); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(29, 12); + this.label5.TabIndex = 11; + this.label5.Text = "비고"; + // + // tb_Etc + // + this.tb_Etc.Location = new System.Drawing.Point(89, 146); + this.tb_Etc.Name = "tb_Etc"; + this.tb_Etc.Size = new System.Drawing.Size(248, 21); + this.tb_Etc.TabIndex = 12; + // + // dtp_DateRes + // + this.dtp_DateRes.Enabled = false; + this.dtp_DateRes.Format = System.Windows.Forms.DateTimePickerFormat.Short; + this.dtp_DateRes.Location = new System.Drawing.Point(89, 172); + this.dtp_DateRes.Name = "dtp_DateRes"; + this.dtp_DateRes.Size = new System.Drawing.Size(248, 21); + this.dtp_DateRes.TabIndex = 16; + // + // chk_DateRes + // + this.chk_DateRes.AutoSize = true; + this.chk_DateRes.Location = new System.Drawing.Point(7, 174); + this.chk_DateRes.Name = "chk_DateRes"; + this.chk_DateRes.Size = new System.Drawing.Size(72, 16); + this.chk_DateRes.TabIndex = 17; + this.chk_DateRes.Text = "완료일자"; + this.chk_DateRes.UseVisualStyleBackColor = true; + this.chk_DateRes.CheckedChanged += new System.EventHandler(this.chk_DateRes_CheckedChanged); + // + // btSave + // + this.btSave.Location = new System.Drawing.Point(183, 205); + this.btSave.Name = "btSave"; + this.btSave.Size = new System.Drawing.Size(75, 31); + this.btSave.TabIndex = 13; + this.btSave.Text = "저 장"; + this.btSave.UseVisualStyleBackColor = true; + this.btSave.Click += new System.EventHandler(this.btSave_Click); + // + // btClose + // + this.btClose.Location = new System.Drawing.Point(264, 205); + this.btClose.Name = "btClose"; + this.btClose.Size = new System.Drawing.Size(75, 31); + this.btClose.TabIndex = 14; + this.btClose.Text = "닫 기"; + this.btClose.UseVisualStyleBackColor = true; + this.btClose.Click += new System.EventHandler(this.btClose_Click); + // + // Mac_List_Edit + // + this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 12F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(347, 245); + this.Controls.Add(this.dtp_DateRes); + this.Controls.Add(this.btClose); + this.Controls.Add(this.btSave); + this.Controls.Add(this.tb_Etc); + this.Controls.Add(this.label5); + this.Controls.Add(this.tb_WorkName); + this.Controls.Add(this.label4); + this.Controls.Add(this.cb_State); + this.Controls.Add(this.label3); + this.Controls.Add(this.cb_User); + this.Controls.Add(this.label2); + this.Controls.Add(this.tbCustomIDX); + this.Controls.Add(this.tb_divComp); + this.Controls.Add(this.btCustom); + this.Controls.Add(this.tb_ListName); + this.Controls.Add(this.label1); + this.Controls.Add(this.chk_DateRes); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "Mac_List_Edit"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "정보 편집"; + this.Load += new System.EventHandler(this.Mac_List_Edit_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox tb_ListName; + private System.Windows.Forms.Button btCustom; + private System.Windows.Forms.TextBox tb_divComp; + private System.Windows.Forms.TextBox tbCustomIDX; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.ComboBox cb_User; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox cb_State; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.TextBox tb_WorkName; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.TextBox tb_Etc; + private System.Windows.Forms.DateTimePicker dtp_DateRes; + private System.Windows.Forms.CheckBox chk_DateRes; + private System.Windows.Forms.Button btSave; + private System.Windows.Forms.Button btClose; + } +} diff --git a/unimarc/unimarc/마크/Mac_List_Edit.cs b/unimarc/unimarc/마크/Mac_List_Edit.cs new file mode 100644 index 0000000..9c83557 --- /dev/null +++ b/unimarc/unimarc/마크/Mac_List_Edit.cs @@ -0,0 +1,159 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using UniMarc.ListOfValue; +using AR; + +namespace UniMarc +{ + public partial class Mac_List_Edit : Form + { + Helper_DB db = new Helper_DB(); + MacListItem item; + Mac_List ml; + + public Mac_List_Edit(Mac_List _ml, MacListItem _item) + { + InitializeComponent(); + ml = _ml; + item = _item; + } + + private void Mac_List_Edit_Load(object sender, EventArgs e) + { + db.DBcon(); + + string compidx = PUB.user.CompanyIdx; + + #region 콤보박스 채우기 + + // 담당자 + string CompQuery = string.Format("SELECT `comp_name` FROM `Comp` WHERE `idx` = {0}", compidx); + string cmd = string.Format("SELECT `name` FROM `User_Data` WHERE `affil` = ({0});", CompQuery); + string[] cmdResult = db.DB_Send_CMD_Search(cmd).Split('|'); + + foreach (string UserName in cmdResult) + { + if (!string.IsNullOrEmpty(UserName)) + cb_User.Items.Add(UserName); + } + + // 상태 + cb_State.Items.AddRange(new string[] { "진행", "완료" }); + + #endregion + + // 데이터 로드 + tb_ListName.Text = item.list_name; + tb_divComp.Text = item.customer_name; + tbCustomIDX.Text = item.customer; + cb_User.SelectedItem = item.charge; + cb_State.SelectedItem = item.state; + tb_WorkName.Text = item.work_name; + tb_Etc.Text = item.etc; + + DateTime resDate; + if (DateTime.TryParse(item.end_date, out resDate)) + { + chk_DateRes.Checked = true; + dtp_DateRes.Enabled = true; + dtp_DateRes.Value = resDate; + } + else + { + chk_DateRes.Checked = false; + dtp_DateRes.Enabled = false; + } + } + + private void chk_DateRes_CheckedChanged(object sender, EventArgs e) + { + dtp_DateRes.Enabled = chk_DateRes.Checked; + } + + private void btCustom_Click(object sender, EventArgs e) + { + LovCustom(); + } + + void LovCustom() + { + string compidx = PUB.user.CompanyIdx; + var inputsearch = tb_divComp.Text.Trim(); + var where = $"campanyidx={compidx}"; + if (!string.IsNullOrEmpty(inputsearch)) + { + where += $" and c_sangho like '%{inputsearch.Replace("'", "''")}%'"; + } + var dt = Helper_DB.GetDT("Client", columns: "idx,c_sangho", orders: "c_sangho", wheres: where); + using (var f = new fSelectDT(dt)) + if (f.ShowDialog() == DialogResult.OK) + { + var dr = f.SelectedRow; + if (dr == null) return; + tbCustomIDX.Text = dr["idx"]?.ToString() ?? string.Empty; + tb_divComp.Text = dr["c_sangho"]?.ToString() ?? string.Empty; + } + } + + private void tb_divComp_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) LovCustom(); + } + + private void btSave_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(tb_ListName.Text)) + { + MessageBox.Show("목록명을 입력하세요."); + return; + } + + string table = "Obj_List"; + string[] edit_col = { "list_name", "customer", "m_charge", "state", "work_name", "m_etc", "date_res" }; + string resDateVal = chk_DateRes.Checked ? dtp_DateRes.Value.ToString("yyyy-MM-dd") : "NULL"; + + string[] edit_tbl = { + tb_ListName.Text, + tbCustomIDX.Text, + cb_User.Text, + cb_State.Text, + tb_WorkName.Text, + tb_Etc.Text, + resDateVal + }; + string[] sear_col = { "idx", "comp_num" }; + string[] sear_tbl = { item.idx, PUB.user.CompanyIdx }; + + string U_cmd = db.More_Update(table, edit_col, edit_tbl, sear_col, sear_tbl); + if (resDateVal == "NULL") + { + U_cmd = U_cmd.Replace("`date_res` = \"NULL\"", "`date_res` = NULL"); + } + + var result = Helper_DB.ExcuteNonQuery(U_cmd); + + if (result.applyCount > 0) + { + //UTIL.MsgI("수정되었습니다."); + this.DialogResult = DialogResult.OK; + this.Close(); + } + else + { + UTIL.MsgE("수정에 실패했습니다.\n" + result.errorMessage); + } + } + + private void btClose_Click(object sender, EventArgs e) + { + this.Close(); + } + } +} diff --git a/unimarc/unimarc/마크/Mac_List_Edit.resx b/unimarc/unimarc/마크/Mac_List_Edit.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/unimarc/unimarc/마크/Mac_List_Edit.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file