// GET: Search public ActionResult SearchProduct(string keyword, int page = 1) { ViewBag.Keyword = keyword; List <ClientProduct> listPro = new List <ClientProduct>(); Dictionary <string, object> result = CSDLQLBH.GetPagedProducts(keyword: keyword, page: page, pageSize: nPerPage); ViewBag.totalPage = result["totalPage"]; ViewBag.curPage = result["curPage"]; listPro = result["Collection"] as List <ClientProduct>; return(View("Search", listPro)); }
public ActionResult GetListByCategorySX(int?id, int page = 1) { if (!id.HasValue) { return(RedirectToAction("Index", "Home")); } Dictionary <string, object> result = CSDLQLBH.GetPagedProducts(filter: "ProducerID =" + id, page: page, pageSize: nPerPage); ViewBag.totalPage = result["totalPage"]; ViewBag.curPage = result["curPage"]; ViewBag.cId = id; var l = result["Collection"] as List <ClientProduct>; return(View("ListByCategory", l)); }