Browse Source

维修不良零件和不良位置添加删除按钮

章政 8 years ago
parent
commit
55ead4a078

+ 62 - 36
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -62,11 +62,7 @@
             this.ms_sncode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.prodcode = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.mbp_partdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
-            this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mbp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.mbl_locdgv = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithCheckBox();
-            this.mbl_loc1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.mbl_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.RefreshTreeView = new UAS_MES.CustomControl.ClickPicBox.ClickPicBox();
             this.GetSNCode = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.NewRepairInf = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
@@ -91,6 +87,12 @@
             this.SaveBadLocation = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.Scrap = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.RepairComplete = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.mbl_loc1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.DeletePos = new System.Windows.Forms.DataGridViewImageColumn();
+            this.mbl_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.mbp_part1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.DeleteCom = new System.Windows.Forms.DataGridViewImageColumn();
+            this.mbp_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel2.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).BeginInit();
@@ -454,6 +456,7 @@
             this.mbp_partdgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.mbp_partdgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.mbp_part1,
+            this.DeleteCom,
             this.mbp_id});
             this.mbp_partdgv.Location = new System.Drawing.Point(611, 418);
             this.mbp_partdgv.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
@@ -461,21 +464,7 @@
             this.mbp_partdgv.RowTemplate.Height = 27;
             this.mbp_partdgv.Size = new System.Drawing.Size(349, 190);
             this.mbp_partdgv.TabIndex = 121;
-            // 
-            // mbp_part1
-            // 
-            this.mbp_part1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbp_part1.DataPropertyName = "mbp_part";
-            this.mbp_part1.HeaderText = "已选择不良零件";
-            this.mbp_part1.Name = "mbp_part1";
-            this.mbp_part1.ReadOnly = true;
-            // 
-            // mbp_id
-            // 
-            this.mbp_id.DataPropertyName = "mbp_id";
-            this.mbp_id.HeaderText = "mbp_id";
-            this.mbp_id.Name = "mbp_id";
-            this.mbp_id.Visible = false;
+            this.mbp_partdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbp_partdgv_CellContentClick);
             // 
             // mbl_locdgv
             // 
@@ -483,6 +472,7 @@
             this.mbl_locdgv.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
             this.mbl_locdgv.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.mbl_loc1,
+            this.DeletePos,
             this.mbl_id});
             this.mbl_locdgv.Location = new System.Drawing.Point(222, 418);
             this.mbl_locdgv.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
@@ -490,21 +480,7 @@
             this.mbl_locdgv.RowTemplate.Height = 27;
             this.mbl_locdgv.Size = new System.Drawing.Size(349, 190);
             this.mbl_locdgv.TabIndex = 120;
-            // 
-            // mbl_loc1
-            // 
-            this.mbl_loc1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
-            this.mbl_loc1.DataPropertyName = "mbl_loc";
-            this.mbl_loc1.HeaderText = "已选择不良位置";
-            this.mbl_loc1.Name = "mbl_loc1";
-            this.mbl_loc1.ReadOnly = true;
-            // 
-            // mbl_id
-            // 
-            this.mbl_id.DataPropertyName = "mbl_id";
-            this.mbl_id.HeaderText = "mbl_id";
-            this.mbl_id.Name = "mbl_id";
-            this.mbl_id.Visible = false;
+            this.mbl_locdgv.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.mbl_locdgv_CellContentClick);
             // 
             // RefreshTreeView
             // 
@@ -951,6 +927,54 @@
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);
             // 
+            // mbl_loc1
+            // 
+            this.mbl_loc1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbl_loc1.DataPropertyName = "mbl_loc";
+            this.mbl_loc1.HeaderText = "已选择不良位置";
+            this.mbl_loc1.Name = "mbl_loc1";
+            this.mbl_loc1.ReadOnly = true;
+            // 
+            // DeletePos
+            // 
+            this.DeletePos.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.DeletePos.HeaderText = "删除";
+            this.DeletePos.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
+            this.DeletePos.Name = "DeletePos";
+            this.DeletePos.Width = 80;
+            // 
+            // mbl_id
+            // 
+            this.mbl_id.DataPropertyName = "mbl_id";
+            this.mbl_id.HeaderText = "mbl_id";
+            this.mbl_id.Name = "mbl_id";
+            this.mbl_id.Visible = false;
+            // 
+            // mbp_part1
+            // 
+            this.mbp_part1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
+            this.mbp_part1.DataPropertyName = "mbp_part";
+            this.mbp_part1.HeaderText = "已选择不良零件";
+            this.mbp_part1.Name = "mbp_part1";
+            this.mbp_part1.ReadOnly = true;
+            // 
+            // DeleteCom
+            // 
+            this.DeleteCom.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.DeleteCom.HeaderText = "删除";
+            this.DeleteCom.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
+            this.DeleteCom.Name = "DeleteCom";
+            this.DeleteCom.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.DeleteCom.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.DeleteCom.Width = 80;
+            // 
+            // mbp_id
+            // 
+            this.mbp_id.DataPropertyName = "mbp_id";
+            this.mbp_id.HeaderText = "mbp_id";
+            this.mbp_id.Name = "mbp_id";
+            this.mbp_id.Visible = false;
+            // 
             // Make_Repair
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -1017,14 +1041,14 @@
             this.Text = "维修作业";
             this.Load += new System.EventHandler(this.维修作业_Load);
             this.SizeChanged += new System.EventHandler(this.Make_Repair_SizeChanged);
