public PagingResult <Member> GetPagingMemberList(MemberSearchFilter filter)
        {
            var session = GetSession();
            var query   = session.QueryOver <Member>();

            if (!String.IsNullOrEmpty(filter.Account))
            {
                query.And(o => o.Account.IsLike(filter.Account, MatchMode.Anywhere));
            }
            query.And(o => o.CreateTime >= filter.BeginDate && o.CreateTime <= filter.EndDate);

            var list = query
                       .OrderBy(o => o.MemberId).Desc()
                       .Skip(filter.PageIndex * filter.PageSize)
                       .Take(filter.PageSize)
                       .List();

            PagingResult <Member> result = new PagingResult <Member>(query.RowCount());

            result.AddRange(list);
            return(result);
        }
Beispiel #2
0
        public virtual PagingResult <Member> GetMemberPaging(MemberSearchFilter filter)
        {
            var result = memberRepository.GetPagingMemberList(filter);

            return(result);
        }