Beispiel #1
0
        public int Count(CountrySearchEntity SearchCountryEntity)
        {
            if (SearchCountryEntity == null)
            {
                SearchCountryEntity = new CountrySearchEntity();
            }
            IQueryable <Country> Countries = context.Countries;

            Apply(Countries, SearchCountryEntity);
            return(Countries.Count());
        }
Beispiel #2
0
        public List <Country> List(CountrySearchEntity SearchCountryEntity)
        {
            if (SearchCountryEntity == null)
            {
                SearchCountryEntity = new CountrySearchEntity();
            }
            IQueryable <Country> Countries = context.Countries
                                             .Include(c => c.Cities)
                                             .Include(c => c.Taxes).ThenInclude(t => t.Category);

            Apply(Countries, SearchCountryEntity);
            SkipAndTake(Countries, SearchCountryEntity);
            return(Countries.ToList());
        }
Beispiel #3
0
 private IQueryable <Country> Apply(IQueryable <Country> Countries, CountrySearchEntity SearchCountryEntity)
 {
     if (SearchCountryEntity.Id.HasValue)
     {
         Countries = Countries.Where(wh => wh.Id == SearchCountryEntity.Id.Value);
     }
     if (!string.IsNullOrEmpty(SearchCountryEntity.Code))
     {
         Countries = Countries.Where(T => T.Code.ToLower().Contains(SearchCountryEntity.Code.ToLower()));
     }
     if (!string.IsNullOrEmpty(SearchCountryEntity.Name))
     {
         Countries = Countries.Where(T => T.Name.ToLower().Contains(SearchCountryEntity.Name.ToLower()));
     }
     if (!string.IsNullOrEmpty(SearchCountryEntity.Note))
     {
         Countries = Countries.Where(T => T.Note.ToLower().Contains(SearchCountryEntity.Note.ToLower()));
     }
     return(Countries);
 }
Beispiel #4
0
        public List <CountryEntity> Get(EmployeeEntity EmployeeEntity, CountrySearchEntity CountrySearchEntity)
        {
            List <Country> Countrys = UnitOfWork.CountryRepository.List(CountrySearchEntity);

            return(Countrys.ToList().Select(c => new CountryEntity(c)).ToList());
        }
Beispiel #5
0
 public int Count(EmployeeEntity EmployeeEntity, CountrySearchEntity CountrySearchEntity)
 {
     return(UnitOfWork.CountryRepository.Count(CountrySearchEntity));
 }
Beispiel #6
0
 public List <CountryEntity> Get(CountrySearchEntity SearchCountryEntity)
 {
     return(CountryService.Get(EmployeeEntity, SearchCountryEntity));
 }
Beispiel #7
0
 public long Count(CountrySearchEntity SearchCountryEntity)
 {
     return(CountryService.Count(EmployeeEntity, SearchCountryEntity));
 }