public ScheduleServiceOfferingListOptionsModel GenerateScheduleOfferingViewModel(EducationSecurityPrincipal user, IEnumerable <int> studentIds) { IEnumerable <Student> students = StudentRepository.Items.Include(s => s.School).Where(s => studentIds.Contains(s.Id)); IPermission permission = PermissionFactory.Current.Create("ScheduleOffering", students); permission.GrantAccess(user); ScheduleServiceOfferingListOptionsModel viewModel = new ScheduleServiceOfferingListOptionsModel { SelectedStudents = studentIds }; viewModel.Favorites = LookupHelper.LoadFavorites(ServiceOfferingRepository, user); viewModel.TypeFilterList = ServiceTypeRepository.Items.Where(s => s.IsActive).Select(t => t.Name).ToList(); viewModel.CategoryFilterList = CategoryRepository.Items.Select(c => c.Name).ToList(); return(viewModel); }
public IEnumerable <ServiceOffering> LoadFavorites(EducationSecurityPrincipal user) { return(LookupHelper.LoadFavorites(ServiceOfferingRepository, user)); }