예제 #1
0
        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));
        }
예제 #2
0
        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);
            }
        }