예제 #1
0
		public void Init()
		{
			Console.WriteLine("CrossSellingTest: Init");

			TLocalizedValue comment1_de = new TLocalizedValue();
			comment1_de.LanguageCode = "de";
			comment1_de.Value = ".net CrossSellingService Test";
			TLocalizedValue comment1_en = new TLocalizedValue();
			comment1_en.LanguageCode = "en";
			comment1_en.Value = ".net CrossSellingService Test";
			Comment1  = new TLocalizedValue[]{ comment1_de, comment1_en };

			TLocalizedValue comment2_de = new TLocalizedValue();
			comment2_de.LanguageCode = "de";
			comment2_de.Value = ".net CrossSellingService Test Aktualisierung";
			TLocalizedValue comment2_en = new TLocalizedValue();
			comment2_en.LanguageCode = "en";
			comment2_en.Value = ".net CrossSellingService test update";
			Comment2  = new TLocalizedValue[]{ comment2_de, comment2_en };

			crossSellingService = new CrossSellingService();
			crossSellingService.Credentials = new System.Net.NetworkCredential(WEBSERVICE_LOGIN, WEBSERVICE_PASSWORD);
			crossSellingService.PreAuthenticate = true;
			crossSellingService.Url = WEBSERVICE_URL;

			// remove all assigned cross selling products
			TDelete_Input CrossSelling_in = new TDelete_Input();
			CrossSelling_in.Product	= product;
			CrossSelling_in.TargetProduct = "*";
			CrossSelling_in.Type = "CrossSelling";
			TDelete_Input[] CrossSellings = new TDelete_Input[]{CrossSelling_in};
			TDelete_Return[] CrossSellings_out = crossSellingService.delete( CrossSellings );

			Console.WriteLine("delete all CrossSelling: " + CrossSellings_out.GetLength(0));
			foreach( TDelete_Return result in CrossSellings_out )
			{
				if( result.Error != null )
					Console.Error.WriteLine("delete CrossSelling failed:" + result.Error.Message);
				else
					Console.WriteLine("deleted CrossSelling: " + result.TargetProduct + " : " + result.deleted );
			}

			CrossSelling_in = new TDelete_Input();
			CrossSelling_in.Product	= product;
			CrossSelling_in.TargetProduct = "*";
			CrossSelling_in.Type = "Accessory";
			CrossSellings = new TDelete_Input[]{CrossSelling_in};
			CrossSellings_out = crossSellingService.delete( CrossSellings );

			Console.WriteLine("delete all Accessory: " + CrossSellings_out.GetLength(0));
			foreach( TDelete_Return result in CrossSellings_out )
			{
				if( result.Error != null )
					Console.Error.WriteLine("delete failed:" + result.Error.Message);
				else
					Console.WriteLine("deleted Accessory: " + result.TargetProduct + " : " + result.deleted );
			}

			CrossSelling_in = new TDelete_Input();
			CrossSelling_in.Product	= product;
			CrossSelling_in.TargetProduct = "*";
			CrossSelling_in.Type = "ProductComparison";
			CrossSellings = new TDelete_Input[]{CrossSelling_in};
			CrossSellings_out = crossSellingService.delete( CrossSellings );

			Console.WriteLine("delete all ProductComparison: " + CrossSellings_out.GetLength(0));
			foreach( TDelete_Return result in CrossSellings_out )
			{
				if( result.Error != null )
					Console.Error.WriteLine("delete ProductComparison failed:" + result.Error.Message);
				else
					Console.WriteLine("deleted ProductComparison: " + result.TargetProduct + " : " + result.deleted );
			}
		}
예제 #2
0
 /// <remarks/>
 public System.IAsyncResult Begindelete(TDelete_Input[] CrossSellings, System.AsyncCallback callback, object asyncState) {
     return this.BeginInvoke("delete", new object[] {
                 CrossSellings}, callback, asyncState);
 }
예제 #3
0
		/// <summary>
		/// delete a cross selling and check if the deletion was successful
		/// </summary>
		public void testDelete()
		{
			Console.WriteLine("CrossSellingTest: testDelete");

			TDelete_Input crossSelling = new TDelete_Input();
			crossSelling.Product	= product;
			crossSelling.TargetProduct = target_product;
			crossSelling.Type = "CrossSelling";

			TDelete_Input productComparison = new TDelete_Input();
			productComparison.Product	= product;
			productComparison.TargetProduct = target_product;
			productComparison.Type = "ProductComparison";

			TDelete_Input accessory = new TDelete_Input();
			accessory.Product	= product;
			accessory.TargetProduct = target_product;
			accessory.Type = "Accessory";

			TDelete_Input[] CrossSellings = new TDelete_Input[]{
				crossSelling,
				productComparison,
				accessory,
			};

			TDelete_Return[] CrossSellings_out = crossSellingService.delete(CrossSellings);

			// test if deletion was successful
			Assert.AreEqual(3, CrossSellings_out.GetLength(0), "delete result count");

			TDelete_Return	CrossSelling_out = CrossSellings_out[0];
			Assert.IsNull(CrossSelling_out.Error, "delete: no error");
			Assert.AreEqual(product,	CrossSelling_out.Product, "Product path");
			Assert.IsTrue(CrossSelling_out.deleted, "deleted?");
		}
예제 #4
0
 public TDelete_Return[] delete(TDelete_Input[] CrossSellings) {
     object[] results = this.Invoke("delete", new object[] {
                 CrossSellings});
     return ((TDelete_Return[])(results[0]));
 }