Browse Source

微浦项目修改提交

caosy 3 years ago
parent
commit
a1da79ef8a

+ 1 - 1
UAS_MES_WEIP/App.config

@@ -79,7 +79,7 @@
     <UAS_MES_NEW.Properties.Settings>
       <setting name="MES" serializeAs="String">
         <value>Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=
-192.168.1.105)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
+usoft.f3322.net)(PORT=11585)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</value>
       </setting>
     </UAS_MES_NEW.Properties.Settings>
     <UAS_MES.Properties.Settings>

+ 8 - 2
UAS_MES_WEIP/FunctionCode/Make/Make_SMTBind.cs

@@ -52,6 +52,7 @@ namespace UAS_MES_NEW.Make
             ma_code.SetValueField = new string[] { "ma_code", "ma_prodcode", "ma_qty", "pr_spec", "ma_craftcode", "ma_bomversion", "ma_softversion", "ma_ecncode", "pr_pcbacount" };
             ma_code.Condition = "ma_statuscode='STARTED'";
             ma_code.DbChange += Ma_code_DBChange;
+            code.GotFocus+= text_getfocus;
             code.Focus();
             dh = SystemInf.dh;
             StepCount.StepCode = User.CurrentStepCode;
@@ -61,6 +62,11 @@ namespace UAS_MES_NEW.Make
             StepCount.Start();
         }
 
