public int Count(SupplierSearchEntity SearchSupplierEntity) { if (SearchSupplierEntity == null) { SearchSupplierEntity = new SupplierSearchEntity(); } IQueryable <Supplier> Suppliers = context.Suppliers; Apply(Suppliers, SearchSupplierEntity); return(Suppliers.Count()); }
public List <Supplier> List(SupplierSearchEntity SearchSupplierEntity) { if (SearchSupplierEntity == null) { SearchSupplierEntity = new SupplierSearchEntity(); } IQueryable <Supplier> Suppliers = context.Suppliers; Apply(Suppliers, SearchSupplierEntity); SkipAndTake(Suppliers, SearchSupplierEntity); return(Suppliers.ToList()); }
private IQueryable <Supplier> Apply(IQueryable <Supplier> Suppliers, SupplierSearchEntity SearchSupplierEntity) { if (SearchSupplierEntity.Id.HasValue) { Suppliers = Suppliers.Where(t => t.Id == SearchSupplierEntity.Id.Value); } if (!string.IsNullOrEmpty(SearchSupplierEntity.Name)) { Suppliers = Suppliers.Where(t => t.Name.ToLower().Contains(SearchSupplierEntity.Name.ToLower())); } if (!string.IsNullOrEmpty(SearchSupplierEntity.TaxCode)) { Suppliers = Suppliers.Where(t => t.TaxCode.ToLower().Contains(SearchSupplierEntity.TaxCode.ToLower())); } if (!string.IsNullOrEmpty(SearchSupplierEntity.Address)) { Suppliers = Suppliers.Where(t => t.Address.ToLower().Contains(SearchSupplierEntity.Address.ToLower())); } if (!string.IsNullOrEmpty(SearchSupplierEntity.Phone)) { Suppliers = Suppliers.Where(t => t.Phone.ToLower().Contains(SearchSupplierEntity.Phone.ToLower())); } if (!string.IsNullOrEmpty(SearchSupplierEntity.Origin)) { Suppliers = Suppliers.Where(t => t.Origin.ToLower().Contains(SearchSupplierEntity.Origin.ToLower())); } if (!string.IsNullOrEmpty(SearchSupplierEntity.Description)) { Suppliers = Suppliers.Where(t => t.Description.ToLower().Contains(SearchSupplierEntity.Description.ToLower())); } if (SearchSupplierEntity.IsActive.HasValue) { Suppliers = Suppliers.Where(t => t.IsActive == SearchSupplierEntity.IsActive.Value); } return(Suppliers); }
public List <SupplierEntity> Get(SupplierSearchEntity SearchSupplierEntity) { return(SupplierService.Get(EmployeeEntity, SearchSupplierEntity)); }
public long Count(SupplierSearchEntity SearchSupplierEntity) { return(SupplierService.Count(EmployeeEntity, SearchSupplierEntity)); }
public List <SupplierEntity> Get(EmployeeEntity EmployeeEntity, SupplierSearchEntity SupplierSearchEntity) { List <Supplier> Suppliers = UnitOfWork.SupplierRepository.List(SupplierSearchEntity); return(Suppliers.ToList().Select(c => new SupplierEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, SupplierSearchEntity SupplierSearchEntity) { return(UnitOfWork.SupplierRepository.Count(SupplierSearchEntity)); }