Esempio n. 1
0
        //GetCurrent()
        public Event GetCurrent()
        {
            DataCacheObject dco  = new DataCacheObject(DataCacheType.REFERENCE, DataCacheRegions.EVENTS, "GETCURRENT", null, CachingExpirationTime.Hours_01);
            Event           evnt = CacheRepository.Get(dco) as Event;

            if (evnt != null)
            {
                return(evnt);
            }
            evnt = dataContext.spEvent_Current().FirstOrDefault();
            if (evnt != null)
            {
                dco.Data = evnt;
                CacheRepository.Add(dco);
            }
            return(evnt);
        }
Esempio n. 2
0
        ////GetPreviousEvent
        //public IEvent GetPreviousEvent()
        //{
        //  var query = (from e in dataContext.Events
        //               where e.IsClickable && e.IsViewable
        //               orderby e.DateEnd descending
        //               select e);
        //  return (query.Count() > 0) ? query.First() : null;
        //}

        //GetCurrentEvent
        public Event GetCurrentEvent()
        {
            return(dataContext.spEvent_Current().FirstOrDefault());
        }