Exemplo n.º 1
0
 internal List<LazyList> AutoCompleteProduct(string searchText, int maxResults)
 {
     int count = maxResults;
     var dDb = new DirectoryDb();
     List<Product> products = dDb.GetAutoCompleteProduct(searchText).Take(count).ToList();
     return products.Select(t => new LazyList(t.ProductName, t.ProductName)).ToList();
 }
Exemplo n.º 2
0
 internal List<LazyList> AutoCompleteBrand(string searchText, int maxResults)
 {
     int count = maxResults;
     var dDb = new DirectoryDb();
     List<Brand> brands = dDb.GetAutoCompleteBrand(searchText).Take(count).ToList();
     return brands.Select(t => new LazyList(t.BrandName, t.BrandName)).ToList();
 }
Exemplo n.º 3
0
        public List<Event> GetEvents()
        {
            List<Event> events;

            const string key = "ModelsCoreGetEvents";

            if (!CacheHelper.Get(key, out events))
            {
                var dDb = new DirectoryDb();
                List<Venue> venues = dDb.GetAllVenues();
                List<VenueOwner> owners = dDb.GetGetVenueOwners();
                events = GetVenueEvents(venues, owners);
                CacheHelper.Add(events, key);
            }

            IEnumerable<Event> result = events.Where(s => s.StartTime.Date >= DateTime.Now.Date).OrderBy(s => s.StartTime);
            return result.ToList();
        }