public PartialViewResult _SanPham(int pageNumber = 1, int pageSize = 10, string keyText = "") { List <SanPhamDAO> list = new List <SanPhamDAO>(); try { List <LoaiSanPhamDAO> productType = LoaiSanPham_Service.GetAll(); Hashtable hs = new Hashtable(); for (int i = 0; i < productType.Count; i++) { hs.Add(productType[i].MaLoaiSanPham, productType[i].TenLoaiSanPham); } ViewBag.listProductTypes = hs; int totalEntries; list = SanPham_Service.GetAllBy(pageNumber, pageSize, keyText, out totalEntries); ViewBag.maxNumber = Math.Ceiling(totalEntries / (double)pageSize); ViewBag.pageNumber = pageNumber; ViewBag.pageSize = pageSize; TempData["products"] = list; TempData["productType"] = productType; TempData.Keep(); } catch (Exception e) { throw e; } return(PartialView(list)); }
public ActionResult MenuPartial() { List <LoaiSanPhamDAO> lstLSP = LoaiSanPham_Service.GetAll(); return(PartialView(lstLSP)); }
// GET: MenuProduct public ActionResult LoaiSanPham() { List <LoaiSanPhamDAO> lstLSP = LoaiSanPham_Service.GetAll(); return(View(lstLSP)); }