public static string GetApplicationUsername(string userId) { Repository _repository = new Repository(); if (_repository.GetApplicationUsername(userId) != null) { return _repository.GetApplicationUsername(userId); } else return null; }
public static string GetApplicationUserRole(string username) { Repository _repository = new Repository(); string userRole; if (_repository.GetApplicationUser(username) != null) { userRole = _repository.GetApplicationUser(username).RoleName; return userRole; } else return null; }
public static Guid GetApplicationUserId(string username) { Repository _repository = new Repository(); return _repository.GetApplicationUserId(username); }
public static IEnumerable<SelectListItem> GetRolesSelectList() { Repository _repository = new Repository(); List<SelectListItem> selectListItems = new List<SelectListItem>(); int i = 0; foreach (string roleName in _repository.GetRolesList()) { selectListItems.Add(new SelectListItem { Text = roleName, Value = roleName, Selected = false }); i++; } return selectListItems; }