Beispiel #1
0
        public void ReviseSellingManagerTemplate()
        {
            Assert.IsTrue(TestData.SoldItemId != string.Empty);
            ReviseSellingManagerTemplateCall api = new ReviseSellingManagerTemplateCall(apiContext);
            ItemType item = new ItemType();

            item.ItemID        = TestData.ItemId;
            item.Description   = "Modified by selling manager call.";
            api.Item           = item;
            api.SaleTemplateID = TestData.SaleTemplateId;
//			api.Execute();
//			//check whether the call is success.
//			Assert.IsTrue(api.ApiResponse.Ack==AckCodeType.Success || api.ApiResponse.Ack==AckCodeType.Warning,"do not success!");
        }
Beispiel #2
0
        public static void ReviseSellingManagerTemplates(SellingManagerProductTypeCollection products)
        {
            Console.WriteLine("Start writing EAN...");
            Int32 productIndex = 0;

            foreach (SellingManagerProductType productRunner in products)
            {
                Console.WriteLine(String.Format("Writing {0} of {1} with Id={2}....", productIndex, products.Count, productRunner.SellingManagerProductDetails.CustomLabel));
                var article = Article.LoadByArticleNumber(productRunner.SellingManagerProductDetails.CustomLabel);

                if (article != null && article.SupplierId != 1)
                {
                    foreach (SellingManagerTemplateDetailsType templateRunner in productRunner.SellingManagerTemplateDetailsArray)
                    {
                        try
                        {
                            ReviseSellingManagerTemplateCall call = new ReviseSellingManagerTemplateCall(EbayController.GetApiContext());
                            call.SaleTemplateID                 = Convert.ToInt64(templateRunner.SaleTemplateID);
                            call.Item                           = new ItemType();
                            call.Item.ProductListingDetails     = new ProductListingDetailsType();
                            call.Item.ProductListingDetails.EAN = article.EAN;
                            call.Execute();
                        }
                        catch (Exception ex)
                        {
                            Console.WriteLine(ex.Message);
                        }
                    }
                }
                else
                {
                    Console.WriteLine("Skipped. No article or supplier is 1");
                }
                productIndex++;
            }
            Console.ReadKey();
        }