1
wangyi
3 天以前 8cdf2c4d1edba2cfa7d63c7b071f170354bdf691
WebAPI/DLL/ClsSc_MouldRepairCheckBill.cs
@@ -9,6 +9,7 @@
    {
        public Model.ClsSc_MouldRepairCheckBillMain omodel = new Model.ClsSc_MouldRepairCheckBillMain();
        public List<Model.ClsSc_MouldRepairCheckBillSub> DetailColl = new List<Model.ClsSc_MouldRepairCheckBillSub>();
        Pub_Class.ClsXt_SystemParameter oSystemParameter = new Pub_Class.ClsXt_SystemParameter(); //获取系统参数
        public ClsSc_MouldRepairCheckBill()
        {
@@ -121,6 +122,12 @@
        {
            try
            {
                //获取系统参数
                if (oSystemParameter.ShowBill(ref sReturn) == false)
                {
                    sReturn = "获取系统参数失败! " + sReturn;
                    return false;
                }
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
@@ -172,19 +179,7 @@
                      "," + oSub.HSourceInterID.ToString() + "," + oSub.HSourceEntryID.ToString() + ",'" + oSub.HSourceBillNo + "','" + oSub.HSourceBillType + "'," + oSub.HRelationQty.ToString() + "," + oSub.HRelationMoney.ToString() +
                      ") ");
                }
                //
                //foreach (Model.ClsSc_MouldRepairCheckBillSub oSub in DetailColl)
                //{
                //    Ds = oCn.RunProcReturn("exec h_p_Sc_MouldRepairCheckBill_Qty " + oSub.HICMOInterID, "");
                //    if (Ds.Tables[0].Rows.Count == 0)
                //        return;
                //    if (DBUtility.ClsPub.isStrNull(Ds.Tables[0].Rows[0]["HBool"]) == "Y")
                //    {
                //        sReturn = "汇报数量超过计划数量!不允许保存";
                //        return false;
                //    }
                //}
                //
                //=========================保存后控制  
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldRepairCheckBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1,1 ", "h_p_Sc_MouldRepairCheckBill_AfterSaveCtrl");
@@ -202,7 +197,17 @@
                }
                //============================
                sReturn = "新增单据成功!";
                //保存后是否自动审核
                if (oSystemParameter.omodel.Sc_MouldRepairCheckBill_AutoCheck.ToUpper() == "Y")
                {
                    oCn.RunProc("Update Sc_MouldRepairCheckBillMain Set HChecker='" + omodel.HMaker + "',HCheckDate=getdate(),HBillStatus=2 where HInterID= " + omodel.HInterID);
                    sReturn = "单据号:" + omodel.HBillNo + " 新增审核成功!";
                }
                else
                {
                    sReturn = "单据号:" + omodel.HBillNo + " 新增成功!";
                }
                oCn.Commit();
                return true;
            }