Account.DAL.ManifestDAL.GetManifest C# (CSharp) Method

GetManifest() public method

按起止日期获取消费明细
public GetManifest ( System.DateTime start, System.DateTime end ) : IEnumerable
start System.DateTime
end System.DateTime
return IEnumerable
        public IEnumerable<Manifest> GetManifest(DateTime start, DateTime end)
        {
            IPredicate[] predicates = new IPredicate[]
            {
                Predicates.Field<Manifest>(x => x.Date, Operator.Ge, start),
                Predicates.Field<Manifest>(x => x.Date, Operator.Lt, new DateTime(end.Year, end.Month, end.Day).AddDays(1))
            };
            IList<ISort> sorts = new List<ISort>()
            {
                Predicates.Sort<Manifest>(x => x.Date),
                Predicates.Sort<Manifest>(x => x.Cost)
            };

            return _database.GetList<Manifest>(Predicates.Group(GroupOperator.And, predicates), sorts);
        }

Same methods

ManifestDAL::GetManifest ( System.DateTime start, System.DateTime end, int pageIndex, int pageSize, int &count ) : IEnumerable

Usage Example

Example #1
0
 public void GetManifest()
 {
     DateTime begin = DateTime.Now.AddYears(-3),
         end = DateTime.Now;
     ManifestDAL dal = new ManifestDAL();
     IEnumerable<Manifest> result = dal.GetManifest(begin, end);
     Assert.IsNotNull(result);
 }