Example #1
0
        static void Main(string[] args)
        {
            PhoneBookManager manager = PhoneBookManager.CreatInstance();

            manager.LoadData();

            while (true)
            {
                try
                {
                    manager.ShowMenu();
                    int choice = int.Parse(Console.ReadLine());

                    switch (choice)
                    {
                    case 1: manager.InputData(); break;

                    case 2: manager.ListData(); break;

                    case 3: manager.SearchData(); break;

                    case 4: manager.DeleteData(); break;

                    case 5: manager.SortDate(); break;

                    case 6: manager.SaveData(); Console.WriteLine("프로그램을 종료합니다"); return;
                    }
                }

                catch (Exception err)
                {
                    Console.WriteLine(err.Message);
                    Console.WriteLine();
                }
            }
        }