Exemple #1
0
        private void AddMenuItem()
        {
            Console.Clear();

            Console.WriteLine("Enter a name for this meal:");
            string mealName = Console.ReadLine();

            Console.WriteLine("Enter a description for this meal:");
            string mealDescription = Console.ReadLine();

            Console.WriteLine("Enter the ingredients that are in this meal:");
            string mealIngredients = Console.ReadLine();

            Console.WriteLine("Enter a price for this meal:");
            string  mealPriceString = Console.ReadLine();
            decimal mealPrice       = Convert.ToDecimal(mealPriceString);

            MealContent newContent = new MealContent(mealName, mealDescription, mealIngredients, mealPrice);

            //  Add meal to directory

            bool mealWasAdded = _repo.AddMenuItem(newContent);

            if (mealWasAdded)
            {
                Console.WriteLine("Meal added to directory");
            }
            else
            {
                Console.WriteLine("There was an error adding the meal");
            }

            Console.WriteLine("Press any key to continue...");
            Console.ReadLine();
        }
Exemple #2
0
        private void SeedContent()
        {
            MealContent cheeseBurger      = new MealContent("Cheese Burger", "Basic burger with cheese", "Meat, buns, lettuce, tomato, ketchup, cheese, mayo", 10.00m);
            MealContent baconCheeseBurger = new MealContent("Bacon Cheese Burger", "Basic burger with cheese and BACON!!!", "Meat, bun, lettuce, tomato, ketchup, cheese, mayo, BACON!!", 13.00m);
            MealContent chickenFingers    = new MealContent("Chicken Fingers", "Strips of chicken", "Chicken", 7.50m);

            _repo.AddMenuItem(cheeseBurger);
            _repo.AddMenuItem(baconCheeseBurger);
            _repo.AddMenuItem(chickenFingers);
        }
Exemple #3
0
        public bool AddMenuItem(MealContent content)
        {
            int startingCount = _contentDirectory.Count;

            _contentDirectory.Add(content);

            bool wasAdded = (_contentDirectory.Count > startingCount);

            return(wasAdded);
        }