protected void Page_Load(object sender, EventArgs e) { Micajah.Common.Pages.MasterPage.InitializeSetupPage(this.Page); if (!IsPostBack) { bool editMode = (this.RoleId != Guid.Empty); if (RoleProvider.IsBuiltIn(this.RoleId) || (editMode && (RoleProvider.GetRoleRow(RoleId) == null))) { this.RedirectToRolePage(); } LoadResources(); ActionsTree_DataBind(); } MagicForm.ApplyStyle(CommandTable, EditForm.ColorScheme); }
public DataSet GetSortedListOfRolesGroupsById(Guid organizationId) { ClientDataSet.GroupsInstancesRolesDataTable table = GroupProvider.GetGroupsInstancesRoles(organizationId); table.Columns.Add("RoleName", typeof(string)); table.Columns.Add("GroupName", typeof(string)); foreach (ClientDataSet.GroupsInstancesRolesRow row in table.Rows) { ConfigurationDataSet.RoleRow roleRow = RoleProvider.GetRoleRow((Guid)row["RoleId"]); if (row != null) { row["RoleName"] = roleRow.Name; } MasterDataSet.GroupMappingsRow[] groups = LdapInfoProvider.GetGroupMappings(organizationId).Select(string.Format(CultureInfo.InvariantCulture, "GroupId = '{0}' AND OrganizationId = '{1}'", row["GroupId"], organizationId)) as MasterDataSet.GroupMappingsRow[]; if (groups.Length > 0) { row["GroupName"] = groups[0].LdapGroupName; } } return(table.DataSet); }