章政 7 лет назад
Родитель
Сommit
a25625259e
1 измененных файлов с 2 добавлено и 30 удалено
  1. 2 30
      UAS-MES/PublicMethod/Print.cs

+ 2 - 30
UAS-MES/PublicMethod/Print.cs

@@ -87,18 +87,6 @@ namespace UAS_MES.PublicMethod
                             }
                         }
                     }
-                    ////否则只查询名称相等的参数赋值
-                    //else
-                    //{
-                    //    for (int j = 0; j < doc.Variables.FormVariables.Count; j++)
-                    //    {
-                    //        if (doc.Variables.FormVariables.Item(j + 1).Name == dt.Rows[i]["lp_name"].ToString())
-                    //        {
-                    //            doc.Variables.FormVariables.Item(j + 1).Value = Param.Rows[0][0].ToString();
-                    //            break;
-                    //        }
-                    //    }
-                    //}
                 }
                 catch (System.Exception ex)
                 {
@@ -107,10 +95,8 @@ namespace UAS_MES.PublicMethod
             }
             LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印
-            //doc.Save();
             doc.Printer.SwitchTo(PrinterName);
             doc.PrintDocument(PrintNum);
-            //doc.Close();
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
             for (int k = 0; k < doc.Variables.FormVariables.Count; k++)
             {
@@ -129,7 +115,7 @@ namespace UAS_MES.PublicMethod
             {
                 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");
+                    dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
                 }
                 else
                 {
@@ -160,7 +146,7 @@ namespace UAS_MES.PublicMethod
                 lbl = new ApplicationClass();
                 BaseUtil.WriteLbl();
                 filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
-                string update = "la_lastwritetime = to_date((regexp_substr('"+ filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
+                string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
                 dh.UpdateByCondition("label", update, "la_id = '" + LaID + "'");
             }
             doc = lbl.Documents.Open(LabelName, true);
@@ -204,18 +190,6 @@ namespace UAS_MES.PublicMethod
                             }
                         }
                     }
-                    ////否则只查询名称相等的参数赋值
-                    //else
-                    //{
-                    //    for (int j = 0; j < doc.Variables.FormVariables.Count; j++)
-                    //    {
-                    //        if (doc.Variables.FormVariables.Item(j + 1).Name == dt.Rows[i]["lp_name"].ToString())
-                    //        {
-                    //            doc.Variables.FormVariables.Item(j + 1).Value = Param.Rows[0][0].ToString();
-                    //            break;
-                    //        }
-                    //    }
-                    //}
                 }
                 catch (System.Exception ex)
                 {
@@ -224,10 +198,8 @@ namespace UAS_MES.PublicMethod
             }
             LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印
-            //doc.Save();
             doc.Printer.SwitchTo(PrinterName);
             doc.PrintDocument(PrintNum);
-            //doc.Close();
             LogicHandler.DoCommandLog(iCaller, User.UserCode, "", User.UserLineCode, User.UserSourceCode, "打印", "成功打印", SnCode, "");
             for (int k = 0; k < doc.Variables.FormVariables.Count; k++)
             {