浏览代码

调整BUG

callm 6 年之前
父节点
当前提交
fe23cfa75d
共有 1 个文件被更改,包括 29 次插入11 次删除
  1. 29 11
      UAS-MES/FunctionCode/Make/Make_SMTStencil.cs

+ 29 - 11
UAS-MES/FunctionCode/Make/Make_SMTStencil.cs

@@ -299,22 +299,41 @@ namespace UAS_MES.Make
         private void ST_ENSION_TextChanged(object sender, EventArgs e)
         {
             double Range = 0;
-            if (ST_ENSIONA.Text != "" && ST_ENSIONB.Text != "" && ST_ENSIONC.Text != "" && ST_ENSIOND.Text != "" && ST_ENSIONE.Text != "")
+            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 (double.TryParse((sender as Control).Text, out Range))
+                if (item != "")
                 {
-                    if (Range >= 39 && Range <= 55)
-                    {
-                        Return.Enabled = true;
-                        Scrap.Enabled = false;
-                    }
-                    else
+                    FillCount = FillCount + 1;
+                    if (double.TryParse(item, out Range))
                     {
-                        Return.Enabled = false;
-                        Scrap.Enabled = true;
+                        if (Range >= 39 && Range <= 55)
+                        {
+                            CheckCount = CheckCount + 1;
+                        }
                     }
                 }
             }
+            if (FillCount == 5)
+            {
+                if (CheckCount == 5)
+                {
+                    Return.Enabled = true;
+                    Scrap.Enabled = false;
+                }
+                else
+                {
+                    Return.Enabled = false;
+                    Scrap.Enabled = true;
+                }
+            }
         }
 
         private void SU_DEVCODE_KeyDown(object sender, KeyEventArgs e)
@@ -351,7 +370,6 @@ namespace UAS_MES.Make
                 DataTable dt = (DataTable)dh.ExecuteSql("select case when nvl(ST_COMBINENUMBER,1)=0 then 1 else nvl(ST_COMBINENUMBER,1) end from STENCIL where st_code='" + SU_DEVCODE1.Text + "'", "select");
                 if (dt.Rows.Count > 0)
                 {
-                    Console.WriteLine(dt.Rows[0][0].ToString());
                     st_combinenumber.Text = (int.Parse(ma_qty.Text) / int.Parse(dt.Rows[0][0].ToString())).ToString();
                 }
                 else