Inheritance: MWSClientCsRuntime.AbstractMwsObject
Exemplo n.º 1
0
        public Dictionary <string, decimal> GetMyPriceForSKUs(IEnumerable <string> skus)
        {
            Dictionary <string, decimal> myPriceDictionary = new Dictionary <string, decimal>();

            GetMyPriceForSKURequest requestMyPriceForSku = new GetMyPriceForSKURequest
            {
                SellerId      = m_sellerId,
                MarketplaceId = m_marketPlaceId,
                SellerSKUList = new SellerSKUListType()
            };

            requestMyPriceForSku.SellerSKUList.SellerSKU.AddRange(skus);
            try
            {
                GetMyPriceForSKUResponse response = m_productClient.GetMyPriceForSKU(requestMyPriceForSku);

                List <GetMyPriceForSKUResult> getMyPriceForSkuResultList = response.GetMyPriceForSKUResult;
                foreach (GetMyPriceForSKUResult getMyPriceForSkuResult in getMyPriceForSkuResultList)
                {
                    if (getMyPriceForSkuResult.IsSetProduct())
                    {
                        MarketplaceWebServiceProducts.Model.Product product = getMyPriceForSkuResult.Product;

                        if (product.IsSetOffers())
                        {
                            OffersList       offers    = product.Offers;
                            List <OfferType> offerList = offers.Offer;
                            foreach (OfferType offer in offerList)
                            {
                                if (offer.IsSetBuyingPrice())
                                {
                                    PriceType buyingPrice = offer.BuyingPrice;
                                    if (buyingPrice.IsSetLandedPrice())
                                    {
                                        MoneyType landedPrice2 = buyingPrice.LandedPrice;

                                        if (landedPrice2.IsSetAmount())
                                        {
                                            decimal myPrice = landedPrice2.Amount;
                                            myPriceDictionary.Add(offer.SellerSKU, myPrice);
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (MarketplaceWebServiceProductsException e)
            {
                LoggingRepository.Log(LoggingCategory.RepricingScript, string.Format("Exception in 'GetMyPriceForSKU': {0}", e.Message));
            }

            return(myPriceDictionary);
        }
Exemplo n.º 2
0
        public void UpdateAmazonListingStatusAndAsin(AmazonListing item, Product amazonProduct)
        {
            if (amazonProduct == null)
                amazonProduct = _amazonProductsApiService.GetMatchingProductForId(item.SellerSKU);

            if (amazonProduct != null && amazonProduct.Identifiers.MarketplaceASIN != null)
            {
                    item.Status = AmazonListingStatus.Active;
                    item.ASIN = amazonProduct.Identifiers.MarketplaceASIN.ASIN;
            }
            else
            {
                item.Status = String.IsNullOrWhiteSpace(item.ASIN)
                                  ? AmazonListingStatus.NotOnAmazon
                                  : AmazonListingStatus.Inactive;
            }
            Save(item);
        }
 /// <summary>
 /// Sets the Product property.
 /// </summary>
 /// <param name="product">Product property.</param>
 /// <returns>this instance.</returns>
 public GetLowestOfferListingsForASINResult WithProduct(Product product)
 {
     this._product = product;
     return this;
 }
 public override void ReadFragmentFrom(IMwsReader reader)
 {
     _asin = reader.ReadAttribute<string>("ASIN");
     _status = reader.ReadAttribute<string>("status");
     _allOfferListingsConsidered = reader.Read<bool?>("AllOfferListingsConsidered");
     _product = reader.Read<Product>("Product");
     _error = reader.Read<Error>("Error");
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sets the Product property.
 /// </summary>
 /// <param name="product">Product property.</param>
 /// <returns>this instance.</returns>
 public GetMyPriceForSKUResult WithProduct(Product product)
 {
     this._product = product;
     return this;
 }
Exemplo n.º 6
0
 public override void ReadFragmentFrom(IMwsReader reader)
 {
     _sellerSKU = reader.ReadAttribute<string>("SellerSKU");
     _status = reader.ReadAttribute<string>("status");
     _product = reader.Read<Product>("Product");
     _error = reader.Read<Error>("Error");
 }
 /// <summary>
 /// Sets the Product property
 /// </summary>
 /// <param name="product">Product property</param>
 /// <returns>this instance</returns>
 public GetCompetitivePricingForASINResult WithProduct(Product product)
 {
     this.productField = product;
     return this;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Sets the Product property.
 /// </summary>
 /// <param name="product">Product property.</param>
 /// <returns>this instance.</returns>
 public ProductList WithProduct(Product[] product)
 {
     this._product.AddRange(product);
     return this;
 }
 /// <summary>
 /// Sets the Product property.
 /// </summary>
 /// <param name="product">Product property.</param>
 /// <returns>this instance.</returns>
 public GetMatchingProductResult WithProduct(Product product)
 {
     this._product = product;
     return this;
 }
 private void ProcessProduct(Product product, AsinInputItemShort asinInputItem)
 {
     if (DataToGet.Equals("Dimension", StringComparison.CurrentCultureIgnoreCase))
     {
         product.WriteDimensionSeparatedFragment(StartRange.ToString("yyyy-MM-dd"),
         asinInputItem.Account, asinInputItem.SellerSku, asinInputItem.Asin, asinInputItem.AmzRstListPrice, _productInfoCsv, "\t");
     }
     else
     {
         product.WriteRankSeparatedFragment(StartRange.ToString("yyyy-MM-dd"),
         asinInputItem.Account, asinInputItem.SellerSku, asinInputItem.Asin, asinInputItem.AmzRstListPrice, _productInfoCsv, "\t");
     }
 }
 /// <summary>
 /// Sets the Product property
 /// </summary>
 /// <param name="product">Product property</param>
 /// <returns>this instance</returns>
 public GetLowestOfferListingsForSKUResult WithProduct(Product product)
 {
     this.productField = product;
     return this;
 }
 /// <summary>
 /// Sets the Product property.
 /// </summary>
 /// <param name="product">Product property.</param>
 /// <returns>this instance.</returns>
 public GetCompetitivePricingForSKUResult WithProduct(Product product)
 {
     this._product = product;
     return this;
 }