Esempio n. 1
0
        public virtual async Task <OrchestratorResponse <EmployerAgreementViewModel> > CreateAccount(CreateAccountViewModel viewModel, HttpContextBase context)
        {
            try
            {
                var result = await Mediator.SendAsync(new CreateAccountCommand
                {
                    ExternalUserId              = viewModel.UserId,
                    OrganisationType            = viewModel.OrganisationType,
                    OrganisationName            = viewModel.OrganisationName,
                    OrganisationReferenceNumber = viewModel.OrganisationReferenceNumber,
                    OrganisationAddress         = viewModel.OrganisationAddress,
                    OrganisationDateOfInception = viewModel.OrganisationDateOfInception,
                    PayeReference          = viewModel.PayeReference,
                    AccessToken            = viewModel.AccessToken,
                    RefreshToken           = viewModel.RefreshToken,
                    OrganisationStatus     = viewModel.OrganisationStatus,
                    EmployerRefName        = viewModel.EmployerRefName,
                    PublicSectorDataSource = viewModel.PublicSectorDataSource,
                    Sector = viewModel.Sector
                });

                CookieService.Delete(CookieName);

                return(new OrchestratorResponse <EmployerAgreementViewModel>
                {
                    Data = new EmployerAgreementViewModel
                    {
                        EmployerAgreement = new EmployerAgreementView
                        {
                            HashedAccountId = result.HashedAccountId
                        }
                    },
                    Status = HttpStatusCode.OK
                });
            }
            catch (InvalidRequestException ex)
            {
                Logger.Info($"Create Account Validation Error: {ex.Message}");
                return(new OrchestratorResponse <EmployerAgreementViewModel>
                {
                    Data = new EmployerAgreementViewModel(),
                    Status = HttpStatusCode.BadRequest,
                    Exception = ex,
                    FlashMessage = new FlashMessageViewModel()
                });
            }
        }
Esempio n. 2
0
 public virtual void DeleteCookieData()
 {
     CookieService.Delete(CookieName);
 }
Esempio n. 3
0
 public virtual void DeleteCookieData(HttpContextBase context)
 {
     CookieService.Delete(CookieName);
 }