zrg
2024-01-30 93eee231d1d82f19013fbb51e8015ff9b84333d6
DAL/ÏúÊÛ¹ÜÀí/ClsXs_SeOrderChangeBill.cs
@@ -37,6 +37,21 @@
        {
            try
            {
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOrderChangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOrderChangeBill_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();
                //更新主表
                string mainSql = "update Xs_SeOrderChangeBillMain set " +
@@ -98,7 +113,23 @@
                        ")";
                    oCn.RunProc(subSql);
                }
                //保存后控制=========================================
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Xs_SeOrderChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString(), "h_p_Xs_SeOrderChangeBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }
                //=========================================================
                sReturn = "修改单据成功!";
                oCn.Commit();
                return true;
@@ -123,6 +154,21 @@
                    omodel.HInterID = DBUtility.ClsPub.CreateBillID(BillType, ref DBUtility.ClsPub.sExeReturnInfo);
                }
                //保存前控制=========================================
                string HBillNote = "";
                DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOrderChangeBill_BeforeSaveCtrl " + omodel.HInterID.ToString() + ", '" + omodel.HBillNo + "','" + HBillNote + "',1 ", "h_p_Xs_SeOrderChangeBill_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();
                //插入主表
@@ -193,16 +239,16 @@
                }
                //保存后控制=========================================
                DataSet ds = oCn.RunProcReturn("Exec h_p_Xs_SeOrderChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString(), "h_p_Xs_SeOrderChangeBill_AfterSaveCtrl");
                if (ds == null)
                DataSet ds2 = oCn.RunProcReturn("Exec h_p_Xs_SeOrderChangeBill_AfterSaveCtrl " + omodel.HInterID.ToString(), "h_p_Xs_SeOrderChangeBill_AfterSaveCtrl");
                if (ds2 == null)
                {
                    sReturn = "保存后判断失败!";
                    oCn.RollBack();
                    return false;
                }
                if (DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBack"]) != "0")
                if (DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBack"]) != "0")
                {
                    sReturn = "" + DBUtility.ClsPub.isStrNull(ds.Tables[0].Rows[0]["HBackRemark"]);
                    sReturn = "" + DBUtility.ClsPub.isStrNull(ds2.Tables[0].Rows[0]["HBackRemark"]);
                    oCn.RollBack();
                    return false;
                }