/// <summary> /// 加载页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.ActionPlanSummaryId = Request.Params["ActionPlanSummaryId"]; if (!string.IsNullOrEmpty(this.ActionPlanSummaryId)) { Model.ActionPlan_ActionPlanSummary ActionPlanSummary = BLL.ActionPlanSummaryService.GetActionPlanSummaryById(this.ActionPlanSummaryId); if (ActionPlanSummary != null) { ///读取编号 this.txtCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.ActionPlanSummaryId); this.txtName.Text = ActionPlanSummary.Name; this.txtUnit.Text = BLL.UnitService.GetUnitNameByUnitId(ActionPlanSummary.UnitId); this.drpCompileMan.Text = BLL.UserService.GetUserNameByUserId(ActionPlanSummary.CompileMan); this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ActionPlanSummary.CompileDate); this.txtContents.Text = HttpUtility.HtmlDecode(ActionPlanSummary.Contents); } } ///初始化审核菜单 this.ctlAuditFlow.MenuId = BLL.Const.ProjectActionPlanSummaryMenuId; this.ctlAuditFlow.DataId = this.ActionPlanSummaryId; } }
/// <summary> /// 根据主键删除实施计划 /// </summary> /// <param name="ActionPlanSummaryId"></param> public static void DeleteActionPlanSummaryById(string ActionPlanSummaryId) { Model.SUBHSSEDB db = Funs.DB; Model.ActionPlan_ActionPlanSummary ActionPlanSummary = db.ActionPlan_ActionPlanSummary.FirstOrDefault(e => e.ActionPlanSummaryId == ActionPlanSummaryId); if (ActionPlanSummary != null) { BLL.CommonService.DeleteAttachFileById(ActionPlanSummaryId); ////删除审核流程表 BLL.CommonService.DeleteFlowOperateByID(ActionPlanSummary.ActionPlanSummaryId); ////删除编码表记录 BLL.CodeRecordsService.DeleteCodeRecordsByDataId(ActionPlanSummary.ActionPlanSummaryId); db.ActionPlan_ActionPlanSummary.DeleteOnSubmit(ActionPlanSummary); db.SubmitChanges(); } }
/// <summary> /// 修改实施计划 /// </summary> /// <param name="ActionPlanSummary"></param> public static void UpdateActionPlanSummary(Model.ActionPlan_ActionPlanSummary ActionPlanSummary) { Model.SUBHSSEDB db = Funs.DB; Model.ActionPlan_ActionPlanSummary newActionPlanSummary = db.ActionPlan_ActionPlanSummary.FirstOrDefault(e => e.ActionPlanSummaryId == ActionPlanSummary.ActionPlanSummaryId); if (newActionPlanSummary != null) { //newActionPlanSummary.ProjectId = ActionPlanSummary.ProjectId; newActionPlanSummary.UnitId = ActionPlanSummary.UnitId; newActionPlanSummary.Code = ActionPlanSummary.Code; newActionPlanSummary.Name = ActionPlanSummary.Name; newActionPlanSummary.Contents = ActionPlanSummary.Contents; newActionPlanSummary.CompileMan = ActionPlanSummary.CompileMan; newActionPlanSummary.CompileDate = ActionPlanSummary.CompileDate; newActionPlanSummary.States = ActionPlanSummary.States; db.SubmitChanges(); } }
/// <summary> /// 保存数据 /// </summary> /// <param name="type"></param> private void SaveData(string type) { Model.ActionPlan_ActionPlanSummary ActionPlanSummary = new Model.ActionPlan_ActionPlanSummary { ProjectId = this.ProjectId, Code = this.txtCode.Text.Trim(), Name = this.txtName.Text.Trim(), Contents = HttpUtility.HtmlEncode(this.txtContents.Text) }; if (this.drpCompileMan.SelectedValue != BLL.Const._Null) { ActionPlanSummary.CompileMan = this.drpCompileMan.SelectedValue; } if (this.drpUnit.SelectedValue != BLL.Const._Null) { ActionPlanSummary.UnitId = this.drpUnit.SelectedValue; } if (!string.IsNullOrEmpty(this.txtCompileDate.Text.Trim())) { ActionPlanSummary.CompileDate = Convert.ToDateTime(this.txtCompileDate.Text.Trim()); } ActionPlanSummary.States = BLL.Const.State_0; if (type == BLL.Const.BtnSubmit) { ActionPlanSummary.States = this.ctlAuditFlow.NextStep; } if (!string.IsNullOrEmpty(this.ActionPlanSummaryId)) { ActionPlanSummary.ActionPlanSummaryId = this.ActionPlanSummaryId; BLL.ActionPlanSummaryService.UpdateActionPlanSummary(ActionPlanSummary); BLL.LogService.AddSys_Log(this.CurrUser, ActionPlanSummary.Code, ActionPlanSummary.ActionPlanSummaryId, BLL.Const.ProjectActionPlanSummaryMenuId, Const.BtnModify); } else { this.ActionPlanSummaryId = SQLHelper.GetNewID(typeof(Model.ActionPlan_ActionPlanSummary)); ActionPlanSummary.ActionPlanSummaryId = this.ActionPlanSummaryId; BLL.ActionPlanSummaryService.AddActionPlanSummary(ActionPlanSummary); BLL.LogService.AddSys_Log(this.CurrUser, ActionPlanSummary.Code, ActionPlanSummary.ActionPlanSummaryId, BLL.Const.ProjectActionPlanSummaryMenuId, Const.BtnAdd); } ////保存流程审核数据 this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.ProjectActionPlanSummaryMenuId, this.ActionPlanSummaryId, (type == BLL.Const.BtnSubmit ? true : false), ActionPlanSummary.Name, "../ActionPlan/ActionPlanSummaryView.aspx?ActionPlanSummaryId={0}"); }
/// <summary> /// 添加实施计划 /// </summary> /// <param name="ActionPlanSummary"></param> public static void AddActionPlanSummary(Model.ActionPlan_ActionPlanSummary ActionPlanSummary) { Model.SUBHSSEDB db = Funs.DB; Model.ActionPlan_ActionPlanSummary newActionPlanSummary = new Model.ActionPlan_ActionPlanSummary { ActionPlanSummaryId = ActionPlanSummary.ActionPlanSummaryId, ProjectId = ActionPlanSummary.ProjectId, UnitId = ActionPlanSummary.UnitId, Code = ActionPlanSummary.Code, Name = ActionPlanSummary.Name, Contents = ActionPlanSummary.Contents, CompileMan = ActionPlanSummary.CompileMan, CompileDate = ActionPlanSummary.CompileDate, States = ActionPlanSummary.States }; db.ActionPlan_ActionPlanSummary.InsertOnSubmit(newActionPlanSummary); db.SubmitChanges(); ////增加一条编码记录 BLL.CodeRecordsService.InsertCodeRecordsByMenuIdProjectIdUnitId(BLL.Const.ProjectActionPlanSummaryMenuId, newActionPlanSummary.ProjectId, null, newActionPlanSummary.ActionPlanSummaryId, newActionPlanSummary.CompileDate); }
/// <summary> /// 加载页面 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.ProjectId = this.CurrUser.LoginProjectId; this.InitDropDownList(); this.ActionPlanSummaryId = Request.Params["ActionPlanSummaryId"]; if (!string.IsNullOrEmpty(this.ActionPlanSummaryId)) { Model.ActionPlan_ActionPlanSummary ActionPlanSummary = BLL.ActionPlanSummaryService.GetActionPlanSummaryById(this.ActionPlanSummaryId); if (ActionPlanSummary != null) { this.ProjectId = ActionPlanSummary.ProjectId; if (this.ProjectId != this.CurrUser.LoginProjectId) { this.InitDropDownList(); } ///读取编号 this.txtCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.ActionPlanSummaryId); this.txtName.Text = ActionPlanSummary.Name; if (!string.IsNullOrEmpty(ActionPlanSummary.CompileMan)) { this.drpCompileMan.SelectedValue = ActionPlanSummary.CompileMan; } if (!string.IsNullOrEmpty(ActionPlanSummary.UnitId)) { this.drpUnit.SelectedValue = ActionPlanSummary.UnitId; } if (ActionPlanSummary.CompileDate != null) { this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", ActionPlanSummary.CompileDate); } this.txtContents.Text = HttpUtility.HtmlDecode(ActionPlanSummary.Contents); } } else { this.drpCompileMan.SelectedValue = this.CurrUser.UserId; this.drpUnit.SelectedValue = this.CurrUser.UnitId; this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); var codeTemplateRule = BLL.ProjectData_CodeTemplateRuleService.GetProjectData_CodeTemplateRuleByMenuIdProjectId(BLL.Const.ProjectActionPlanSummaryMenuId, this.ProjectId); if (codeTemplateRule != null) { this.txtContents.Text = HttpUtility.HtmlDecode(codeTemplateRule.Template); } ////自动生成编码 this.txtCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.ProjectActionPlanSummaryMenuId, this.ProjectId, this.CurrUser.UnitId); this.txtName.Text = this.SimpleForm1.Title; } ///初始化审核菜单 this.ctlAuditFlow.MenuId = BLL.Const.ProjectActionPlanSummaryMenuId; this.ctlAuditFlow.DataId = this.ActionPlanSummaryId; this.ctlAuditFlow.ProjectId = this.ProjectId; this.ctlAuditFlow.UnitId = this.CurrUser.UnitId; } }