Esempio n. 1
0
        public ActionResult Show(int id = 0, int page = 1)
        {
            ViewBag.MenuId = Utility.GetMenuId(0);
            ViewBag.NewsId = id;
            Utility.GetModelState(this);
            IEnumerable <PhotoEntry> list = new List <PhotoEntry>();

            if (id > 0)
            {
                var model = new PageModel
                {
                    Filter    = "Where 1=1 AND NewsId = " + id,
                    PageIndex = page,
                    PageSize  = 8
                };

                list = _photo.GetList(model);
                Pagination.NewPager(this, page, (int)model.Records, 8);
            }

            return(View(list));
        }
Esempio n. 2
0
 /// <summary>
 /// 根据条件获取列表 GetList(string strWhere,string orderBy=null)
 /// </summary>
 /// <param name="strWhere">strWhere</param>
 /// <param name="orderBy">orderBy</param>
 /// <returns>返回List(PhotoInfo)类型数据,未查询到数据则返回null</returns>
 public List <PhotoInfo> GetList(string strWhere, string orderBy = null)
 {
     return(_photo.GetList(strWhere, orderBy));
 }