public static ICollection <Conviction> UnspentConvictionsResolver(UnspentConvictionsViewModel uc) { return(uc.UnspentConvictions.Select(c => new Conviction { Id = c.Id, Description = c.Description, Date = c.Date.Date }) as ICollection <Conviction>); }
public NamedIndividualViewModel() { FullName = new FullNameViewModel(); DateOfBirth = new DateOfBirthViewModel(); BusinessPhoneNumber = new BusinessPhoneNumberViewModel(); BusinessExtension = new BusinessExtensionViewModel(); RightToWorkViewModel = new RightToWorkViewModel(); UndischargedBankruptViewModel = new UndischargedBankruptViewModel(); DisqualifiedDirectorViewModel = new DisqualifiedDirectorViewModel(); RestraintOrdersViewModel = new RestraintOrdersViewModel(); UnspentConvictionsViewModel = new UnspentConvictionsViewModel(); OffencesAwaitingTrialViewModel = new OffencesAwaitingTrialViewModel(); PreviousLicenceViewModel = new PreviousLicenceViewModel(); }
public IActionResult ReviewPrincipalAuthorityUnspentConvictions(UnspentConvictionsViewModel model) { Session.SetSubmittedPage(FormSection.PrincipalAuthority, 22); var licenceId = Session.GetCurrentLicenceId(); var parent = LicenceApplicationViewModelBuilder.Build <PrincipalAuthorityViewModel, PrincipalAuthority>(licenceId, l => l.PrincipalAuthorities.SingleOrDefault(p => p.Id == Session.GetCurrentPaId())); model = parent.UnspentConvictionsViewModel; if ((model.HasUnspentConvictions ?? false) && !model.UnspentConvictions.Any()) { ModelState.AddModelError(nameof(model.UnspentConvictions), "Please enter details of the unspent criminal convictions, or alternative sanctions or penalties for proven offences you have."); ViewData.Add("doOverride", true); return(View(GetViewPath(FormSection.PrincipalAuthority, 22), model)); } return(ValidateParentAndRedirect(parent, FormSection.PrincipalAuthority, 23)); }
public PersonViewModel() { FullName = new FullNameViewModel(); AlternativeName = new AlternativeFullNameViewModel(); DateOfBirth = new DateOfBirthViewModel(); BirthDetailsViewModel = new BirthDetailsViewModel(); JobTitle = new JobTitleViewModel(); Address = new AddressViewModel(); BusinessPhoneNumber = new BusinessPhoneNumberViewModel(); BusinessExtension = new BusinessExtensionViewModel(); PersonalEmailAddress = new PersonalEmailAddressViewModel(); PersonalMobileNumber = new PersonalMobileNumberViewModel(); Nationality = new NationalityViewModel(); PassportViewModel = new PassportViewModel(); UndischargedBankruptViewModel = new UndischargedBankruptViewModel(); DisqualifiedDirectorViewModel = new DisqualifiedDirectorViewModel(); RestraintOrdersViewModel = new RestraintOrdersViewModel(); UnspentConvictionsViewModel = new UnspentConvictionsViewModel(); OffencesAwaitingTrialViewModel = new OffencesAwaitingTrialViewModel(); PreviousLicenceViewModel = new PreviousLicenceViewModel(); Address = new AddressViewModel(); }
public IActionResult SaveUnspentConvictions(UnspentConvictionsViewModel model) { return(PrincipalAuthorityPost(model, 21)); }
public IActionResult SaveUnspentConvictions(UnspentConvictionsViewModel model) { return(DirectorOrPartnerPost(model, 21)); }
public IActionResult SaveUnspentConvictions(UnspentConvictionsViewModel model) { return(AlternativeBusinessRepresentativePost(model, 18)); }
public IActionResult SaveUnspentConvictions(UnspentConvictionsViewModel model) { return(NamedIndividualPost(model, 10)); }