示例#1
0
        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());
        }
示例#2
0
        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;
        }
示例#4
0
        public ExportEventSelector(ExportEventSelectorVM vm)
        {
            InitializeComponent();

            DataContext = _model = vm;
        }
示例#5
0
 public static void Export(string reportPathName,
                           ExportEventSelectorVM eventsFilter,
                           List <ReportParameters> reportParams)
 {
     System.IO.File.WriteAllText(reportPathName, Export(eventsFilter, reportParams));
 }
示例#6
0
 public static void Export(string reportPathName,
                           ExportEventSelectorVM eventsFilter,
                           List<ReportParameters> reportParams)
 {
     System.IO.File.WriteAllText(reportPathName, Export(eventsFilter, reportParams));
 }