public IQueryable <ActionInfo> LoadPageData(Model.Param.ActionQueryParam actionQueryParam)
        {
            var temp = CurrentDal.GetEntities(u => u.DelFlag == (short)DelFlagEnum.Normal);

            if (!string.IsNullOrEmpty(actionQueryParam.SrchName))
            {
                temp = temp.Where(u => u.ActionName.Contains(actionQueryParam.SrchName));
            }

            if (!string.IsNullOrEmpty(actionQueryParam.SrchRemark))
            {
                temp = temp.Where(u => u.Remark.Contains(actionQueryParam.SrchRemark));
            }

            actionQueryParam.Total = temp.Count();

            // Pagination
            return(temp.OrderBy(u => u.Id)
                   .Skip(actionQueryParam.PageSize * (actionQueryParam.PageIndex - 1))
                   .Take(actionQueryParam.PageSize).AsQueryable());
        }
Beispiel #2
0
        public IQueryable <ActionInfo> LoagPageData(Model.Param.ActionQueryParam actionQueryParam)
        {
            short normalFlag = (short)Moshang.OA.Model.Enum.DelFlagEnum.Normal;

            var temp = DbSession.ActionInfoDal.GetEntities(a => a.DelFlag == normalFlag);

            //过滤
            if (!string.IsNullOrEmpty(actionQueryParam.SchName))
            {
                temp = temp.Where(a => a.ActionName.Contains(actionQueryParam.SchName)).AsQueryable();
            }

            if (!string.IsNullOrEmpty(actionQueryParam.SchRemark))
            {
                temp = temp.Where(a => a.Remark.Contains(actionQueryParam.SchRemark)).AsQueryable();
            }

            actionQueryParam.Total = temp.Count();

            //分页
            return(temp.OrderBy(u => u.ID)
                   .Skip(actionQueryParam.PageSize * (actionQueryParam.PageIndex - 1))
                   .Take(actionQueryParam.PageSize).AsQueryable());
        }