diff --git a/LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs b/LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs index bac3461a4..6fd57f208 100644 --- a/LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs +++ b/LearningHub.Nhs.WebUI/Controllers/MyAccountController.cs @@ -810,7 +810,7 @@ public async Task ChangeGrade([FromQuery] UserGradeUpdateViewMode viewModel.SelectedMedicalCouncilId = jobRole.MedicalCouncilId; if (formSubmission) { - if (this.User.IsInRole("BasicUser") || viewModel.SelectedGradeId.HasValue) + if (this.User.IsInRole("BasicUser") || viewModel.SelectedGradeId != null) { var medicalCouncilNoRequired = jobRole.MedicalCouncilId > 0 && jobRole.MedicalCouncilId < 4; await this.userService.UpdateUserEmployment( @@ -821,7 +821,7 @@ await this.userService.UpdateUserEmployment( JobRoleId = viewModel.SelectedJobRoleId, MedicalCouncilId = medicalCouncilNoRequired ? jobRole.MedicalCouncilId : null, MedicalCouncilNo = medicalCouncilNoRequired ? (viewModel.SelectedMedicalCouncilNo ?? profile.MedicalCouncilNo) : null, - GradeId = viewModel.SelectedGradeId, + GradeId = Convert.ToInt32(viewModel.SelectedGradeId), SpecialtyId = profile.SpecialtyId, StartDate = profile.JobStartDate, LocationId = profile.LocationId, @@ -836,6 +836,10 @@ await this.userService.UpdateUserEmployment( return this.View("ChangeGrade", viewModel); } } + else + { + viewModel.SelectedGradeId = profile.GradeId.ToString(); + } return this.View("ChangeGrade", viewModel); } diff --git a/LearningHub.Nhs.WebUI/Models/UserProfile/UserGradeUpdateViewModel.cs b/LearningHub.Nhs.WebUI/Models/UserProfile/UserGradeUpdateViewModel.cs index af9915c18..5394cf09b 100644 --- a/LearningHub.Nhs.WebUI/Models/UserProfile/UserGradeUpdateViewModel.cs +++ b/LearningHub.Nhs.WebUI/Models/UserProfile/UserGradeUpdateViewModel.cs @@ -38,7 +38,7 @@ public class UserGradeUpdateViewModel /// /// Gets or sets the selected grade id. /// - public int? SelectedGradeId { get; set; } + public string SelectedGradeId { get; set; } /// /// Gets or sets the grade list.