public ActionResult List(int page = 1) { int cateID = Request.Form["cate"].ToInt32(0); int pageSize = 100; var list = FunsService.GetList(page, pageSize, cateID); ViewBag.Total = list.TotalItem; ViewBag.PageIndex = page; ViewBag.TotalPages = Math.Ceiling(list.TotalItem * 1.0 / pageSize); ViewBag.Cates = FunsCateService.GetList(false); ViewBag.CurrentCateID = cateID; return(View(list.Data)); }
public FunsContainer() { List <Funs> funs = null; string key = AppConfig.FunsContainerKey; funs = AppCaches.AppGet <List <Funs> >(key); if (funs == null) { funs = FunsService.GetList(); } if (funs != null && funs.Any()) { foreach (Funs item in funs) { this.Add(item.Url.ToLower(), item); } AppCaches.AppSet(key, funs); } }