Exemplo n.º 1
0
        public ActionResult Index(int?page, CategorySearchModel Model)
        {
            Model.searchResultModel = new List <CategoryViewModel>();
            Model.searchResultModel = _categoryBL.Search(Model);
            int Count = _categoryBL.Count(Model);

            TempData["SearchCount"] = Count + " row(s)";
            if (page.HasValue && Session[ScreenController] != null)
            {
                Model = (CategorySearchModel)Session[ScreenController];
            }
            else
            {
                Session[ScreenController] = Model;
            }
            var pageNumber = (page ?? 1);

            ViewBag.No = (pageNumber - 1) * 200;
            var list = Model.searchResultModel.ToPagedList(pageNumber, 200);

            return(PartialView("ListCategory", list));
        }