Example #1
0
        public ActionResult Index(int pageIndex = 1)
        {
            var key        = Request.QueryString["CategoryKey"];
            var pageEntity = PageListHepler.BuildPageEntity(pageIndex, 8, "ContentId", "DESC");
            var category   = _categoryBll.Query(key, false);

            if (category == null)
            {
                throw new ArgumentNullException(nameof(category));
            }

            var data = _contentBll.Page(pageEntity, category.CategoryId, category.ListJson);

            var timeFormat = new IsoDateTimeConverter {
                DateTimeFormat = "yyyy-MM-dd HH:mm:ss"
            };

            ViewBag.Data         = JsonConvert.SerializeObject(data, Formatting.Indented, timeFormat);
            ViewBag.ListHead     = category.ListHead;
            ViewBag.ListTempalte = category.ListTempalte;
            ViewBag.CategoryId   = category.CategoryId;

            var page = PageListHepler.BuildPagedList(data, pageEntity);

            return(View(page));
        }
Example #2
0
        public ActionResult Index(int pageIndex = 1)
        {
            var pageEntity = PageListHepler.BuildPageEntity(pageIndex, 8, "ModelId", "ASC");
            var data       = _modelBll.Page(pageEntity);

            var page = PageListHepler.BuildPagedList(data, pageEntity);

            return(View(page));
        }