+        private void text_getfocus(object sender, EventArgs e)
+        {
+            code.ImeMode = ImeMode.Close;
+        }
+
         private void Ma_code_DBChange(object sender, EventArgs e)
         {
             DBFind = ma_code.ReturnData;
@@ -91,9 +97,9 @@ namespace UAS_MES_NEW.Make
                 {
                     if (Loading.Checked)
                     {
-                        if (code.Text.Replace(" ", "") == "")
+                        if (code.Text.Replace(" ", "") == ""||pr_pcbacount.Value == 0 || pr_pcbacount.Value == 1)
                         {
-                            OperateResult.AppendText(">>采集数据不可为空\n", Color.Red);
+                            OperateResult.AppendText(">>采集数据与拼版数不可为空\n", Color.Red);
                             return;
                         }
                         else

+ 201 - 1
UAS_MES_NEW/FunctionCode/Make/Make_SMTStencil.Designer.cs → UAS_MES_WEIP/FunctionCode/Make/Make_SMTStencil.Designer.cs

@@ -66,6 +66,19 @@
             this.ma_code = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.em_code1 = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.em_code1_label = new System.Windows.Forms.Label();
+            this.ST_ENSIONA = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.ST_ENSIONA_label = new System.Windows.Forms.Label();
+            this.ST_ENSIONB = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.ST_ENSIONB_label = new System.Windows.Forms.Label();
+            this.ST_ENSIONC = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.ST_ENSIONC_label = new System.Windows.Forms.Label();
+            this.ST_ENSIOND = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.label9 = new System.Windows.Forms.Label();
+            this.ST_ENSIONE = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
+            this.ST_ENSIONE_label = new System.Windows.Forms.Label();
+            this.label7 = new System.Windows.Forms.Label();
+            this.Scrap = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.st_usecount = new System.Windows.Forms.Label();
             ((System.ComponentModel.ISupportInitialize)(this.ToolsBom)).BeginInit();
             this.SuspendLayout();
             // 
@@ -503,11 +516,185 @@
             this.em_code1_label.TabIndex = 113;
             this.em_code1_label.Text = "人员编号";
             // 
+            // ST_ENSIONA
+            // 
+            this.ST_ENSIONA.AllPower = null;
+            this.ST_ENSIONA.BackColor = System.Drawing.Color.White;
+            this.ST_ENSIONA.ID = null;
+            this.ST_ENSIONA.Location = new System.Drawing.Point(165, 592);
+            this.ST_ENSIONA.Name = "ST_ENSIONA";
+            this.ST_ENSIONA.Negative = false;
+            this.ST_ENSIONA.Power = null;
+            this.ST_ENSIONA.Size = new System.Drawing.Size(120, 21);
+            this.ST_ENSIONA.Str = null;
+            this.ST_ENSIONA.Str1 = null;
+            this.ST_ENSIONA.Str2 = null;
+            this.ST_ENSIONA.TabIndex = 125;
+            // 
+            // ST_ENSIONA_label
+            // 
+            this.ST_ENSIONA_label.AutoSize = true;
+            this.ST_ENSIONA_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ST_ENSIONA_label.Location = new System.Drawing.Point(138, 592);
+            this.ST_ENSIONA_label.Name = "ST_ENSIONA_label";
+            this.ST_ENSIONA_label.Size = new System.Drawing.Size(21, 21);
+            this.ST_ENSIONA_label.TabIndex = 124;
+            this.ST_ENSIONA_label.Text = "A";
+            // 
+            // ST_ENSIONB
+            // 
+            this.ST_ENSIONB.AllPower = null;
+            this.ST_ENSIONB.BackColor = System.Drawing.Color.White;
+            this.ST_ENSIONB.ID = null;
+            this.ST_ENSIONB.Location = new System.Drawing.Point(360, 592);
+            this.ST_ENSIONB.Name = "ST_ENSIONB";
+            this.ST_ENSIONB.Negative = false;
+            this.ST_ENSIONB.Power = null;
+            this.ST_ENSIONB.Size = new System.Drawing.Size(120, 21);
+            this.ST_ENSIONB.Str = null;
+            this.ST_ENSIONB.Str1 = null;
+            this.ST_ENSIONB.Str2 = null;
+            this.ST_ENSIONB.TabIndex = 123;
+            // 
+            // ST_ENSIONB_label
+            // 
+            this.ST_ENSIONB_label.AutoSize = true;
+            this.ST_ENSIONB_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ST_ENSIONB_label.Location = new System.Drawing.Point(333, 592);
+            this.ST_ENSIONB_label.Name = "ST_ENSIONB_label";
+            this.ST_ENSIONB_label.Size = new System.Drawing.Size(20, 21);
+            this.ST_ENSIONB_label.TabIndex = 122;
+            this.ST_ENSIONB_label.Text = "B";
+            // 
+            // ST_ENSIONC
+            // 
+            this.ST_ENSIONC.AllPower = null;
+            this.ST_ENSIONC.BackColor = System.Drawing.Color.White;
+            this.ST_ENSIONC.ID = null;
+            this.ST_ENSIONC.Location = new System.Drawing.Point(559, 592);
+            this.ST_ENSIONC.Name = "ST_ENSIONC";
+            this.ST_ENSIONC.Negative = false;
+            this.ST_ENSIONC.Power = null;
+            this.ST_ENSIONC.Size = new System.Drawing.Size(120, 21);
+            this.ST_ENSIONC.Str = null;
+            this.ST_ENSIONC.Str1 = null;
+            this.ST_ENSIONC.Str2 = null;
+            this.ST_ENSIONC.TabIndex = 121;
+            // 
+            // ST_ENSIONC_label
+            // 
+            this.ST_ENSIONC_label.AutoSize = true;
+            this.ST_ENSIONC_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ST_ENSIONC_label.Location = new System.Drawing.Point(532, 592);
+            this.ST_ENSIONC_label.Name = "ST_ENSIONC_label";
+            this.ST_ENSIONC_label.Size = new System.Drawing.Size(21, 21);
+            this.ST_ENSIONC_label.TabIndex = 120;
+            this.ST_ENSIONC_label.Text = "C";
+            // 
+            // ST_ENSIOND
+            // 
+            this.ST_ENSIOND.AllPower = null;
+            this.ST_ENSIOND.BackColor = System.Drawing.Color.White;
+            this.ST_ENSIOND.ID = null;
+            this.ST_ENSIOND.Location = new System.Drawing.Point(165, 619);
+            this.ST_ENSIOND.Name = "ST_ENSIOND";
+            this.ST_ENSIOND.Negative = false;
+            this.ST_ENSIOND.Power = null;
+            this.ST_ENSIOND.Size = new System.Drawing.Size(120, 21);
+            this.ST_ENSIOND.Str = null;
+            this.ST_ENSIOND.Str1 = null;
+            this.ST_ENSIOND.Str2 = null;
+            this.ST_ENSIOND.TabIndex = 119;
+            // 
+            // label9
+            // 
+            this.label9.AutoSize = true;
+            this.label9.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label9.Location = new System.Drawing.Point(138, 619);
+            this.label9.Name = "label9";
+            this.label9.Size = new System.Drawing.Size(22, 21);
+            this.label9.TabIndex = 118;
+            this.label9.Text = "D";
+            // 
+            // ST_ENSIONE
+            // 
+            this.ST_ENSIONE.AllPower = null;
+            this.ST_ENSIONE.BackColor = System.Drawing.Color.White;
+            this.ST_ENSIONE.ID = null;
+            this.ST_ENSIONE.Location = new System.Drawing.Point(360, 619);
+            this.ST_ENSIONE.Name = "ST_ENSIONE";
+            this.ST_ENSIONE.Negative = false;
+            this.ST_ENSIONE.Power = null;
+            this.ST_ENSIONE.Size = new System.Drawing.Size(120, 21);
+            this.ST_ENSIONE.Str = null;
+            this.ST_ENSIONE.Str1 = null;
+            this.ST_ENSIONE.Str2 = null;
+            this.ST_ENSIONE.TabIndex = 117;
+            // 
+            // ST_ENSIONE_label
+            // 
+            this.ST_ENSIONE_label.AutoSize = true;
+            this.ST_ENSIONE_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ST_ENSIONE_label.Location = new System.Drawing.Point(334, 619);
+            this.ST_ENSIONE_label.Name = "ST_ENSIONE_label";
+            this.ST_ENSIONE_label.Size = new System.Drawing.Size(19, 21);
+            this.ST_ENSIONE_label.TabIndex = 116;
+            this.ST_ENSIONE_label.Text = "E";
+            // 
+            // label7
+            // 
+            this.label7.AutoSize = true;
+            this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label7.Location = new System.Drawing.Point(7, 592);
+            this.label7.Name = "label7";
+            this.label7.Size = new System.Drawing.Size(129, 21);
+            this.label7.TabIndex = 115;
+            this.label7.Text = "张力测试结果(N)";
+            // 
+            // Scrap
+            // 
+            this.Scrap.AllPower = null;
+            this.Scrap.BackColor = System.Drawing.Color.Transparent;
+            this.Scrap.DownImage = ((System.Drawing.Image)(resources.GetObject("Scrap.DownImage")));
+            this.Scrap.Image = null;
+            this.Scrap.IsShowBorder = true;
+            this.Scrap.Location = new System.Drawing.Point(782, 614);
+            this.Scrap.MoveImage = ((System.Drawing.Image)(resources.GetObject("Scrap.MoveImage")));
+            this.Scrap.Name = "Scrap";
+            this.Scrap.NormalImage = ((System.Drawing.Image)(resources.GetObject("Scrap.NormalImage")));
+            this.Scrap.Power = null;
+            this.Scrap.Size = new System.Drawing.Size(68, 28);
+            this.Scrap.TabIndex = 126;
+            this.Scrap.Text = "报废";
+            this.Scrap.UseVisualStyleBackColor = false;
+            // 
+            // st_usecount
+            // 
+            this.st_usecount.AutoSize = true;
+            this.st_usecount.Location = new System.Drawing.Point(336, 528);
+            this.st_usecount.Name = "st_usecount";
+            this.st_usecount.Size = new System.Drawing.Size(0, 12);
+            this.st_usecount.TabIndex = 127;
+            this.st_usecount.Visible = false;
+            // 
             // Make_SMTStencil
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(908, 580);
+            this.ClientSize = new System.Drawing.Size(908, 655);
+            this.Controls.Add(this.st_usecount);
+            this.Controls.Add(this.Scrap);
+            this.Controls.Add(this.ST_ENSIONA);
+            this.Controls.Add(this.ST_ENSIONA_label);
+            this.Controls.Add(this.ST_ENSIONB);
+            this.Controls.Add(this.ST_ENSIONB_label);
+            this.Controls.Add(this.ST_ENSIONC);
+            this.Controls.Add(this.ST_ENSIONC_label);
+            this.Controls.Add(this.ST_ENSIOND);
+            this.Controls.Add(this.label9);
+            this.Controls.Add(this.ST_ENSIONE);
+            this.Controls.Add(this.ST_ENSIONE_label);
+            this.Controls.Add(this.label7);
             this.Controls.Add(this.em_code1);
             this.Controls.Add(this.em_code1_label);
             this.Controls.Add(this.em_code);
@@ -588,5 +775,18 @@
         private System.Windows.Forms.Label em_code_label;
         private CustomControl.TextBoxWithIcon.EnterTextBox em_code1;
         private System.Windows.Forms.Label em_code1_label;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox ST_ENSIONA;
+        private System.Windows.Forms.Label ST_ENSIONA_label;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox ST_ENSIONB;
+        private System.Windows.Forms.Label ST_ENSIONB_label;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox ST_ENSIONC;
+        private System.Windows.Forms.Label ST_ENSIONC_label;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox ST_ENSIOND;
+        private System.Windows.Forms.Label label9;
+        private CustomControl.TextBoxWithIcon.NumOnlyTextBox ST_ENSIONE;
+        private System.Windows.Forms.Label ST_ENSIONE_label;
+        private System.Windows.Forms.Label label7;
+        private CustomControl.ButtonUtil.NormalButton Scrap;
+        private System.Windows.Forms.Label st_usecount;
     }
 }

+ 198 - 9
UAS_MES_NEW/FunctionCode/Make/Make_SMTStencil.cs → UAS_MES_WEIP/FunctionCode/Make/Make_SMTStencil.cs

@@ -17,7 +17,7 @@ namespace UAS_MES_NEW.Make
     {
 
         DataTable Dbfind;
-
+        bool ifUsed = false;
         AutoSizeFormClass asc = new AutoSizeFormClass();
 
         DataHelper dh = SystemInf.dh;
@@ -35,6 +35,16 @@ namespace UAS_MES_NEW.Make
             su_singlepringqty1.Enabled = false;
             Receive.Enabled = false;
             Return.Enabled = false;
+
+            SU_DEVCODE.Enabled = false;
+            SU_DEVCODE1.Enabled = false;
+            ST_ENSIONA.Enabled = false;
+            ST_ENSIONB.Enabled = false;
+            ST_ENSIONC.Enabled = false;
+            ST_ENSIOND.Enabled = false;
+            ST_ENSIONE.Enabled = false;
+            Scrap.Enabled = false;
+
         }
 
         private void Make_SMTStencil_Load(object sender, EventArgs e)
@@ -107,7 +117,7 @@ namespace UAS_MES_NEW.Make
                 version = dt.Rows[0]["st_version"].ToString();
                 st_maxusecount =int.Parse( dt.Rows[0]["st_maxusecount"].ToString());
                 st_usecount = int.Parse(dt.Rows[0]["st_usecount"].ToString());
-                if (status == "在线" || status == "报废" || status == "在仓")
+                if (status == "在线" || status == "报废"/* || status == "在仓"*/)
                 {
                     MessageBox.Show("当前钢网" + SU_DEVCODE.Text + "处于" + status + "状态,无法领用");
                     return;
@@ -128,12 +138,19 @@ namespace UAS_MES_NEW.Make
                 }
             }
             //限制钢网使用的产品
