public int Count(CustomerGroupSearchEntity SearchCustomerGroupEntity) { if (SearchCustomerGroupEntity == null) { SearchCustomerGroupEntity = new CustomerGroupSearchEntity(); } IQueryable <CustomerGroup> CustomerGroups = context.CustomerGroups; Apply(CustomerGroups, SearchCustomerGroupEntity); return(CustomerGroups.Count()); }
public List <CustomerGroup> List(CustomerGroupSearchEntity SearchCustomerGroupEntity) { if (SearchCustomerGroupEntity == null) { SearchCustomerGroupEntity = new CustomerGroupSearchEntity(); } IQueryable <CustomerGroup> CustomerGroups = context.CustomerGroups; Apply(CustomerGroups, SearchCustomerGroupEntity); SkipAndTake(CustomerGroups, SearchCustomerGroupEntity); return(CustomerGroups.ToList()); }
public List <CustomerGroupEntity> Get(EmployeeEntity EmployeeEntity, CustomerGroupSearchEntity CustomerGroupSearchEntity) { List <CustomerGroup> CustomerGroups = UnitOfWork.CustomerGroupRepository.List(CustomerGroupSearchEntity); return(CustomerGroups.ToList().Select(c => new CustomerGroupEntity(c)).ToList()); }
public int Count(EmployeeEntity EmployeeEntity, CustomerGroupSearchEntity CustomerGroupSearchEntity) { return(UnitOfWork.CustomerGroupRepository.Count(CustomerGroupSearchEntity)); }
private IQueryable <CustomerGroup> Apply(IQueryable <CustomerGroup> CustomerGroups, CustomerGroupSearchEntity SearchCustomerGroupEntity) { if (SearchCustomerGroupEntity.Id.HasValue) { CustomerGroups = CustomerGroups.Where(wh => wh.Id == SearchCustomerGroupEntity.Id.Value); } if (!string.IsNullOrEmpty(SearchCustomerGroupEntity.Code)) { CustomerGroups = CustomerGroups.Where(T => T.Code.ToLower().Contains(SearchCustomerGroupEntity.Code.ToLower())); } if (!string.IsNullOrEmpty(SearchCustomerGroupEntity.Name)) { CustomerGroups = CustomerGroups.Where(T => T.Name.ToLower().Contains(SearchCustomerGroupEntity.Name.ToLower())); } if (!string.IsNullOrEmpty(SearchCustomerGroupEntity.Description)) { CustomerGroups = CustomerGroups.Where(T => T.Description.ToLower().Contains(SearchCustomerGroupEntity.Description.ToLower())); } if (SearchCustomerGroupEntity.IsActive.HasValue) { CustomerGroups = CustomerGroups.Where(wh => wh.IsActive == SearchCustomerGroupEntity.IsActive.Value); } return(CustomerGroups); }
public List <CustomerGroupEntity> Get(CustomerGroupSearchEntity SearchCustomerGroupEntity) { return(CustomerGroupService.Get(EmployeeEntity, SearchCustomerGroupEntity)); }
public long Count(CustomerGroupSearchEntity SearchCustomerGroupEntity) { return(CustomerGroupService.Count(EmployeeEntity, SearchCustomerGroupEntity)); }