Exemple #1
0
        public int Count(PackSearchEntity PackSearchEntity)
        {
            if (PackSearchEntity == null)
            {
                PackSearchEntity = new PackSearchEntity();
            }
            IQueryable <Pack> Packs = context.Packs;

            Apply(Packs, PackSearchEntity);
            return(Packs.Count());
        }
Exemple #2
0
        public List <Pack> List(PackSearchEntity PackSearchEntity)
        {
            if (PackSearchEntity == null)
            {
                PackSearchEntity = new PackSearchEntity();
            }
            IQueryable <Pack> Packs = context.Packs
                                      .Include(p => p.Product).ThenInclude(pro => pro.ProductValues);

            Apply(Packs, PackSearchEntity);
            SkipAndTake(Packs, PackSearchEntity);
            return(Packs.ToList());
        }
Exemple #3
0
 private IQueryable <Pack> Apply(IQueryable <Pack> Packs, PackSearchEntity PackSearchEntity)
 {
     if (PackSearchEntity.Id.HasValue)
     {
         Packs = Packs.Where(wh => wh.Id == PackSearchEntity.Id.Value);
     }
     if (PackSearchEntity.ProductId.HasValue)
     {
         Packs = Packs.Where(wh => wh.ProductId == PackSearchEntity.ProductId.Value);
     }
     if (PackSearchEntity.UnitPrice.HasValue)
     {
         Packs = Packs.Where(wh => wh.UnitPrice == PackSearchEntity.UnitPrice.Value);
     }
     if (PackSearchEntity.Quantity.HasValue)
     {
         Packs = Packs.Where(wh => wh.Quantity == PackSearchEntity.Quantity.Value);
     }
     if (PackSearchEntity.IsDefault.HasValue)
     {
         Packs = Packs.Where(wh => wh.IsDefault == PackSearchEntity.IsDefault.Value);
     }
     return(Packs);
 }
Exemple #4
0
        public List <PackEntity> Get(EmployeeEntity EmployeeEntity, PackSearchEntity PackSearchEntity)
        {
            List <Pack> Packs = UnitOfWork.PackRepository.List(PackSearchEntity);

            return(Packs.ToList().Select(c => new PackEntity(c)).ToList());
        }
Exemple #5
0
 public int Count(EmployeeEntity EmployeeEntity, PackSearchEntity PackSearchEntity)
 {
     return(UnitOfWork.PackRepository.Count(PackSearchEntity));
 }
Exemple #6
0
 public List <PackEntity> Get(PackSearchEntity SearchPackEntity)
 {
     return(PackService.Get(EmployeeEntity, SearchPackEntity));
 }
Exemple #7
0
 public long Count(PackSearchEntity SearchPackEntity)
 {
     return(PackService.Count(EmployeeEntity, SearchPackEntity));
 }