-            dt = (DataTable)dh.ExecuteSql("select 1 from STENILCANUSEPRO where sp_stcode='" + SU_DEVCODE.Text + "' and sp_prodcode='" + ma_prodcode.Text + "'", "select");
-            if (dt.Rows.Count == 0)
+            String pr_spec = dh.getFieldDataByCondition("product", "pr_spec", "pr_code = '" + ma_prodcode.Text + "'").ToString();
+            String st_vendcode = dh.getFieldDataByCondition("STENCIL", "nvl(st_vendcode,'aabbcc')", "st_code = '" + SU_DEVCODE.Text + "'").ToString();
+            if (!pr_spec.Contains(st_vendcode))
             {
                 MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "不能在产品" + ma_prodcode.Text + "中使用");
                 return;
             }
+            //dt = (DataTable)dh.ExecuteSql("select 1 from STENILCANUSEPRO where sp_stcode='" + SU_DEVCODE.Text + "' and sp_prodcode='" + ma_prodcode.Text + "'", "select");
+            //if (dt.Rows.Count == 0)
+            //{
+            //    MessageBox.Show("钢网编号" + SU_DEVCODE.Text + "不能在产品" + ma_prodcode.Text + "中使用");
+            //    return;
+            //}
             //一条线只能在线一个钢网
             dt = (DataTable)dh.ExecuteSql("select su_stcode from stenciluse where su_linecode='" + li_code.Text + "' and su_status='在线'", "select");
             if (dt.Rows.Count > 0)
