2 Commity 49b6b1ad8f ... 24b210e29f

Autor SHA1 Wiadomość Data
  jz.kai 24b210e29f 合并完成 11 miesięcy temu
  jz.kai 692ad34e64 工单编号 11 miesięcy temu

+ 13 - 0
WinForms/Default.Designer.cs

@@ -75,6 +75,7 @@
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
+            this.workId = new System.Windows.Forms.Label();
             this.toolStrip1.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
@@ -110,6 +111,7 @@
             // panel1
             // 
             this.panel1.BackColor = System.Drawing.SystemColors.Control;
+            this.panel1.Controls.Add(this.workId);
             this.panel1.Controls.Add(this.dataGridView1);
             this.panel1.Controls.Add(this.label15);
             this.panel1.Controls.Add(this.label14);
@@ -581,6 +583,16 @@
             this.label1.TabIndex = 13;
             this.label1.Text = "米";
             // 
+            // workId
+            // 
+            this.workId.AutoSize = true;
+            this.workId.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.workId.Location = new System.Drawing.Point(179, 423);
+            this.workId.Name = "workId";
+            this.workId.Size = new System.Drawing.Size(0, 21);
+            this.workId.TabIndex = 72;
+            this.workId.Visible = false;
+            // 
             // Default
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -654,5 +666,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn tag_length;
         private System.Windows.Forms.DataGridViewTextBoxColumn flaw_;
         private System.Windows.Forms.DataGridViewTextBoxColumn status_;
+        private System.Windows.Forms.Label workId;
     }
 }

+ 20 - 14
WinForms/Default.cs

@@ -28,18 +28,7 @@ namespace WinForms
                 string workId = selectWork.selectValue;
 
                 //基本信息
-                Jpsoft.BLL.Work bllWork = new Jpsoft.BLL.Work();
-                Jpsoft.Model.Work modelWork = bllWork.GetModel(workId);
-
-                Jpsoft.BLL.Customer bllCustomer = new Jpsoft.BLL.Customer();
-                Jpsoft.Model.Customer modelCustomer = bllCustomer.GetModel(modelWork.customer_id);
-
-                this.labCustomer.Text = "客户:" + modelCustomer.name_;
-                this.labName.Text = "品种及规格:" + modelWork.name_;
-                this.labWidth.Text = "幅宽:" + modelWork.width_.ToString();
-                this.labNumber.Text = "编号:" + modelWork.number_;
-                this.labColour.Text = "色泽:" + modelWork.colour_;
-                this.labTagFactorSave.Text = "加码:" + modelWork.tag_factor_save.ToString();
+                ShowInfo(workId);
 
                 //库存信息
                 Jpsoft.BLL.Stock bllStock = new Jpsoft.BLL.Stock();
@@ -49,13 +38,30 @@ namespace WinForms
             }
         }
 
+        private void ShowInfo(string workId)
+        {
+            Jpsoft.BLL.Work bllWork = new Jpsoft.BLL.Work();
+            Jpsoft.Model.Work modelWork = bllWork.GetModel(workId);
+
+            Jpsoft.BLL.Customer bllCustomer = new Jpsoft.BLL.Customer();
+            Jpsoft.Model.Customer modelCustomer = bllCustomer.GetModel(modelWork.customer_id);
+
+            this.workId.Text = modelWork.id_;
+            this.labCustomer.Text = "客户:" + modelCustomer.name_;
+            this.labName.Text = "品种及规格:" + modelWork.name_;
+            this.labWidth.Text = "幅宽:" + modelWork.width_.ToString();
+            this.labNumber.Text = "编号:" + modelWork.number_;
+            this.labColour.Text = "色泽:" + modelWork.colour_;
+            this.labTagFactorSave.Text = "加码:" + modelWork.tag_factor_save.ToString();
+        }
+
         private void button11_Click(object sender, EventArgs e)
         {
-            WorkNumber workNumber = new WorkNumber();
+            WorkNumber workNumber = new WorkNumber(this.workId.Text);
             DialogResult result = workNumber.ShowDialog();
             if (result == DialogResult.OK)
             {
-
+                ShowInfo(this.workId.Text);
             }
         }
 

+ 13 - 0
WinForms/WorkNumber.Designer.cs

@@ -34,6 +34,7 @@
             this.newNumber = new System.Windows.Forms.TextBox();
             this.btnCancel = new System.Windows.Forms.Button();
             this.btnSubmit = new System.Windows.Forms.Button();
+            this.workId = new System.Windows.Forms.Label();
             this.SuspendLayout();
             // 
             // label1
@@ -97,12 +98,23 @@
             this.btnSubmit.UseVisualStyleBackColor = true;
             this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
             // 
+            // workId
+            // 
+            this.workId.AutoSize = true;
+            this.workId.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.workId.Location = new System.Drawing.Point(12, 116);
+            this.workId.Name = "workId";
+            this.workId.Size = new System.Drawing.Size(0, 21);
+            this.workId.TabIndex = 77;
+            this.workId.Visible = false;
+            // 
             // WorkNumber
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.BackColor = System.Drawing.Color.White;
             this.ClientSize = new System.Drawing.Size(348, 153);
+            this.Controls.Add(this.workId);
             this.Controls.Add(this.btnCancel);
             this.Controls.Add(this.btnSubmit);
             this.Controls.Add(this.newNumber);
@@ -126,5 +138,6 @@
         private System.Windows.Forms.TextBox newNumber;
         private System.Windows.Forms.Button btnCancel;
         private System.Windows.Forms.Button btnSubmit;
+        private System.Windows.Forms.Label workId;
     }
 }

+ 23 - 2
WinForms/WorkNumber.cs

@@ -15,14 +15,35 @@ namespace WinForms
     public partial class WorkNumber : Form
     {
         public String selectValue;
-        public WorkNumber()
+        public WorkNumber(string workId)
         {
             InitializeComponent();
+            this.workId.Text = workId;
+            ShowInfo();
         }
 
-        private void btnSubmit_Click(object sender, EventArgs e)
+        private void ShowInfo()
         {
+            Jpsoft.BLL.Work bllWork = new Jpsoft.BLL.Work();
+            Jpsoft.Model.Work modelWork = bllWork.GetModel(this.workId.Text);
+            this.oldNumber.Text = modelWork.number_;
+            this.newNumber.Text = modelWork.number_;
+        }
 
+        private void btnSubmit_Click(object sender, EventArgs e)
+        {
+            if(String.IsNullOrEmpty(this.newNumber.Text))
+            {
+                MessageBox.Show("请填入新工单编号!");
+            }
+            else
+            {
+                Jpsoft.BLL.Work bllWork = new Jpsoft.BLL.Work();
+                Jpsoft.Model.Work modelWork = bllWork.GetModel(this.workId.Text);
+                modelWork.number_ = this.newNumber.Text.Trim();
+                bllWork.Update(modelWork);
+                this.DialogResult = DialogResult.OK;
+            }
         }
 
         private void btnCancel_Click(object sender, EventArgs e)