Просмотр исходного кода

Merge repos.ubtob.net:usoft/mes-client

callm 23 часов назад
Родитель
Сommit
3496f651a6

+ 35 - 35
UAS_MES_YTDZ/FunctionCode/Make/Make_ToolingManager.Designer.cs

@@ -44,6 +44,8 @@
             this.ExePage1 = new System.Windows.Forms.TabPage();
             this.ExePage1 = new System.Windows.Forms.TabPage();
             this.Page1Box = new System.Windows.Forms.TableLayoutPanel();
             this.Page1Box = new System.Windows.Forms.TableLayoutPanel();
             this.panel2 = new System.Windows.Forms.Panel();
             this.panel2 = new System.Windows.Forms.Panel();
+            this.useCountVal = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
+            this.useCountLab = new System.Windows.Forms.Label();
             this.Scrap = new System.Windows.Forms.Button();
             this.Scrap = new System.Windows.Forms.Button();
             this.Return = new System.Windows.Forms.Button();
             this.Return = new System.Windows.Forms.Button();
             this.stA = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.stA = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
@@ -72,8 +74,6 @@
             this.Receive = new System.Windows.Forms.Button();
             this.Receive = new System.Windows.Forms.Button();
             this.Container = new System.Windows.Forms.TableLayoutPanel();
             this.Container = new System.Windows.Forms.TableLayoutPanel();
             this.MsgBox = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
             this.MsgBox = new UAS_MES_NEW.CustomControl.RichText.RichTextAutoBottom();
-            this.useCountVal = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.useCountLab = new System.Windows.Forms.Label();
             this.TopBox.SuspendLayout();
             this.TopBox.SuspendLayout();
             this.ExeBox.SuspendLayout();
             this.ExeBox.SuspendLayout();
             this.ExePage1.SuspendLayout();
             this.ExePage1.SuspendLayout();
@@ -276,6 +276,33 @@
             this.panel2.Size = new System.Drawing.Size(870, 188);
             this.panel2.Size = new System.Drawing.Size(870, 188);
             this.panel2.TabIndex = 1;
             this.panel2.TabIndex = 1;
             // 
             // 
+            // useCountVal
+            // 
+            this.useCountVal.AllPower = null;
+            this.useCountVal.BackColor = System.Drawing.Color.White;
+            this.useCountVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.useCountVal.ID = null;
+            this.useCountVal.Location = new System.Drawing.Point(438, 117);
+            this.useCountVal.Margin = new System.Windows.Forms.Padding(4);
+            this.useCountVal.Name = "useCountVal";
+            this.useCountVal.Power = null;
+            this.useCountVal.Size = new System.Drawing.Size(72, 31);
+            this.useCountVal.Str = null;
+            this.useCountVal.Str1 = null;
+            this.useCountVal.Str2 = null;
+            this.useCountVal.TabIndex = 156;
+            // 
+            // useCountLab
+            // 
+            this.useCountLab.AutoSize = true;
+            this.useCountLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.useCountLab.Location = new System.Drawing.Point(348, 118);
+            this.useCountLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.useCountLab.Name = "useCountLab";
+            this.useCountLab.Size = new System.Drawing.Size(101, 28);
+            this.useCountLab.TabIndex = 142;
+            this.useCountLab.Text = "使用次数:";
+            // 
             // Scrap
             // Scrap
             // 
             // 
             this.Scrap.Cursor = System.Windows.Forms.Cursors.Hand;
             this.Scrap.Cursor = System.Windows.Forms.Cursors.Hand;
@@ -315,7 +342,7 @@
             this.stA.Str = null;
             this.stA.Str = null;
             this.stA.Str1 = null;
             this.stA.Str1 = null;
             this.stA.Str2 = null;
             this.stA.Str2 = null;
-            this.stA.TabIndex = 139;
+            this.stA.TabIndex = 150;
             // 
             // 
             // stALab
             // stALab
             // 
             // 
@@ -342,7 +369,7 @@
             this.stB.Str = null;
             this.stB.Str = null;
             this.stB.Str1 = null;
             this.stB.Str1 = null;
             this.stB.Str2 = null;
             this.stB.Str2 = null;
-            this.stB.TabIndex = 137;
+            this.stB.TabIndex = 153;
             // 
             // 
             // stBLab
             // stBLab
             // 
             // 
@@ -370,7 +397,7 @@
             this.stC.Str = null;
             this.stC.Str = null;
             this.stC.Str1 = null;
             this.stC.Str1 = null;
             this.stC.Str2 = null;
             this.stC.Str2 = null;
