コード例 #1
0
        public void Menu()
        {
            int flag = 1;

            while (flag != 0)
            {
                Console.WriteLine("\nType keywords to perform Action\n Add \tDisplay \tUpdate \tSearch \tDelete \tExit");
                string choice = Console.ReadLine();
                switch (choice.ToLower())
                {
                case "add":
                    contactDB.Insert(ContactDetails());
                    break;

                case "display":
                    contactDB.Display();
                    break;

                case "update": Console.WriteLine("Enter the name whose Constact is to be Updated");
                    contactDB.Update(Console.ReadLine());
                    break;

                case "search": contactDB.SearchByName(Console.ReadLine());
                    break;

                case "delete": contactDB.Delete(Console.ReadLine());
                    break;

                case "exit":
                    flag = 0;
                    break;

                default: Console.WriteLine("Enter Proper KeyWord");
                    break;
                }
            }
        }