예제 #1
0
		/// <summary>
		/// use stub to create a Product via web services
		/// </summary>
		/// <param name="Products">Array of TUpdate_Input</param>
		/// <returns>ArrayList of TUpdate_Return</returns>
		public ArrayList update(TUpdate_Input[] Products)
		{
			TUpdate_Return[] Products_out = stub.update(Products);

			ArrayList result = new ArrayList();

			for(int i = 0; i < Products_out.Length; i++)
			{
				TUpdate_Return Product_out = Products_out[i];

				if (Product_out.Error == null)
				{
					Console.WriteLine("successfully updated Product: " + Product_out.Path);
					result.Add(Product_out);
				}
				else
				{
					Console.WriteLine("an error occured (Epages Error):\n" + Product_out.Error.Message);
				}
			}

			return result;
		}
예제 #2
0
 /// <remarks/>
 public System.IAsyncResult Beginupdate(TUpdate_Input[] Products, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("update", new object[] {
                 Products}, callback, asyncState);
 }
예제 #3
0
 public TUpdate_Return[] update(TUpdate_Input[] Products) {
     object[] results = this.Invoke("update", new object[] {
                 Products});
     return ((TUpdate_Return[])(results[0]));
 }
예제 #4
0
		/// <summary>
		/// test update of a Product and check if method returns a true value
		/// </summary>
		public void update()
		{
			TUpdate_Input[] Products = new TUpdate_Input[]{Product_update};

			ArrayList Products_out = serviceClient.update(Products);

			// test if update was successful
			Assert.AreEqual(1, Products_out.Count, "udpated result set");

			TUpdate_Return Product_out = (TUpdate_Return)Products_out.ToArray()[0];
			Assert.AreEqual(path + alias, Product_out.Path, "product path");
			Assert.AreEqual(true, Product_out.updated, "updated?");
		}
예제 #5
0
        private ArrayList updateStockLevels(int newVal)
        {
            List<TUpdate_Input> updates = new List<TUpdate_Input>();
            foreach(string path in productPaths)
            {
                TUpdate_Input update = new TUpdate_Input();
                update.Path = path;
                update.StockLevel = newVal;
                update.StockLevelSpecified = true;
                updates.Add(update);
            }

            return productServiceClient.update(updates.ToArray());
        }
예제 #6
0
        private ArrayList updateContent()
        {
            List<TUpdate_Input> updates = new List<TUpdate_Input>();
            TUpdate_Input update = new TUpdate_Input();
            update.Path = productPaths[0];

            TLocalizedValue name = new TLocalizedValue();
            name.LanguageCode = "de";
            name.Value = "Updated DotNetTestProduct " + productPaths[0];
            update.Name = new TLocalizedValue[] { name };
                
            updates.Add(update);

            return productServiceClient.update(updates.ToArray());
        }