private void GetLowPrices()
        {
            if (Simulated)
            {
                ProcessingLog.LogAndPrintScreenMessage("Simulated Get Low Prices", true);
                return;
            }

            int requestCount = 1;
            int asinCount = 0;
            ASINListType asinList = new ASINListType();

            foreach (AsinInputItem asinInputItem in _asinInputList)
            {
                if (!string.IsNullOrEmpty(asinInputItem.Asin))
                {
                    asinCount++;
                    asinList.ASIN.Add(asinInputItem.Asin);
                }
                if (asinCount == 20)
                {
                    asinCount = 0;
                    requestCount++;
                    ProcessAsinList(asinList);
                    asinList.ASIN.Clear();

                    System.Threading.Thread.Sleep(3000);
                }
            }

            if (asinCount > 0)
            {
                ProcessAsinList(asinList);
            }
        }
Example #2
0
        /// <summary>
        /// Get Competitive Pricing For ASIN
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnCompetitivePricingSearch_Click(object sender, RoutedEventArgs e)
        {
            string SellerId = CommonValue.strMerchantId;
            string MarketplaceId = CommonValue.strMarketplaceId;
            string AccessKeyId = CommonValue.strAccessKeyId;
            string SecretKeyId = CommonValue.strSecretKeyId;
            string ApplicationVersion = CommonValue.strApplicationVersion;
            string ApplicationName = CommonValue.strApplicationName;
            string MWSAuthToken = CommonValue.strMWSAuthToken;
            string strbuff = string.Empty;

            MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
            config.ServiceURL = CommonValue.strServiceURL;

            MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(
                                                             ApplicationName,
                                                             ApplicationVersion,
                                                             AccessKeyId,
                                                             SecretKeyId,
                                                             config);
            GetCompetitivePricingForASINRequest request = new GetCompetitivePricingForASINRequest();
            request.SellerId = SellerId;
            request.MarketplaceId = MarketplaceId;
            ASINListType asinListType = new ASINListType();
            asinListType.ASIN.Add(txtSearchValue.Text);
            request.ASINList = asinListType;
            request.MWSAuthToken = MWSAuthToken;

            GetCompetitivePricingForASINResponse response = client.GetCompetitivePricingForASIN(request);
            if (response.IsSetGetCompetitivePricingForASINResult())
            {
                foreach (GetCompetitivePricingForASINResult getCompetitivePricingForASINResult in response.GetCompetitivePricingForASINResult)
                {
                    if (getCompetitivePricingForASINResult.IsSetProduct())
                    {
                        Product product = getCompetitivePricingForASINResult.Product;
                        if (product.IsSetCompetitivePricing())
                        {
                            CompetitivePricingType competitivePricing = product.CompetitivePricing;
                            if (competitivePricing.IsSetCompetitivePrices())
                            {
                                CompetitivePriceList competitivePrices = competitivePricing.CompetitivePrices;
                                foreach (CompetitivePriceType priceList in competitivePrices.CompetitivePrice)
                                {
                                    strbuff += "価格:" + priceList.Price.LandedPrice.Amount + System.Environment.NewLine;
                                }
                            }
                        }
                    }
                }
                txtCompetitivePricingResult.Text = strbuff;
            }
        }
 public GetCompetitivePricingForASINResponse InvokeGetCompetitivePricingForASIN(List<string> asinList)
 {
     // Create a request.
     GetCompetitivePricingForASINRequest request = new GetCompetitivePricingForASINRequest();
     string sellerId = "example";
     request.SellerId = sellerId;
     string mwsAuthToken = "example";
     request.MWSAuthToken = mwsAuthToken;
     string marketplaceId = "example";
     request.MarketplaceId = marketplaceId;
     ASINListType ASINList = new ASINListType();
     ASINList.ASIN = asinList;
     request.ASINList = ASINList;
     return this.client.GetCompetitivePricingForASIN(request);
 }
