public ActionResult Index(int?page, string SearchString) { int pageNum = page ?? 1; var entity = Dao.ListAll().ToList(); if (!string.IsNullOrEmpty(SearchString)) { return(View(entity.Where(x => x.Text.Contains(SearchString) || x.Url.Contains(SearchString)).OrderBy(x => x.TypeId).OrderBy(x => x.Order).ToPagedList(pageNum, 20))); } else { return(View(entity.OrderBy(x => x.TypeId).OrderBy(x => x.Order).ToPagedList(pageNum, 20))); } }
// GET: Admin/Menu public ActionResult Index() { SetStatusViewBag(); var dao = new MenuDao(); var model = dao.ListAll(); return(View(model)); }