Пример #1
0
        public int Count(InputSearchEntity SearchInputEntity)
        {
            if (SearchInputEntity == null)
            {
                SearchInputEntity = new InputSearchEntity();
            }
            IQueryable <Input> Inputs = context.Inputs;

            Apply(Inputs, SearchInputEntity);
            return(Inputs.Count());
        }
Пример #2
0
        public List <Input> List(InputSearchEntity SearchInputEntity)
        {
            if (SearchInputEntity == null)
            {
                SearchInputEntity = new InputSearchEntity();
            }
            IQueryable <Input> Inputs = context.Inputs;

            Apply(Inputs, SearchInputEntity);
            SkipAndTake(Inputs, SearchInputEntity);
            return(Inputs.ToList());
        }
Пример #3
0
 private IQueryable <Input> Apply(IQueryable <Input> Inputs, InputSearchEntity SearchInputEntity)
 {
     if (SearchInputEntity.Id.HasValue)
     {
         Inputs = Inputs.Where(wh => wh.Id == SearchInputEntity.Id.Value);
     }
     if (SearchInputEntity.Quantity.HasValue)
     {
         Inputs = Inputs.Where(wh => wh.Quantity == SearchInputEntity.Quantity.Value);
     }
     if (SearchInputEntity.UnitPrice.HasValue)
     {
         Inputs = Inputs.Where(wh => wh.UnitPrice == SearchInputEntity.UnitPrice.Value);
     }
     if (SearchInputEntity.InventoryId.HasValue)
     {
         Inputs = Inputs.Where(wh => wh.InventoryId == SearchInputEntity.InventoryId.Value);
     }
     if (!string.IsNullOrEmpty(SearchInputEntity.Description))
     {
         Inputs = Inputs.Where(wh => wh.Description.ToLower().Contains(SearchInputEntity.Description.ToLower()));
     }
     return(Inputs);
 }
Пример #4
0
        public List <InputEntity> Get(EmployeeEntity EmployeeEntity, InputSearchEntity InputSearchEntity)
        {
            List <Input> Inputs = UnitOfWork.InputRepository.List(InputSearchEntity);

            return(Inputs.ToList().Select(c => new InputEntity(c)).ToList());
        }
Пример #5
0
 public int Count(EmployeeEntity EmployeeEntity, InputSearchEntity InputSearchEntity)
 {
     return(UnitOfWork.InputRepository.Count(InputSearchEntity));
 }
Пример #6
0
 public List <InputEntity> Get(InputSearchEntity SearchInputEntity)
 {
     return(InputService.Get(EmployeeEntity, SearchInputEntity));
 }
Пример #7
0
 public long Count(InputSearchEntity SearchInputEntity)
 {
     return(InputService.Count(EmployeeEntity, SearchInputEntity));
 }