Пример #1
0
        /// <summary>
        /// 截图列表
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public ActionResult Index(int?page)
        {
            PageIndex = page ?? 1;
            PageSize  = 10;

            var predicate = PredicateBuilder.True <ScreenShot>().And(i => i.IsValid == true);

            var BLL  = new ScreenShotBLL();
            var list = BLL.GetPagedList(PageIndex, PageSize, predicate, i => i.ID, false);

            var rowCount  = BLL.GetCount(predicate);;
            var pageCount = Convert.ToInt32(Math.Ceiling(rowCount * 1.0 / PageSize));
            var pagedHtml = HtmlCommon.GetPagedHtml(PageIndex, pageCount, "",
                                                    string.Format("&keyword={0}", ""));

            ViewBag.Data = new
            {
                PageIndex = PageIndex,
                PageSize  = PageSize,
                PageCount = pageCount,
                PagedHtml = pagedHtml,
                RowCount  = rowCount
            }.ToExpando();

            return(View(list));
        }
Пример #2
0
        /// <summary>
        /// 获取图片分页列表
        /// </summary>
        /// <param name="page"></param>
        /// <returns></returns>
        public JsonResult GetPagedPicList(int page)
        {
            PageIndex = page;
            PageSize  = 6;

            var json      = new JsonModel();
            var predicate = PredicateBuilder.True <ScreenShot>().And(i => i.IsValid == true);

            var BLL  = new ScreenShotBLL();
            var list = BLL.GetPagedList(PageIndex, PageSize, predicate, i => i.ID, false);

            json.Status = "success";
            json.Data   = list;

            return(Json(json));
        }
Пример #3
0
        /// <summary>
        /// 截图展示页面视图
        /// </summary>
        /// <returns></returns>
        public ActionResult Index()
        {
            PageIndex = 1;
            PageSize  = 6;

            var predicate = PredicateBuilder.True <ScreenShot>().And(i => i.IsValid == true);

            var BLL       = new ScreenShotBLL();
            var list      = BLL.GetPagedList(PageIndex, PageSize, predicate, i => i.ID, false);
            var rowCount  = BLL.GetCount(predicate);;
            var pageCount = Convert.ToInt32(Math.Ceiling(rowCount * 1.0 / PageSize));

            ViewBag.Data = new
            {
                PageCount = pageCount
            }.ToExpando();

            return(View(list));
        }