示例#1
0
        public int Count(CouponSearchEntity SearchCouponEntity)
        {
            if (SearchCouponEntity == null)
            {
                SearchCouponEntity = new CouponSearchEntity();
            }
            IQueryable <Coupon> Coupons = context.Coupons;

            Apply(Coupons, SearchCouponEntity);
            return(Coupons.Count());
        }
示例#2
0
 private IQueryable <Coupon> Apply(IQueryable <Coupon> Coupons, CouponSearchEntity SearchCouponEntity)
 {
     if (SearchCouponEntity.Id.HasValue)
     {
         Coupons = Coupons.Where(wh => wh.Id == SearchCouponEntity.Id.Value);
     }
     if (!string.IsNullOrEmpty(SearchCouponEntity.Code))
     {
         Coupons = Coupons.Where(T => T.Code.ToLower().Contains(SearchCouponEntity.Code.ToLower()));
     }
     return(Coupons);
 }
示例#3
0
        public List <Coupon> List(CouponSearchEntity SearchCouponEntity)
        {
            if (SearchCouponEntity == null)
            {
                SearchCouponEntity = new CouponSearchEntity();
            }
            IQueryable <Coupon> Coupons = context.Coupons;

            Apply(Coupons, SearchCouponEntity);
            SkipAndTake(Coupons, SearchCouponEntity);
            return(Coupons.ToList());
        }
示例#4
0
 public List <CouponEntity> Get(CouponSearchEntity SearchCouponEntity)
 {
     return(CouponService.Get(EmployeeEntity, SearchCouponEntity));
 }
示例#5
0
 public long Count(CouponSearchEntity SearchCouponEntity)
 {
     return(CouponService.Count(EmployeeEntity, SearchCouponEntity));
 }
示例#6
0
        public List <CouponEntity> Get(EmployeeEntity EmployeeEntity, CouponSearchEntity CouponSearchEntity)
        {
            List <Coupon> Coupons = UnitOfWork.CouponRepository.List(CouponSearchEntity);

            return(Coupons.ToList().Select(c => new CouponEntity(c)).ToList());
        }
示例#7
0
 public int Count(EmployeeEntity EmployeeEntity, CouponSearchEntity CouponSearchEntity)
 {
     return(UnitOfWork.CouponRepository.Count(CouponSearchEntity));
 }