Exemplo n.º 1
0
        public EventDetail Get(string eventId)
        {
            EventDetail entity = CacheHelper.CreateInstance().GetCache <EventDetail>(eventId);

            if (entity == null)
            {
                entity = _dal.Get(eventId);
                if (entity != null)
                {
                    CacheHelper.CreateInstance().SetCache(entity, eventId, DateTime.Now.AddHours(12));
                }
            }
            return(entity);
        }
Exemplo n.º 2
0
        public List <EventLogDetail> GetAll(string connString, DateTime startDate)
        {
            List <EventLogDetail> listEventLogDetail = new List <EventLogDetail>();
            PageData pageData = GetPageList(connString, 200, 1, startDate);

            if (pageData.PageList != null)
            {
                listEventLogDetail.AddRange(pageData.PageList.Cast <EventLogDetail>());
            }
            if (pageData.PageCount > 0)
            {
                for (int i = 2; i <= pageData.PageCount; i++)
                {
                    listEventLogDetail.AddRange(GetPageList(connString, 200, i, startDate).PageList.Cast <EventLogDetail>());
                }
            }
            if (listEventLogDetail != null)
            {
                listEventLogDetail.ForEach((entity) => {
                    entity.EventName = _eventDetailDAL.Get(entity.EventId)?.EventName;
                });
            }
            return(listEventLogDetail);
        }