Browse Source

途程放大镜条件修改

章政 8 years ago
parent
commit
034f5d0260
2 changed files with 8 additions and 5 deletions
  1. 4 1
      UAS-MES/FunctionCode/Make/Make_Repair.cs
  2. 4 4
      UAS-MES/PublicMethod/LogicHandler.cs

+ 4 - 1
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -649,7 +649,10 @@ namespace UAS_MES.Make
 
         private void ms_prodcode_TextChanged(object sender, EventArgs e)
         {
-            cr_code.Condition = "cr_prodcode='" + ms_prodcode.Text + "'";
+            if (ms_prodcode.Text != "")
+                cr_code.Condition = "cr_prodcode='" + ms_prodcode.Text + "'";
+            else
+                cr_code.Condition = "";
             bd_soncode.Condition = "bd_mothercode='" + ms_prodcode.Text + "' and NVL(bd_usestatus,' ')<>'DISABLE'";
         }
     }

+ 4 - 4
UAS-MES/PublicMethod/LogicHandler.cs

@@ -388,12 +388,12 @@ namespace UAS_MES.PublicMethod
         {
             oErrorMessage = "";
             iUserCode = iUserCode.ToUpper();
-            string SQL = "select em_code,em_type,em_name from employee where upper(em_code)=:UserName ";
+            iSourceCode = iSourceCode.ToUpper();
+            string SQL = "select em_code,em_type from employee where upper(em_code)=:UserName ";
             DataTable dt;
             dt = (DataTable)dh.ExecuteSql(SQL, "select", iUserCode);
             if (dt.Rows.Count > 0)
             {
-                string em_name = dt.Rows[0]["em_name"].ToString();
                 string em_type = dt.Rows[0]["em_type"].ToString();
                 if (iSourceCode == "")
                 {
@@ -402,7 +402,7 @@ namespace UAS_MES.PublicMethod
                 }
                 if (em_type == "admin")
                 {
-                    if (dh.CheckExist("Source", "upper(sc_code)='" + iSourceCode.ToUpper() + "' and sc_statuscode='AUDITED'"))
+                    if (dh.CheckExist("Source", "upper(sc_code)='" + iSourceCode + "' and sc_statuscode='AUDITED'"))
                     {
                         return true;
                     }
@@ -414,7 +414,7 @@ namespace UAS_MES.PublicMethod
                 }
                 else
                 {
-                    dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "ur_resourcecode" }, "upper(eg_emcode)= '" + iUserCode + "' and sc_statuscode='AUDITED'");
+                    dt = dh.getFieldsDatasByCondition("cs$empgroup left join cs$userresource on ur_groupcode=eg_groupcode left join source on ur_resourcecode=sc_code", new string[] { "upper(ur_resourcecode) ur_resourcecode" }, "upper(eg_emcode)= '" + iUserCode + "' and sc_statuscode='AUDITED'");
                     //如果存在该编号
                     if (dt.Rows.Count > 0)
                     {