Example #1
0
        public override void Refresh()
        {
            //this.filter1.Refresh();



            DateTime wEndDate     = Fwk.HelperFunctions.DateFunctions.NullDateTime;
            Event    wEventFilter = null;

            this.filter1.GetFilter(out wEventFilter, out wEndDate);
            Events wEvents = null;

            try
            {
                if (wEndDate == Fwk.HelperFunctions.DateFunctions.NullDateTime)
                {
                    wEvents = _Target.SearchByParam(wEventFilter);
                }
                else
                {
                    wEvents = _Target.SearchByParam(wEventFilter, wEndDate);
                }
            }
            catch (Exception ex)
            {
                ExceptionViewer.Show(ex);
            }
            currentEvents = Get_EventGridList(wEvents);
            this.eventGridListBindingSource.DataSource = null;
            this.eventGridListBindingSource.DataSource = currentEvents;
            grdLogs.Refresh();
            base.Refresh();
        }
Example #2
0
        private void filter1_OnFilterChanged(Event eventFilter, DateTime endDate)
        {
            Events wEvents = null;

            this.eventGridListBindingSource.DataSource = null;
            try
            {
                if (endDate == Fwk.HelperFunctions.DateFunctions.NullDateTime)
                {
                    wEvents = _Target.SearchByParam(eventFilter);
                }
                else
                {
                    wEvents = _Target.SearchByParam(eventFilter, endDate);
                }
            }
            catch (Exception ex)
            {
                ExceptionViewer.Show(ex);
            }
            currentEvents = Get_EventGridList(wEvents);
            if (currentEvents.Count == 0)
            {
                return;
            }
            this.eventGridListBindingSource.DataSource = null;
            this.eventGridListBindingSource.DataSource = currentEvents;
            grdLogs.Refresh();
        }
Example #3
0
        public EventGridList SearchByParams(EventType type)
        {
            EventGridList lisToReturn = new EventGridList();
            var           list        = from item in this where item.LogType == type select item;

            lisToReturn.AddRange(list.ToArray <EventGrid>());
            return(lisToReturn);
        }
Example #4
0
        /// <summary>
        /// Mapea Events con EventGridList
        /// </summary>
        /// <param name="pEvents"></param>
        /// <returns></returns>
        EventGridList Get_EventGridList(Events pEvents)
        {
            if (pEvents.Count == 0)
            {
                return(new EventGridList());
            }
            var           lst  = from e in pEvents select new EventGrid(e);
            EventGridList lst2 = new EventGridList();

            lst2.AddRange(lst.ToArray <EventGrid>());
            return(lst2);
        }
Example #5
0
        public EventGridList SearchByParam(EventGrid pEvent)
        {
            var lisToReturn = from s in this
                              where
                              (String.IsNullOrEmpty(pEvent.Machine) || s.Machine.StartsWith(pEvent.Machine))
                              &&
                              (String.IsNullOrEmpty(pEvent.User) || s.Machine.StartsWith(pEvent.User))
                              &&
                              (pEvent.LogType == EventType.None || s.LogType == pEvent.LogType)
                              &&
                              (pEvent.LogDate == HelperFunctions.DateFunctions.NullDateTime || s.LogDate >= pEvent.LogDate)
                              select s;
            EventGridList list2 = new EventGridList();


            Fwk.HelperFunctions.TypeFunctions.SetEntitiesFromIenumerable <EventGridList, EventGrid>(list2, lisToReturn);


            return(list2);
        }
Example #6
0
        public void Populate(Fwk.Logging.Targets.Target target)
        {
            _Target = target;
            //grdLogs.BindingContextChanged += new EventHandler(grdLogs_BindingContextChanged);

            Event ev = new Event();

            try
            {
                Events wEvents = _Target.SearchByParam(ev);
                currentEvents = Get_EventGridList(wEvents);
                this.eventGridListBindingSource.DataSource = null;
                this.eventGridListBindingSource.DataSource = currentEvents;

                grdLogs.Refresh();
            }
            catch (InvalidOperationException io)
            {
                MessageBox.Show("El archivo no tiene el formato correcto");

                throw io;
            }
        }