예제 #1
0
        public EditUserVacationDaysViewModel GetUserByEmailForEditVacationDays(UserManager <ApplicationUser> userManager, string email)
        {
            ApplicationUser user = _adminData.GetUserByEmail(userManager, email);

            if (user == null)
            {
                return(null);
            }
            var roles = _adminData.GetUserRoles(userManager, user);
            Dictionary <string, int> vacations = new Dictionary <string, int>();

            vacations = _adminData.GetUserVacationDictionary(user);

            return(new EditUserVacationDaysViewModel()
            {
                FullName = user.FullName,
                Email = user.Email,
                EmploymentDate = user.EmploymentDate.ToShortDateString(),
                AllRoles = string.Join(", ", roles),
                Vacations = vacations
            });
        }