//GetEventDetals
        public EventDetail GetEventDetail(long?event_id)
        {
            DataCacheObject dco    = new DataCacheObject(DataCacheType.REFERENCE, DataCacheRegions.EVENTS, "GETEVENTDETAIL", new object[] { event_id }, CachingExpirationTime.Hours_01);
            EventDetail     result = CacheRepository.Get(dco) as EventDetail;

            if (result != null)
            {
                return(result);
            }
            result = (from p in dataContext.spEvent_Detail(event_id)
                      select new EventDetail
            {
                BuyerFee = p.BuyerFee,
                DateEnd = p.DateEnd,
                DateStart = p.DateStart,
                Description = p.Description,
                ID = p.Event_ID,
                IsClickable = p.IsClickable,
                IsCurrent = p.IsCurrent,
                IsPrivate = p.IsPrivate.GetValueOrDefault(false),
                IsViewable = p.IsViewable,
                RegisterRequired = p.RegisterRequired,
                Ordinary = p.Ordinary,
                Title = p.Title
            }).FirstOrDefault();
            if (result != null)
            {
                dco.Data = result;
                CacheRepository.Add(dco);
            }
            return(result);
        }
Beispiel #2
0
        public static Event CreateEventObject(EventDetail ed)
        {
            Event evnt = new Event();

            evnt.ID               = ed.ID;
            evnt.Title            = ed.Title;
            evnt.DateStart        = ed.DateStart;
            evnt.DateEnd          = ed.DateEnd;
            evnt.BuyerFee         = ed.BuyerFee;
            evnt.Description      = ed.Description;
            evnt.IsViewable       = ed.IsViewable;
            evnt.IsClickable      = ed.IsClickable;
            evnt.Ordinary         = ed.Ordinary;
            evnt.IsCurrent        = ed.IsCurrent;
            evnt.IsPrivate        = ed.IsPrivate;
            evnt.RegisterRequired = ed.RegisterRequired;
            return(evnt);
        }