Exemplo n.º 1
0
        public IActionResult TerminologyAndClassificationsDeliveryService()
        {
            var model = new LearningContentViewModel(
                TerminologyAndClassificationsDeliveryServiceBrand,
                TerminologyAndClassificationsDeliveryServiceTitle,
                true
                );

            return(View("Index", model));
        }
        public IActionResult Index(
            int brandId,
            int page                    = 1,
            string?sortBy               = null,
            string sortDirection        = GenericSortingHelper.Ascending,
            string?existingFilterString = null,
            string?newFilterToAdd       = null,
            bool clearFilters           = false
            )
        {
            var brand = brandsService.GetPublicBrandById(brandId);

            if (brand == null)
            {
                return(NotFound());
            }

            sortBy ??= DefaultSortByOptions.Name.PropertyName;
            existingFilterString = FilteringHelper.GetFilterString(
                existingFilterString,
                newFilterToAdd,
                clearFilters,
                Request,
                BrandCoursesFilterCookieName
                );

            var tutorials    = tutorialService.GetPublicTutorialSummariesForBrand(brandId);
            var applications = courseService.GetApplicationsThatHaveSectionsByBrandId(brandId).ToList();

            var categories       = applications.Select(x => x.CategoryName).Distinct().OrderBy(x => x).ToList();
            var topics           = applications.Select(x => x.CourseTopic).Distinct().OrderBy(x => x).ToList();
            var availableFilters = LearningContentViewModelFilterOptions
                                   .GetFilterOptions(categories, topics).ToList();

            var searchSortPaginationOptions = new SearchSortFilterAndPaginateOptions(
                null,
                new SortOptions(sortBy, sortDirection),
                new FilterOptions(
                    existingFilterString,
                    availableFilters
                    ),
                new PaginationOptions(page)
                );

            var result = searchSortFilterPaginateService.SearchFilterSortAndPaginate(
                applications,
                searchSortPaginationOptions
                );

            var model = new LearningContentViewModel(result, availableFilters, brand, tutorials);

            Response.UpdateFilterCookie(BrandCoursesFilterCookieName, result.FilterString);

            return(View(model));
        }
Exemplo n.º 3
0
        public IActionResult ReasonableAdjustmentFlag()
        {
            var model = new LearningContentViewModel(ReasonableAdjustmentFlagBrand, ReasonableAdjustmentFlagTitle);

            return(View("Index", model));
        }
Exemplo n.º 4
0
        public IActionResult ItSkillsPathway()
        {
            var model = new LearningContentViewModel(ItSkillsPathwayBrand, ItSkillsPathwayTitle);

            return(View("Index", model));
        }