示例#1
0
        public int Count(CustomerGroupSearchEntity SearchCustomerGroupEntity)
        {
            if (SearchCustomerGroupEntity == null)
            {
                SearchCustomerGroupEntity = new CustomerGroupSearchEntity();
            }
            IQueryable <CustomerGroup> CustomerGroups = context.CustomerGroups;

            Apply(CustomerGroups, SearchCustomerGroupEntity);
            return(CustomerGroups.Count());
        }
示例#2
0
        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());
        }
示例#3
0
        public List <CustomerGroupEntity> Get(EmployeeEntity EmployeeEntity, CustomerGroupSearchEntity CustomerGroupSearchEntity)
        {
            List <CustomerGroup> CustomerGroups = UnitOfWork.CustomerGroupRepository.List(CustomerGroupSearchEntity);

            return(CustomerGroups.ToList().Select(c => new CustomerGroupEntity(c)).ToList());
        }
示例#4
0
 public int Count(EmployeeEntity EmployeeEntity, CustomerGroupSearchEntity CustomerGroupSearchEntity)
 {
     return(UnitOfWork.CustomerGroupRepository.Count(CustomerGroupSearchEntity));
 }
示例#5
0
 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);
 }
示例#6
0
 public List <CustomerGroupEntity> Get(CustomerGroupSearchEntity SearchCustomerGroupEntity)
 {
     return(CustomerGroupService.Get(EmployeeEntity, SearchCustomerGroupEntity));
 }
示例#7
0
 public long Count(CustomerGroupSearchEntity SearchCustomerGroupEntity)
 {
     return(CustomerGroupService.Count(EmployeeEntity, SearchCustomerGroupEntity));
 }