Exemple #1
0
        public ActionResult GetActionByPage()
        {
            int pageSize  = int.Parse(Request["limit"] ?? "10");
            int pageIndex = int.Parse(Request["page"] ?? "1");
            int count     = 0;
            //条件
            Expression <Func <ActionInfo, bool> > WhereLambda = u => u.DelFlag == 1;
            //排序条件
            Expression <Func <ActionInfo, DateTime> > OrderbyLambda = u => u.Subtime;
            var olddata = ActionInfoService.GetEntitiesByPage(pageSize, pageIndex, out count, WhereLambda, OrderbyLambda, false);
            var data    = olddata.Select(a => new
            {
                a.ActionName,
                a.DelFlag,
                a.HttpMethod,
                a.Id,
                a.IsMenu,
                a.MenuIcon,
                a.Remark,
                a.Sort,
                a.Subtime,
                a.Url
            });
            var jsondata = new { Status.code, count, data };

            return(Json(jsondata, JsonRequestBehavior.AllowGet));
        }