Ejemplo n.º 1
0
        protected void AddRecipe(string name, string category)
        {
            string dishName, description, cooking;
            Dishes addDish = new Dishes(category);

            Console.WriteLine(name + " , you dicided to add new recipe in " + category);
            Console.WriteLine();
            Console.WriteLine("write name of your new " + category);
            dishName = Console.ReadLine();
            Console.WriteLine("write description of your new " + category);
            description = Console.ReadLine();
            Console.WriteLine("Describe step by step how to prepare your " + category);
            cooking = Console.ReadLine();
            Console.WriteLine();
            Console.WriteLine("Now we added ingredients");


            Recipe dish = new Recipe()
            {
                Categories  = category,
                Name        = dishName,
                Description = description,
                Cooking     = cooking,
                Ingredients = AddIngredients(name, category, dishName)
            };

            if (addDish.AddRecipe(dish) == true)
            {
                Console.WriteLine("We added your dish to " + category);
            }
            else
            {
                Console.WriteLine("Something went wrong");
            }
            Console.ReadLine();
        }