소스 검색

标签获取修改

Hcsy 8 년 전
부모
커밋
afd53da7a1

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

@@ -237,7 +237,7 @@ namespace UAS_MES.Make
                                 if (LogicHandler.SetStepResult((oMakeCode == "null" ? ma_code.Text : oMakeCode), User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage2))
                                 {
                                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
-                                    Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                                    Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, sncode.Text, int.Parse(PrintNum.Text));
                                     //提示用户打印成功
                                     OperateResult.AppendText(">>序列号:" + sncode.Text + "打印成功\n", Color.Green);
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒打印", "彩盒打印成功", sncode.Text, "");

+ 8 - 9
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -226,7 +226,7 @@ namespace UAS_MES.Make
                             dh.ExecuteSql("update makeserial set ms_nextmacode='" + ma_code.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + ms_sncode.Text + "' and ms_makecode<>'" + ma_code.Text + "')", "update");
                             OperateResult.AppendText(">>序列号" + ms_sncode.Text + "对应的物料已经采集完成\n", Color.Green);
                             doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
-                            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                            Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), Printer.Text, ms_sncode.Text, int.Parse(PrintNum.Text));
                             RemainIndex = 0;
                             CollectData.Clear();
                             CollectDataSonCode.Clear();
@@ -254,16 +254,15 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='彩盒标' order by pl_isdefault desc", "select");
-            PrintLabel.DataSource = dt;
-            PrintLabel.DisplayMember = "pl_labelname";
-            PrintLabel.ValueMember = "pl_labelcode";
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            PrintLabel.DataSource = _dt;
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[dt.Rows.Count];
-            for (int i = 0; i < dt.Rows.Count; i++)
+            indate = new System.DateTime[_dt.Rows.Count];
+            for (int i = 0; i < _dt.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(dt.Rows[i]["pl_labelname"].ToString(), dt.Rows[i]["pl_labelurl"].ToString(), dt.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(dt.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(_dt.Rows[i]["la_name"].ToString(), _dt.Rows[i]["la_url"].ToString());
             }
         }
 

+ 9 - 10
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -237,8 +237,8 @@ namespace UAS_MES.Make
         {
             if (PrintLabel.Items.Count != 0)
             {
-                doc = lbl.Documents.Open(ftpOperater.DownLoadTo+ PrintLabel.Text.Split(':')[1]);
-                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text), indate[PrintLabel.SelectedIndex]);
+                doc = lbl.Documents.Open(ftpOperater.DownLoadTo+ PrintLabel.Text);
+                Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrinterList.Text, sncode.Text, int.Parse(PrintNum.Text));
             }
             else
             {
@@ -276,16 +276,15 @@ namespace UAS_MES.Make
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
             LoadCheckQTY();
-            dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
-            PrintLabel.DataSource = dt;
-            PrintLabel.DisplayMember = "pl_laname";
-            PrintLabel.ValueMember = "pl_labelcode";
+            DataTable _dt = (DataTable)dh.ExecuteSql("select la_id,substr(la_url,instr(la_url,'\\',-1)+1)la_name,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='彩盒标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            PrintLabel.DataSource = _dt;
+            PrintLabel.DisplayMember = "la_name";
+            PrintLabel.ValueMember = "la_id";
             ftpOperater ftp = new ftpOperater();
-            indate = new System.DateTime[dt.Rows.Count];
-            for (int i = 0; i < dt.Rows.Count; i++)
+            indate = new System.DateTime[_dt.Rows.Count];
+            for (int i = 0; i < _dt.Rows.Count; i++)
             {
-                BaseUtil.GetPrintLabel(dt.Rows[i]["pl_labelname"].ToString(), dt.Rows[i]["pl_labelurl"].ToString(), dt.Rows[i]["pl_indate"].ToString());
-                indate[i] = Convert.ToDateTime(dt.Rows[i]["pl_indate"].ToString());
+                BaseUtil.GetPrintLabel(_dt.Rows[i]["la_name"].ToString(), _dt.Rows[i]["la_url"].ToString());
             }
         }