-            this.stC.TabIndex = 135;
+            this.stC.TabIndex = 151;
             // 
             // 
             // stCLab
             // stCLab
             // 
             // 
@@ -397,7 +424,7 @@
             this.stD.Str = null;
             this.stD.Str = null;
             this.stD.Str1 = null;
             this.stD.Str1 = null;
             this.stD.Str2 = null;
             this.stD.Str2 = null;
-            this.stD.TabIndex = 133;
+            this.stD.TabIndex = 154;
             // 
             // 
             // stDLab
             // stDLab
             // 
             // 
@@ -424,7 +451,7 @@
             this.stE.Str = null;
             this.stE.Str = null;
             this.stE.Str1 = null;
             this.stE.Str1 = null;
             this.stE.Str2 = null;
             this.stE.Str2 = null;
-            this.stE.TabIndex = 131;
+            this.stE.TabIndex = 152;
             // 
             // 
             // stELab
             // stELab
             // 
             // 
@@ -462,7 +489,7 @@
             this.empVal1.Str = null;
             this.empVal1.Str = null;
             this.empVal1.Str1 = null;
             this.empVal1.Str1 = null;
             this.empVal1.Str2 = null;
             this.empVal1.Str2 = null;
-            this.empVal1.TabIndex = 128;
+            this.empVal1.TabIndex = 155;
             // 
             // 
             // empLab1
             // empLab1
             // 
             // 
@@ -655,33 +682,6 @@
             this.MsgBox.TabIndex = 54;
             this.MsgBox.TabIndex = 54;
             this.MsgBox.Text = "";
             this.MsgBox.Text = "";
             // 
             // 
-            // useCountVal
-            // 
-            this.useCountVal.AllPower = null;
-            this.useCountVal.BackColor = System.Drawing.Color.White;
-            this.useCountVal.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.useCountVal.ID = null;
-            this.useCountVal.Location = new System.Drawing.Point(438, 117);
-            this.useCountVal.Margin = new System.Windows.Forms.Padding(4);
-            this.useCountVal.Name = "useCountVal";
-            this.useCountVal.Power = null;
-            this.useCountVal.Size = new System.Drawing.Size(72, 31);
-            this.useCountVal.Str = null;
-            this.useCountVal.Str1 = null;
-            this.useCountVal.Str2 = null;
-            this.useCountVal.TabIndex = 143;
-            // 
-            // useCountLab
-            // 
-            this.useCountLab.AutoSize = true;
-            this.useCountLab.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.useCountLab.Location = new System.Drawing.Point(348, 118);
-            this.useCountLab.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
-            this.useCountLab.Name = "useCountLab";
-            this.useCountLab.Size = new System.Drawing.Size(101, 28);
-            this.useCountLab.TabIndex = 142;
-            this.useCountLab.Text = "使用次数:";
-            // 
             // Make_ToolingManager
             // Make_ToolingManager
             // 
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);

+ 20 - 19
UAS_MES_YTDZ/FunctionCode/Make/Make_ToolingManager.cs

@@ -271,7 +271,8 @@ namespace UAS_MES_NEW.Make
                     '{ma_code.Text}','{ma_prodcode}','{li_code.Text}','{sideVal.Text}','{empVal.Text}',sysdate, '领用'
                     '{ma_code.Text}','{ma_prodcode}','{li_code.Text}','{sideVal.Text}','{empVal.Text}',sysdate, '领用'
                     FROM stencil WHERE st_code = '{toolingVal.Text.Trim()}'", "insert");
                     FROM stencil WHERE st_code = '{toolingVal.Text.Trim()}'", "insert");
             }
             }
-            dh.ExecuteSql("update stencil set st_usestatus= '出库' where st_code='" + toolingVal.Text + "'", "update");
+            dh.ExecuteSql($@"update stencil set st_usestatus= '出库',st_line = '{li_code.Text}',st_macode = '{ma_code.Text}',
+                st_useofproduct = '{ma_prodcode}' where st_code='" + toolingVal.Text + "'", "update");
 
 
 
 
             ma_code.Text = "";
             ma_code.Text = "";
@@ -290,6 +291,10 @@ namespace UAS_MES_NEW.Make
                 empVal1.SelectAll();
                 empVal1.SelectAll();
                 return;
                 return;
             }
             }
