public static void DetailContact(Contact contact)
        {
            DetailContactView.Show(contact);
            bool flag = true;

            while (flag)
            {
                switch (Console.ReadKey().Key)
                {
                case ConsoleKey.Insert:
                    ChangeContactController.ChangeContact(contact);
                    flag = false;
                    break;

                case ConsoleKey.Delete:
                    DetailContactView.DeleteContact(Model.DeleteContact(contact));
                    Console.ReadKey();
                    MainMenuController.Menu();
                    flag = false;
                    break;

                case ConsoleKey.Enter:
                    MainMenuController.Menu();
                    flag = false;
                    break;

                default:
                    Page.ErrorMessage(0);
                    break;
                }
            }
        }
Esempio n. 2
0
        public static void Contacts(string[] expression = null)
        {
            List <Contact> contacts      = Model.GetContacts(expression);
            int            contactNumber = ContactsView.Show(contacts);

            if (contactNumber > 0)
            {
                DetailContactController.DetailContact(contacts.ElementAt(contactNumber - 1));
            }
            else
            {
                MainMenuController.Menu();
            }
        }