@@ -177,7 +194,9 @@ namespace UAS_MES_NEW.Make
 
         private void Return_Click(object sender, EventArgs e)
         {
-            if (SU_RETURNIFCLEAN.Checked)
+            if (ST_ENSIONA.Text != "" && ST_ENSIONB.Text != "" && ST_ENSIONC.Text != "" && ST_ENSIOND.Text != "" && ST_ENSIONE.Text != "")
+            {
+                if (SU_RETURNIFCLEAN.Checked)
             {
                 DataTable dt = (DataTable)dh.ExecuteSql("select ST_USESTATUS,St_USECOUNT from Stencil where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
                 if (dt.Rows.Count > 0)
@@ -205,19 +224,25 @@ namespace UAS_MES_NEW.Make
                     if (int.Parse(st_combinenumber.Text) >= 0)
                     {
                         sql.Clear();
-                        sql.Append("update StencilUse set  su_cleannums=nvl(su_cleannums,0)+1, SU_BACKDATE=sysdate,su_returnman='" + dt.Rows[0]["em_name"].ToString() + "',su_returnmancode='" + em_code1.Text + "',");
+                        sql.Append("update StencilUse set SU_ENSIONA='" + ST_ENSIONA.Text + "',SU_ENSIONB='" + ST_ENSIONB.Text + "',SU_ENSIONC='" + ST_ENSIONC.Text + "',SU_ENSIOND='" + ST_ENSIOND.Text + "',SU_ENSIONE='" + ST_ENSIONE.Text + "', su_cleannums=nvl(su_cleannums,0)+1, SU_BACKDATE=sysdate,su_returnman='" + dt.Rows[0]["em_name"].ToString() + "',su_returnmancode='" + em_code1.Text + "',");
                         sql.Append("SU_THISUSETIMES='" + (st_combinenumber.Text == "" ? "0" : st_combinenumber.Text) + "',SU_STATUS='借出',su_usecount=" + (St_USECOUNT == "" ? "0" : St_USECOUNT) + "+" + st_combinenumber.Text);
                         sql.Append(",SU_RETURNIFCLEAN='" + (SU_RETURNIFCLEAN.Checked ? "-1" : "0") + "' where su_id=(select max(su_id) from stenciluse where su_stcode='" + SU_DEVCODE1.Text + "' and su_status='在线')");
                         dh.ExecuteSql(sql.ToString(), "update");
                         sql.Clear();
-                        sql.Append("update Stencil set st_cleannums=nvl(st_cleannums,0)+1,St_USECOUNT=nvl(St_USECOUNT,0)+" + (st_combinenumber.Text == "" ? "0" : st_combinenumber.Text) + ",ST_USESTATUS='借出' where st_code='" + SU_DEVCODE1.Text + "'");
+                        sql.Append("update Stencil set st_cleannums=nvl(st_cleannums,0)+1,ST_ENSIONA='" + ST_ENSIONA.Text + "',ST_ENSIONB='" + ST_ENSIONB.Text + "',ST_ENSIONC='" + ST_ENSIONC.Text + "',ST_ENSIOND='" + ST_ENSIOND.Text + "',ST_ENSIONE='" + ST_ENSIONE.Text + "',St_USECOUNT=nvl(St_USECOUNT,0)+" + (st_combinenumber.Text == "" ? "0" : st_combinenumber.Text) + ",ST_USESTATUS='借出' where st_code='" + SU_DEVCODE1.Text + "'");
                         dh.ExecuteSql(sql.ToString(), "update");
                         MessageBox.Show("钢网" + SU_DEVCODE1.Text + "退回成功!");
                         SU_DEVCODE1.Text = "";
                         st_combinenumber.Text = "";
                         em_code1.Text = "";
-                        SU_RETURNIFCLEAN.Checked = false;
-                        Confirm.PerformClick();
+                            ST_ENSIONA.Text = "";
+                            ST_ENSIONB.Text = "";
+                            ST_ENSIONC.Text = "";
+                            ST_ENSIOND.Text = "";
+                            ST_ENSIONE.Text = "";
+                            SU_RETURNIFCLEAN.Checked = false;
+                            Return.Enabled = false;
+                            Confirm.PerformClick();
                     }
                     else
                     {
@@ -234,6 +259,11 @@ namespace UAS_MES_NEW.Make
                 MessageBox.Show("请确认是否清洗钢网");
             }
         }
+            else
+            {
+                MessageBox.Show("请维护完成的测试参数");
+            }
+}
 
         private void Radio_CheckedChanged(object sender, EventArgs e)
         {
@@ -250,6 +280,13 @@ namespace UAS_MES_NEW.Make
                         st_combinenumber.Enabled = false;
                         SU_DEVCODE1.Enabled = false;
                         Return.Enabled = false;
+                        ST_ENSIONA.Enabled = false;
+                        ST_ENSIONB.Enabled = false;
+                        ST_ENSIONC.Enabled = false;
+                        ST_ENSIOND.Enabled = false;
+                        ST_ENSIONE.Enabled = false;
+                        Return.Enabled = false;
+                        Scrap.Enabled = false;
                     }
                     break;
                 case "RadioReturn":
@@ -262,6 +299,14 @@ namespace UAS_MES_NEW.Make
                         st_table.Enabled = false;
                         su_singlepringqty1.Enabled = false;
                         Receive.Enabled = false;
+                        ST_ENSIONA.Enabled = true;
+                        ST_ENSIONB.Enabled = true;
+                        ST_ENSIONC.Enabled = true;
+                        ST_ENSIOND.Enabled = true;
+                        ST_ENSIONE.Enabled = true;
+                        SU_DEVCODE.Enabled = false;
+                        Receive.Enabled = false;
+                        Receive.Enabled = false;
                     }
                     break;
                 default:
@@ -316,9 +361,153 @@ namespace UAS_MES_NEW.Make
                 {
                     MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
                 }
+
+
+                 dt = (DataTable)dh.ExecuteSql("select nvl(st_usecount,0)st_usecount,case when nvl(ST_COMBINENUMBER,1)=0 then 1 else nvl(ST_COMBINENUMBER,1) end from STENCIL where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
+                if (dt.Rows.Count == 0)
+                {
+                    MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
+                }
+                else
+                {
+                    st_usecount.Text = dt.Rows[0]["st_usecount"].ToString();
+                    if (int.Parse(st_usecount.Text) > 0)
+                    {
+                        ifUsed = true;
+                    }
+                    else
+                    {
+                        ifUsed = false;
+                    }
+                }
+
             }
         }
 