Example #4
0
        /// <summary>
        /// Get My Price For ASIN
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMyPriceSearch_Click(object sender, RoutedEventArgs e)
        {
            string SellerId = CommonValue.strMerchantId;
            string MarketplaceId = CommonValue.strMarketplaceId;
            string AccessKeyId = CommonValue.strAccessKeyId;
            string SecretKeyId = CommonValue.strSecretKeyId;
            string ApplicationVersion = CommonValue.strApplicationVersion;
            string ApplicationName = CommonValue.strApplicationName;
            string MWSAuthToken = CommonValue.strMWSAuthToken;
            string strbuff = string.Empty;

            MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
            config.ServiceURL = CommonValue.strServiceURL;

            MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(
                                                             ApplicationName,
                                                             ApplicationVersion,
                                                             AccessKeyId,
                                                             SecretKeyId,
                                                             config);
            GetMyPriceForASINRequest request = new GetMyPriceForASINRequest();
            request.SellerId = SellerId;
            request.MarketplaceId = MarketplaceId;
            request.MWSAuthToken = MWSAuthToken;
            ASINListType asinListType = new ASINListType();
            asinListType.ASIN.Add(txtMyPriceSearchValue.Text.ToString().Trim());
            request.ASINList = asinListType;

            GetMyPriceForASINResponse response = client.GetMyPriceForASIN(request);
            if (response.IsSetGetMyPriceForASINResult())
            {
                List<GetMyPriceForASINResult> getMyPriceForASINResult = response.GetMyPriceForASINResult;
                foreach (GetMyPriceForASINResult myPriceForASIN in getMyPriceForASINResult)
                {
                    Product product = myPriceForASIN.Product;

                    strbuff += "コンディション:" + product.Offers.Offer[0].ItemCondition + System.Environment.NewLine;
                    strbuff += "セラーID:" + product.Offers.Offer[0].SellerId + System.Environment.NewLine;
                    strbuff += "SKU:" + product.Offers.Offer[0].SellerSKU + System.Environment.NewLine;

                    txtMyPriceResult.Text = strbuff;
                }
            }
        }
 /// <summary>
 /// Sets the ASINList property
 /// </summary>
 /// <param name="ASINList">ASINList property</param>
 /// <returns>this instance</returns>
 public GetMyPriceForASINRequest WithASINList(ASINListType ASINList)
 {
     this.ASINListField = ASINList;
     return this;
 }
 public override void ReadFragmentFrom(IMwsReader reader)
 {
     _sellerId = reader.Read<string>("SellerId");
     _mwsAuthToken = reader.Read<string>("MWSAuthToken");
     _marketplaceId = reader.Read<string>("MarketplaceId");
     _asinList = reader.Read<ASINListType>("ASINList");
     _itemCondition = reader.Read<string>("ItemCondition");
     _excludeMe = reader.Read<bool?>("ExcludeMe");
 }
 public override void ReadFragmentFrom(IMwsReader reader)
 {
     _sellerId = reader.Read<string>("SellerId");
     _mwsAuthToken = reader.Read<string>("MWSAuthToken");
     _marketplaceId = reader.Read<string>("MarketplaceId");
     _asinList = reader.Read<ASINListType>("ASINList");
 }
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetMatchingProductRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return this;
 }
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetCompetitivePricingForASINRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return this;
 }
        private GetLowestOfferListingsForASINResponse InvokeGetLowestOfferListingsForAsin(ASINListType asinList)
        {
            GetLowestOfferListingsForASINRequest request = new GetLowestOfferListingsForASINRequest();
            request.SellerId = _sellerId;
            request.MarketplaceId = AccountSettingsConfigSection.Rst_marketplaceId.Value;

            request.ASINList = asinList;

            request.ItemCondition = "New";
            request.ExcludeMe = false;

            return _client.GetLowestOfferListingsForASIN(request);
        }
        private void ProcessAsinList(ASINListType asinList)
        {
            GetLowestOfferListingsForASINResponse response = InvokeGetLowestOfferListingsForAsin(asinList);
            ProcessingLog.LogAndPrintScreenMessage(string.Format("Got lowest price header meta data:\n {0}", response.ResponseHeaderMetadata), false);
            ProcessingLog.LogAndPrintScreenMessage(string.Format("Got lowest price listings: {0}", asinList.ASIN.Count), true);

            foreach (GetLowestOfferListingsForASINResult getLowestOfferListingsForAsinResult in response.GetLowestOfferListingsForASINResult)
            {
                AsinInputItem asinInputItem = GetMatchingSkuForAsin(getLowestOfferListingsForAsinResult.ASIN);

                foreach (LowestOfferListingType lowestOfferListing in getLowestOfferListingsForAsinResult.Product.LowestOfferListings.LowestOfferListing)
                {
                    ProcessLowPriceMember(lowestOfferListing, asinInputItem);
                }
            }
        }
 /// <summary>
 /// Sets the ASINList property
 /// </summary>
 /// <param name="ASINList">ASINList property</param>
 /// <returns>this instance</returns>
 public GetMyPriceForASINRequest WithASINList(ASINListType ASINList)
 {
     this.ASINListField = ASINList;
     return(this);
 }
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetLowestOfferListingsForASINRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return(this);
 }
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetMyPriceForASINRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return(this);
 }
 public GetLowestOfferListingsForASINResponse InvokeGetLowestOfferListingsForASIN()
 {
     // Create a request.
     GetLowestOfferListingsForASINRequest request = new GetLowestOfferListingsForASINRequest();
     string sellerId = "example";
     request.SellerId = sellerId;
     string mwsAuthToken = "example";
     request.MWSAuthToken = mwsAuthToken;
     string marketplaceId = "example";
     request.MarketplaceId = marketplaceId;
     ASINListType asinList = new ASINListType();
     request.ASINList = asinList;
     string itemCondition = "example";
     request.ItemCondition = itemCondition;
     bool excludeMe = true;
     request.ExcludeMe = excludeMe;
     return this.client.GetLowestOfferListingsForASIN(request);
 }
 /// <summary>
 /// Sets the ASINList property
 /// </summary>
 /// <param name="ASINList">ASINList property</param>
 /// <returns>this instance</returns>
 public GetLowestOfferListingsForASINRequest WithASINList(ASINListType ASINList)
 {
     this.ASINListField = ASINList;
     return this;
 }
 public GetMyPriceForASINResponse InvokeGetMyPriceForASIN()
 {
     // Create a request.
     GetMyPriceForASINRequest request = new GetMyPriceForASINRequest();
     string sellerId = "example";
     request.SellerId = sellerId;
     string mwsAuthToken = "example";
     request.MWSAuthToken = mwsAuthToken;
     string marketplaceId = "example";
     request.MarketplaceId = marketplaceId;
     ASINListType asinList = new ASINListType();
     request.ASINList = asinList;
     return this.client.GetMyPriceForASIN(request);
 }
 /// <summary>
 /// Sets the ASINList property
 /// </summary>
 /// <param name="ASINList">ASINList property</param>
 /// <returns>this instance</returns>
 public GetCompetitivePricingForASINRequest WithASINList(ASINListType ASINList)
 {
     this.ASINListField = ASINList;
     return this;
 }
 /// <summary>
 /// Sets the ASINList property
 /// </summary>
 /// <param name="ASINList">ASINList property</param>
 /// <returns>this instance</returns>
 public GetMatchingProductRequest WithASINList(ASINListType ASINList)
 {
     this.ASINListField = ASINList;
     return this;
 }
