Browse Source

修改标签获取类型

callm 11 hours ago
parent
commit
29157dc14d
1 changed files with 8 additions and 5 deletions
  1. 8 5
      UAS_MES_JC/FunctionCode/Query/Query_SN.cs

+ 8 - 5
UAS_MES_JC/FunctionCode/Query/Query_SN.cs

@@ -32,6 +32,8 @@ namespace UAS_MES_NEW.Query
 
         DataTable _dt;
 
+        string pr_useattach = "";
+
         public Query_SN()
         {
             InitializeComponent();
@@ -56,9 +58,10 @@ namespace UAS_MES_NEW.Query
         {
             Dbfind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, Dbfind);
-            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select ma_qty,ma_prodcode,pr_useattach,pr_detail,ma_printnum from make left join product on ma_prodcode=pr_code left join (select count(1)ma_printnum,msl_makecode from makesnlist where msl_printstatus=-1 group by msl_makecode) on msl_makecode=ma_code where ma_code='" + ma_code.Text + "'", "select");
             if (dt.Rows.Count > 0)
             {
+                pr_useattach = dt.Rows[0]["pr_useattach"].ToString();
                 pr_code.Text = dt.Rows[0]["ma_prodcode"].ToString();
                 ma_qty.Text = dt.Rows[0]["ma_qty"].ToString();
                 ma_printcount.Text = dt.Rows[0]["ma_printnum"].ToString();
@@ -70,7 +73,7 @@ namespace UAS_MES_NEW.Query
         {
             try
             {
-                engine = new Engine(true);
+                //engine = new Engine(true);
             }
             catch (Exception)
             {
@@ -118,10 +121,10 @@ namespace UAS_MES_NEW.Query
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='机身标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+            _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode='" + pr_code.Text + "' and la_templatetype='" + pr_useattach + "' and la_statuscode='AUDITED' order by la_isdefault", "select");
             if (_dt.Rows.Count == 0)
             {
-                _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode is null and la_templatetype='机身标' and la_statuscode='AUDITED' order by la_isdefault", "select");
+                _dt = (DataTable)dh.ExecuteSql("select la_id,la_url,la_isdefault from label where la_prodcode is null and la_templatetype='" + pr_useattach + "' and la_statuscode='AUDITED' order by la_isdefault", "select");
             }
             PrintLabel.DataSource = _dt;
             PrintLabel.DisplayMember = "la_url";
@@ -139,7 +142,7 @@ namespace UAS_MES_NEW.Query
                 MessageBox.Show("工单号不存在");
                 return;
             }
-            DataTable dt = (DataTable)dh.ExecuteSql("select '机柜' pr_exbarcode,pr_spec3_user,ma_qty,pr_prefix from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select '机柜' pr_exbarcode,pr_useattach,pr_spec3_user,ma_qty,pr_prefix from make left join product on ma_prodcode=pr_code where ma_code='" + ma_code.Text + "'", "select");
             string pr_exbarcode = "";
             string ma_qty = "";
             string pr_spec3_user = "";