Exemplo n.º 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());
        }
Exemplo n.º 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());
        }
Exemplo n.º 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);
 }
Exemplo n.º 4
0
        public List <VendorEntity> Get(VendorSearchEntity VendorSearchEntity)
        {
            List <Vendor> vendors = vendorRepository.List(VendorSearchEntity);

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