示例#1
0
        public int Count(SupplierSearchEntity SearchSupplierEntity)
        {
            if (SearchSupplierEntity == null)
            {
                SearchSupplierEntity = new SupplierSearchEntity();
            }
            IQueryable <Supplier> Suppliers = context.Suppliers;

            Apply(Suppliers, SearchSupplierEntity);
            return(Suppliers.Count());
        }
示例#2
0
        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());
        }
示例#3
0
 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);
 }
示例#4
0
 public List <SupplierEntity> Get(SupplierSearchEntity SearchSupplierEntity)
 {
     return(SupplierService.Get(EmployeeEntity, SearchSupplierEntity));
 }
示例#5
0
 public long Count(SupplierSearchEntity SearchSupplierEntity)
 {
     return(SupplierService.Count(EmployeeEntity, SearchSupplierEntity));
 }
示例#6
0
        public List <SupplierEntity> Get(EmployeeEntity EmployeeEntity, SupplierSearchEntity SupplierSearchEntity)
        {
            List <Supplier> Suppliers = UnitOfWork.SupplierRepository.List(SupplierSearchEntity);

            return(Suppliers.ToList().Select(c => new SupplierEntity(c)).ToList());
        }
示例#7
0
 public int Count(EmployeeEntity EmployeeEntity, SupplierSearchEntity SupplierSearchEntity)
 {
     return(UnitOfWork.SupplierRepository.Count(SupplierSearchEntity));
 }