private void UpdateSave() { PD_PROJECT_CONTRACT_Bll bll = new PD_PROJECT_CONTRACT_Bll(); PD_CONTRACT_CHANGE_Bll bll2 = new PD_CONTRACT_CHANGE_Bll(); if ((base.Request["UpdatePK"] != null) && PublicDal.PageValidate.IsDecimal(base.Request["UpdatePK"])) { PD_PROJECT_CONTRACT_Model model = bll.GetModel(base.Request["UpdatePK"].ToString()); model.PD_DB_LOOP = "1"; PD_CONTRACT_CHANGE_Model model2 = new PD_CONTRACT_CHANGE_Model(); PD_PROJECT_CONTRACT_BAK_Bll bll3 = new PD_PROJECT_CONTRACT_BAK_Bll(); this.getModel(model, model2); model.PD_NOW_SERVERPK = PublicDal.SetCreateServiceStream(this.Page); bll.Update(model); model2.PD_NOW_SERVERPK = PublicDal.SetCreateServiceStream(this.Page); this.getModel_BG(model2, model); decimal? maxID = bll3.GetMaxID(model.PD_CONTRACT_NO); if (maxID.HasValue) { model2.CONTR_CHANGE_MIAN_ID = maxID.Value; } model2.AUTO_NO = auto_nos; bll2.Update(model2); Const.DoSuccessNoClose("修改成功", this.Page.Request.Url.LocalPath + "?UpdatePK=" + model.AUTO_NO + "&doType=look&strTitle=", this.Page); } }
private void Save() { PD_PROJECT_CONTRACT_Bll bll = new PD_PROJECT_CONTRACT_Bll(); PD_CONTRACT_CHANGE_Bll bll2 = new PD_CONTRACT_CHANGE_Bll(); if (base.Request["UpdatePK"] != null) { if (PublicDal.PageValidate.IsDecimal(base.Request["UpdatePK"])) { PD_PROJECT_CONTRACT_Model model = bll.GetModel(base.Request["UpdatePK"].ToString()); PD_CONTRACT_CHANGE_Model model2 = new PD_CONTRACT_CHANGE_Model(); PD_PROJECT_CONTRACT_BAK_Bll bll3 = new PD_PROJECT_CONTRACT_BAK_Bll(); this.getModel(model, model2); if (bll.Update(model)) { decimal? maxID = bll3.GetMaxID(model.PD_CONTRACT_NO); if (maxID.HasValue) { model2.CONTR_CHANGE_MIAN_ID = maxID.Value; } bll2.Add(model2); } Const.DoSuccessNoClose("合同变更成功", this.Page.Request.Url.LocalPath + "?UpdatePK=" + base.Request["UpdatePK"].ToString() + "&doType=look&strTitle=" + base.Request["strTitle"].ToString(), this.Page); this.Master.btModel.IfUpdate = true; } } else if (this.txtPD_PROJECT_CODE.Value != null) { PD_PROJECT_CONTRACT_Model model3 = new PD_PROJECT_CONTRACT_Model { PD_DB_LOOP = "1" }; PD_CONTRACT_CHANGE_Model model4 = new PD_CONTRACT_CHANGE_Model(); PD_PROJECT_CONTRACT_BAK_Bll bll4 = new PD_PROJECT_CONTRACT_BAK_Bll(); this.getModel(model3, model4); model3.PD_NOW_SERVERPK = PublicDal.SetCreateServiceStream(this.Page); bll.Add(model3); model4.PD_NOW_SERVERPK = PublicDal.SetCreateServiceStream(this.Page); this.getModel_BG(model4, model3); decimal? nullable2 = bll4.GetMaxID(model3.PD_CONTRACT_NO); if (nullable2.HasValue) { model4.CONTR_CHANGE_MIAN_ID = nullable2.Value; } bll2.Add(model4); Const.DoSuccessNoClose("添加成功", this.Page.Request.Url.LocalPath + "?UpdatePK=" + model3.AUTO_NO + "&doType=look&strTitle=", this.Page); } }