protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { PageUtility.SetContentTitle(this, "组织机构管理"); this.Page.Title = "组织机构管理"; //初始化不显示作废组织结构 this.ViewState["ShowActiveOU"] = true; int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.UseCase.OrganizationManage, SystemEnums.OperateEnum.View); int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.UseCase.OrganizationManage, SystemEnums.OperateEnum.Manage); AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow) this.Session["Position"]; PositionRightBLL positionRightBLL = new PositionRightBLL(); bool hasViewRight = positionRightBLL.CheckPositionRight(position.PositionId, opViewId); bool hasManageRight = positionRightBLL.CheckPositionRight(position.PositionId, opManageId); if (!hasViewRight && !hasManageRight) { Response.Redirect("~/ErrorPage/NoRightErrorPage.aspx"); return; } if (!hasManageRight) { this.AddRootOrganizationUnitBtn.Visible = false; //this.ChangeParentUnitBtn.Visible=false; this.UpdataOrganizationUnitBtn.Visible = false; this.DeleteOrganizationUnitBtn.Visible = false; this.AddOrganizationUnitBtn.Visible = false; this.AddPositionBtn.Visible = false; //this.ChangeOrganizationUnitBtn.Visible = false; this.UpdatePositionBtn.Visible = false; this.DeletePositionBtn.Visible = false; } this.InitTreeView(); } PageUtility.CloseModelDlg(this); }
protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); if (!this.IsPostBack) { PageUtility.SetContentTitle(this, "省份城市管理"); this.Page.Title = "省份城市管理"; int opViewId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.Province, SystemEnums.OperateEnum.View); int opManageId = BusinessUtility.GetBusinessOperateId(SystemEnums.BusinessUseCase.Province, SystemEnums.OperateEnum.Manage); AuthorizationDS.PositionRow position = (AuthorizationDS.PositionRow) this.Session["Position"]; PositionRightBLL positionRightBLL = new PositionRightBLL(); this.HasViewRight = positionRightBLL.CheckPositionRight(position.PositionId, opViewId); this.HasManageRight = positionRightBLL.CheckPositionRight(position.PositionId, opManageId); if (!this.HasViewRight && !HasManageRight) { Response.Redirect("~/ErrorPage/NoRightErrorPage.aspx"); return; } } else { PageUtility.CloseModelDlg(this); } }