using BLL; using System; namespace FineUIPro.Web.ZHGL.Plan { public partial class DepartEdit : PageBase { #region 定义项 /// /// 主键 /// public string ActionPlanListApproveId { get { return (string)ViewState["ActionPlanListApproveId"]; } set { ViewState["ActionPlanListApproveId"] = value; } } /// /// 主表主键 /// public string ActionPlanListId { get { return (string)ViewState["ActionPlanListId"]; } set { ViewState["ActionPlanListId"] = value; } } #endregion #region 加载 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); DepartService.InitDepartDropDownList(this.drpDepart, true); Funs.FineUIPleaseSelect(this.drpApproveMan); this.ActionPlanListId = Request.Params["ActionPlanListId"]; this.ActionPlanListApproveId = Request.Params["ActionPlanListApproveId"]; if (!string.IsNullOrEmpty(this.ActionPlanListApproveId)) { Model.ActionPlan_ActionPlanListApprove approve = BLL.ActionPlanListApproveService.GetActionPlanListApproveByActionPlanListApproveId(this.ActionPlanListApproveId); if (approve != null) { this.ActionPlanListId = approve.ActionPlanListId; if (!string.IsNullOrEmpty(approve.DepartId)) { this.drpDepart.SelectedValue = approve.DepartId; Person_PersonsService.InitUserUnitIdDepartIdDropDownList(this.drpApproveMan, BLL.Const.UnitId_SEDIN, this.drpDepart.SelectedValue, true); if (!string.IsNullOrEmpty(approve.ApproveMan)) { this.drpApproveMan.SelectedValue = approve.ApproveMan; } } } } } } #endregion #region 保存 /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { if (this.drpDepart.SelectedValue == BLL.Const._Null) { Alert.ShowInTop("请选择部门!", MessageBoxIcon.Warning); return; } if (this.drpApproveMan.SelectedValue == BLL.Const._Null) { Alert.ShowInTop("请选择办理人!", MessageBoxIcon.Warning); return; } Model.ActionPlan_ActionPlanList actionPlanList = BLL.ActionPlanListService.GetActionPlanListById(this.ActionPlanListId); Model.ActionPlan_ActionPlanListApprove approve = new Model.ActionPlan_ActionPlanListApprove { ActionPlanListId = this.ActionPlanListId }; if (this.drpDepart.SelectedValue != BLL.Const._Null) { approve.DepartId = this.drpDepart.SelectedValue; } if (this.drpApproveMan.SelectedValue != BLL.Const._Null) { approve.ApproveMan = this.drpApproveMan.SelectedValue; } approve.ApproveType = BLL.Const.ActionPlanList_DepartReview; if (actionPlanList == null) { approve.Edition = 0; } else { approve.Edition = actionPlanList.Edition; } approve.IsPushOa = 0; if (!string.IsNullOrEmpty(this.ActionPlanListApproveId)) { approve.ActionPlanListApproveId = this.ActionPlanListApproveId; BLL.ActionPlanListApproveService.UpdateActionPlanListApprove(approve); } else { this.ActionPlanListApproveId = SQLHelper.GetNewID(typeof(Model.ActionPlan_ActionPlanListApprove)); approve.ActionPlanListApproveId = this.ActionPlanListApproveId; BLL.ActionPlanListApproveService.AddActionPlanListApprove(approve); } PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } #endregion protected void drpDepart_SelectedIndexChanged(object sender, EventArgs e) { this.drpApproveMan.Items.Clear(); if (this.drpDepart.SelectedValue != BLL.Const._Null) { Person_PersonsService.InitUserUnitIdDepartIdDropDownList(this.drpApproveMan, BLL.Const.UnitId_SEDIN, this.drpDepart.SelectedValue, true); this.drpApproveMan.SelectedValue = BLL.Const._Null; } else { Funs.FineUIPleaseSelect(this.drpApproveMan); this.drpApproveMan.SelectedValue = BLL.Const._Null; } } } }