Пример #1
0
		public void Init()
		{
			serviceClient = new ProductServiceClient();
			
			// create test Products that can be used with the create and update methods
			Product_in.Alias            = alias;
			TLocalizedValue name_de     = new TLocalizedValue();
			    name_de.LanguageCode    = "de";
			    name_de.Value           = "Test-Hauptprodukt";
			TLocalizedValue name_en     = new TLocalizedValue();
			    name_en.LanguageCode    = "en";
			    name_en.Value           = "test master product";
			Product_in.Name             = new TLocalizedValue[]{name_de, name_en};

            Product_in.Class            = "/Shops/DemoShop/ProductTypes/Shoe";
            Product_in.TaxClass         = "/TaxMatrixGermany/normal";
            Product_in.IsVisible        = true;         Product_in.IsVisibleSpecified       = true;
            Product_in.IsNew            = true;         Product_in.IsNewSpecified           = true;
			Product_in.PriceQuantity    = (float)1;     Product_in.PriceQuantitySpecified   = true;
            Product_in.MinOrder         = (float)1;     Product_in.MinOrderSpecified        = true;
			Product_in.IntervalOrder    = (float)1;     Product_in.IntervalOrderSpecified   = true;
            Product_in.OrderUnit        = "/Units/piece";

            Product_in.Weight           = (float)240;   Product_in.WeightSpecified          = true;
            Product_in.WeightUnit       = "/Units/gram";

            Product_in.RefAmount        = (float)1;     Product_in.RefAmountSpecified       = true;
            Product_in.RefContentAmount = (float)0.240; Product_in.RefContentAmountSpecified = true;
            Product_in.RefUnit          = "Units/gram/kilogram";

            Product_in.StockLevel       = (float)140;   Product_in.StockLevelSpecified      = true;
            Product_in.StockLevelAlert  = (float)100;   Product_in.StockLevelAlertSpecified = true;

			TProductPrice price         = new TProductPrice();
			    price.Price             = (float)123;
			    price.CurrencyID        = "EUR";
			    price.TaxModel          = "gross";
			Product_in.ProductPrices    = new TProductPrice[]{price};

			TAttribute attr             = new TAttribute();
			    attr.Name               = "AvailabilityDate";
                attr.Type = "DateTime";
                attr.Value = "2005-12-24T10:00:00";
			Product_in.Attributes       = new TAttribute[]{attr};


            Product_update.Path             = path + alias;
			TLocalizedValue name_de_update  = new TLocalizedValue();
			    name_de_update.LanguageCode = "de";
			    name_de_update.Value        = "verändertes Test-Hauptprodukt";
			TLocalizedValue name_en_update  = new TLocalizedValue();
			    name_en_update.LanguageCode = "en";
			    name_en_update.Value        = "updated test master product";
			Product_update.Name             = new TLocalizedValue[]{name_de_update, name_en_update};

            Product_update.IsVisible        = true;         Product_update.IsVisibleSpecified           = true;
            Product_update.IsNew            = true;         Product_update.IsNewSpecified               = true;
            Product_update.PriceQuantity    = (float)1;     Product_update.PriceQuantitySpecified       = true;
            Product_update.MinOrder         = (float)1;     Product_update.MinOrderSpecified            = true;
            Product_update.IntervalOrder    = (float)1;     Product_update.IntervalOrderSpecified       = true;

            Product_update.Weight           = (float)240;   Product_update.WeightSpecified              = true;
            Product_update.RefAmount        = (float)1;     Product_update.RefAmountSpecified           = true;
            Product_update.RefContentAmount = (float)0.240; Product_update.RefContentAmountSpecified    = true;

            Product_update.StockLevel       = (float)140;   Product_update.StockLevelSpecified          = true;
            Product_update.StockLevelAlert  = (float)100;   Product_update.StockLevelAlertSpecified     = true;

			TProductPrice price_update      = new TProductPrice();
			    price_update.Price          = (float)123.50;
			    price_update.CurrencyID     = "EUR";
			    price_update.TaxModel       = "gross";
			Product_update.ProductPrices    = new TProductPrice[]{price_update};

			TAttribute attr_update          = new TAttribute();
			    attr_update.Name            = "AvailabilityDate";
                attr_update.Type = "DateTime";
                attr_update.Value = "2005-12-24T18:00:00";
			Product_update.Attributes       = new TAttribute[]{attr_update};
		}