public ActionResult CreateNewOrganisation(string organisationName)
        {
            var model = new CreateNewOrganisationViewModel {
                Name = organisationName
            };

            return(View(model));
        }
        public async Task <ActionResult> CreateNewOrganisation(CreateNewOrganisationViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var organisationRegistrationData = new OrganisationRegistrationData
            {
                Name             = model.Name,
                BusinessType     = model.BusinessType,
                OtherDescription = model.OtherDescription
            };

            try
            {
                var organisationId =
                    await
                    client.SendAsync(User.GetAccessToken(), new CreateOrganisation(organisationRegistrationData));

                await client.SendAsync(User.GetAccessToken(), new LinkUserToOrganisation(organisationId));

                return(RedirectToAction("Home", "Applicant"));
            }
            catch (ApiBadRequestException ex)
            {
                this.HandleBadRequest(ex);

                if (ModelState.IsValid)
                {
                    throw;
                }
            }

            return(View(model));
        }
        public async Task<ActionResult> CreateNewOrganisation(CreateNewOrganisationViewModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            var organisationRegistrationData = new OrganisationRegistrationData
            {
                Name = model.Name,
                BusinessType = model.BusinessType,
                OtherDescription = model.OtherDescription
            };

            try
            {
                var organisationId =
                    await
                        client.SendAsync(User.GetAccessToken(), new CreateOrganisation(organisationRegistrationData));
                await client.SendAsync(User.GetAccessToken(), new LinkUserToOrganisation(organisationId));
                return RedirectToAction("Home", "Applicant");
            }
            catch (ApiBadRequestException ex)
            {
                this.HandleBadRequest(ex);

                if (ModelState.IsValid)
                {
                    throw;
                }
            }

            return View(model);
        }
 public ActionResult CreateNewOrganisation(string organisationName)
 {
     var model = new CreateNewOrganisationViewModel { Name = organisationName };
     return View(model);
 }