Пример #1
0
        public void CreateAndAddMealToMenu()
        {
            Console.Write("Enter the number on the badge: ");
            int badgeID = int.Parse(Console.ReadLine());



            Console.WriteLine("What is the description of the meal?");
            string mealDescription = Console.ReadLine();

            Console.WriteLine("What are the ingrdients in this meal?");
            string mealIndgrediants = Console.ReadLine();

            Console.WriteLine("What meal type is this?\n" +
                              "1. Breakfast\n" +
                              "2. Lunch\n" +
                              "3. Dinner");
            string mealTypeAsString = Console.ReadLine();
            int    mealTypeAsInt    = int.Parse(mealTypeAsString);

            MenuType menu = (MenuType)mealTypeAsInt;

            Console.WriteLine("What is the price of the meal?");
            string  mealPriceAsString = Console.ReadLine();
            decimal mealPrice         = decimal.Parse(mealPriceAsString);

            // these lines are making a meal or a "crate". That is the first line the second line is sending it to the "warehouse" or repository.
            Meal newMenuItem = new Meal(menu, mealName, mealNumber, mealDescription, mealIndgrediants, mealPrice);

            _MenuRepo.AddItemToMenu(newMenuItem);
        }
Пример #2
0
        public void CreateMenuItem()
        {
            Console.WriteLine("Please enter the number you would like to assign to this meal.");
            int mealNumber = int.Parse(Console.ReadLine());

            Console.WriteLine("Please enter the name of the meal.");
            string mealName = Console.ReadLine();

            Console.WriteLine("Enter all of the ingredients for this meal");

            List <string> ingredients = new List <string>();

            Console.WriteLine("Please enter an ingredient.");

            bool addMore = true;

            while (addMore)
            {
                string input = Console.ReadLine();

                if (input == "no")
                {
                    addMore = false;
                }
                else
                {
                    addMore = true;
                }

                ingredients.Add(input);
                Console.WriteLine("Would you like to enter another ingredient?");
            }


            Console.WriteLine("Enter the a description.");
            string description = Console.ReadLine();

            Console.WriteLine("Please enter the price.");
            decimal price = decimal.Parse(Console.ReadLine());

            MenuItems menuItem = new MenuItems(mealNumber, mealName, description, ingredients, price);

            _menuRepository.AddItemToMenu(menuItem);

            Console.WriteLine($"\"{menuItem.MealName}\" added to list.");
            Console.ReadKey();
        }
Пример #3
0
        private void AddMenuItem()
        {
            Console.WriteLine("Enter the meal number:\n");
            string mealNumber = Console.ReadLine();

            Console.WriteLine("Please enter the meal name:\n");
            string mealName = Console.ReadLine();

            Console.WriteLine("Please enter description:\n");
            string description = Console.ReadLine();

            Console.WriteLine("Please enter ingredients:\n");
            string ingredients = Console.ReadLine();

            Console.WriteLine("Please enter price:\n");
            decimal orderPrice = decimal.Parse(Console.ReadLine());
            Menu    menuItem   = new Menu(mealNumber, mealName, description, ingredients, orderPrice);

            _menuRepo.AddItemToMenu(menuItem);

            Console.WriteLine($"\"{menuItem.MealNumber}\" added to the menu. press any key to continue");
            Console.ReadKey();
        }