private async Task SetPersonAsync(CartContext cartContext, Person person) { if (cartContext != null && cartContext.PersonSystemId != person.SystemId) { await cartContext.ChangeCustomerAsync(new ChangeCustomerArgs { CustomerNumber = person.Id, CustomerType = CustomerType.PrivatePerson, PersonSystemId = person.SystemId, OrganizationSystemId = null }); } }
private async Task SetOrganizationAsync(CartContext cartContext, Guid organizationSystemId) { _personStorage.CurrentSelectedOrganization = _organizationService.Get(organizationSystemId); if (cartContext != null && cartContext.OrganizationSystemId != organizationSystemId) { await cartContext.ChangeCustomerAsync(new ChangeCustomerArgs { CustomerNumber = _personStorage.CurrentSelectedOrganization.Id, CustomerType = CustomerType.Company, PersonSystemId = _securityContextService.GetIdentityUserSystemId().GetValueOrDefault(), OrganizationSystemId = organizationSystemId }); } }