Exemplo n.º 1
0
        public async Task <IActionResult> AddOrganisation(RegisterOrganisationViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                viewModel.OrganisationTypes = await _apiClient.GetOrganisationTypes();

                return(View(viewModel));
            }

            var addOrganisationRequest = new CreateEpaOrganisationRequest
            {
                Name  = viewModel.Name,
                Ukprn = viewModel.Ukprn,
                OrganisationTypeId = viewModel.OrganisationTypeId,
                LegalName          = viewModel.LegalName,
                TradingName        = viewModel.TradingName,
                Email         = viewModel.Email,
                PhoneNumber   = viewModel.PhoneNumber,
                WebsiteLink   = viewModel.WebsiteLink,
                Address1      = viewModel.Address1,
                Address2      = viewModel.Address2,
                Address3      = viewModel.Address3,
                Address4      = viewModel.Address4,
                Postcode      = viewModel.Postcode,
                CompanyNumber = viewModel.CompanyNumber,
                CharityNumber = viewModel.CharityNumber
            };

            var organisationId = await _apiClient.CreateEpaOrganisation(addOrganisationRequest);

            return(RedirectToAction("ViewOrganisation", "register", new { organisationId }));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> AddOrganisation()
        {
            var vm = new RegisterOrganisationViewModel
            {
                OrganisationTypes = await _apiClient.GetOrganisationTypes()
            };

            return(View(vm));
        }