public ActionResult Index(int?page) { int pageIndex = PagingHelper.GetPageIndex(page); MRPSearchModel q = new MRPSearchModel(); ICalculateService cs = new CalculateService(Settings.Default.db); IPagedList <MrpRound> rounds = cs.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize); ViewBag.Query = q; SetMrpRoundStatusList(null); return(View(rounds)); }
public ActionResult Search([Bind(Include = "MrpRoundId,RunningStatus,TimeFrom,TimeTo,Launcher")] MRPSearchModel q) { int pageIndex = 0; int.TryParse(Request.QueryString.Get("page"), out pageIndex); pageIndex = PagingHelper.GetPageIndex(pageIndex); ICalculateService cs = new CalculateService(Settings.Default.db); IPagedList <MrpRound> rounds = cs.Search(q).ToPagedList(pageIndex, Settings.Default.pageSize); ViewBag.Query = q; SetMrpRoundStatusList(null); return(View("Index", rounds)); }