Ejemplo n.º 1
0
        /// <summary>
        /// Create a new box
        /// </summary>
        /// <param name="carrier">The carrier</param>
        /// <param name="trackingNumber">The Tracking number.</param>
        /// <param name="lookup">The lookup value</param>
        /// <returns></returns>
        public static ShipItemBox CreateBox(string carrier, string trackingNumber,
                                            Dictionary <string, AutoGen.ItemShippingInformation> lookup)
        {
            ShipItemBox retVal = new ShipItemBox(carrier, trackingNumber);

            retVal._lookup        = lookup;
            retVal.Carrier        = carrier;
            retVal.TrackingNumber = trackingNumber;
            return(retVal);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Add a new item based on a MerchantItemID
        /// </summary>
        /// <param name="carrier">
        /// The &lt;carrier&gt; tag contains the name of the company
        /// responsible for shipping the item. Valid values for this
        /// tag are DHL, FedEx, UPS, USPS and Other.
        /// </param>
        /// <param name="trackingNumber">
        /// The &lt;tracking-number&gt; tag contains the shipper's tracking
        /// number that is associated with an order.
        /// </param>
        /// <param name="merchantItemID">
        /// The &lt;merchant-item-id&gt; tag contains a value,
        /// such as a stock keeping unit (SKU),
        /// that you use to uniquely identify an item.
        /// </param>
        public void AddMerchantItemId(string carrier, string trackingNumber,
                                      string merchantItemID)
        {
            ShipItemBox box = null;

            if (!_boxes.TryGetValue(trackingNumber, out box))
            {
                box = ShipItemBox.CreateBox(carrier, trackingNumber, _items);
                _boxes[trackingNumber] = box;
            }

            box.AddMerchantItemID(merchantItemID);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add a new box to the order that items will be placed in.
        /// </summary>
        /// <param name="carrier">
        /// The &lt;carrier&gt; tag contains the name of the company
        /// responsible for shipping the item. Valid values for this
        /// tag are DHL, FedEx, UPS, USPS and Other.
        /// </param>
        /// <param name="trackingNumber">
        /// The &lt;tracking-number&gt; tag contains the shipper's tracking
        /// number that is associated with an order.
        /// </param>
        /// <returns></returns>
        public ShipItemBox AddBox(string carrier, string trackingNumber)
        {
            if (_boxes.ContainsKey(trackingNumber))
            {
                throw new ApplicationException(
                          "You attempted to add a duplicate tracking number.");
            }

            ShipItemBox retVal = ShipItemBox.CreateBox(carrier, trackingNumber, _items);

            _boxes.Add(trackingNumber, retVal);

            return(retVal);
        }
 /// <summary>
 /// Create a new box
 /// </summary>
 /// <param name="carrier">The carrier</param>
 /// <param name="trackingNumber">The Tracking number.</param>
 /// <param name="lookup">The lookup value</param>
 /// <returns></returns>
 public static ShipItemBox CreateBox(string carrier, string trackingNumber, 
     Dictionary<string, AutoGen.ItemShippingInformation> lookup)
 {
     ShipItemBox retVal = new ShipItemBox(carrier, trackingNumber);
       retVal._lookup = lookup;
       retVal.Carrier = carrier;
       retVal.TrackingNumber = trackingNumber;
       return retVal;
 }