Browse Source

卡通箱移箱操作清除原明细

Hcsy 8 years ago
parent
commit
c1664e3feb
1 changed files with 5 additions and 2 deletions
  1. 5 2
      UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

+ 5 - 2
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -95,8 +95,6 @@ namespace UAS_MES.Packing
             }
         }
 
-
-
         private void sn_code_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.KeyCode == Keys.Enter)
@@ -169,6 +167,8 @@ namespace UAS_MES.Packing
                                                     sql.Append("values (packagedetail_seq.nextval,'" + pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yymmdd'))");
                                                     dh.ExecuteSql(sql.GetString(), "insert");
 
+                                                    //删除原明细
+                                                    dh.ExecuteSql("delete from packagedetail where pd_id='" + old_pa_id + "'", "delete");
                                                     //更新原箱数量
                                                     dh.UpdateByCondition("package", "pa_currentqty=pa_currentqty-1", "pa_outboxcode = '" + ms_outboxcode + "'");
                                                     //更新目标箱数量
@@ -263,6 +263,9 @@ namespace UAS_MES.Packing
                                         sql.Append("values (packagedetail_seq.nextval,'" + old_pa_id + "','" + pa_outboxcode.Text + "','" + sn_code.Text + "','1','" + msprodcode + "','" + ms_makecode + "',sysdate,to_char(sysdate,'yymmdd'))");
                                         dh.ExecuteSql(sql.GetString(), "insert");
 
+
+                                        //删除原明细
+                                        dh.ExecuteSql("delete from packagedetail where pd_id='" + old_pa_id + "'", "delete");
                                         //更新原箱数量
                                         dh.UpdateByCondition("package", "pa_currentqty=pa_currentqty-1", "pa_outboxcode = '" + ms_outboxcode + "'");
                                         //更新目标箱数量