Esempio n. 1
0
 public AllCourseDelegatesViewModel(IEnumerable <CourseDelegate> delegates, IList <CourseAdminField> adminFields)
 {
     Delegates = delegates.Select(
         d => new DelegateCourseInfoViewModel(
             d,
             DelegateAccessRoute.CourseDelegates,
             new ReturnPageQuery(1, $"{d.DelegateId}-card")
             )
         );
     Filters = CourseDelegateViewModelFilterOptions.GetAllCourseDelegatesFilterViewModels(adminFields)
               .SelectAppliedFilterViewModels();
 }
Esempio n. 2
0
        public SelectedCourseDetailsViewModel(
            CourseDelegatesData courseDelegatesData,
            string sortBy,
            string sortDirection,
            string?filterBy,
            int page,
            Dictionary <string, string> routeData
            ) : base(null, page, true, sortBy, sortDirection, filterBy, routeData: routeData)
        {
            Active = courseDelegatesData.Courses.Single(c => c.CustomisationId == courseDelegatesData.CustomisationId)
                     .Active;

            var courseDelegatesToShow = SortFilterAndPaginate(courseDelegatesData.Delegates);

            Delegates = courseDelegatesToShow.Select(d => new SearchableCourseDelegateViewModel(d));
            Filters   = CourseDelegateViewModelFilterOptions.GetAllCourseDelegatesFilterViewModels();
        }
        public SelectedCourseDetailsViewModel(
            SearchSortFilterPaginationResult <CourseDelegate> result,
            IEnumerable <FilterModel> availableFilters,
            CourseDelegatesData courseDelegatesData,
            Dictionary <string, string> routeData
            ) : base(result, true, availableFilters, routeData: routeData)
        {
            var currentCourse =
                courseDelegatesData.Courses.Single(c => c.CustomisationId == courseDelegatesData.CustomisationId);

            Active    = currentCourse.Active;
            Delegates = result.ItemsToDisplay.Select(
                d => new DelegateCourseInfoViewModel(
                    d,
                    DelegateAccessRoute.CourseDelegates,
                    result.GetReturnPageQuery($"{d.DelegateId}-card")
                    )
                );
            Filters = CourseDelegateViewModelFilterOptions.GetAllCourseDelegatesFilterViewModels(
                courseDelegatesData.CourseAdminFields
                );
        }
Esempio n. 4
0
 public AllCourseDelegatesViewModel(IEnumerable <CourseDelegate> delegates)
 {
     Delegates = delegates.Select(d => new SearchableCourseDelegateViewModel(d));
     Filters   = CourseDelegateViewModelFilterOptions.GetAllCourseDelegatesFilterViewModels()
                 .SelectAppliedFilterViewModels();
 }