Pārlūkot izejas kodu

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

章政 8 gadi atpakaļ
vecāks
revīzija
2640f9671d

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_MakeCancelDown.cs

@@ -87,7 +87,7 @@ namespace UAS_MES.Make
                         BaseUtil.CleanDGVData(LabelDataGridView);
                     }
                     sum.Text = dt1.Rows.Count.ToString();
-                    make_count.Text = dt1.Rows.Count.ToString(); 
+                    make_count.Text = dt1.Rows.Count.ToString();
                 }
                 else
                 {
@@ -198,7 +198,8 @@ namespace UAS_MES.Make
         //勾选框更改提交
         private void LabelDataGridView_CurrentCellDirtyStateChanged(object sender, EventArgs e)
         {
-            if (LabelDataGridView.IsCurrentCellDirty) {
+            if (LabelDataGridView.IsCurrentCellDirty)
+            {
                 LabelDataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit);
             }
         }

+ 49 - 49
UAS-MES/FunctionCode/Make/Make_MakeDown.Designer.cs

@@ -34,6 +34,11 @@
             this.count_label = new System.Windows.Forms.Label();
             this.md_reson = new System.Windows.Forms.Label();
             this.LabelDataGridView = new System.Windows.Forms.DataGridView();
+            this.md_macode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.md_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.md_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.MD_DOWNMAN = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.label1 = new System.Windows.Forms.Label();
             this.pr_code = new System.Windows.Forms.Label();
             this.ms_makecode = new System.Windows.Forms.Label();
@@ -45,11 +50,6 @@
             this.sn_code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.inputreson = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.dataGridViewTextBoxColumn5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.md_macode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.md_sncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.md_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.MD_DOWNMAN = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.LabelDataGridView)).BeginInit();
             this.SuspendLayout();
             // 
@@ -124,6 +124,49 @@
             this.LabelDataGridView.Size = new System.Drawing.Size(747, 192);
             this.LabelDataGridView.TabIndex = 200;
             // 
+            // md_macode
+            // 
+            this.md_macode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.md_macode.DataPropertyName = "md_macode";
+            this.md_macode.HeaderText = "工单编号";
+            this.md_macode.Name = "md_macode";
+            this.md_macode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // md_sncode
+            // 
+            this.md_sncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.md_sncode.DataPropertyName = "md_sncode";
+            this.md_sncode.HeaderText = "序列号";
+            this.md_sncode.Name = "md_sncode";
+            this.md_sncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // md_prodcode
+            // 
+            this.md_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.md_prodcode.DataPropertyName = "md_prodcode";
+            this.md_prodcode.HeaderText = "产品代码";
+            this.md_prodcode.Name = "md_prodcode";
+            this.md_prodcode.ReadOnly = true;
+            this.md_prodcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.pr_detail.DataPropertyName = "pr_detail";
+            this.pr_detail.HeaderText = "产品名称";
+            this.pr_detail.MinimumWidth = 80;
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.ReadOnly = true;
+            this.pr_detail.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            // 
+            // MD_DOWNMAN
+            // 
+            this.MD_DOWNMAN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.MD_DOWNMAN.HeaderText = "";
+            this.MD_DOWNMAN.MinimumWidth = 2;
+            this.MD_DOWNMAN.Name = "MD_DOWNMAN";
+            this.MD_DOWNMAN.Width = 2;
+            // 
             // label1
             // 
             this.label1.AutoSize = true;
@@ -190,7 +233,7 @@
             // 
             // OperateResult
             // 
-            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.OperateResult.Location = new System.Drawing.Point(377, 51);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(392, 124);
@@ -229,49 +272,6 @@
             this.dataGridViewTextBoxColumn5.Name = "dataGridViewTextBoxColumn5";
             this.dataGridViewTextBoxColumn5.Width = 5;
             // 
-            // md_macode
-            // 
-            this.md_macode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.md_macode.DataPropertyName = "md_macode";
-            this.md_macode.HeaderText = "工单编号";
-            this.md_macode.Name = "md_macode";
-            this.md_macode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // md_sncode
-            // 
-            this.md_sncode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.md_sncode.DataPropertyName = "md_sncode";
-            this.md_sncode.HeaderText = "序列号";
-            this.md_sncode.Name = "md_sncode";
-            this.md_sncode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // md_prodcode
-            // 
-            this.md_prodcode.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.md_prodcode.DataPropertyName = "md_prodcode";
-            this.md_prodcode.HeaderText = "产品代码";
-            this.md_prodcode.Name = "md_prodcode";
-            this.md_prodcode.ReadOnly = true;
-            this.md_prodcode.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // pr_detail
-            // 
-            this.pr_detail.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.pr_detail.DataPropertyName = "pr_detail";
-            this.pr_detail.HeaderText = "产品名称";
-            this.pr_detail.MinimumWidth = 80;
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.ReadOnly = true;
-            this.pr_detail.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            // 
-            // MD_DOWNMAN
-            // 
-            this.MD_DOWNMAN.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.MD_DOWNMAN.HeaderText = "";
-            this.MD_DOWNMAN.MinimumWidth = 2;
-            this.MD_DOWNMAN.Name = "MD_DOWNMAN";
-            this.MD_DOWNMAN.Width = 2;
-            // 
             // Make_MakeDown
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);

