public ActionResult Search(string meetingName, string reservationistName, DateTime?fromDate, DateTime?toDate, bool?canceled, int?pageIndex, string sortFieldName, bool?descending) { int totalRows; int index = pageIndex.HasValue ? (pageIndex.Value - 1) : 0; List <Meeting> result = EntityFinder.GetMeetingsSortedAndPaged(meetingName, reservationistName, fromDate, toDate, canceled, index, sortFieldName, descending, out totalRows); // 设置分页标签的数据模型 PagedNavigatorViewModel navigatorModel = new PagedNavigatorViewModel { TotalRows = totalRows, CurrentPageIndex = index + 1 }; ViewBag.PagedNavigatorModel = navigatorModel; return(View(result)); }
public ActionResult Index(string employeeName, string userName, string email, int?department, int?status, int?pageIndex, string sortFieldName, bool?descending) { ViewBag.Departments = new SelectList(db.Departments.ToList(), "DepartmentID", "DepartmentName"); int totalRows; int index = pageIndex.HasValue ? (pageIndex.Value - 1) : 0; List <Employee> result = EntityFinder.GetEmployeesSortedAndPaged( employeeName, userName, email, department, status, index, sortFieldName, descending, out totalRows); // 设置分页标签的数据模型 PagedNavigatorViewModel navigatorModel = new PagedNavigatorViewModel { TotalRows = totalRows, CurrentPageIndex = index + 1 }; ViewBag.PagedNavigatorModel = navigatorModel; return(View(result)); }