+
+        //默认范围39-55,如不在范围内则可以报废
+        private void ST_ENSION_TextChanged(object sender, EventArgs e)
+        {
+            double Range = 0;
+            List<string> Num = new List<string>();
+            Num.Add(ST_ENSIONA.Text);
+            Num.Add(ST_ENSIONB.Text);
+            Num.Add(ST_ENSIONC.Text);
+            Num.Add(ST_ENSIOND.Text);
+            Num.Add(ST_ENSIONE.Text);
+            int CheckCount = 0;
+            int FillCount = 0;
+            foreach (string item in Num)
+            {
+                if (item != "")
+                {
+                    FillCount = FillCount + 1;
+                    if (double.TryParse(item, out Range))
+                    {
+                        //如果使用过张力范围39-55,使用过30-55
+                        if (ifUsed)
+                        {
+                            if (Range > 30 && Range <= 55)
+                            {
+                                CheckCount = CheckCount + 1;
+                            }
+                        }
+                        else
+                        {
+                            if (Range > 30 && Range <= 55)
+                            {
+                                CheckCount = CheckCount + 1;
+                            }
+                        }
+                    }
+                }
+            }
+            if (FillCount == 5)
+            {
+                if (CheckCount == 5)
+                {
+                    Return.Enabled = true;
+                    Scrap.Enabled = false;
+                }
+                else
+                {
+                    Return.Enabled = false;
+                    Scrap.Enabled = true;
+                }
+            }
+        }
+
+
+
+        Make_StencilScrapReason form;
+        private void Scrap_Click(object sender, EventArgs e)
+        {
+            DataTable dt = (DataTable)dh.ExecuteSql("select st_usestatus,st_status from stencil where st_code='" + SU_DEVCODE1.Text + "' and st_statuscode='AUDITED'", "select");
+            if (dt.Rows.Count > 0)
+            {
+                if (dt.Rows[0]["st_usestatus"].ToString() == "报废")
+                {
+                    MessageBox.Show("钢网" + SU_DEVCODE1.Text + "已处于报废状态");
+                    return;
+                }
+                if (dt.Rows[0]["st_usestatus"].ToString() != "借出")
+                {
+                    MessageBox.Show("报废钢网必须" + SU_DEVCODE1.Text + "处于借出状态");
+                    return;
+                }
+                string closetab_confirm = MessageBox.Show(this.ParentForm, "报废后不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                if (closetab_confirm != "Yes")
+                {
+                    return;
+                }
+                form = new Make_StencilScrapReason();
+                BaseUtil.SetFormCenter(form);
+                form.Controls["ConfirmScrap"].Click += Make_SMTStencil_Click;
+                form.ShowDialog();
+            }
+            else
+            {
+                MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
+            }
+        }
+
+        private void Make_SMTStencil_Click(object sender, EventArgs e)
+        {
+            string Code = "";
+            string scrapreason = form.Controls["Reason"].Text;
+            if (scrapreason == "")
+            {
+                MessageBox.Show("报废原因不能为空");
+                return;
+            }
+            sql.Clear();
+            sql.Append("update StencilUse set SU_IFSCRAPOLD=-1,SU_STATUS='报废',SU_ENSIONA='" + ST_ENSIONA.Text + "',SU_ENSIONB='" + ST_ENSIONB.Text + "',SU_ENSIONC='" + ST_ENSIONC.Text + "',SU_ENSIOND='" + ST_ENSIOND.Text + "',SU_ENSIONE='" + ST_ENSIONE.Text + "'");
+            sql.Append(",SU_RETURNIFCLEAN='" + (SU_RETURNIFCLEAN.Checked ? "-1" : "0") + "' where su_id=(select max(su_id) from stenciluse where su_stcode='" + SU_DEVCODE1.Text + "')");
+            dh.ExecuteSql(sql.ToString(), "update");
+            sql.Clear();
+            sql.Append("update Stencil set ST_SCRAPREASON='" + scrapreason + "',ST_SCRAPMANCODE='" + User.UserCode + "',st_scrapman='" + User.UserName + "',st_scrapdate=sysdate,ST_USESTATUS='报废',ST_ENSIONA='" + ST_ENSIONA.Text + "',ST_ENSIONB='" + ST_ENSIONB.Text + "',");
+            sql.Append("ST_ENSIONC='" + ST_ENSIONC.Text + "',ST_ENSIOND='" + ST_ENSIOND.Text + "',ST_ENSIONE='" + ST_ENSIONE.Text + "' ");
+            sql.Append("where st_code='" + SU_DEVCODE1.Text + "'");
+            dh.ExecuteSql(sql.ToString(), "insert");
+            ////推送人员信息
+            //string[] emid = dh.GetConfig("sendEmp", "Stencil").ToString().Replace("\n", "#").Split('#');
+            //for (int i = 0; i < emid.Length; i++)
+            //{
+            //    string em_name = dh.getFieldDataByCondition("employee", "em_name", "em_id='" + emid[i] + "'").ToString();
+            //   // LogicHandler.SendMessage(emid[i], em_name, "钢网" + SU_DEVCODE1.Text + "已报废" + ",原因" + scrapreason + ",人员" + User.UserName);
+            //}
+            form.Close();
+            SU_DEVCODE1.Text = "";
+            ST_ENSIONA.Text = "";
+            ST_ENSIONB.Text = "";
+            ST_ENSIONC.Text = "";
+            ST_ENSIOND.Text = "";
+            ST_ENSIONE.Text = "";
+            SU_RETURNIFCLEAN.Checked = false;
+            Scrap.Enabled = false;
+            MessageBox.Show("报废成功!");
+        }
+
         private void ma_code_TextKeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)