-            this.panel2.ResumeLayout(true);
+            this.panel2.ResumeLayout(false);
             this.panel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.LocationSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.ComponentSource)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.mbp_partdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.mbl_locdgv)).EndInit();
             ((System.ComponentModel.ISupportInitialize)(this.RefreshTreeView)).EndInit();
-            this.ResumeLayout(true);
+            this.ResumeLayout(false);
             this.PerformLayout();
 
         }
@@ -1088,8 +1112,10 @@
         private CustomControl.ValueLabel.ValueLabel ms_sncode;
         private CustomControl.TextBoxWithIcon.TextBoxWithTextArea mb_badremark;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_part1;
+        private System.Windows.Forms.DataGridViewImageColumn DeleteCom;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbp_id;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_loc1;
+        private System.Windows.Forms.DataGridViewImageColumn DeletePos;
         private System.Windows.Forms.DataGridViewTextBoxColumn mbl_id;
     }
 }

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

@@ -302,7 +302,7 @@ namespace UAS_MES.Make
                     {
                         dh.UpdateByCondition("makeserial", "ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
                         dh.UpdateByCondition("make", "MA_NGMADEQTY=nvl(MA_NGMADEQTY,0)+1", "ma_code='" + macode + "'");
-                        LogicHandler.InsertMakeProcess(ms_sncode.Text,ms_makecode.Text,User.UserSourceCode,"报废","序列号报废",User.UserCode);
+                        LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "报废", "序列号报废", User.UserCode);
                         OperatResult.AppendText(">>报废成功\n", Color.Green);
                         GetSNCode.Clear();
                         BaseUtil.CleanForm(this);
@@ -399,10 +399,10 @@ namespace UAS_MES.Make
             {
                 if (mbr_id != "")
                 {
-                    string delete1 = "delete from makebadrsloc where mbl_mbrid='" + mbr_id+"'";
-                    string delete2 = "delete from makebadrspart where mbp_mbrid='" + mbr_id+"'";
-                    string delete3 = "delete from makebadrscom where mbc_mbrid='" + mbr_id+"'";
-                    string delete4 = "delete from makebadreason where mbr_id='" + mbr_id+"'";
+                    string delete1 = "delete from makebadrsloc where mbl_mbrid='" + mbr_id + "'";
+                    string delete2 = "delete from makebadrspart where mbp_mbrid='" + mbr_id + "'";
+                    string delete3 = "delete from makebadrscom where mbc_mbrid='" + mbr_id + "'";
+                    string delete4 = "delete from makebadreason where mbr_id='" + mbr_id + "'";
                     dh.ExecuteSQLTran(delete1, delete2, delete3, delete4);
                     OperatResult.AppendText(">>删除成功\n", Color.Green);
                     BaseUtil.CleanControlsText(bc_name, bc_code, bg_name, bg_code, mb_badremark, nrg_name, nr_name, nr_code, mbr_solutioncode, mbr_dutycode, mbc_component);
@@ -491,5 +491,21 @@ namespace UAS_MES.Make
         {
             OperatResult.Clear();
         }
+
+        private void mbl_locdgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (mbl_locdgv.Columns[e.ColumnIndex].Name == "DeletePos")
+            {
+                mbl_locdgv.Rows.RemoveAt(e.RowIndex);
+            }
+        }
+
+        private void mbp_partdgv_CellContentClick(object sender, DataGridViewCellEventArgs e)
+        {
+            if (mbp_partdgv.Columns[e.ColumnIndex].Name == "DeleteCom")
+            {
+                mbp_partdgv.Rows.RemoveAt(e.RowIndex);
+            }
+        }
     }
 }

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

@@ -126,9 +126,15 @@
   <metadata name="mbp_part1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="DeleteCom.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="DeletePos.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
   <data name="NewRepairInf.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>