Browse Source

SQL修改

章政 7 years ago
parent
commit
3a3c8d2329
1 changed files with 4 additions and 2 deletions
  1. 4 2
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 4 - 2
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -1632,10 +1632,12 @@ namespace UAS_LabelMachine
         private void CustomerLabel_Click(object sender, EventArgs e)
         private void CustomerLabel_Click(object sender, EventArgs e)
         {
         {
             sql.Clear();
             sql.Clear();
-            sql.Append("update prodiobarcode set pib_custbarcode=('SL'||pib_custbarcode),");
-            sql.Append("pib_custoutboxcode=('SC'||pib_custoutboxcode) where pib_inoutno='" + pi_inoutno.Text + "'");
+            sql.Append("update prodiobarcode set pib_custbarcode=case when instr(pib_custbarcode,'SL')=0 ");
+            sql.Append("then ('SL'||pib_custbarcode)else pib_custbarcode end, pib_custoutboxcode=case when instr");
+            sql.Append("(pib_custoutboxcode,'SC')=0 then ('SC'||pib_custoutboxcode)else pib_custoutboxcode end where pib_inoutno='" + pi_inoutno.Text + "'");
             dh.ExecuteSql(sql.ToString(), "select");
             dh.ExecuteSql(sql.ToString(), "select");
             LoadGridData(sender, e);
             LoadGridData(sender, e);
+            CustomerLabel.Enabled = false;
         }
         }
     }
     }
 }
 }