/// <summary>
		/// use stub to create a QuantityDiscount via web services
		/// </summary>
		/// <param name="PriceListAssignments">Array of TSetQuantityDiscounts_Input</param>
		/// <returns>ArrayList of TSetQuantityDiscounts_Return</returns>
		public ArrayList setQuantityDiscounts(TSetQuantityDiscounts_Input[] PriceListAssignments) 
		{
			TSetQuantityDiscounts_Return[] PriceListAssignments_out = stub.setQuantityDiscounts(PriceListAssignments);

			ArrayList result = new ArrayList();

			for(int i = 0; i < PriceListAssignments_out.Length; i++)
			{
				TSetQuantityDiscounts_Return PriceListAssignment_out = PriceListAssignments_out[i];

				if (PriceListAssignment_out.Error == null) 
				{
					Console.WriteLine("successfully created QuantityDiscount for Product: " + PriceListAssignment_out.Product);
					result.Add(PriceListAssignment_out);
				} 
				else 
				{
					Console.WriteLine("an error occured (Epages Error):\n" + PriceListAssignment_out.Error.Message);
				}
			}

			return result;
		}
		/// <summary>
		/// test setQuantityDiscounts for a Product and a PriceList and check if method returns a true value
		/// </summary>
		public void setQuantityDiscounts()
		{
			TSetQuantityDiscounts_Input quantityDiscountInput = new TSetQuantityDiscounts_Input();
			quantityDiscountInput.Product = product;
			quantityDiscountInput.PriceList = pricelist;
			quantityDiscountInput.QuantityDiscounts = quantityDiscounts;

			TSetQuantityDiscounts_Input[] PriceListAssignments = new TSetQuantityDiscounts_Input[]{quantityDiscountInput};

			ArrayList PriceListAssignments_out = serviceClient.setQuantityDiscounts(PriceListAssignments);

			// test if creation was successful
			Assert.AreEqual(1, PriceListAssignments_out.Count, "create result set");

			TSetQuantityDiscounts_Return PriceListAssignment_out = (TSetQuantityDiscounts_Return)PriceListAssignments_out.ToArray()[0];
			Assert.AreEqual(product, PriceListAssignment_out.Product, "product path");
			Assert.AreEqual(true, PriceListAssignment_out.updated, "updated?");
		}
Exemplo n.º 3
0
 /// <remarks/>
 public System.IAsyncResult BeginsetQuantityDiscounts(TSetQuantityDiscounts_Input[] Products, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("setQuantityDiscounts", new object[] {
                 Products}, callback, asyncState);
 }
Exemplo n.º 4
0
 public TSetQuantityDiscounts_Return[] setQuantityDiscounts(TSetQuantityDiscounts_Input[] Products) {
     object[] results = this.Invoke("setQuantityDiscounts", new object[] {
                 Products});
     return ((TSetQuantityDiscounts_Return[])(results[0]));
 }