/// <summary>
        /// Step 3 - Simple
        /// </summary>
        /// <param name="urn"></param>
        /// <param name="comparisonType"></param>
        /// <param name="basketSize"></param>
        /// <param name="estType"></param>
        /// <param name="simpleCriteria"></param>
        /// <returns></returns>
        public ActionResult SimpleCharacteristics(int urn, ComparisonType comparisonType, int basketSize, EstablishmentType estType, SimpleCriteria SimpleCriteria)
        {
            ViewBag.URN            = urn;
            ViewBag.ComparisonType = comparisonType;
            ViewBag.BasketSize     = basketSize;
            ViewBag.EstType        = estType;

            var benchmarkSchool = new SchoolViewModel(_contextDataService.GetSchoolByUrn(urn.ToString()), base.ExtractSchoolComparisonListFromCookie());

            var schoolCharsVM = new SimpleCharacteristicsViewModel(benchmarkSchool, SimpleCriteria);

            return(View(schoolCharsVM));
        }
Esempio n. 2
0
        /// <summary>
        /// Step 3 - Simple
        /// </summary>
        /// <param name="urn"></param>
        /// <param name="fuid"></param>
        /// <param name="comparisonType"></param>
        /// <param name="estType"></param>
        /// <param name="simpleCriteria"></param>
        /// <returns></returns>
        public async Task <ActionResult> SimpleCharacteristics(long?urn, long?fuid, ComparisonType comparisonType, EstablishmentType?estType, SimpleCriteria SimpleCriteria)
        {
            if (estType.HasValue)
            {
                ViewBag.URN            = urn;
                ViewBag.Fuid           = fuid;
                ViewBag.ComparisonType = comparisonType;
                ViewBag.EstType        = estType;

                EstablishmentViewModelBase benchmarkSchool;

                if (fuid.HasValue)
                {
                    benchmarkSchool = new FederationViewModel(await _contextDataService.GetSchoolDataObjectByUrnAsync(fuid.Value), _benchmarkBasketService.GetSchoolBenchmarkList());
                }
                else
                {
                    benchmarkSchool = new SchoolViewModel(await _contextDataService.GetSchoolDataObjectByUrnAsync(urn.GetValueOrDefault()), _benchmarkBasketService.GetSchoolBenchmarkList());
                }

                var schoolCharsVM = new SimpleCharacteristicsViewModel(benchmarkSchool, SimpleCriteria);
                return(View(schoolCharsVM));
            }
            else
            {
                ViewBag.URN            = urn;
                ViewBag.Fuid           = fuid;
                ViewBag.ComparisonType = comparisonType;

                EstablishmentViewModelBase benchmarkSchool;
                if (fuid.HasValue)
                {
                    benchmarkSchool = new FederationViewModel(await _contextDataService.GetSchoolDataObjectByUrnAsync(fuid.Value), _benchmarkBasketService.GetSchoolBenchmarkList());
                }
                else
                {
                    benchmarkSchool = new SchoolViewModel(await _contextDataService.GetSchoolDataObjectByUrnAsync(urn.GetValueOrDefault()), _benchmarkBasketService.GetSchoolBenchmarkList());
                }

                benchmarkSchool.ErrorMessage = ErrorMessages.SelectSchoolType;

                return(View("SelectSchoolType", benchmarkSchool));
            }
        }