Browse Source

维修作业限制保存时关键信息不能为空

章政 8 years ago
parent
commit
f3ca8b676a

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_NewBadCode.cs

@@ -154,6 +154,11 @@ namespace UAS_MES.Make
 
         private void Save_Click(object sender, EventArgs e)
         {
+            if (ms_sncode.Text == "" || ms_makecode.Text == "")
+            {
+                MessageBox.Show("序列号和工单号不允许为空");
+                return;
+            }
             int RejectCount = ChoosedRejectList.Items.Count;
             string[] bccode = new string[RejectCount];
             string[] bcremark = new string[RejectCount];
@@ -182,7 +187,7 @@ namespace UAS_MES.Make
             sql.Append("select :id,ma_code,ms_code,ms_sncode,'" + User.UserName + "',sysdate,'" + User.CurrentStepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
             sql.Append("sp_soncode,'0',:bc_remark from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
             sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode + "'");
-            dh.BatchInsert(sql.GetString(), new string[] { "bg_code","id", "bg_code", "bc_code", "bc_remark" }, bgcode, id, bgcode, bccode, bcremark);
+            dh.BatchInsert(sql.GetString(), new string[] { "bg_code", "id", "bg_code", "bc_code", "bc_remark" }, bgcode, id, bgcode, bccode, bcremark);
             MessageBox.Show("保存成功");
             Close();
         }

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_NewMatainInf.cs

@@ -148,6 +148,11 @@ namespace UAS_MES.Make
 
         private void Save_Click(object sender, EventArgs e)
         {
+            if (bg_name.Text == "" || bc_name.Text == "")
+            {
+                MessageBox.Show("不良代码组和不良代码不能为空");
+                return;
+            }
             string[] mbc_component = new string[GetListViewCheckCount(mbc_component_lsv)];
             string[] nrg_name = new string[GetListViewCheckCount(nrg_name_lsv)];
             string[] nr_name = new string[GetListViewCheckCount(nr_name_lsv)];
@@ -218,7 +223,7 @@ namespace UAS_MES.Make
         }
 
         private void ListView_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
-        { 
+        {
             e.Item.BackColor = Color.LightBlue;
             foreach (ListViewItem item in (sender as ListView).Items)
             {

+ 17 - 17
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -78,7 +78,6 @@
             this.nrg_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bc_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.bg_name = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.mb_badremark = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithTextArea();
             this.OperatResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.ms_makecode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_prodcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -91,6 +90,7 @@
             this.Scrap = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.RepairComplete = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
+            this.mb_badremark = new UAS_MES.CustomControl.TextBoxWithIcon.TextBoxWithTextArea();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
@@ -304,7 +304,7 @@
             // 
             this.panel1.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.panel1.Location = new System.Drawing.Point(163, 280);
-            this.panel1.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel1.Margin = new System.Windows.Forms.Padding(2);
             this.panel1.Name = "panel1";
             this.panel1.Size = new System.Drawing.Size(829, 2);
             this.panel1.TabIndex = 108;
@@ -336,7 +336,7 @@
             // 
             this.panel3.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
             this.panel3.Location = new System.Drawing.Point(1, 117);
-            this.panel3.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.panel3.Margin = new System.Windows.Forms.Padding(2);
             this.panel3.Name = "panel3";
             this.panel3.Size = new System.Drawing.Size(990, 2);
             this.panel3.TabIndex = 109;
@@ -345,7 +345,7 @@
             // 
             this.BadCodeTree.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.BadCodeTree.Location = new System.Drawing.Point(16, 154);
-            this.BadCodeTree.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.BadCodeTree.Margin = new System.Windows.Forms.Padding(2);
             this.BadCodeTree.Name = "BadCodeTree";
             this.BadCodeTree.Size = new System.Drawing.Size(146, 426);
             this.BadCodeTree.TabIndex = 118;
@@ -392,7 +392,7 @@
             this.prodcode.DBTitle = null;
             this.prodcode.FormName = null;
             this.prodcode.Location = new System.Drawing.Point(560, 299);
-            this.prodcode.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.prodcode.Margin = new System.Windows.Forms.Padding(2);
             this.prodcode.Name = "prodcode";
             this.prodcode.Power = null;
             this.prodcode.SelectField = null;
@@ -411,7 +411,7 @@
             this.mbp_part1,
             this.mbp_id});
             this.mbp_partdgv.Location = new System.Drawing.Point(485, 335);
-            this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbp_partdgv.Name = "mbp_partdgv";
             this.mbp_partdgv.RowTemplate.Height = 27;
             this.mbp_partdgv.Size = new System.Drawing.Size(270, 152);
@@ -439,7 +439,7 @@
             this.mbl_loc1,
             this.mbl_id});
             this.mbl_locdgv.Location = new System.Drawing.Point(186, 335);
-            this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(2);
             this.mbl_locdgv.Name = "mbl_locdgv";
             this.mbl_locdgv.RowTemplate.Height = 27;
             this.mbl_locdgv.Size = new System.Drawing.Size(270, 152);
@@ -465,7 +465,7 @@
             this.RefreshTreeView.Cursor = System.Windows.Forms.Cursors.Hand;
             this.RefreshTreeView.Image = global::UAS_MES.Properties.Resources.refresh;
             this.RefreshTreeView.Location = new System.Drawing.Point(84, 126);
