Browse Source

BUG调整

章政 6 years ago
parent
commit
e218496347
1 changed files with 9 additions and 11 deletions
  1. 9 11
      UAS-MES/FunctionCode/Make/Make_SMTStockStencil.cs

+ 9 - 11
UAS-MES/FunctionCode/Make/Make_SMTStockStencil.cs

@@ -144,16 +144,6 @@ namespace UAS_MES.Make
                         MessageBox.Show("钢网编号" + SU_DEVCODE1.Text + "不存在或者未审核");
                         return;
                     }
-                    string St_USECOUNT = dt.Rows[0]["St_USECOUNT"].ToString();
-                    //如果有使用过的话
-                    if (int.Parse(St_USECOUNT) > 0)
-                    {
-                        ifUsed = true;
-                    }
-                    else
-                    {
-                        ifUsed = false;
-                    }
                     sql.Clear();
                     sql.Append("update StencilUse set su_returnman='" + User.UserName + "',SU_BACKDATE=sysdate,SU_ENSIONA='" + ST_ENSIONA.Text + "',SU_ENSIONB='" + ST_ENSIONB.Text + "',SU_ENSIONC='" + ST_ENSIONC.Text + "',SU_ENSIOND='" + ST_ENSIOND.Text + "',");
                     sql.Append("SU_ENSIONE='" + ST_ENSIONE.Text + "',SU_STATUS='在仓'");
@@ -370,7 +360,7 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                DataTable dt = (DataTable)dh.ExecuteSql("select 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");
+                DataTable 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 + "不存在或者未审核");
@@ -378,6 +368,14 @@ namespace UAS_MES.Make
                 else
                 {
                     st_usecount.Text = dt.Rows[0]["st_usecount"].ToString();
+                    if (int.Parse(st_usecount.Text) > 0)
+                    {
+                        ifUsed = true;
+                    }
+                    else
+                    {
+                        ifUsed = false;
+                    }
                 }
             }
         }