Exemplo n.º 1
0
        //获取权限信息
        public ActionResult GetActionInfo()
        {
            int    pageIndex  = Request["page"] == null ? 1 : int.Parse(Request["page"]);
            int    pageSize   = Request["rows"] == null ? 10 : int.Parse(Request["rows"]);
            int    total      = 0;
            string Remark     = Request["Remark"];
            string HttpMethd  = Request["HttpMethd"];
            string ActionName = Request["ActionName"];
            ActionInfoSearchParms actionInfoSearchParms = new ActionInfoSearchParms()
            {
                pageIndex  = pageIndex,
                pageSize   = pageSize,
                total      = total,
                Remark     = Remark,
                HttpMethd  = HttpMethd,
                ActionName = ActionName
            };
            var ActionInfos = ActionInfoService.GetPageEntityBySearch(actionInfoSearchParms);

            return(Content(SerializerHelper.SerializerToString(new { rows = ActionInfos, total = actionInfoSearchParms.total })));
        }
Exemplo n.º 2
0
        public IQueryable <ActionInfo> GetPageEntityBySearch(ActionInfoSearchParms actionInfoSearchParms)
        {
            short Normal = (short)DelFlagEnum.Normal;//正常状态
            //查询所有权限信息
            var temp = DBSession.ActionInfoDal.GetEntities(a => a.DelFlag == Normal);

            if (!string.IsNullOrEmpty(actionInfoSearchParms.Remark))
            {
                temp = temp.Where <ActionInfo>(a => a.Remark.Contains(actionInfoSearchParms.Remark));
            }
            if (!string.IsNullOrEmpty(actionInfoSearchParms.HttpMethd))
            {
                temp = temp.Where <ActionInfo>(a => a.HttpMethd.Contains(actionInfoSearchParms.HttpMethd.ToUpper()));
            }
            if (!string.IsNullOrEmpty(actionInfoSearchParms.ActionName))
            {
                temp = temp.Where <ActionInfo>(a => a.ActionName.Contains(actionInfoSearchParms.ActionName));
            }
            actionInfoSearchParms.total = temp.Count();//总条数
            return(temp.OrderBy(a => a.ID)
                   .Skip(actionInfoSearchParms.pageSize * (actionInfoSearchParms.pageIndex - 1))
                   .Take(actionInfoSearchParms.pageSize));
        }