protected void Page_Load(object sender, EventArgs e) { if (!CheckGrant(TravelPermission.系统设置_权限管理)) { Utils.ResponseNoPermit(); haveUpdate = false; return; } EyouSoft.Model.CompanyStructure.CompanyDetailInfo companyModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(SiteUserInfo.CompanyID); //是否开通收费MQ //if (!companyModel.StateMore.CompanyService.IsServiceAvailable(EyouSoft.Model.CompanyStructure.SysService.MQ)) //{ // Server.Transfer("/SystemSet/ApplyMQ.aspx"); // return; //} roleBll = EyouSoft.BLL.CompanyStructure.CompanyUserRoles.CreateInstance(); string method = Utils.GetFormValue("method"); if (method == "del") { DelRole();//删除角色 return; } LoadRoleList(); }
protected void BindDepartAndRole() { int recordCount = 0; EyouSoft.IBLL.CompanyStructure.ICompanyDepartment departBll = EyouSoft.BLL.CompanyStructure.CompanyDepartment.CreateInstance(); IList <EyouSoft.Model.CompanyStructure.CompanyDepartment> departList = departBll.GetList(SiteUserInfo.CompanyID, 1000, 1, ref recordCount); sus_selDepart.DataTextField = "DepartName"; sus_selDepart.DataValueField = "ID"; sus_selDepart.DataSource = departList; sus_selDepart.DataBind(); ListItem item1 = new ListItem("请选择部门", ""); sus_selDepart.Items.Insert(0, item1); recordCount = 0; EyouSoft.IBLL.CompanyStructure.ICompanyUserRoles roleBll = EyouSoft.BLL.CompanyStructure.CompanyUserRoles.CreateInstance(); IList <EyouSoft.Model.CompanyStructure.CompanyUserRoles> roleList = roleBll.GetList(SiteUserInfo.CompanyID, 1000, 1, ref recordCount); sus_selRole.DataTextField = "RoleName"; sus_selRole.DataValueField = "ID"; sus_selRole.DataSource = roleList; sus_selRole.DataBind(); ListItem item2 = new ListItem("请选择角色", ""); sus_selRole.Items.Insert(0, item2); departList = null; roleList = null; }
protected void Page_Load(object sender, EventArgs e) { //是否登录 if (!IsLogin) { EyouSoft.Security.Membership.UserProvider.RedirectLoginOpenTopPage("/Default.aspx"); return; } if (!CheckGrant(TravelPermission.系统设置_权限管理)) { Utils.ResponseNoPermit(); return; } string roleid = Utils.GetQueryStringValue("roleid"); roleBll = EyouSoft.BLL.CompanyStructure.CompanyUserRoles.CreateInstance(); if (!Page.IsPostBack) { if (roleid != "") { roleModle = roleBll.GetModel(roleid); rs_txtRoleName.Value = roleModle.RoleName; perList = roleModle.PermissionList.Split(',').ToList <string>(); } BindPermit(); } else { bool isSuccess = true; if (!IsCompanyCheck) { MessageBox.Show(this, "对不起,你尚未审核通过!"); return; } if (roleid == "")//添加角色 { if (!AddPermit()) { isSuccess = false; } } else//修改角色 { if (!UpdatePermit(roleid)) { isSuccess = false; } } if (isSuccess) { Page.ClientScript.RegisterClientScriptBlock(this.GetType(), Guid.NewGuid().ToString(), "<script>;alert('操作完成!');window.parent.Boxy.getIframeDialog('" + Request.QueryString["iframeId"] + "').hide();window.parent.PermitManage.refresh();</script>"); } else { MessageBox.Show(this, "操作失败!"); } } }