Пример #1
0
        public void AddMealByName()
        {
            Console.Clear();

            Console.WriteLine("Name the meal you would like to add:");
            string name = Console.ReadLine();

            Console.WriteLine("Enter a number for your meal:");
            string numberAsString = Console.ReadLine();
            int    number         = Int32.Parse(numberAsString);

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

            Console.WriteLine("List ingredenits for your meal:");
            string ingredients = Console.ReadLine();

            Console.WriteLine("Enter a price for your meal:");
            string  priceAsString = Console.ReadLine();
            decimal price         = Decimal.Parse(priceAsString);

            CafeMenu meal = new CafeMenu(name, number, description, ingredients, price);

            Console.WriteLine($"Here are the details for your meal:\r\n" +
                              $"Meal Name: {meal.Name} \r\n" +
                              $"Meal Number: {meal.Number} \r\n" +
                              $"Description: {meal.Description} \r\n" +
                              $"Ingredients: {meal.Ingredients} \r\n" +
                              $"Price: {meal.Price}");

            _menuRepo.AddMealByName(meal);

            Console.WriteLine("Your Meal has been successfully added!");

            Console.ReadLine();
        }