Example #20
0
        /// <summary>
        /// Get Lowest Offer Listings For ASIN
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnLowestOfferListingsSearch_Click(object sender, RoutedEventArgs e)
        {
            string SellerId = CommonValue.strMerchantId;
            string MarketplaceId = CommonValue.strMarketplaceId;
            string AccessKeyId = CommonValue.strAccessKeyId;
            string SecretKeyId = CommonValue.strSecretKeyId;
            string ApplicationVersion = CommonValue.strApplicationVersion;
            string ApplicationName = CommonValue.strApplicationName;
            string MWSAuthToken = CommonValue.strMWSAuthToken;
            string strbuff = string.Empty;

            MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
            config.ServiceURL = CommonValue.strServiceURL;

            MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(
                                                             ApplicationName,
                                                             ApplicationVersion,
                                                             AccessKeyId,
                                                             SecretKeyId,
                                                             config);
            GetLowestOfferListingsForASINRequest request = new GetLowestOfferListingsForASINRequest();
            request.SellerId = SellerId;
            request.MarketplaceId = MarketplaceId;
            ASINListType asinListType = new ASINListType();
            asinListType.ASIN.Add(txtLowestOfferListingsSearchValue.Text.ToString().Trim());
            request.ASINList = asinListType;

            GetLowestOfferListingsForASINResponse response = client.GetLowestOfferListingsForASIN(request);
            if (response.IsSetGetLowestOfferListingsForASINResult())
            {
                List<GetLowestOfferListingsForASINResult> getLowestOfferListingsForASINResultList = response.GetLowestOfferListingsForASINResult;
                foreach (GetLowestOfferListingsForASINResult getLowestOfferListingsForASINResult in getLowestOfferListingsForASINResultList)
                {
                    if (getLowestOfferListingsForASINResult.IsSetProduct())
                    {
                        Product product = getLowestOfferListingsForASINResult.Product;

                        if (product.IsSetLowestOfferListings())
                        {
                            LowestOfferListingList lowestOfferListingList = product.LowestOfferListings;
                            foreach (LowestOfferListingType lowestOfferListing in lowestOfferListingList.LowestOfferListing)
                            {
                                strbuff += "価格:" + lowestOfferListing.Price.ListingPrice.Amount + System.Environment.NewLine;
                            }
                        }
                    }
                }
                txtLowestOfferListingsResult.Text = strbuff;
            }
        }
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetMyPriceForASINRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return this;
 }
