private string GetCustomerName(IPurchaseOrder purchaseOrder, OmniumOrderAddress billingAddress)
 {
     if (string.IsNullOrEmpty(billingAddress.FirstName) && string.IsNullOrEmpty(billingAddress.LastName))
     {
         return(purchaseOrder is OrderGroup ? ((OrderGroup)purchaseOrder).CustomerName : string.Empty);
     }
     return($"{billingAddress.FirstName} {billingAddress.LastName}");
 }
示例#2
0
        private bool CompareOrderAddress(IOrderAddress orderAddress, OmniumOrderAddress omniumOrderAddress)
        {
            var twoLetterCountryCode = CultureResolver.GetTwoLetterCountryCode(orderAddress.CountryCode);

            return
                ($"{orderAddress.FirstName} {orderAddress.LastName}".Equals(omniumOrderAddress.Name) &&
                 orderAddress.FirstName.Equals(omniumOrderAddress.FirstName) &&
                 orderAddress.LastName.Equals(omniumOrderAddress.LastName) &&
                 orderAddress.Line1.Equals(omniumOrderAddress.Line1) &&
                 orderAddress.Line2.Equals(omniumOrderAddress.Line2) &&
                 orderAddress.PostalCode.Equals(omniumOrderAddress.PostalCode) &&
                 orderAddress.City.Equals(omniumOrderAddress.City) &&
                 orderAddress.RegionCode.Equals(omniumOrderAddress.RegionCode) &&
                 orderAddress.RegionName.Equals(omniumOrderAddress.RegionName) &&
                 twoLetterCountryCode.Equals(omniumOrderAddress.CountryCode) &&
                 orderAddress.CountryName.Equals(omniumOrderAddress.CountryName) &&
                 orderAddress.DaytimePhoneNumber.Equals(omniumOrderAddress.DaytimePhoneNumber) &&
                 orderAddress.EveningPhoneNumber.Equals(omniumOrderAddress.EveningPhoneNumber) &&
                 orderAddress.Email.Equals(omniumOrderAddress.Email) &&
                 orderAddress.Organization.Equals(omniumOrderAddress.Organization));
        }
示例#3
0
 public static OmniumOrderAddress Anonymize(this OmniumOrderAddress address)
 {
     return(new OmniumOrderAddress
     {
         Name = address.Name.ToAnonymized(),
         FirstName = address.FirstName.ToAnonymized(),
         LastName = address.LastName.ToAnonymized(),
         Organization = address.Organization,
         Email = address.Email.ToAnonymized(),
         DaytimePhoneNumber = address.DaytimePhoneNumber.ToAnonymized(),
         EveningPhoneNumber = address.EveningPhoneNumber.ToAnonymized(),
         Line1 = address.Line1.ToAnonymized(),
         Line2 = address.Line2.ToAnonymized(),
         PostalCode = address.PostalCode,
         State = address.State,
         RegionCode = address.RegionCode,
         RegionName = address.RegionName,
         City = address.City,
         CountryCode = address.CountryCode,
         CountryName = address.CountryName
     });
 }