コード例 #1
0
        public async Task <IActionResult> ShortDescription(ShortDescriptionEditModel m)
        {
            var response = await _orchestrator.PostShortDescriptionEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            var vm = await _orchestrator.GetShortDescriptionViewModelAsync(m);

            if (!ModelState.IsValid)
            {
                return(View(vm));
            }

            if (_feature.IsFeatureEnabled(FeatureNames.EmployerTaskList))
            {
                if (vm.IsTaskListCompleted)
                {
                    return(RedirectToRoute(RouteNames.EmployerCheckYourAnswersGet));
                }
                return(RedirectToRoute(RouteNames.VacancyDescription_Index_Get));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
コード例 #2
0
        public async Task <IActionResult> ShortDescription(ShortDescriptionEditModel m)
        {
            var response = await _orchestrator.PostShortDescriptionEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            if (!ModelState.IsValid)
            {
                var vm = await _orchestrator.GetShortDescriptionViewModelAsync(m);

                return(View(vm));
            }

            return(RedirectToRoute(RouteNames.Vacancy_Preview_Get));
        }
コード例 #3
0
        public async Task <IActionResult> ShortDescription(ShortDescriptionEditModel m, [FromQuery] bool wizard)
        {
            var response = await _orchestrator.PostShortDescriptionEditModelAsync(m, User.ToVacancyUser());

            if (!response.Success)
            {
                response.AddErrorsToModelState(ModelState);
            }

            if (!ModelState.IsValid)
            {
                var vm = await _orchestrator.GetShortDescriptionViewModelAsync(m);

                vm.PageInfo.SetWizard(wizard);
                return(View(vm));
            }

            return(wizard
                ? RedirectToRoute(RouteNames.Location_Get)
                : RedirectToRoute(RouteNames.Vacancy_Preview_Get, null, Anchors.ShortDescriptionSection));
        }
 public async Task PostShortDescriptionEditModelAsync(ShortDescriptionEditModel model)
 {
     await Sut.PostShortDescriptionEditModelAsync(model, User);
 }