Exemplo n.º 1
0
        public int Count(InventorySearchEntity SearchInventoryEntity)
        {
            if (SearchInventoryEntity == null)
            {
                SearchInventoryEntity = new InventorySearchEntity();
            }
            IQueryable <Inventory> Inventories = context.Inventories;

            Apply(Inventories, SearchInventoryEntity);
            return(Inventories.Count());
        }
Exemplo n.º 2
0
        public List <Inventory> List(InventorySearchEntity SearchInventoryEntity)
        {
            if (SearchInventoryEntity == null)
            {
                SearchInventoryEntity = new InventorySearchEntity();
            }
            IQueryable <Inventory> Inventories = context.Inventories;

            Apply(Inventories, SearchInventoryEntity);
            SkipAndTake(Inventories, SearchInventoryEntity);
            return(Inventories.ToList());
        }
Exemplo n.º 3
0
 private IQueryable <Inventory> Apply(IQueryable <Inventory> Inventories, InventorySearchEntity SearchInventoryEntity)
 {
     if (SearchInventoryEntity.Id.HasValue)
     {
         Inventories = Inventories.Where(wh => wh.Id == SearchInventoryEntity.Id.Value);
     }
     if (SearchInventoryEntity.WareHouseId.HasValue)
     {
         Inventories = Inventories.Where(wh => wh.WareHouseId == SearchInventoryEntity.WareHouseId.Value);
     }
     if (SearchInventoryEntity.ProductId.HasValue)
     {
         Inventories = Inventories.Where(wh => wh.ProductId == SearchInventoryEntity.ProductId.Value);
     }
     return(Inventories);
 }
Exemplo n.º 4
0
 public List <InventoryEntity> Get(InventorySearchEntity SearchInventoryEntity)
 {
     return(InventoryService.Get(EmployeeEntity, SearchInventoryEntity));
 }
Exemplo n.º 5
0
 public long Count(InventorySearchEntity SearchInventoryEntity)
 {
     return(InventoryService.Count(EmployeeEntity, SearchInventoryEntity));
 }
Exemplo n.º 6
0
        public List <InventoryEntity> Get(EmployeeEntity EmployeeEntity, InventorySearchEntity InventorySearchEntity)
        {
            List <Inventory> Inventorys = UnitOfWork.InventoryRepository.List(InventorySearchEntity);

            return(Inventorys.ToList().Select(c => new InventoryEntity(c)).ToList());
        }
Exemplo n.º 7
0
 public int Count(EmployeeEntity EmployeeEntity, InventorySearchEntity InventorySearchEntity)
 {
     return(UnitOfWork.InventoryRepository.Count(InventorySearchEntity));
 }