+            if (string.IsNullOrEmpty(useCountVal.Text))
+            {
+                useCountVal.Text = "0";
+            }
 
 
             dt = (DataTable)dh.ExecuteSql($@"SELECT st_usestatus,st_usecount
             dt = (DataTable)dh.ExecuteSql($@"SELECT st_usestatus,st_usecount
                 FROM stencil WHERE st_code = '{toolingVal.Text.Trim()}'", "select");
                 FROM stencil WHERE st_code = '{toolingVal.Text.Trim()}'", "select");
@@ -300,22 +305,21 @@ namespace UAS_MES_NEW.Make
                 return;
                 return;
             }
             }
 
 
-            if(typeVal.Text == "钢网")
+
+            int cleanCount = Convert.ToInt32(useCountVal.Text.Trim());
+            if (typeVal.Text == "钢网")
             {
             {
-                if (IsClean.Checked) {
-                    dh.ExecuteSql($@"UPDATE stencil SET st_cleannums = nvl(st_cleannums, 0) + 1,
-                        st_ensiona = '{stA.Text.Trim()}',st_ensionb = '{stB.Text.Trim()}',
+                dh.ExecuteSql($@"UPDATE stencil SET st_ensiona = '{stA.Text.Trim()}',st_ensionb = '{stB.Text.Trim()}',
                         st_ensionc = '{stC.Text.Trim()}',st_ensiond = '{stD.Text.Trim()}',st_ensione = '{stE.Text.Trim()}',
                         st_ensionc = '{stC.Text.Trim()}',st_ensiond = '{stD.Text.Trim()}',st_ensione = '{stE.Text.Trim()}',
-                        st_usecount = nvl(st_usecount,0) + {Convert.ToInt32(useCountVal.Text.Trim())},st_usestatus = '在库' 
+                        st_usecount = nvl(st_usecount,0) + {cleanCount},st_usestatus = '在库',
+                        st_line = '',st_macode = '',st_useofproduct = ''
                         WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
                         WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
-                }
-                else
-                {
-                    dh.ExecuteSql($@"UPDATE stencil SET st_ensiona = '{stA.Text.Trim()}',st_ensionb = '{stB.Text.Trim()}',
-                        st_ensionc = '{stC.Text.Trim()}',st_ensiond = '{stD.Text.Trim()}',st_ensione = '{stE.Text.Trim()}',
-                        st_usecount = nvl(st_usecount,0) + {Convert.ToInt32(useCountVal.Text.Trim())},st_usestatus = '在库'
+
+                if (IsClean.Checked) {
+                    dh.ExecuteSql($@"UPDATE stencil SET st_cleannums = nvl(st_cleannums, 0) + 1 
                         WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
                         WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
                 }
                 }
+
                 dh.ExecuteSql($@"INSERT INTO stenciluse (su_id,su_stcode,su_stid,
                 dh.ExecuteSql($@"INSERT INTO stenciluse (su_id,su_stcode,su_stid,
                     su_usemacode,su_useprodcode,su_linecode,su_table,
                     su_usemacode,su_useprodcode,su_linecode,su_table,
                     su_useman,su_usedate,su_status,
                     su_useman,su_usedate,su_status,
@@ -329,15 +333,12 @@ namespace UAS_MES_NEW.Make
             }
             }
             else if(typeVal.Text == "刮刀")
             else if(typeVal.Text == "刮刀")
             {
             {
+                dh.ExecuteSql($@"UPDATE stencil SET st_usecount = nvl(st_usecount,0) + {cleanCount},
+                        st_usestatus = '在库',st_line = '',st_macode = '',st_useofproduct = ''WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
+
                 if (IsClean.Checked)
                 if (IsClean.Checked)
                 {
                 {
-                    dh.ExecuteSql($@"UPDATE stencil SET st_cleannums = nvl(st_cleannums, 0) + 1,st_usecount = '{useCountVal.Text.Trim()}',
-                        st_usestatus = '在库' WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
-                }
-                else
-                {
-                    dh.ExecuteSql($@"UPDATE stencil SET st_usecount = '',st_usestatus = '在库'
-                        WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
+                    dh.ExecuteSql($@"UPDATE stencil SET st_cleannums = nvl(st_cleannums, 0) + 1 WHERE st_code = '{toolingVal.Text.Trim()}'", "update");
                 }
                 }
 
 
                 dh.ExecuteSql($@"INSERT INTO stenciluse (su_id,su_stcode,su_stid,
                 dh.ExecuteSql($@"INSERT INTO stenciluse (su_id,su_stcode,su_stid,