+ 38 - 0
UAS_MES_NEW/FunctionCode/Make/Make_SMTStencil.resx → UAS_MES_WEIP/FunctionCode/Make/Make_SMTStencil.resx

@@ -254,6 +254,44 @@
         2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
         zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
         ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Scrap.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFcSURBVFhH5di7UsJAFMbxtDT6QMI76IAFT0npIE0K
+        GcRORxHklpAIBHLfbILV8XxeNsMznJ35F5vu+82kWYuILD4N7oq75roCw27sb/x5WBdc27btntY64o/i
+        DnZjPxy4S6A0R6PHO1WUNHc9ep4uxIXd2D8eP/XZowWUThBG+n3p0stsKbbJ0qFDFFfscQuUbpzm9Pqx
+        Eh8c4PGLkuX0Nl+LDw4GJckUTRaO+OBQo+SKpitXfHAwKClfZuuN+OBgUDJV0NzxxAeHM5TFxhffGUpe
+        aFp5n+KDg0FRfHH8nfjgUKPoktztXnxwMCgFX7xdID441ChlRf7+ID44GBTNl21wFB8capSqot0xFB8c
+        /lE6Wa70IU5oH0Ziw/5cFebpoPUwHPbL04nCJKUgisWF3dgPB3gABc9v7fvBoBcnaVKdvkha2I39cPjx
+        oPrhusndcPinpIXd2N8gIusbTaFspKtR2SQAAAAASUVORK5CYII=
+</value>
+  </data>
+  <data name="Scrap.MoveImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAFzSURBVFhH5djNSgJRGMZxL2P2gTfQFbZvHSEZFBEW
+        CEIQBEIgVFiS9qXWoDmp4/fHzDmjM2a+vU/QqUVX0DvwXxxn9fwYXJwYEcXWNzIWt83dcq7AsBv7LXgA
+        ZI0r71/aaqjCJf8o7sFu7IcDFwdK4vimrv1oSZXRnArdQFzYjf3pQkOzRxIoVWc6X5X6M7ruBGIr9mbU
+        9MIVe9hAcXvBO125WnxwgMcXSpcPF20tPjgYlI5eUK6lxAcHg9Lmw3nTFx8cDEpLLSjr+OKDg0FpqojO
+        Gp744GBQ3vyITutT8cHBoDheRCe1ifjgYFBe+ZCxJ+KDg0GpT0NKv4zFBweDUpuEdFQdiQ8OBsXmw2Fl
+        JD44/KCM53TwNBQfHAzKMx/2Hgfig8M3SrXYUasUfz67DwOxYf9dV5urg+RWzta4aEnxn83OfV9c2I39
+        cIAHUOJceTNbUfmW94GX0sJu7IcDPH5fXCe4EvfXxe5/D7ux3yKi2CfkPhTy27lqkwAAAABJRU5ErkJg
+        gg==
+</value>
+  </data>
+  <data name="Scrap.NormalImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
+        dHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAGVSURBVFhH5di7agJRFIXhDSKoYBQEC8FCECwEQRBE
+        4uUVEtTiPKVlom2wttM6IfF+15njXHRnL19jD/zFmanWV8zAEDNTp9OJS6/Sm2QUht3YH4cHtdvtF6k7
+        mUwG1tqd3FR3YTf2w0FKUVOu6XT68Xgw3+8PtWH/bDYbCkeLGo1Gz/d9JwzvrL0gCKx49KlerxtIBUGo
+        PjjAg2q1mqDc2fN99cEBHlStVk0oB+t56oMDPKhSqZggDNm1N/XBAR5ULpeNvGD46rrqgwM8qFQqGV8O
+        56ujPjjAg4rFosFL5ni5qA8O8KBCoWBuns/701l9cIAH5fN5QfF4dzipDw7woFwuZ+zN483+oD44wIOy
+        2azB52i13asPDvCgTCZjHGt5sdmqDw7woHQ6bRzX8ny1UR8c4EHJZNJc5fC7XKsPDvCgRCLR2x9Pzt9q
+        zT+Lpdqw/3A6W/HoUywWa32Nx8OL4zwffM8X6sJu7IcDPCgajaak7udoNNjsdgc81BZ2Yz8c4PH8cR2J
+        ROJSU3qXjMKwG/vjzEz/skOI3Zqgv7AAAAAASUVORK5CYII=
 </value>
   </data>
 </root>

