private void EditShippingInformation(AddressSave shippingAddress)
 {
     try
     {
         _transactionLibraryInternal.EditShipmentInformation(
             UCommerce.Constants.DefaultShipmentAddressName,
             shippingAddress.FirstName,
             shippingAddress.LastName,
             shippingAddress.EmailAddress,
             shippingAddress.PhoneNumber,
             shippingAddress.MobilePhoneNumber,
             shippingAddress.CompanyName,
             shippingAddress.Line1,
             shippingAddress.Line2,
             shippingAddress.PostalCode,
             shippingAddress.City,
             shippingAddress.State,
             shippingAddress.Attention,
             shippingAddress.CountryId);
     }
     catch (System.Configuration.ConfigurationErrorsException ex)
     {
         Log.Write(ex);
     }
 }
        private void EvaluateAddress(CustomerSave customer)
        {
            if (customer.Address?.AddressId == default(int) &&
                customer.Address?.City == default &&
                customer.Address?.Neighborhood == default &&
                customer.Address?.Number == default &&
                customer.Address?.Reference == default &&
                customer.Address?.State == default &&
                customer.Address?.Street == default &&
                customer.Address?.ZipCode == default)
            {
                customer.Address = null;
            }
            else
            {
                if (customer.Address?.AddressId == default(int))
                {
                    var newAddress = new AddressSave()
                    {
                        City         = customer.Address?.City,
                        Neighborhood = customer.Address?.Neighborhood,
                        Number       = customer.Address?.Number,
                        Reference    = customer.Address?.Reference,
                        State        = customer.Address?.State,
                        Street       = customer.Address?.Street,
                        ZipCode      = customer.Address?.ZipCode
                    };

                    customer.Address = newAddress;
                }
            }
        }
 private void EditBillingInformation(AddressSave billingAddress)
 {
     _transactionLibraryInternal.EditBillingInformation(
         billingAddress.FirstName,
         billingAddress.LastName,
         billingAddress.EmailAddress,
         billingAddress.PhoneNumber,
         billingAddress.MobilePhoneNumber,
         billingAddress.CompanyName,
         billingAddress.Line1,
         billingAddress.Line2,
         billingAddress.PostalCode,
         billingAddress.City,
         billingAddress.State,
         billingAddress.Attention,
         billingAddress.CountryId);
 }
 public AddressSaveViewModel()
 {
     ShippingAddress            = new AddressSave();
     BillingAddress             = new AddressSave();
     IsShippingAddressDifferent = false;
 }