Pārlūkot izejas kodu

出货单装箱状态更新,删除为0就更新为空

章政 5 gadi atpakaļ
vecāks
revīzija
c58133bbbd

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 309 - 195
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs


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

@@ -1180,8 +1180,8 @@ namespace UAS_LabelMachine
         {
             if (dh.getFieldDataByCondition("prodinout", "pi_statuscode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString() == "POSTED")
             {
-                MessageBox.Show("单据" + pi_inoutno.Text + "已过账,不允许删除条码");
-                return;
+                //MessageBox.Show("单据" + pi_inoutno.Text + "已过账,不允许删除条码");
+                //return;
             }
             ArrayList<string> DeleteID = new ArrayList<string>();
             for (int i = 0; i < LabelInf.RowCount; i++)
@@ -1202,7 +1202,14 @@ namespace UAS_LabelMachine
                     Input.Clear();
                     LoadPrcodeData();
                     LoadGridData(sender, e);
-                    dh.UpdateByCondition("prodinout", "pi_user_packingstatus='Packing'", "pi_inoutno='" + pi_inoutno.Text + "'");
+                    if (int.Parse(dh.getFieldDataByCondition("prodiobarcode", "count(1)", "pib_inoutno='" + pi_inoutno.Text + "'").ToString()) == 0)
+                    {
+                        dh.UpdateByCondition("prodinout", "pi_user_packingstatus=''", "pi_inoutno='" + pi_inoutno.Text + "'");
+                    }
+                    else
+                    {
+                        dh.UpdateByCondition("prodinout", "pi_user_packingstatus='Packing'", "pi_inoutno='" + pi_inoutno.Text + "'");
+                    }
                 }
             }
             else
@@ -1214,11 +1221,14 @@ namespace UAS_LabelMachine
             if (OutBoxCombox.Text != "")
             {
                 Pack_Click(sender, e);
-                //记录整箱的重量
-                sql.Clear();
-                sql.Append("update prodiobarcode set pib_totalweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
-                sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
-                dh.ExecuteSql(sql.ToString(), "update");
+                if (Weight.Text != "" && Weight.Text != "0.000")
+                {
+                    //记录整箱的重量
+                    sql.Clear();
+                    sql.Append("update prodiobarcode set pib_totalweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");
+                    sql.Append(" and pib_outboxcode2='" + OutBoxNum.Text + "'");
+                    dh.ExecuteSql(sql.ToString(), "update");
+                }
                 LoadGridData(sender, e);
                 thread = new Thread(OutBoxPrint);
                 stw = new SetLoadingWindow(thread, "正在打印外箱");
@@ -2035,6 +2045,7 @@ namespace UAS_LabelMachine
             {
                 dh.ExecuteSql("delete from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "'", "delete");
                 dh.ExecuteSql("delete from CS$InoutPrcode where pd_inoutno='" + pi_inoutno.Text + "'", "delete");
+                dh.UpdateByCondition("prodinout", "pi_user_packingstatus=''", "pi_inoutno='" + pi_inoutno.Text + "'");
                 pi_inoutno_KeyDown(sender, new KeyEventArgs(Keys.Enter));
             }
         }
@@ -2060,7 +2071,7 @@ namespace UAS_LabelMachine
 
         private void ButtonWeigh_Click(object sender, EventArgs e)
         {
-            if (Weight.Text != "")
+            if (Weight.Text != "" && Weight.Text != "0.000")
             {
                 sql.Clear();
                 sql.Append("update prodiobarcode set pib_boxweight='" + Weight.Text + "' where pib_inoutno='" + pi_inoutno.Text + "' ");

Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels