1
duhe
2025-03-31 9b4915b7b3669ffe80774740bd06c547ece49494
DAL/Éú²ú¹ÜÀí/Ä£¾ß¹ÜÀí/ClsSc_MouldMaintainPlanBill.cs
@@ -38,7 +38,21 @@
        {
            try
            {
                //
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                oCn.BeginTran();
                //更新主表
                oCn.RunProc("UpDate Sc_MouldMaintainPlanBillMain set  " +
@@ -48,7 +62,7 @@
                ",HPeriod='" + omodel.HPeriod.ToString() + "'" +
                //",HStockType='" + omodel.HStockType + "'" +
                ",HRemark='" + omodel.HRemark + "'" +
                ",HUpDater='" + DBUtility.ClsPub.CurUserName + "'" +
                ",HUpDater='" + omodel.HMaker + "'" +
                ",HUpDateDate=getdate()" +
                //========================================
                //",HDeptID=" + omodel.HDeptID.ToString() +
@@ -144,6 +158,21 @@
                //        return false;
                //    }
                //}
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -160,6 +189,22 @@
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Sc_MouldMaintainPlanBill_BeforeSaveCtrl");
                if (ds == null)
                {
                    sReturn = "保存前判断失败!";
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败!" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    return false;
                }
                //=========================================================
                //得到mainid
                omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                //若MAINDI重复则重新获取
@@ -172,7 +217,7 @@
                ",HInnerBillNo,HExplanation,HMouldMaintainRuleID,HMaintainLevID,HMainSourceInterID,HMainSourceBillNo,HMouldID" +
                ",HUSEORGID,HCREATEORGID,HDeptID,HErrWarQtys" +
                ") " +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + DBUtility.ClsPub.CurUserName + "',getdate()" +
                " values('" + this.BillType + "','"  + this.HBillSubType + "'," +omodel.HInterID.ToString() + ",'" + omodel.HBillNo + "','" + omodel.HDate + "','" + omodel.HMaker + "',getdate()" +
                "," + omodel.HYear.ToString() + "," + omodel.HPeriod.ToString() + ",'" + omodel.HRemark + "'"+
                ",'" + omodel.HCycleUnit + "'," + omodel.HCheckCycle.ToString() + ",'" + omodel.HBeginDate + "','" + omodel.HEndDate + "'" +
                ",'" + omodel.HInnerBillNo + "','" + omodel.HExplanation  + "','" + omodel.HMouldMaintainRuleID + "'," + omodel.HMaintainLevID +
@@ -225,6 +270,23 @@
                //    }
                //}
                //
                //=========================保存后控制
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "',1 ", "h_p_Sc_MouldMaintainPlanBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后控制判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "保存失败2!" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //============================
                sReturn = "新增单据成功!";
                oCn.Commit();
                return true;