Пример #1
0
        public EditUserViewModel GetUserForEditByEmail(UserManager <ApplicationUser> userManager, string email)
        {
            var user  = _adminData.GetUserByEmail(userManager, email);
            var roles = _adminData.GetUserRoles(userManager, user);

            return(new EditUserViewModel
            {
                OldFullName = user.FullName,
                NewFullName = user.FullName,
                OldEmail = user.Email,
                NewEmail = user.Email,
                OldEmploymentDate = user.EmploymentDate.ToShortDateString(),
                NewEmploymentDate = user.EmploymentDate,
                OldRoles = string.Join(", ", roles),
                AvailableRoles = _adminData.GetSelectListItemRoles(roles)
            });
        }