public PartialViewResult LoadUserInfo() { IEnumerable <IntialUserInfo> userList = this.adminManager.GetIntialUserList(null); UserSearchViewModel model = new UserSearchViewModel(); userList = userList.OrderBy(x => x.UserName); var pagedUserlist = userList.Skip(0).Take(PageSize); ViewBag.rowCount = userList.Count(); ViewBag.pageIndex = 0; model.UserList = pagedUserlist; model.Page = 1; var roleList = AppConfigRegionSource.GetRoles().Where(x => x.Id == 1 || x.Id == 4 || x.Id == 5).Select(x => x.FriendlyName).ToArray(); var countryList = userList.Select(x => x.Country).Distinct().ToArray(); model.RoleList = new List <SelectListItem>(); foreach (var role in roleList) { model.RoleList.Add(new SelectListItem { Text = role, Value = role }); } model.CountryList = new List <SelectListItem>(); foreach (var country in countryList) { model.CountryList.Add(new SelectListItem { Text = country, Value = country }); } model.Alphabets = new char[] { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' }; return(this.PartialView("UserSearchPartial", model)); }
public static Microsoft.WhiteSpaces.Common.Role[] GetUpgradableAccessLevels(int currentAccessLevel, string regulatory) { return(AppConfigRegionSource.GetRoles().Where(x => x.Id > currentAccessLevel && x.ApplicableRegulatories.Contains(regulatory)).ToArray()); }
private string GetRoleFromId(int id) { return(AppConfigRegionSource.GetRoles().Where(x => x.Id == id).First().FriendlyName); }