Example #1
0
        public static string BuildCustomerAddress(AddressData customerAddress)
        {
            var result = "";

            result = result + (string.IsNullOrEmpty(customerAddress.Street)
                         ? ""
                         : Utils.TrimStringWithLength(customerAddress.Street, 40) + Environment.NewLine);
            var zipPostCode =
                (string.IsNullOrEmpty(customerAddress.ZipPostalCode) ? "" : customerAddress.ZipPostalCode) +
                (string.IsNullOrEmpty(customerAddress.City) ? "" : " " + customerAddress.City) +
                (string.IsNullOrEmpty(customerAddress.StateProvince) ? "" : ", " + customerAddress.StateProvince);

            result = result + Utils.TrimStringWithLength(zipPostCode, 40) + Environment.NewLine;
            if (customerAddress.Customer != null)
            {
                result = result + (string.IsNullOrEmpty(customerAddress.Customer.Phone1)
                             ? ""
                             : Utils.TrimStringWithLength(customerAddress.Customer.Phone1, 40) + Environment.NewLine);
                result = result + (string.IsNullOrEmpty(customerAddress.Customer.Email1)
                             ? ""
                             : Utils.TrimStringWithLength(customerAddress.Customer.Email1, 40));
            }
            return(result);
        }