Пример #1
0
        //Create
        private void CreateNewMenuItem()
        {
            MenuItems newMenuItems = new MenuItems();

            //Meal Name
            Console.WriteLine("Enter the name of the meal:");
            newMenuItems.MealName = Console.ReadLine();
            //Meal Number
            Console.WriteLine("Enter the meal number ex: a #5 please");
            string mealNumberAsString = Console.ReadLine();

            newMenuItems.MealNumber = int.Parse(mealNumberAsString);
            //Item Description
            Console.WriteLine("Enter the meal description");
            newMenuItems.ItemDescription = Console.ReadLine();
            //Price
            Console.WriteLine("Enter the price of the meal");
            string priceAsString = Console.ReadLine();

            newMenuItems.Price = decimal.Parse(priceAsString);
            //Ingredients
            Console.WriteLine("Enter the ingredients used");
            newMenuItems.Ingredients = Console.ReadLine();

            _menuItemsRepo.AddMenuItemToList(newMenuItems);
        }
Пример #2
0
        //create new menu item
        private void AddNewMenuItem()
        {
            Console.Clear();
            MenuItems newContent = new MenuItems();

            Console.WriteLine("Enter the Item Number for the Menu Item:");
            string itemNoAsString = Console.ReadLine();

            newContent.ItemNo = int.Parse(itemNoAsString);

            Console.WriteLine("Enter the name of the meal you want to add:");
            newContent.MealName = Console.ReadLine();

            Console.WriteLine("Enter the description of this Meal Item:");
            newContent.MealDesc = Console.ReadLine();

            Console.WriteLine("What are the ingredients of this Meal Item?");

            newContent.ItemIngredients = Console.ReadLine();

            Console.WriteLine("What is the price of this meal item?");
            string priceOfMealItem = Console.ReadLine();

            newContent.Price = decimal.Parse(priceOfMealItem);

            _menuItemRepo.AddMenuItemToList(newContent);
        }
Пример #3
0
        public void AddMenuItem()
        {
            MenuItems menuItem1 = new MenuItems(1, "meal1", "Meal1 Description", "ingred1, ingred2, ingred3, ingred4", 3.25m);

            menuOperations.AddMenuItemToList(menuItem1);

            MenuItems menuItem2 = new MenuItems(2, "meal2", "Meal2 Description", "ingred2.1, ingred2.2, ingred2.3, ingred2.4", 3.50m);

            menuOperations.AddMenuItemToList(menuItem2);
        }