jz.kai 10 mesiacov pred
rodič
commit
692ad34e64

+ 110 - 96
WinForms/Default.Designer.cs

@@ -35,6 +35,13 @@
             this.toolStrip1 = new System.Windows.Forms.ToolStrip();
             this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.dataGridView1 = new System.Windows.Forms.DataGridView();
+            this.id_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.stock_number = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.length_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.tag_length = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.flaw_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.status_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label15 = new System.Windows.Forms.Label();
             this.label14 = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
@@ -68,19 +75,13 @@
             this.groupBox1 = new System.Windows.Forms.GroupBox();
             this.label2 = new System.Windows.Forms.Label();
             this.label1 = new System.Windows.Forms.Label();
-            this.dataGridView1 = new System.Windows.Forms.DataGridView();
-            this.id_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.stock_number = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.length_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.tag_length = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.flaw_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.status_ = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.workId = new System.Windows.Forms.Label();
             this.toolStrip1.SuspendLayout();
             this.panel1.SuspendLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.groupBox3.SuspendLayout();
             this.groupBox2.SuspendLayout();
             this.groupBox1.SuspendLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
             this.SuspendLayout();
             // 
             // toolStrip1
@@ -111,6 +112,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);
@@ -145,6 +147,96 @@
             this.panel1.Size = new System.Drawing.Size(763, 450);
             this.panel1.TabIndex = 1;
             // 
+            // dataGridView1
+            // 
+            this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
+            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            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.ColumnHeadersHeight = 30;
+            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
+            this.id_,
+            this.stock_number,
+            this.length_,
+            this.tag_length,
+            this.flaw_,
+            this.status_});
+            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
+            dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
+            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
+            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
+            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
+            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle5;
+            this.dataGridView1.Location = new System.Drawing.Point(359, 6);
+            this.dataGridView1.Name = "dataGridView1";
+            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
+            dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
+            dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            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;
+            this.dataGridView1.RowHeadersVisible = false;
+            this.dataGridView1.RowTemplate.Height = 30;
+            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
+            this.dataGridView1.Size = new System.Drawing.Size(398, 352);
+            this.dataGridView1.TabIndex = 71;
+            // 
+            // id_
+            // 
+            this.id_.DataPropertyName = "id_";
+            this.id_.HeaderText = "ID";
+            this.id_.Name = "id_";
+            this.id_.ReadOnly = true;
+            this.id_.Visible = false;
+            this.id_.Width = 52;
+            // 
+            // stock_number
+            // 
+            this.stock_number.DataPropertyName = "stock_number";
+            this.stock_number.HeaderText = "卷号";
+            this.stock_number.Name = "stock_number";
+            this.stock_number.Width = 67;
+            // 
+            // length_
+            // 
+            this.length_.DataPropertyName = "length_";
+            this.length_.HeaderText = "长度";
+            this.length_.Name = "length_";
+            this.length_.Width = 67;
+            // 
+            // tag_length
+            // 
+            this.tag_length.DataPropertyName = "tag_length";
+            this.tag_length.HeaderText = "标签长度";
+            this.tag_length.Name = "tag_length";
+            this.tag_length.Width = 99;
+            // 
+            // flaw_
+            // 
+            this.flaw_.DataPropertyName = "flaw_";
+            this.flaw_.HeaderText = "瑕疵";
+            this.flaw_.Name = "flaw_";
+            this.flaw_.Width = 67;
+            // 
+            // status_
+            // 
+            this.status_.DataPropertyName = "status_";
+            this.status_.HeaderText = "状态";
+            this.status_.Name = "status_";
+            this.status_.Width = 67;
+            // 
             // label15
             // 
             this.label15.AutoSize = true;
@@ -492,94 +584,15 @@
             this.label1.TabIndex = 13;
             this.label1.Text = "米";
             // 
-            // dataGridView1
+            // workId
             // 
-            this.dataGridView1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
-            | System.Windows.Forms.AnchorStyles.Left) 
-            | System.Windows.Forms.AnchorStyles.Right)));
-            this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.AllCells;
-            dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            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.ColumnHeadersHeight = 30;
-            this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
-            this.id_,
-            this.stock_number,
-            this.length_,
-            this.tag_length,
-            this.flaw_,
-            this.status_});
-            dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle5.BackColor = System.Drawing.SystemColors.Window;
-            dataGridViewCellStyle5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            dataGridViewCellStyle5.ForeColor = System.Drawing.SystemColors.ControlText;
-            dataGridViewCellStyle5.SelectionBackColor = System.Drawing.SystemColors.Highlight;
-            dataGridViewCellStyle5.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
-            dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
-            this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle5;
-            this.dataGridView1.Location = new System.Drawing.Point(359, 6);
-            this.dataGridView1.Name = "dataGridView1";
-            dataGridViewCellStyle6.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
-            dataGridViewCellStyle6.BackColor = System.Drawing.SystemColors.Control;
-            dataGridViewCellStyle6.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            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;
-            this.dataGridView1.RowHeadersVisible = false;
-            this.dataGridView1.RowTemplate.Height = 30;
-            this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
-            this.dataGridView1.Size = new System.Drawing.Size(398, 352);
-            this.dataGridView1.TabIndex = 71;
-            // 
-            // id_
-            // 
-            this.id_.DataPropertyName = "id_";
-            this.id_.HeaderText = "ID";
-            this.id_.Name = "id_";
-            this.id_.ReadOnly = true;
-            this.id_.Visible = false;
-            // 
-            // stock_number
-            // 
-            this.stock_number.DataPropertyName = "stock_number";
-            this.stock_number.HeaderText = "卷号";
-            this.stock_number.Name = "stock_number";
-            this.stock_number.Width = 67;
-            // 
-            // length_
-            // 
-            this.length_.DataPropertyName = "length_";
-            this.length_.HeaderText = "长度";
-            this.length_.Name = "length_";
-            this.length_.Width = 67;
-            // 
-            // tag_length
-            // 
-            this.tag_length.DataPropertyName = "tag_length";
-            this.tag_length.HeaderText = "标签长度";
-            this.tag_length.Name = "tag_length";
-            this.tag_length.Width = 99;
-            // 
-            // flaw_
-            // 
-            this.flaw_.DataPropertyName = "flaw_";
-            this.flaw_.HeaderText = "瑕疵";
-            this.flaw_.Name = "flaw_";
-            this.flaw_.Width = 67;
-            // 
-            // status_
-            // 
-            this.status_.DataPropertyName = "status_";
-            this.status_.HeaderText = "状态";
-            this.status_.Name = "status_";
-            this.status_.Width = 67;
+            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
             // 
@@ -597,13 +610,13 @@
             this.toolStrip1.PerformLayout();
             this.panel1.ResumeLayout(false);
             this.panel1.PerformLayout();
+            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             this.groupBox3.ResumeLayout(false);
             this.groupBox3.PerformLayout();
             this.groupBox2.ResumeLayout(false);
             this.groupBox2.PerformLayout();
             this.groupBox1.ResumeLayout(false);
             this.groupBox1.PerformLayout();
-            ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -654,5 +667,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

@@ -35,18 +35,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();
@@ -56,13 +45,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)