+ 16 - 14
UAS-MES/FunctionCode/Make/Make_MakeDown.cs

@@ -52,8 +52,8 @@ namespace UAS_MES.Make
             dh = new DataHelper();
             sn_code.Focus();
             make_count.Text = count.ToString();
-            string[] param = new string[] { caller,make_count.Text, _macode};
-            dh.CallProcedure("SP_GETMAXNUMBER",ref param);
+            string[] param = new string[] { caller, make_count.Text, _macode };
+            dh.CallProcedure("SP_GETMAXNUMBER", ref param);
             mdcode.Text = param[2];
         }
 
@@ -69,16 +69,16 @@ namespace UAS_MES.Make
                 if (inputreson.Text.Trim() != "")
                 {
                     sql.Clear();
-                    sql.Append("select max(ms_id) from makeserial where ms_sncode='"+sn_code.Text+"'");
+                    sql.Append("select max(ms_id) from makeserial where ms_sncode='" + sn_code.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                    if (dt.Rows.Count > 0)
+                    ms_id = dt.Rows[0][0].ToString();
+                    if (ms_id != "")
                     {
-                        ms_id = dt.Rows[0][0].ToString();
                         //界面赋值
                         dtbar = (DataTable)dh.ExecuteSql("select ms_makecode,pr_code,pr_detail from makeserial left join product on MS_PRODCODE=pr_code where ms_id='" + ms_id + "'", "select");
-                        BaseUtil.SetFormValue(this.Controls, dtbar);      
+                        BaseUtil.SetFormValue(this.Controls, dtbar);
                         sql.Clear();
-                        sql.Append("select ms_outboxcode, ms_downstatus,ms_prodcode from makeserial where ms_id ='"+ms_id+"' ");
+                        sql.Append("select ms_outboxcode, ms_downstatus,ms_prodcode from makeserial where ms_id ='" + ms_id + "' ");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_downstatus = dt.Rows[0]["ms_downstatus"].ToString();
                         string ms_outboxcode = dt.Rows[0]["ms_outboxcode"].ToString();
@@ -91,11 +91,11 @@ namespace UAS_MES.Make
                                 sql.Append("INSERT INTO MAKEDOWN (MD_ID,MD_LINECODE,MD_SCCODE,MD_STEPCODE,");
                                 sql.Append("MD_SNCODE,MD_PRODCODE,MD_MACODE, MD_DOWNREASON, MD_CODE,");
                                 sql.Append("MD_DOWNDATE,MD_DOWNMAN,MD_STATUS) values (MAKEDOWN_seq.nextval,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
-                                sql.Append("'" + User.CurrentStepCode + "','" + sn_code.Text + "','" + pr_code.Text + "','" + ms_makecode.Text + "','"+inputreson.Text+"','" + mdcode.Text + "',sysdate,'" + User.UserCode + "','-1')");
+                                sql.Append("'" + User.CurrentStepCode + "','" + sn_code.Text + "','" + pr_code.Text + "','" + ms_makecode.Text + "','" + inputreson.Text + "','" + mdcode.Text + "',sysdate,'" + User.UserCode + "','-1')");
                                 //执行
                                 dh.ExecuteSql(sql.GetString(), "insert");
                                 //更新序列号状态为下地
-                                dh.UpdateByCondition("makeserial", "ms_downstatus='-1'", "ms_id='"+ms_id+"'");
+                                dh.UpdateByCondition("makeserial", "ms_downstatus='-1'", "ms_id='" + ms_id + "'");
                                 OperateResult.AppendText(">>>序列号" + sn_code.Text + "下地成功\n", Color.Green);
                                 //更新数量
                                 count++;
@@ -103,8 +103,9 @@ namespace UAS_MES.Make
                                 sn_code.Text = "";
                                 loadGrid();
                             }
-                            else {
-                                OperateResult.AppendText(">>>序列号" + sn_code.Text + "已装箱:"+ms_outboxcode+ ",不允许下地,如需下地请先解除装箱\n", Color.Red);
+                            else
+                            {
+                                OperateResult.AppendText(">>>序列号" + sn_code.Text + "已装箱:" + ms_outboxcode + ",不允许下地,如需下地请先解除装箱\n", Color.Red);
                                 sn_code.Text = "";
                                 sn_code.Focus();
                                 return;
@@ -119,8 +120,9 @@ namespace UAS_MES.Make
                         }
 
                     }
-                    else {
-                        ms_id = null; 
+                    else
+                    {
+                        ms_id = null;
                         OperateResult.AppendText(">>>序列号" + sn_code.Text + "不存在\n", Color.Red);
                         sn_code.Text = "";
                         sn_code.Focus();
@@ -139,7 +141,7 @@ namespace UAS_MES.Make
         private void loadGrid()
         {
             sql.Clear();
-            sql.Append("select md_macode,md_sncode,md_prodcode,pr_detail from makedown left join product on pr_code = md_prodcode where md_code = '"+mdcode.Text+"'");
+            sql.Append("select md_macode,md_sncode,md_prodcode,pr_detail from makedown left join product on pr_code = md_prodcode where md_code = '" + mdcode.Text + "'");
             dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(LabelDataGridView, dt1);
         }