jingh
2021-10-06 077dd1267cbe547ca584cb7befc99c238c68b08f
WorkM/Á÷ת¿¨¹ÜÀí/MES_StationOutBillList_Bad.cs
@@ -618,6 +618,10 @@
            int MainIDCol =  Fun_GetCol("hmainid");
            int SubIDCol = Fun_GetCol("hsubid");
            int BillNoCol = Fun_GetCol("单据号");
            int HUserK3Col = Fun_GetCol("K3用户");
            int HKeepCol = Fun_GetCol("K3保管");
            int HSecManagerCol = Fun_GetCol("K3验收");
            int HDeptCol = Fun_GetCol("K3部门");
            DAL.ClsKf_ProductInBill oClsKf_ProductInBill ;
            //获取系统参数
            Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter();
@@ -645,15 +649,23 @@
                oClsKf_ProductInBill.omodel.HInterID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[MainIDCol].Value);
                oClsKf_ProductInBill.omodel.HDate = DateTime.Today;
                oClsKf_ProductInBill.omodel.HBillNo = ClsPub.isStrNull(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[BillNoCol].Value);
                oClsKf_ProductInBill.omodel.HDeptID = 0;
                oClsKf_ProductInBill.omodel.HEmpID = 0;
                oClsKf_ProductInBill.omodel.HSecManagerID = 0;
                oClsKf_ProductInBill.omodel.HKeeperID = 0;
                oClsKf_ProductInBill.omodel.HDeptID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HDeptCol].Value);
                oClsKf_ProductInBill.omodel.HEmpID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
                oClsKf_ProductInBill.omodel.HSecManagerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HSecManagerCol].Value);
                oClsKf_ProductInBill.omodel.HKeeperID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HKeepCol].Value);
                oClsKf_ProductInBill.omodel.HBillerID = ClsPub.isLong(grdMain.Rows[grdMain.SelectedRows[i].Index].Cells[HUserK3Col].Value);
                oClsKf_ProductInBill.omodel.HRemark = "不良品同步";
                oClsKf_ProductInBill.omodel.HMaker =  DBUtility.ClsPub.CurUserName;
                oClsKf_ProductInBill.omodel.HWHID = 0;
                oClsKf_ProductInBill.omodel.HSupID = 0;
                oClsKf_ProductInBill.omodel.HExplanation = ""; 
                if(oClsKf_ProductInBill.omodel.HBillerID==0 || oClsKf_ProductInBill.omodel.HKeeperID==0
                    || oClsKf_ProductInBill.omodel.HEmpID==0 || oClsKf_ProductInBill.omodel.HDeptID==0
                    || oClsKf_ProductInBill.omodel.HSecManagerID ==0 )
                {
                    MessageBox.Show("没有设置金蝶用户、部门、保管、验收员! " + DBUtility.ClsPub.sExeReturnInfo);
                    continue;
                }
                if(oClsKf_ProductInBill.AddBill_StationOut_Bad("3710", oSystemParameter.omodel, ref DBUtility.ClsPub.sExeReturnInfo))
                {
                    n++;
@@ -663,13 +675,15 @@
                    MessageBox.Show("同步单据失败!"+ DBUtility.ClsPub.sExeReturnInfo);
                }
                //休眠5秒
                System.Threading.Thread.Sleep(5000);
                System.Threading.Thread.Sleep(2000);
                //
            }
            //
            if (n > 0)
            {
                MessageBox.Show("同步单据完毕!一共有" + n.ToString() + "张入库单!");
                initGrid();
                Display();
            }
        }