Beispiel #1
0
        private void removeFromListBySpecification()
        {
            displayList();  // Show all listed menus first!

            Console.WriteLine("Please type the menu number you want to delete:\n");
            string input      = Console.ReadLine();
            int    mealNumber = int.Parse(input);

            Console.WriteLine("Please type the menu name you want to delete:\n");
            string mealName = Console.ReadLine();

            bool success = _menuRepository.RemoveBySpecification(mealName, mealNumber);

            if (success == true)
            {
                Console.WriteLine($"\n {mealName} Meal No. {mealNumber} Successfully Removed From List " +
                                  "\n---Please hit enter to continue!");
                DeletedSound();
                Run();
            }
            else
            {
                Console.WriteLine($"\n Sorry, we are unable to remove {mealName}, Meal No. {mealNumber} from List ");
                NotDeletedSound();
                Console.ReadKey();
            }
        }