private IActionResult OfferNewCompaniesHouseAction(ChangeOrganisationAddressViewModel viewModel, Organisation organisation) { viewModel.ParseAndValidateParameters(Request, m => m.AcceptCompaniesHouseAddress); if (viewModel.HasAnyErrors()) { viewModel.Organisation = organisation; viewModel.Action = ManuallyChangeOrganisationAddressViewModelActions.OfferNewCompaniesHouseAddress; return(View("OfferNewCompaniesHouseAddress", viewModel)); } if (viewModel.AcceptCompaniesHouseAddress == AcceptCompaniesHouseAddress.Reject) { return(SendToManualChangePage(organisation)); } viewModel.ParseAndValidateParameters(Request, m => m.Reason); if (viewModel.HasAnyErrors()) { viewModel.Organisation = organisation; viewModel.Action = ManuallyChangeOrganisationAddressViewModelActions.OfferNewCompaniesHouseAddress; return(View("OfferNewCompaniesHouseAddress", viewModel)); } viewModel.Organisation = organisation; viewModel.Action = ManuallyChangeOrganisationAddressViewModelActions.CheckChangesCoHo; return(View("ConfirmAddressChange", viewModel)); }
private IActionResult ManualChangeAction(ChangeOrganisationAddressViewModel viewModel, Organisation organisation) { viewModel.ParseAndValidateParameters(Request, m => m.PoBox); viewModel.ParseAndValidateParameters(Request, m => m.Address1); viewModel.ParseAndValidateParameters(Request, m => m.Address2); viewModel.ParseAndValidateParameters(Request, m => m.Address3); viewModel.ParseAndValidateParameters(Request, m => m.TownCity); viewModel.ParseAndValidateParameters(Request, m => m.County); viewModel.ParseAndValidateParameters(Request, m => m.Country); viewModel.ParseAndValidateParameters(Request, m => m.PostCode); viewModel.ParseAndValidateParameters(Request, m => m.IsUkAddress); viewModel.ParseAndValidateParameters(Request, m => m.Reason); if (viewModel.HasAnyErrors()) { viewModel.Organisation = organisation; viewModel.Action = ManuallyChangeOrganisationAddressViewModelActions.ManualChange; return(View("ManuallyChangeOrganisationAddress", viewModel)); } viewModel.Organisation = organisation; viewModel.Action = ManuallyChangeOrganisationAddressViewModelActions.CheckChangesManual; return(View("ConfirmAddressChange", viewModel)); }