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; } }
/// <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; }
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(); }
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(); }