Ejemplo n.º 1
0
        // 分页查询 id为页码,按条件查询也写在这里面
        public ActionResult List(string TID, string title, int id = 1)
        {
            string where = null;
            where        = TID != null ? "TID=" + TID : null;
            if (title != null && title.Length > 0)
            {
                where += (where != null ? " and " : "") + "title like '%" + title + "%'";
            }

            ViewModel <Types> model = new ViewModel <Types>();

            model.PageSize  = 15;
            model.PageIndex = id;
            model.List      = Dal.SelPage(id, model.PageSize, where, "ID DESC");
            model.DataCount = Dal.SelCount(where);
            return(View(model));
        }