예제 #1
0
        public bool ListByDept(string keyword, ref PageModel p, ref List <TASM_USER> list)
        {
            list = CurrentDb.GetPageList(it => it.USER_NAME.Contains(keyword) || it.WORK_ID.Contains(keyword) ||
                                         it.DEPARTMENT.Contains(keyword) ||
                                         it.DEPT2.Contains(keyword) ||
                                         it.DEPT3.Contains(keyword) ||
                                         it.DEPT4.Contains(keyword) ||
                                         it.DEPT5.Contains(keyword)
                                         , p, it => it.WORK_ID, OrderByType.Asc);

            return(list.Count > 0);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public List <News> Query(string channelId,
                                 int type,
                                 ref int totalCount,
                                 int pageSize  = 12,
                                 int pageIndex = 1)
        {
            var pageModel = new PageModel {
                PageIndex = pageIndex, PageSize = pageSize
            };
            //var list = CurrentDb.GetPageList(x => x.ChannelId == channelId, pageModel, x => x.Date, OrderByType.Desc);
            var list = CurrentDb.GetPageList(x => x.Type == type, pageModel, x => x.Date, OrderByType.Desc);

            totalCount = pageModel.PageCount;

            return(list);
        }
예제 #3
0
 /// <summary>
 /// 根据表达式查询分页并排序
 /// </summary>
 /// <param name="whereExpression">it</param>
 /// <param name="pageModel"></param>
 /// <param name="orderByExpression">it=>it.id或者it=>new{it.id,it.name}</param>
 /// <param name="orderByType">OrderByType.Desc</param>
 /// <returns></returns>
 public virtual List <T> GetPageList(Expression <Func <T, bool> > whereExpression, PageModel pageModel, Expression <Func <T, object> > orderByExpression = null, OrderByType orderByType = OrderByType.Asc)
 {
     return(CurrentDb.GetPageList(whereExpression, pageModel, orderByExpression, orderByType));
 }
예제 #4
0
 /// <summary>
 /// 根据表达式查询分页
 /// </summary>
 /// <returns></returns>
 public virtual List <T> GetPageList(Expression <Func <T, bool> > whereExpression, PageModel pageModel)
 {
     return(CurrentDb.GetPageList(whereExpression, pageModel));
 }
예제 #5
0
 /// <summary>
 /// 根据表达式查询分页
 /// </summary>
 /// <returns></returns>
 public virtual List <T> GetPageList(List <IConditionalModel> conditionalModels, PageModel pageModel)
 {
     return(CurrentDb.GetPageList(conditionalModels, pageModel));
 }