コード例 #1
0
        public async Task <IActionResult> Location(VacancyRouteModel vrm, [FromQuery] string wizard = "true")
        {
            var vm = await _orchestrator.GetLocationViewModelAsync(vrm, User.GetUkprn());

            vm.PageInfo.SetWizard(wizard);
            return(View(vm));
        }
        public async Task <IActionResult> Location(VacancyRouteModel vrm, [FromQuery] string wizard = "true")
        {
            var employerInfoModel = GetVacancyEmployerInfoCookie(vrm.VacancyId.GetValueOrDefault());
            var vm = await _orchestrator.GetLocationViewModelAsync(vrm, employerInfoModel, User.ToVacancyUser());

            vm.PageInfo.SetWizard(wizard);

            //back link is available only if cookie is not there (back link in part 1)
            //or part 2 has not started (coming from preview)
            vm.CanShowBackLink = employerInfoModel != null || vm.PageInfo.IsWizard;

            //if cookie is missing and user is in part1 then create the cookie to support back navigation
            //either part 1 is not completed or part 1 is completed but part 2 has not started
            if (employerInfoModel == null && (!vm.PageInfo.HasCompletedPartOne || !vm.PageInfo.HasStartedPartTwo))
            {
                employerInfoModel = await _orchestrator.GetVacancyEmployerInfoModelAsync(vrm);

                SetVacancyEmployerInfoCookie(employerInfoModel);
            }
            return(View(vm));
        }