示例#1
0
        private void AddShipFromAddress(UPSTimeInTransit.TimeInTransitRequest request)
        {
            var shipFrom        = new UPSTimeInTransit.RequestShipFromType();
            var shipFromAddress = new UPSTimeInTransit.RequestShipFromAddressType();

            if (!string.IsNullOrEmpty(ShipFromCity))
            {
                shipFromAddress.City = ShipFromCity;
            }
            if (!string.IsNullOrEmpty(ShipFromPostalCode))
            {
                shipFromAddress.PostalCode = ShipFromPostalCode;
            }
            if (!string.IsNullOrEmpty(ShipFromStateProvinceCode))
            {
                shipFromAddress.StateProvinceCode = ShipFromStateProvinceCode;
            }
            if (!string.IsNullOrEmpty(ShipFromCountryCode))
            {
                shipFromAddress.CountryCode = ShipFromCountryCode;
            }
            shipFrom.Address = shipFromAddress;
            request.ShipFrom = shipFrom;
        }
 private void AddShipFromAddress(UPSTimeInTransit.TimeInTransitRequest request)
 {
     var shipFrom = new UPSTimeInTransit.RequestShipFromType();
     var shipFromAddress = new UPSTimeInTransit.RequestShipFromAddressType();
     if (!string.IsNullOrEmpty(ShipFromCity))
         shipFromAddress.City = ShipFromCity;
     if (!string.IsNullOrEmpty(ShipFromPostalCode))
         shipFromAddress.PostalCode = ShipFromPostalCode;
     if (!string.IsNullOrEmpty(ShipFromStateProvinceCode))
         shipFromAddress.StateProvinceCode = ShipFromStateProvinceCode;
     if (!string.IsNullOrEmpty(ShipFromCountryCode))
         shipFromAddress.CountryCode = ShipFromCountryCode;
     shipFrom.Address = shipFromAddress;
     request.ShipFrom = shipFrom;
 }