コード例 #1
0
        public static CustomerAddress AsWebModel(this Data.Address address)
        {
            var customerAddress = new CustomerAddress();

            customerAddress.Address1     = address.Line1;
            customerAddress.Address2     = address.Line2;
            customerAddress.City         = address.City;
            customerAddress.Company      = address.Organization;
            customerAddress.Country      = address.CountryName;
            customerAddress.CountryCode  = "US";
            customerAddress.FirstName    = address.FirstName;
            customerAddress.LastName     = address.LastName;
            customerAddress.Phone        = address.Phone;
            customerAddress.Province     = address.RegionName;
            customerAddress.ProvinceCode = address.RegionId;
            customerAddress.Zip          = address.PostalCode ?? address.Zip;

            return(customerAddress);
        }
コード例 #2
0
        public static Data.Address AsServiceModel(this CustomerAddress customerAddress)
        {
            var address = new Data.Address();

            address.City         = customerAddress.City;
            address.CountryCode  = customerAddress.CountryCode;
            address.CountryName  = customerAddress.Country;
            address.FirstName    = customerAddress.FirstName;
            address.LastName     = customerAddress.LastName;
            address.Line1        = customerAddress.Address1;
            address.Line2        = customerAddress.Address2;
            address.Name         = string.Format("{0} {1}", customerAddress.FirstName, customerAddress.LastName);
            address.Organization = customerAddress.Company;
            address.Phone        = customerAddress.Phone;
            address.PostalCode   = customerAddress.Zip;
            address.RegionName   = customerAddress.Province;
            address.RegionId     = customerAddress.ProvinceCode;
            address.Zip          = customerAddress.Zip;

            return(address);
        }
コード例 #3
0
        public static Data.Address AsServiceModel(this CustomerAddress customerAddress)
        {
            var address = new Data.Address();

            address.City = customerAddress.City;
            address.CountryCode = customerAddress.CountryCode;
            address.CountryName = customerAddress.Country;
            address.FirstName = customerAddress.FirstName;
            address.LastName = customerAddress.LastName;
            address.Line1 = customerAddress.Address1;
            address.Line2 = customerAddress.Address2;
            address.Name = string.Format("{0} {1}", customerAddress.FirstName, customerAddress.LastName);
            address.Organization = customerAddress.Company;
            address.Phone = customerAddress.Phone;
            address.PostalCode = customerAddress.Zip;
            address.RegionName = customerAddress.Province;
            address.RegionId = customerAddress.ProvinceCode;
            address.Zip = customerAddress.Zip;

            return address;
        }