public int Count(InventorySearchEntity SearchInventoryEntity) { if (SearchInventoryEntity == null) { SearchInventoryEntity = new InventorySearchEntity(); } IQueryable <Inventory> Inventories = context.Inventories; Apply(Inventories, SearchInventoryEntity); return(Inventories.Count()); }
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()); }
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); }
public List <InventoryEntity> Get(InventorySearchEntity SearchInventoryEntity) { return(InventoryService.Get(EmployeeEntity, SearchInventoryEntity)); }
public long Count(InventorySearchEntity SearchInventoryEntity) { return(InventoryService.Count(EmployeeEntity, SearchInventoryEntity)); }
public List <InventoryEntity> Get(EmployeeEntity EmployeeEntity, InventorySearchEntity InventorySearchEntity) { List <Inventory> Inventorys = UnitOfWork.InventoryRepository.List(InventorySearchEntity); return(Inventorys.ToList().Select(c => new InventoryEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, InventorySearchEntity InventorySearchEntity) { return(UnitOfWork.InventoryRepository.Count(InventorySearchEntity)); }