/// <summary> /// use stub to create a ValueDiscounts via web services /// </summary> /// <param name="PriceListAssignments">Array of TSetValueDiscounts_Input</param> /// <returns>ArrayList of TSetValueDiscounts_Return</returns> public ArrayList setValueDiscounts(TSetValueDiscounts_Input[] PriceListAssignments) { TSetValueDiscounts_Return[] PriceListAssignments_out = stub.setValueDiscounts(PriceListAssignments); ArrayList result = new ArrayList(); for(int i = 0; i < PriceListAssignments_out.Length; i++) { TSetValueDiscounts_Return PriceListAssignment_out = PriceListAssignments_out[i]; if (PriceListAssignment_out.Error == null) { Console.WriteLine("successfully created ValueDiscounts 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 setValueDiscounts for a Product and a PriceList and check if method returns a true value /// </summary> public void setValueDiscounts() { TSetValueDiscounts_Input valueDiscountInput = new TSetValueDiscounts_Input(); valueDiscountInput.Product = product; valueDiscountInput.PriceList = pricelist; valueDiscountInput.ValueDiscounts = valueDiscounts; TSetValueDiscounts_Input[] PriceListAssignments = new TSetValueDiscounts_Input[]{valueDiscountInput}; ArrayList PriceListAssignments_out = serviceClient.setValueDiscounts(PriceListAssignments); // test if creation was successful Assert.AreEqual(1, PriceListAssignments_out.Count, "create result set"); TSetValueDiscounts_Return PriceListAssignment_out = (TSetValueDiscounts_Return)PriceListAssignments_out.ToArray()[0]; Assert.AreEqual(product, PriceListAssignment_out.Product, "product path"); Assert.AreEqual(true, PriceListAssignment_out.updated, "updated?"); }
/// <remarks/> public System.IAsyncResult BeginsetValueDiscounts(TSetValueDiscounts_Input[] Products, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("setValueDiscounts", new object[] { Products}, callback, asyncState); }
public TSetValueDiscounts_Return[] setValueDiscounts(TSetValueDiscounts_Input[] Products) { object[] results = this.Invoke("setValueDiscounts", new object[] { Products}); return ((TSetValueDiscounts_Return[])(results[0])); }