-            this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(2, 2, 2, 2);
+            this.RefreshTreeView.Margin = new System.Windows.Forms.Padding(2);
             this.RefreshTreeView.Name = "RefreshTreeView";
             this.RefreshTreeView.Power = null;
             this.RefreshTreeView.Size = new System.Drawing.Size(20, 22);
@@ -695,13 +695,6 @@
             this.bg_name.TabIndex = 91;
             this.bg_name.Tag = "Read";
             // 
-            // mb_badremark
-            // 
-            this.mb_badremark.Location = new System.Drawing.Point(820, 155);
-            this.mb_badremark.Name = "mb_badremark";
-            this.mb_badremark.Size = new System.Drawing.Size(140, 20);
-            this.mb_badremark.TabIndex = 90;
-            // 
             // OperatResult
             // 
             this.OperatResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -891,11 +884,19 @@
             this.ms_sncode.Size = new System.Drawing.Size(0, 21);
             this.ms_sncode.TabIndex = 126;
             // 
+            // mb_badremark
+            // 
+            this.mb_badremark.Location = new System.Drawing.Point(822, 154);
+            this.mb_badremark.Name = "mb_badremark";
+            this.mb_badremark.Size = new System.Drawing.Size(161, 21);
+            this.mb_badremark.TabIndex = 127;
+            // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(995, 588);
+            this.Controls.Add(this.mb_badremark);
             this.Controls.Add(this.ms_sncode);
             this.Controls.Add(this.nr_code);
             this.Controls.Add(this.prodcode);
@@ -928,7 +929,6 @@
             this.Controls.Add(this.mbr_brgcode_label);
             this.Controls.Add(this.bc_name);
             this.Controls.Add(this.bg_name);
-            this.Controls.Add(this.mb_badremark);
             this.Controls.Add(this.OperatResult);
             this.Controls.Add(this.ms_makecode);
             this.Controls.Add(this.ms_prodcode);
@@ -991,7 +991,6 @@
         private CustomControl.ValueLabel.ValueLabel ms_prodcode;
         private CustomControl.ValueLabel.ValueLabel ms_makecode;
         private CustomControl.RichText.RichTextAutoBottom OperatResult;
-        private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;
         private CustomControl.TextBoxWithIcon.EnterTextBox bg_name;
         private CustomControl.TextBoxWithIcon.EnterTextBox bc_name;
         private CustomControl.TextBoxWithIcon.EnterTextBox nrg_name;
@@ -1030,5 +1029,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc1;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_id;
         private CustomControl.ValueLabel.ValueLabel ms_sncode;
+        private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;
     }
 }

+ 6 - 5
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -74,16 +74,19 @@ namespace UAS_MES.Make
             cr_code.TableName = "craft";
             cr_code.SelectField = "cr_name # 工艺名称 ,cr_code # 工艺编号,cr_prodcode # 物料编号";
             cr_code.SetValueField = new string[] { "cr_code" };
+            cr_code.DBTitle = "回流工艺";
 
             cd_stepcode.FormName = Name;
             cd_stepcode.TableName = "craftdetail left join step on st_code=cd_stepcode left join craft on cd_crid=cr_id";
             cd_stepcode.SetValueField = new string[] { "cd_stepcode" };
             cd_stepcode.SelectField = "cd_stepname # 工序名称 ,cd_stepcode # 工序编号,cd_stepno # 执行顺序";
+            cd_stepcode.DBTitle = "回流工序";
 
             prodcode.FormName = Name;
             prodcode.TableName = dbtable1.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text);
             prodcode.SetValueField = new string[] { "prodcode" };
             prodcode.SelectField = "prodcode # 不良零件编号,pr_detail # 零件名称";
+            prodcode.DBTitle = "不良零件";
 
             asc.controllInitializeSize(this);
             GetSNCode.Focus();
@@ -234,7 +237,7 @@ namespace UAS_MES.Make
             string ErrorMessage = "";
             string oMakeCode = "";
             string MsID = "";
-            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, GetSNCode.Text,User.UserCode,out oMakeCode,out MsID,out ErrorMessage))
+            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, GetSNCode.Text, User.UserCode, out oMakeCode, out MsID, out ErrorMessage))
             {
                 int RejectNum = int.Parse(dh.getFieldDataByCondition("makebad", "count(0) cn", "mb_sncode='" + GetSNCode.Text + "' and mb_status not in (1,-1)").ToString());
                 if (RejectNum > 0)
@@ -260,6 +263,8 @@ namespace UAS_MES.Make
                     }
                 }
             }
+            else
+                OperatResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
         }
 
         private void Scrap_Click(object sender, EventArgs e)
@@ -379,9 +384,7 @@ namespace UAS_MES.Make
         private void mbl_loc_TextChanged(object sender, EventArgs e)
         {
             if (mbl_loc.Text != "")
-            {
                 prodcode.TableName = dbtable2.Replace(":macode", macode).Replace(":sncode", GetSNCode.Text).Replace(":msl_location", mbl_loc.Text);
-            }
         }
 
         /// <summary>
@@ -411,9 +414,7 @@ namespace UAS_MES.Make
         private void mbl_loc_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
-            {
                 SaveBadLocation_Click(sender, e);
-            }
         }
 
         private void prodcode_TextKeyDown(object sender, KeyEventArgs e)

+ 0 - 12
UAS-MES/FunctionCode/Make/Make_Repair.resx

@@ -129,18 +129,6 @@
   <metadata name="mbp_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="mbp_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="mbl_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
   <metadata name="mbl_loc1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>