Esempio n. 1
0
        static void Main(string[] args)
        {
            PhoneBook Codegym = new PhoneBook();
            int       option  = 0;

            do
            {
                Console.WriteLine("____________________________");
                Console.WriteLine("PhoneBook Management System");
                Console.WriteLine("1. Add Contact");
                Console.WriteLine("2. Update Contact");
                Console.WriteLine("3. Remove Contact");
                Console.WriteLine("4. Search Contact");
                Console.WriteLine("5. Show Contacts");
                Console.WriteLine("6. Exit");
                Console.WriteLine("____________________________");
                Console.Write("Your choice: ");
                if (int.TryParse(Console.ReadLine(), out int n))
                {
                    option = n;
                }
                Process(option, ref Codegym);
            } while (option != 6);
        }
Esempio n. 2
0
 static void ShowContacts(PhoneBook contacts)
 {
     Console.WriteLine(contacts.ShowContacts());
 }