예제 #1
0
        public List <Vendor> List(VendorSearchEntity VendorSearchEntity)
        {
            IQueryable <Vendor> Vendors = readContext.Vendors
                                          .AsNoTracking()
                                          .OrderBy(m => m.name);

            Vendors = Apply(Vendors, VendorSearchEntity);
            Vendors = SkipAndTake(Vendors, VendorSearchEntity);
            Vendors.OrderBy(m => m.name);
            return(Vendors.ToList());
        }
예제 #2
0
        public int Count(VendorSearchEntity VendorSearchEntity)
        {
            if (VendorSearchEntity == null)
            {
                VendorSearchEntity = new VendorSearchEntity();
            }
            IQueryable <Vendor> Vendors = readContext.Vendors;

            Vendors = Apply(Vendors, VendorSearchEntity);
            return(Vendors.Count());
        }
예제 #3
0
 private IQueryable <Vendor> Apply(IQueryable <Vendor> Vendors, VendorSearchEntity VendorSearchEntity)
 {
     if (VendorSearchEntity.id.HasValue)
     {
         Vendors = Vendors.Where(wh => wh.id == VendorSearchEntity.id.Value);
     }
     if (!string.IsNullOrEmpty(VendorSearchEntity.name))
     {
         Vendors = Vendors.Where(mc => mc.name.Contains(VendorSearchEntity.name));
     }
     Vendors = Vendors.OrderBy(m => m.name);
     //if (!string.IsNullOrEmpty(VendorSearchEntity.name))
     //    Vendors = Vendors.Where(T => T.Code.ToLower().Contains(VendorSearchEntity.Code.ToLower()));
     //if (VendorSearchEntity.ParentId.HasValue)
     //    Vendors = Vendors.Where(T => T.ParentId.HasValue && T.ParentId.Value == VendorSearchEntity.ParentId.Value);
     return(Vendors);
 }
예제 #4
0
        public List <VendorEntity> Get(VendorSearchEntity VendorSearchEntity)
        {
            List <Vendor> vendors = vendorRepository.List(VendorSearchEntity);

            return(vendors.Select(u => new VendorEntity(u)).ToList());
        }
예제 #5
0
 public int Count(VendorSearchEntity VendorSearchEntity)
 {
     return(vendorRepository.Count(VendorSearchEntity));
 }
예제 #6
0
 public List <VendorEntity> Get(VendorSearchEntity VendorSearchEntity)
 {
     return(VendorService.Get(VendorSearchEntity));
 }
예제 #7
0
 public long Count(VendorSearchEntity VendorSearchEntity)
 {
     return(VendorService.Count(VendorSearchEntity));
 }