private IQueryable <WareHouse> Apply(IQueryable <WareHouse> WareHouses, WareHouseSearchEntity WareHouseSearchEntity) { if (WareHouseSearchEntity.Id.HasValue) { WareHouses = WareHouses.Where(wh => wh.Id == WareHouseSearchEntity.Id.Value); } if (!string.IsNullOrEmpty(WareHouseSearchEntity.Name)) { WareHouses = WareHouses.Where(wh => wh.Name.ToLower().Contains(WareHouseSearchEntity.Name.ToLower())); } if (!string.IsNullOrEmpty(WareHouseSearchEntity.Code)) { WareHouses = WareHouses.Where(wh => wh.Code.ToLower().Contains(WareHouseSearchEntity.Code.ToLower())); } if (!string.IsNullOrEmpty(WareHouseSearchEntity.StorageLocation)) { WareHouses = WareHouses.Where(wh => wh.StorageLocation.ToLower().Contains(WareHouseSearchEntity.StorageLocation.ToLower())); } if (WareHouseSearchEntity.StockkeeperId.HasValue) { WareHouses = WareHouses.Where(wh => wh.StockkeeperId == WareHouseSearchEntity.StockkeeperId); } if (WareHouseSearchEntity.IsDefault.HasValue) { WareHouses = WareHouses.Where(wh => wh.IsDefault == WareHouseSearchEntity.IsDefault.Value); } return(WareHouses); }
public int Count(WareHouseSearchEntity WareHouseSearchEntity) { if (WareHouseSearchEntity == null) { WareHouseSearchEntity = new WareHouseSearchEntity(); } IQueryable <WareHouse> WareHouses = context.WareHouses; Apply(WareHouses, WareHouseSearchEntity); return(WareHouses.Count()); }
public List <WareHouse> List(WareHouseSearchEntity WareHouseSearchEntity) { if (WareHouseSearchEntity == null) { WareHouseSearchEntity = new WareHouseSearchEntity(); } IQueryable <WareHouse> WareHouses = context.WareHouses .Include(wh => wh.Stockkeeper); Apply(WareHouses, WareHouseSearchEntity); SkipAndTake(WareHouses, WareHouseSearchEntity); return(WareHouses.ToList()); }
public List <WareHouseEntity> Get(EmployeeEntity EmployeeEntity, WareHouseSearchEntity WareHouseSearchEntity) { List <WareHouse> WareHouses = UnitOfWork.WareHouseRepository.List(WareHouseSearchEntity); return(WareHouses.ToList().Select(c => new WareHouseEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, WareHouseSearchEntity WareHouseSearchEntity) { return(UnitOfWork.WareHouseRepository.Count(WareHouseSearchEntity)); }
public List <WareHouseEntity> Get(WareHouseSearchEntity SearchWareHouseEntity) { return(WareHouseService.Get(EmployeeEntity, SearchWareHouseEntity)); }
public long Count(WareHouseSearchEntity SearchWareHouseEntity) { return(WareHouseService.Count(EmployeeEntity, SearchWareHouseEntity)); }