+ 0 - 0
UAS_MES_NEW/FunctionCode/Make/Make_SMTStockStencil.Designer.cs → UAS_MES_WEIP/FunctionCode/Make/Make_SMTStockStencil.Designer.cs


+ 7 - 7
UAS_MES_NEW/FunctionCode/Make/Make_SMTStockStencil.cs → UAS_MES_WEIP/FunctionCode/Make/Make_SMTStockStencil.cs

@@ -240,13 +240,13 @@ namespace UAS_MES_NEW.Make
             sql.Append("ST_ENSIONC='" + ST_ENSIONC.Text + "',ST_ENSIOND='" + ST_ENSIOND.Text + "',ST_ENSIONE='" + ST_ENSIONE.Text + "' ");
             sql.Append("where st_code='" + SU_DEVCODE1.Text + "'");
             dh.ExecuteSql(sql.ToString(), "insert");
-            //推送人员信息
-            string[] emid = dh.GetConfig("sendEmp", "Stencil").ToString().Replace("\n", "#").Split('#');
-            for (int i = 0; i < emid.Length; i++)
-            {
-                string em_name = dh.getFieldDataByCondition("employee", "em_name", "em_id='" + emid[i] + "'").ToString();
-                //LogicHandler.SendMessage(emid[i], em_name, "钢网" + SU_DEVCODE1.Text + "已报废" + ",原因" + scrapreason + ",人员" + User.UserName);
-            }
+            ////推送人员信息
+            //string[] emid = dh.GetConfig("sendEmp", "Stencil").ToString().Replace("\n", "#").Split('#');
+            //for (int i = 0; i < emid.Length; i++)
+            //{
+            //    string em_name = dh.getFieldDataByCondition("employee", "em_name", "em_id='" + emid[i] + "'").ToString();
+            //   // LogicHandler.SendMessage(emid[i], em_name, "钢网" + SU_DEVCODE1.Text + "已报废" + ",原因" + scrapreason + ",人员" + User.UserName);
+            //}
             form.Close();
             SU_DEVCODE1.Text = "";
             ST_ENSIONA.Text = "";

+ 0 - 0
UAS_MES_NEW/FunctionCode/Make/Make_SMTStockStencil.resx → UAS_MES_WEIP/FunctionCode/Make/Make_SMTStockStencil.resx


