public ActionResult Index(int?page) { int pageIndex = PagingHelper.GetPageIndex(page); RequirementSearchModel q = new RequirementSearchModel(); IRequirementService rs = new RequirementService(Settings.Default.db); IPagedList <Requirement> requirements = rs.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize); ViewBag.Query = q; SetRequirementStatusList(null); return(View(requirements)); }
public ActionResult Search([Bind(Include = "PartNr,OrderedDateFrom,OrderedDateTo,RequiredTimeFrom,RequiredTimeTo,QuantityFrom,QuantityTo,Status,DerivedFrom,DerivedType,OrderNr")] RequirementSearchModel q) { int pageIndex = 0; int.TryParse(Request.QueryString.Get("page"), out pageIndex); pageIndex = PagingHelper.GetPageIndex(pageIndex); IRequirementService rs = new RequirementService(Settings.Default.db); IPagedList <Requirement> requirements = rs.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize); ViewBag.Query = q; SetRequirementStatusList(q.Status); return(View("Index", requirements)); }