예제 #1
0
        public static void Main(string[] args)
        {
            PhoneBook phoneBook = new PhoneBook();

            phoneBook.insertPhone("Dat", "0998999999");
            phoneBook.insertPhone("Nam", "0988888888");
            phoneBook.insertPhone("Viet", "0911111111");
            phoneBook.removePhone("Viet");
            phoneBook.updatePhone("Dat", "0989797979");
            phoneBook.insertPhone("Nam", "0779999999");
            phoneBook.show();
            Console.WriteLine("Phone Search :");
            phoneBook.searchPhone("Dat");
        }
예제 #2
0
        public static void Main(string[] args)
        {
            List <PhoneBook> PhoneList = new List <PhoneBook>();
            PhoneBook        a         = new PhoneBook();

            PhoneList.Add(new PhoneBook("le nhat hoang", "0394134127"));
            Console.WriteLine("danh sach");
            foreach (PhoneBook x in PhoneList)
            {
                x.Showlist();
            }

            a.InsertPhone("le thi quynh trang", "0968923122");
            a.RemovePhone("le nhat hoang");
            a.SearchPhone("le thi quynh trang");
            a.UpdatePhone("le thi quynh trang", "1999");
            Console.WriteLine("danh sach sau update");
            foreach (PhoneBook x in PhoneList)
            {
                x.Showlist();
            }
        }