public void CreateMultipleAddressBook()
        {
            while (true)
            {
                Console.WriteLine("Enter your Choice");
                Console.WriteLine("1.Add Address Book");
                Console.WriteLine("2.Exit");

                String choice  = Console.ReadLine();
                int    choice1 = Convert.ToInt32(choice);
                switch (choice1)
                {
                case 1:
                    Console.WriteLine("Enter the Name of Address Book");
                    string name = Console.ReadLine();
                    if (contacts.ContainsKey(name))
                    {
                        Console.WriteLine("Already exists...");
                    }
                    else
                    {
                        addDetails details = new addDetails();
                        contacts.Add(name, addressBook);
                        Console.WriteLine("Address Book is Created...");
                        details.DisplayMenu();
                    }
                    break;

                case 2:
                    return;
                }
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            //Asks the user to select the choice
            Console.WriteLine("---Welcome to Address Book---");
            addDetails newDetails = new addDetails();

            newDetails.CreateMultipleAddressBook();
        }