callm 3 жил өмнө
parent
commit
7d30554424

+ 17 - 17
UAS_MES_YD/PublicMethod/Print.cs

@@ -214,23 +214,23 @@ namespace UAS_MES_NEW.PublicMethod
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
-            //if (IfRePrint != "-1")
-            //{
-            //    if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
-            //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
-            //    }
-            //    else
-            //    {
-            //        dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
-            //    }
-            //    ////如果已经打印过了,则不允许再打印
-            //    if (dt.Rows.Count > 0)
-            //    {
-            //        ErrorMessage = SnCode + LabelType + "已打印";
-            //        return false;
-            //    }
-            //}
+            if (IfRePrint != "-1" && SystemInf.CurrentDB == "HAOQ")
+            {
+                if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                else
+                {
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+                }
+                ////如果已经打印过了,则不允许再打印
+                if (dt.Rows.Count > 0)
+                {
+                    ErrorMessage = SnCode + LabelType + "已打印";
+                    return false;
+                }
+            }
             string filelastwritetime = dh.getFieldDataByCondition("label", "la_lastwritetime", "la_id = '" + LaID + "'").ToString();
             FileInfo PrintFile = new FileInfo(LabelName);
             //打开模板路径