コード例 #1
0
        public ActionResult Display(FormCollection form)
        {
            string searchTerm = form["searchTerm"];

            if (searchTerm == "")
            {
                return(RedirectToAction("/display"));
            }

            //search and return employees with the 'serachTerm' name
            List <Employee> empList = DummyData.Employees().Where(x => x.EmployeeName.Contains(searchTerm)).ToList();

            return(View(empList));
        }
コード例 #2
0
        public ActionResult Display()
        {
            List <Employee> empList = DummyData.Employees();

            return(View(empList));
        }