public ActionResult Index() { ItemSearchModel Model = new ItemSearchModel(); if (Session[ScreenController] != null) { Model = (ItemSearchModel)Session[ScreenController]; Model.searchResultModel = new List <ItemViewModel>(); Model.searchResultModel = _categoryBL.Search(Model).ToPagedList(1, 100); } else { Model.searchResultModel = new List <ItemViewModel>().ToPagedList(1, 100); } ViewBag.Parent = new SelectList(_categoryBL.GetListCategory(true), "id", "name"); return(View(Model)); }
public ActionResult Index() { ItemSearchModel Model = new ItemSearchModel(); if (Session[ScreenController] != null) { Model = (ItemSearchModel)Session[ScreenController]; int Count = _itemBL.Count(Model); Model.searchResultModel = new List <ItemViewModel>(); Model.searchResultModel = _itemBL.Search(Model); Model.searchResultModel = new StaticPagedList <ItemViewModel>(Model.searchResultModel, 1, 200, Count); } else { Model.searchResultModel = new List <ItemViewModel>(); Model.searchResultModel = new StaticPagedList <ItemViewModel>(Model.searchResultModel, 1, 200, 0); } ViewBag.Parent = new SelectList(_itemBL.GetListCategory(true), "id", "name"); ViewBag.No = 0; return(View(Model)); }