Browse Source

修改出货单删除行后无法采集的BUG

章政 6 years ago
parent
commit
62cf35a952

+ 3 - 2
UAS-出货标签管理(泽天)/PublicMethod/DataHelper.cs

@@ -986,7 +986,7 @@ namespace UAS_LabelMachine
         /// </summary>
         /// </summary>
         /// <param name="sql"></param>
         /// <param name="sql"></param>
         /// <param name="names"></param>
         /// <param name="names"></param>
-        public void BatchInsert(string sql, params object[][] names)
+        public int BatchInsert(string sql, params object[][] names)
         {
         {
             command = new OracleCommand(sql, connection);
             command = new OracleCommand(sql, connection);
             command.ArrayBindCount = names[1].Length;
             command.ArrayBindCount = names[1].Length;
@@ -996,8 +996,9 @@ namespace UAS_LabelMachine
             {
             {
                 command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
                 command.Parameters.Add(new OracleParameter(names[0][i - 1].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
             }
-            command.ExecuteNonQuery();
+            int rowsnum=(command.ExecuteNonQuery());
             command.Dispose();
             command.Dispose();
+            return rowsnum;
         }
         }
 
 
         public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)
         public void BatchInsertDataTable(string sql, string[] param, params object[][] param1)

File diff suppressed because it is too large
+ 184 - 212
UAS-出货标签管理(泽天)/UAS_出货标签管理.Designer.cs


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

@@ -373,7 +373,11 @@ namespace UAS_LabelMachine
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
             sql.Append("select :PIB_ID,pd_prodcode,sysdate,pi_inoutno,pi_id,pd_pdno,pd_id,pi_class,");
             sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "' ");
             sql.Append("'" + pib_barcode + "',:PIB_CUSTBARCODE,'" + CurrentZXBZ + "','" + Data["BRAND"] + "','" + Data["DATECODE"] + "','" + Data["LOTNO"] + "','" + pib_outboxcode2 + "','" + User.UserCode + "','" + (EnablePrint && SingleLabelAutoPrint.Checked ? 1 : 0).ToString() + "',pd_ordercode,pd_pocode,pd_remark,'" + MidboxCapacity.Value + "','" + pi_cardcode.Text + "' ");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
             sql.Append("from prodinout left join prodiodetail on pi_id=pd_piid left join PRODJOINVENDDETAIL on pjd_brand =pd_brand and pjd_prodcode=pd_prodcode where pi_id='" + PI_ID + "' and pd_prodcode='" + CurrentPrCode + "' and pd_pdno='" + CurrentPDNO + "'");
-            dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
+            int rowsnum = dh.BatchInsert(sql.ToString(), new string[] { "PIB_ID", "PIB_CUSTBARCODE" }, PIBID, CustBarCode.ToArray());
+            if (rowsnum == 0)
+            {
+                MessageBox.Show("未成功插入数据,请核对出货单当前明细", "提示");
+            }
             //更新流水号
             //更新流水号
             dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + (pi_cardcode.Text == "" ? "Default" : pi_cardcode.Text) + "' and rmn_prefix='" + Prefix + "'");
             dh.UpdateByCondition("RULEMAXNUM", "rmn_maxnumber='" + (MaxNum) + "'", "rmn_nrcode='" + (pi_cardcode.Text == "" ? "Default" : pi_cardcode.Text) + "' and rmn_prefix='" + Prefix + "'");
             LoadGridData(new object(), new EventArgs());
             LoadGridData(new object(), new EventArgs());
@@ -396,12 +400,12 @@ namespace UAS_LabelMachine
                 combined = 1;
                 combined = 1;
             if (CombindetailTwo.Checked)
             if (CombindetailTwo.Checked)
                 combined = 2;
                 combined = 2;
-            dh.UpdateByCondition("CS$InoutPrcode", "Collectednum='" + collectqty + "'", "pd_inoutno='" + pi_inoutno.Text + "' and pd_pdno='" + CurrentPDNO + "' and combined=" + combined);
+            dh.UpdateByCondition("CS$InoutPrcode", "Collectednum='" + CollectQty + "'", "pd_inoutno='" + pi_inoutno.Text + "' and pd_pdno='" + CurrentPDNO + "' and combined=" + combined);
             CollectNum = 0;
             CollectNum = 0;
             double OutNum = 0;
             double OutNum = 0;
             if (GridPrcode.SelectedRows.Count > 0)
             if (GridPrcode.SelectedRows.Count > 0)
             {
             {
-                GridPrcode.Rows[GridPrcode.SelectedRows[0].Index].Cells["CollectedNum"].Value = collectqty;
+                GridPrcode.Rows[GridPrcode.SelectedRows[0].Index].Cells["CollectedNum"].Value = CollectQty;
                 for (int i = 0; i < GridPrcode.Rows.Count; i++)
                 for (int i = 0; i < GridPrcode.Rows.Count; i++)
                 {
                 {
                     CollectNum += float.Parse(GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString());
                     CollectNum += float.Parse(GridPrcode.Rows[i].Cells["CollectedNum"].Value.ToString());

Some files were not shown because too many files changed in this diff