jingh
2021-10-06 077dd1267cbe547ca584cb7befc99c238c68b08f
控制不良品入库单
2个文件已修改
48 ■■■■ 已修改文件
DAL/仓库管理/ClsKf_ProductInBill.cs 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WorkM/流转卡管理/MES_StationOutBillList_Bad.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
DAL/²Ö¿â¹ÜÀí/ClsKf_ProductInBill.cs
@@ -456,8 +456,28 @@
                }
                //生成出入库单据
                //插入子表
                oCn.RunProc("EXEC h_p_Kf_ProductInBillSub_Insert_StationOutBad " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + sHSourceType + "'");
                //插入主表
                DataSet DS2 = oCn.RunProcReturn("EXEC h_p_Kf_ProductInBillSub_Insert_StationOutBad " + omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + sHSourceType + "'", "h_p_Kf_ProductInBillSub_Insert_StationOutBad");
                if (DS2 == null || DS2.Tables[0].Rows.Count == 0)
                {
                    sErrMsg = "判断写入子表状态失败,未知错误!";
                    if (oSystemParameterMain.WMS_CampanyName == "杭州智见" || oSystemParameterMain.WMS_CampanyName == "杭州斯莫尔") //系统参数  å®¢æˆ·å®šåˆ¶åŒ–名称     ç©ºç™½ä¸ºé€šç”¨
                    {
                    }
                    else
                    {
                        oCn.RollBack();
                    }
                    return false;
                }
                else
                {
                    if (DBUtility.ClsPub.isStrNull(DS2.Tables[0].Rows[0][0]) != "OK")
                    {
                        sErrMsg = "写入子表失败!";
                        return false;
                    }
                }
                        //插入主表
                oCn.RunProc("Insert Into Kf_ICStockBillMain   " +
                "(HBillType,HBillSubType,HInterID,HBillNo,HDate,HMainSourceBillType" +
                ",HYear,HPeriod,HRemark,HMaker,HMakeDate" +
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();
            }
        }