Beispiel #1
0
        public void RemoveProduct(int productID)
        {
            var product = RecipeProducts.Find(p => p.ProductId == productID);

            if (product != null)
            {
                NoRecipeProducts.Add(product.Product);
                RecipeProducts.Remove(product);
            }
        }
Beispiel #2
0
        public void AddProduct(int productID)
        {
            var product = NoRecipeProducts.Find(p => p.ProductId == productID);

            if (product != null)
            {
                RecipeProducts.Add(new ProductRecipe {
                    ProductId = productID, RecipeId = RecipeId, Value = 0, Product = product
                });
                NoRecipeProducts.Remove(product);
            }
        }