Преглед изворни кода

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

章政 пре 8 година
родитељ
комит
915a620a02

+ 1 - 5
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs

@@ -140,11 +140,7 @@ namespace UAS_MES.Make
                         {
                         {
                             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                             string ErrorMessage = "";
                             string ErrorMessage = "";
-                            if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "大箱标", "0", out ErrorMessage))
-                            {
-
-                            }
-                            else
+                            if (!Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), pa_makecode.Text, pa_prodcode.Text, "大箱标", "0", out ErrorMessage))
                             {
                             {
                                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                             }
                             }

+ 1 - 5
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -213,11 +213,7 @@ namespace UAS_MES.Make
         {
         {
             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
             string ErrorMessage = "";
             string ErrorMessage = "";
-            if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
-            {
-
-            }
-            else
+            if (!Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, outboxcode.Text, int.Parse(PrintNum.Text), ma_code.Text, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
             {
             {
                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                 OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
             }
             }

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -240,7 +240,7 @@ namespace UAS_MES.Make
                                     }
                                     }
                                     else
                                     else
                                     {
                                     {
-                                        OperateResult.AppendText(ErrorMessage + "\n", Color.Green);
+                                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                                     }
                                     }
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, "");
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, "");
                                     //刷新打印数量和剩余数量
                                     //刷新打印数量和剩余数量

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -205,7 +205,7 @@ namespace UAS_MES.Make
                 {
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                     {
                     {
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     }
                     }

+ 2 - 5
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -195,13 +195,10 @@ namespace UAS_MES.Make
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text),ms_makecode.Text,pr_code.Text,"卡通箱标","0",out ErrorMessage))
-                    {
-                    }
-                    else
+                    if (!Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text),ms_makecode.Text,pr_code.Text,"卡通箱标","0",out ErrorMessage))
                     {
                     {
                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
                         OperateResult.AppendText(ErrorMessage + "\n", Color.Red);
-                    }
+                    }                  
                     pa_outboxcode.Focus();
                     pa_outboxcode.Focus();
                     pa_outboxcode.SelectAll();
                     pa_outboxcode.SelectAll();
                 }
                 }

+ 10 - 1
UAS-MES/PublicMethod/Print.cs

@@ -20,10 +20,19 @@ namespace UAS_MES.PublicMethod
 
 
         public Print() { }
         public Print() { }
 
 
+
         public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
         {
             ErrorMessage = "";
             ErrorMessage = "";
-            DataTable 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");
+            DataTable dt = new DataTable();
+            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)
             if (dt.Rows.Count > 0)
             {
             {