public async Task <IActionResult> Show(string providerCode)
        {
            if (frontendUrlService.ShouldRedirectOrganisationShow())
            {
                return(frontendUrlService.RedirectToFrontend("/organisations/" + providerCode));
            }
            var ucasProviderEnrichmentGetModel = await _manageApi.GetProviderEnrichment(providerCode);

            var providerCourses = await _manageApi.GetCoursesOfProvider(providerCode);

            var summary = await _manageApi.GetProviderSummary(providerCode);

            var multipleOrganisations = (await _manageApi.GetProviderSummaries()).Count() > 1;

            var status = ucasProviderEnrichmentGetModel?.Status.ToString() ?? "Empty";

            var model = new CourseListViewModel
            {
                ProviderName          = summary.ProviderName,
                ProviderCode          = summary.ProviderCode,
                MultipleOrganisations = multipleOrganisations,
            };

            return(View(model));
        }
Example #2
0
        private async Task LoadCopyableCoursesIntoViewBag(string providerCode, string courseCode)
        {
            providerCode = providerCode.ToUpper();
            courseCode   = courseCode.ToUpper();

            var copyable = await _manageApi.GetCoursesOfProvider(providerCode);

            ViewBag.CopyableCourses = copyable != null?copyable.Where(x => x.EnrichmentWorkflowStatus != Domain.Models.WorkflowStatus.Blank && x.CourseCode != courseCode) : new List <Domain.Models.Course>();
        }