Пример #1
0
        private IActionResult OfferNewCompaniesHouseAction(ChangeOrganisationNameViewModel viewModel,
                                                           Organisation organisation)
        {
            viewModel.ParseAndValidateParameters(Request, m => m.AcceptCompaniesHouseName);

            if (viewModel.HasAnyErrors())
            {
                viewModel.Organisation = organisation;
                viewModel.Action       = ManuallyChangeOrganisationNameViewModelActions.OfferNewCompaniesHouseName;
                return(View("OfferNewCompaniesHouseName", viewModel));
            }

            if (viewModel.AcceptCompaniesHouseName == AcceptCompaniesHouseName.Reject)
            {
                return(SendToManualChangePage(organisation));
            }

            viewModel.ParseAndValidateParameters(Request, m => m.Reason);

            if (viewModel.HasAnyErrors())
            {
                viewModel.Organisation = organisation;
                viewModel.Action       = ManuallyChangeOrganisationNameViewModelActions.OfferNewCompaniesHouseName;
                return(View("OfferNewCompaniesHouseName", viewModel));
            }

            viewModel.Organisation = organisation;
            viewModel.Action       = ManuallyChangeOrganisationNameViewModelActions.CheckChangesCoHo;
            return(View("ConfirmNameChange", viewModel));
        }
Пример #2
0
        private IActionResult ManualChangeAction(ChangeOrganisationNameViewModel viewModel, Organisation organisation)
        {
            viewModel.ParseAndValidateParameters(Request, m => m.Name);
            viewModel.ParseAndValidateParameters(Request, m => m.Reason);

            if (viewModel.HasAnyErrors())
            {
                viewModel.Organisation = organisation;
                viewModel.Action       = ManuallyChangeOrganisationNameViewModelActions.ManualChange;
                return(View("ManuallyChangeOrganisationName", viewModel));
            }

            viewModel.Organisation = organisation;
            viewModel.Action       = ManuallyChangeOrganisationNameViewModelActions.CheckChangesManual;
            return(View("ConfirmNameChange", viewModel));
        }