Exemple #1
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);
        }
Exemple #2
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);
        }