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);
}