private static string Export(ExportEventSelectorVM eventsFilter, List <ReportParameters> reportParams) { //write header var sb = new StringBuilder(); sb.Append("Id;"); sb.Append("Event;"); sb.Append("EventName;"); sb.Append("DiscussionId;"); sb.Append("DiscussionName;"); sb.Append("TopicId;"); sb.Append("TopicName;"); sb.Append("UserId;"); sb.Append("UserName;"); sb.Append("Time;"); sb.Append("DeviceType;"); sb.AppendLine("DeviceTypeName"); var ctx = new DiscCtx(Discussions.ConfigManager.ConnStr); foreach (var ev in ctx.StatsEvent) { var addEvent = false; if (ev.Id == 2) { int i = 0; } if (eventsFilter.EventExported((StEvent)ev.Event)) { if (ev.UserId == -1) { addEvent = true; } else if (EventPassesFilter(ev, reportParams)) { addEvent = true; } } if (addEvent) { AddEventRow(sb, ev); } } return(sb.ToString()); }
private static string Export(ExportEventSelectorVM eventsFilter, List<ReportParameters> reportParams) { //write header var sb = new StringBuilder(); sb.Append("Id;"); sb.Append("Event;"); sb.Append("EventName;"); sb.Append("DiscussionId;"); sb.Append("DiscussionName;"); sb.Append("TopicId;"); sb.Append("TopicName;"); sb.Append("UserId;"); sb.Append("UserName;"); sb.Append("Time;"); sb.Append("DeviceType;"); sb.AppendLine("DeviceTypeName"); var ctx = new DiscCtx(Discussions.ConfigManager.ConnStr); foreach (var ev in ctx.StatsEvent) { var addEvent = false; if (ev.Id == 2) { int i = 0; } if(eventsFilter.EventExported((StEvent)ev.Event)) { if (ev.UserId == -1) { addEvent = true; } else if (EventPassesFilter(ev, reportParams)) { addEvent = true; } } if (addEvent) AddEventRow(sb, ev); } return sb.ToString(); }
public ExportEventSelector(ExportEventSelectorVM vm) { InitializeComponent(); DataContext = _model = vm; }
public static void Export(string reportPathName, ExportEventSelectorVM eventsFilter, List <ReportParameters> reportParams) { System.IO.File.WriteAllText(reportPathName, Export(eventsFilter, reportParams)); }
public static void Export(string reportPathName, ExportEventSelectorVM eventsFilter, List<ReportParameters> reportParams) { System.IO.File.WriteAllText(reportPathName, Export(eventsFilter, reportParams)); }