public async Task <IActionResult> Title(TitleEditModel m, [FromQuery] bool wizard) { PopulateModelFromTempData(m); var response = await _orchestrator.PostTitleEditModelAsync(m, User.ToVacancyUser()); if (!response.Success) { response.AddErrorsToModelState(ModelState); } if (!ModelState.IsValid) { var vm = await _orchestrator.GetTitleViewModelAsync(m); await PopulateModelFromTempData(vm); vm.PageInfo.SetWizard(wizard); return(View(vm)); } if (m.ReferredFromSavedFavourites) { if (m.VacancyId == null) { TempData[TempDataKeys.ReferredUkprn + response.Data] = TempData[TempDataKeys.ReferredUkprn]; TempData[TempDataKeys.ReferredProgrammeId + response.Data] = TempData[TempDataKeys.ReferredProgrammeId]; TempData.Remove(TempDataKeys.ReferredUkprn); TempData.Remove(TempDataKeys.ReferredProgrammeId); } return(RedirectToRoute(RouteNames.DisplayVacancy_Get, new { vacancyId = response.Data })); } return(wizard ? RedirectToRoute(RouteNames.Training_Get, new { vacancyId = response.Data }) : RedirectToRoute(RouteNames.Vacancy_Preview_Get)); }
public async Task PostTitleEditModelAsync(TitleEditModel model) { await Sut.PostTitleEditModelAsync(new VacancyRouteModel { Ukprn = Vacancy.TrainingProvider.Ukprn.Value, VacancyId = Vacancy.Id, }, model, User, Vacancy.TrainingProvider.Ukprn.Value); }
public async Task <IActionResult> Title(TitleEditModel m, [FromQuery] bool wizard) { var response = await _orchestrator.PostTitleEditModelAsync(m, User.ToVacancyUser()); if (!response.Success) { response.AddErrorsToModelState(ModelState); } if (!ModelState.IsValid) { var vm = await _orchestrator.GetTitleViewModelAsync(m); vm.PageInfo.SetWizard(wizard); return(View(vm)); } return(wizard ? RedirectToRoute(RouteNames.Training_Get, new { vacancyId = response.Data }) : RedirectToRoute(RouteNames.Vacancy_Preview_Get)); }
//[HttpGet(ExistingVacancyTitleRoute, Name = RouteNames.Title_Post)] public async Task <IActionResult> Title(TitleEditModel model, [FromQuery] string employerAccountId, [FromQuery] bool wizard) { var ukprn = User.GetUkprn(); var response = await _orchestrator.PostTitleEditModelAsync(model, User.ToVacancyUser(), ukprn); if (!response.Success) { response.AddErrorsToModelState(ModelState); } if (!ModelState.IsValid) { var vm = await _orchestrator.GetTitleViewModelAsync(model, ukprn); vm.PageInfo.SetWizard(wizard); return(View(vm)); } return(RedirectToRoute(RouteNames.ShortDescription_Get, new { vacancyId = response.Data })); // return wizard // ? RedirectToRoute(RouteNames.ShortDescription_Get, new {vacancyId = response.Data}) // : RedirectToRoute(RouteNames.Vacancy_Preview_Get); }
public async Task PostTitleEditModelAsync(TitleEditModel model) { await Sut.PostTitleEditModelAsync(model, User); }