Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion LearningHub.Nhs.WebUI/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,18 @@ public async Task<IActionResult> CreateAccountSearchRole(AccountCreationViewMode
{
var accountCreation = await this.multiPageFormService.GetMultiPageFormData<AccountCreationViewModel>(MultiPageFormDataFeature.AddRegistrationPrompt, this.TempData);

return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreationViewModel.CountryId });
var currentJobRole = int.TryParse(accountCreation.CurrentRole, out int currentRole);
if (currentJobRole && currentRole > 0)
{
var filterText = await this.jobRoleService.GetByIdAsync(currentRole);
accountCreationViewModel.FilterText = filterText.Name;
var jobrole = await this.jobRoleService.GetByIdAsync(currentRole);
return this.View("CreateAccountCurrentRole", new AccountCreationListViewModel { RoleList = new List<JobRoleBasicViewModel> { jobrole }, AccountCreationPaging = new AccountCreationPagingModel { TotalItems = 1, PageSize = UserRegistrationContentPageSize, HasItems = jobrole != null, CurrentPage = 1 }, CurrentRole = accountCreation.CurrentRole, CountryId = accountCreation.CountryId, RegionId = accountCreation.RegionId, FilterText = accountCreationViewModel.FilterText, ReturnToConfirmation = accountCreationViewModel.ReturnToConfirmation });
}
else
{
return this.View("CreateAccountSearchRole", new AccountCreationViewModel { CountryId = accountCreationViewModel.CountryId });
}
}

/// <summary>
Expand Down
Loading