목록 생성 이후 수정 할 수 있는 기능이 필요

Ex) 목록일, 완료일, 목록명, 납품처, 담당자 등
This commit is contained in:
2026-02-14 21:58:29 +09:00
parent 9108993612
commit f6dcd5630a
5 changed files with 558 additions and 1 deletions

View File

@@ -373,6 +373,12 @@
<Compile Include="마크\Mac_List_Add.Designer.cs">
<DependentUpon>Mac_List_Add.cs</DependentUpon>
</Compile>
<Compile Include="마크\Mac_List_Edit.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="마크\Mac_List_Edit.Designer.cs">
<DependentUpon>Mac_List_Edit.cs</DependentUpon>
</Compile>
<Compile Include="마크\MarcBookItem.cs" />
<Compile Include="마크\MarcCopySelect2.cs">
<SubType>Form</SubType>
@@ -1105,6 +1111,9 @@
<EmbeddedResource Include="마크\Mac_List_Add.resx">
<DependentUpon>Mac_List_Add.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\Mac_List_Edit.resx">
<DependentUpon>Mac_List_Edit.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="마크\MarcCopySelect2.resx">
<DependentUpon>MarcCopySelect2.cs</DependentUpon>
</EmbeddedResource>

View File

@@ -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);
}
}
}
}
}

View File

@@ -0,0 +1,256 @@
namespace UniMarc
{
partial class Mac_List_Edit
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
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;
}
}

View File

@@ -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();
}
}
}

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>