+ 0 - 0
UAS_MES_NEW/FunctionCode/Make/Make_StencilScrapReason.Designer.cs → UAS_MES_WEIP/FunctionCode/Make/Make_StencilScrapReason.Designer.cs


+ 0 - 0
UAS_MES_NEW/FunctionCode/Make/Make_StencilScrapReason.cs → UAS_MES_WEIP/FunctionCode/Make/Make_StencilScrapReason.cs


+ 0 - 0
UAS_MES_NEW/Form1.resx → UAS_MES_WEIP/FunctionCode/Make/Make_StencilScrapReason.resx


+ 6 - 0
UAS_MES_WEIP/FunctionCode/Make/Make_TestCollection.cs

@@ -58,6 +58,7 @@ namespace UAS_MES_NEW.Make
         {
             GoodProduct.Checked = true;
             asc.controllInitializeSize(this);
+            ms_sncode.GotFocus += text_getfocus;
             ms_sncode.Focus();
             //设置锁定工单
             LockMakeCode.GetMakeCodeCtl(ma_code);
@@ -80,6 +81,11 @@ namespace UAS_MES_NEW.Make
             StepCount.Start();
         }
 
+        private void text_getfocus(object sender, EventArgs e)
+        {
+            ms_sncode.ImeMode = ImeMode.Close;
+        }
+
         private void ControlLockTimer_Tick(object sender, EventArgs e)
         {
             this.Activate();

+ 1 - 1
UAS_MES_WEIP/Login.cs

@@ -88,7 +88,7 @@ namespace UAS_MES_NEW
             //设置选中数据库的链接
             string DBUser = DB.SelectedValue.ToString().Split('#')[0];
             string Address = DB.SelectedValue.ToString().Split('#')[1];
-            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" + Address + ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+            DataHelper.DBConnectionString = "Password=select!#%*(;User ID=" + DBUser + ";Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=usoft.f3322.net)(PORT=11585)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
             SystemInf.CurrentDB = DBUser;
             //设置屏幕的宽高信息
             SystemInf.ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;

+ 1 - 1
UAS_MES_WEIP/Properties/Settings.settings

@@ -28,7 +28,7 @@
     </Setting>
     <Setting Name="MES" Type="System.String" Scope="Application">
       <Value Profile="(Default)">Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=
-192.168.1.105)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
+usoft.f3322.net)(PORT=11585)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));</Value>
     </Setting>
     <Setting Name="SMTBIND" Type="System.Boolean" Scope="User">
       <Value Profile="(Default)">True</Value>

+ 2 - 2
UAS_MES_WEIP/Properties/Settings1.Designer.cs

@@ -122,8 +122,8 @@ namespace UAS_MES_NEW.Properties {
         [global::System.Configuration.ApplicationScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         [global::System.Configuration.DefaultSettingValueAttribute("Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=MES;Pooling=false" +
-            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=\r\n192.168.1" +
-            ".105)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
+            ";Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=\r\nusoft.f33" +
+            "22.net)(PORT=11585)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));")]
         public string MES {
             get {
                 return ((string)(this["MES"]));

+ 27 - 0
UAS_MES_WEIP/UAS_MES_WEIP.csproj

@@ -548,12 +548,30 @@
     <Compile Include="FunctionCode\Make\Make_SMTBind.Designer.cs">
       <DependentUpon>Make_SMTBind.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_SMTStencil.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_SMTStencil.Designer.cs">
+      <DependentUpon>Make_SMTStencil.cs</DependentUpon>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_SMTStockStencil.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_SMTStockStencil.Designer.cs">
+      <DependentUpon>Make_SMTStockStencil.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Make\Make_SmtTestCollection.cs">
       <SubType>Form</SubType>
     </Compile>
     <Compile Include="FunctionCode\Make\Make_SmtTestCollection.Designer.cs">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </Compile>
+    <Compile Include="FunctionCode\Make\Make_StencilScrapReason.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="FunctionCode\Make\Make_StencilScrapReason.Designer.cs">
+      <DependentUpon>Make_StencilScrapReason.cs</DependentUpon>
+    </Compile>
     <Compile Include="FunctionCode\Packing\Packing_BigBoxCollection.cs">
       <SubType>Form</SubType>
     </Compile>
@@ -1275,9 +1293,18 @@
     <EmbeddedResource Include="FunctionCode\Make\Make_SMTBind.resx">
       <DependentUpon>Make_SMTBind.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_SMTStencil.resx">
+      <DependentUpon>Make_SMTStencil.cs</DependentUpon>
+    </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_SMTStockStencil.resx">
+      <DependentUpon>Make_SMTStockStencil.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Make\Make_SmtTestCollection.resx">
       <DependentUpon>Make_SmtTestCollection.cs</DependentUpon>
     </EmbeddedResource>
+    <EmbeddedResource Include="FunctionCode\Make\Make_StencilScrapReason.resx">
+      <DependentUpon>Make_StencilScrapReason.cs</DependentUpon>
+    </EmbeddedResource>
     <EmbeddedResource Include="FunctionCode\Packing\Packing_BigBoxCollection.resx">
       <DependentUpon>Packing_BigBoxCollection.cs</DependentUpon>
     </EmbeddedResource>