internal static UserViewModel MapUserToUserViewModel(User user) { var role = user.Role.ToString(); return new UserViewModel() { Id = user.Id, Email = user.Email, FirstName = user.FirstName, LastName = user.LastName, SelectedRole = user.Role.ToString(), FullName = user.FullName().Trim(' '), // disabling role changing Roles = new List<SelectListItem>() { new SelectListItem() { Value = role, Text = Resources.ResourceManager.GetString(role) } }, }; }
private ScheduleCellViewModel GetScheduleRowItem(int index, User user) { var item = new ScheduleCellViewModel() { Id = user == null ? Guid.Empty : user.Id, Index = index, Value = user == null ? String.Empty : user.FullName(), }; return item; }