Exemple #1
0
        // GET: Home
        public ActionResult Index()
        {
            var telephoneBook = new TelephoneBook();

            ViewBag.Contacts = telephoneBook.GetContacts();

            return(View());
        }
Exemple #2
0
        public ActionResult Search(string ln)
        {
            var telephoneBook = new TelephoneBook();

            if (string.IsNullOrEmpty(ln))
            {
                ViewBag.Contacts = telephoneBook.GetContacts();
            }
            else
            {
                ViewBag.Contacts = telephoneBook.GetContactsByLastName(ln);
            }

            return(View());
        }