Example #22
0
        /// <summary>
        /// Get Matching Product
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnMatchingSearch_Click(object sender, RoutedEventArgs e)
        {
            string SellerId = CommonValue.strMerchantId;
            string MarketplaceId = CommonValue.strMarketplaceId;
            string AccessKeyId = CommonValue.strAccessKeyId;
            string SecretKeyId = CommonValue.strSecretKeyId;
            string ApplicationVersion = CommonValue.strApplicationVersion;
            string ApplicationName = CommonValue.strApplicationName;
            string MWSAuthToken = CommonValue.strMWSAuthToken;
            string strbuff = string.Empty;

            MarketplaceWebServiceProductsConfig config = new MarketplaceWebServiceProductsConfig();
            config.ServiceURL = CommonValue.strServiceURL;

            MarketplaceWebServiceProductsClient client = new MarketplaceWebServiceProductsClient(
                                                             ApplicationName,
                                                             ApplicationVersion,
                                                             AccessKeyId,
                                                             SecretKeyId,
                                                             config);
            GetMatchingProductRequest request = new GetMatchingProductRequest();
            request.SellerId = SellerId;
            request.MarketplaceId = MarketplaceId;

            ASINListType asinListType = new ASINListType();
            asinListType.ASIN.Add(txtSearchValue.Text);
            request.ASINList = asinListType;
            request.MWSAuthToken = MWSAuthToken;

            GetMatchingProductResponse response = client.GetMatchingProduct(request);
            if (response.IsSetGetMatchingProductResult())
            {
                List<GetMatchingProductResult> getMatchingProductResultList = response.GetMatchingProductResult;
                foreach (GetMatchingProductResult getMatchingProductResult in getMatchingProductResultList)
                {
                    Product product = getMatchingProductResult.Product;
                    System.Xml.XmlElement elements = (System.Xml.XmlElement)product.AttributeSets.Any[0];

                    foreach (System.Xml.XmlElement element in elements)
                    {
                        switch (element.LocalName)
                        {
                            case "Title":
                                strbuff += "タイトル:" + element.InnerText + System.Environment.NewLine;
                                break;
                            case "Creator":
                                strbuff += "著者:" + element.InnerText + System.Environment.NewLine;
                                break;
                            case "ListPrice":
                                strbuff += "価格:" + element.InnerText + System.Environment.NewLine;
                                break;
                            case "Manufacturer":
                                strbuff += "販売会社:" + element.InnerText + System.Environment.NewLine;
                                break;
                            default:
                                break;
                        }
                    }
                    txtMatchingResult.Text = strbuff;
                }
            }
        }
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetLowestOfferListingsForASINRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return this;
 }
Example #24
0
 /// <summary>
 /// Sets the ASINList property.
 /// </summary>
 /// <param name="asinList">ASINList property.</param>
 /// <returns>this instance.</returns>
 public GetMatchingProductRequest WithASINList(ASINListType asinList)
 {
     this._asinList = asinList;
     return(this);
 }