コード例 #1
0
 public void InitFilter(ExportFilterDTO filter, Guid investigationId)
 {
     using (var uow = this.UnitOfWorkProvider.Create(investigationId))
     {
         var q = this.MessageFactory();
         q.InitFilter(filter);
     }
 }
コード例 #2
0
 public void InitEmailFilter(ExportFilterDTO filter)
 {
     /*using (var uow = this.UnitOfWorkProvider.Create(investigationId))
      * {
      *  var q = this.EmailsFactory();
      *  q.InitEmailFilter(filter);
      * }*/
 }
コード例 #3
0
        public void InitChatMessageFilter(ExportFilterDTO filter)
        {
            var query = this.unitOfWorkProvider.TryGetContext().Set <SnooperExportedObjectBase>().ToList().OfType <IChatMessage>().ToList().AsQueryable();

            var durationMax = query.Select(e => e.FirstSeen).DefaultIfEmpty().Max();
            var durationMin = query.Select(e => e.FirstSeen).DefaultIfEmpty().Min();

            filter.DurationMin = new DateTime(
                durationMin.Ticks - (durationMin.Ticks % TimeSpan.TicksPerSecond),
                durationMin.Kind
                );
            filter.DurationMax = new DateTime(
                durationMax.Ticks - (durationMax.Ticks % TimeSpan.TicksPerSecond),
                durationMax.Kind
                );
        }
コード例 #4
0
        public void InitFilter(ExportFilterDTO filter)
        {
            // Base Query
            var query = (IQueryable <SnooperExportedDataObjectFTP>) this.unitOfWorkProvider.TryGetContext().Set <SnooperExportedDataObjectFTP>();

            var durationMax = query.Select(e => e.FirstSeen).DefaultIfEmpty().Max();
            var durationMin = query.Select(e => e.FirstSeen).DefaultIfEmpty().Min();

            filter.DurationMin = new DateTime(
                durationMin.Ticks - (durationMin.Ticks % TimeSpan.TicksPerSecond),
                durationMin.Kind
                );
            filter.DurationMax = new DateTime(
                durationMax.Ticks - (durationMax.Ticks % TimeSpan.TicksPerSecond),
                durationMax.Kind
                );
        }
コード例 #5
0
        public void InitCallStreamFilter(ExportFilterDTO filter)
        {
            var query = this.unitOfWorkProvider.TryGetContext().Set <SnooperExportedObjectBase>().ToList().OfType <ICallStream>().ToList().AsQueryable();

            var durationMax = query.Select(e => e.End).DefaultIfEmpty().Max() ?? DateTime.MaxValue;
            var durationMin = query.Select(e => e.Start).DefaultIfEmpty().Min() ?? DateTime.MinValue;


            filter.DurationMin = new DateTime(
                durationMin.Ticks - (durationMin.Ticks % TimeSpan.TicksPerSecond),
                durationMin.Kind
                );

            filter.DurationMax = new DateTime(
                durationMax.Ticks - (durationMax.Ticks % TimeSpan.TicksPerSecond),
                durationMax.Kind
                );
        }
コード例 #6
0
        public void InitFilter(ExportFilterDTO filter)
        {
            // Base Query
            var query = (IQueryable <SnooperExportedDataObjectHTTP>) this.unitOfWorkProvider.TryGetContext().Set <SnooperExportedDataObjectHTTP>()
                        .Where(m => m.Message.HTTPContent.Content != null);

            if (this.FilterImage)
            {
                query = query.Where(m => m.Message.HttpResponseHeader.Fields.SerializedValue.Contains("\"Content-Type\":[\"image/"));
            }

            var durationMax = query.Select(e => e.FirstSeen).DefaultIfEmpty().Max();
            var durationMin = query.Select(e => e.FirstSeen).DefaultIfEmpty().Min();

            filter.DurationMin = new DateTime(
                durationMin.Ticks - (durationMin.Ticks % TimeSpan.TicksPerSecond),
                durationMin.Kind
                );
            filter.DurationMax = new DateTime(
                durationMax.Ticks - (durationMax.Ticks % TimeSpan.TicksPerSecond),
                durationMax.Kind
                );
        }
コード例 #7
0
        public void FillMessages(Guid investigationId, GridViewDataSet <SnooperDNSListDTO> dataset, ExportFilterDTO filter)
        {
            using (var uow = this.UnitOfWorkProvider.Create(investigationId))
            {
                var q = this.MessageFactory();
                q.Filters        = filter;
                q.SortExpression = dataset.SortingOptions.SortExpression;
                q.SortDescending = dataset.SortingOptions.SortDescending;

                q.FillDataSet(dataset);
            }
        }
コード例 #8
0
 public void InitEmailFilter(ExportFilterDTO filter)
 {
 }
コード例 #9
0
        public void FillFiles(Guid investigationId, GridViewDataSet <SnooperHTTPFileDTO> dataset, ExportFilterDTO filter, string appPath, bool onlyImages = false)
        {
            using (var uow = this.UnitOfWorkProvider.Create(investigationId))
            {
                var q = this.FileFactory();
                q.Filters        = filter;
                q.SortExpression = dataset.SortingOptions.SortExpression;
                q.SortDescending = dataset.SortingOptions.SortDescending;
                q.FilterImage    = onlyImages;

                q.FillDataSet(dataset);

                foreach (var img in dataset.Items)
                {
                    this.GetFileHash(investigationId, img, appPath);
                    img.Url = "/DownloadFile/" + investigationId + "?filename=s" + "&content=" + img.ContentType + "&path=" + img.Path;
                }
            }
        }
コード例 #10
0
        public void FillEmailDataSet(GridViewDataSet <ExportEmailDTO> dataset, Guid investigationId, ExportFilterDTO filter)
        {
            using (var uow = this.UnitOfWorkProvider.Create(investigationId))
            {
                var q = this.EmailsFactory();
                q.Filters        = filter;
                q.SortExpression = dataset.SortingOptions.SortExpression;
                q.SortDescending = dataset.SortingOptions.SortDescending;

                q.FillDataSet(dataset);
                CultureInfo MyCultureInfo = new CultureInfo("en-US");
                foreach (var i in dataset.Items)
                {
                    if (i.Date != null)
                    {
                        var d = Regex.Replace(i.Date, @"\.\d+$", string.Empty);
                        i.Timestamp = DateTime.ParseExact(d, "yyyy-MM-dd HH.mm.ss", MyCultureInfo);
                    }
                }
            }
        }
コード例 #11
0
        public void FillChatMessageDataSet(GridViewDataSet <ExportChatMessageDTO> dataset, Guid investigationId, ExportFilterDTO filter)
        {
            using (var uow = this.UnitOfWorkProvider.Create(investigationId))
            {
                var q = ChatMessagesFactory();
                q.SortExpression = dataset.SortingOptions.SortExpression;
                q.SortDescending = dataset.SortingOptions.SortDescending;

                q.FillDataSet(dataset);
            }
        }
コード例 #12
0
        public void FillCallStreamDataSet(GridViewDataSet <ExportCallStreamDTO> dataset, Guid investigationId, ExportFilterDTO filter)
        {
            using (var uow = this.UnitOfWorkProvider.Create(investigationId))
            {
                var q = CallStreamsFactory();
                q.Filters        = filter;
                q.SortExpression = dataset.SortingOptions.SortExpression;
                q.SortDescending = dataset.SortingOptions.SortDescending;

                q.FillDataSet(dataset);
                foreach (var i in dataset.Items)
                {
                    var tmp = Regex.Split(i.WavFilePath, "wwwroot");
                    i.WavFilePath  = tmp[1];
                    i.DurationText = i.Duration.ToString("g");
                }
            }
        }
コード例 #13
0
        public void FillCallDataSet(GridViewDataSet <ExportCallDTO> dataset, Guid investigationId, ExportFilterDTO filter)
        {
            using (var uow = this.UnitOfWorkProvider.Create(investigationId))
            {
                var q = CallsFactory();
                q.Filters        = filter;
                q.SortExpression = dataset.SortingOptions.SortExpression;
                q.SortDescending = dataset.SortingOptions.SortDescending;

                q.FillDataSet(dataset);
                foreach (var i in dataset.Items)
                {
                    i.DurationText = i.Duration.ToString("g");
                }
            }
        }
コード例 #14
0
 private void ClearFilter(ExportFilterDTO filter)
 {
     filter.SearchText   = "";
     filter.DurationTo   = filter.DurationMax.ToString("dd.MM.yyyy HH:mm:ss");
     filter.DurationFrom = filter.DurationMin.ToString("dd.MM.yyyy HH:mm:ss");
 }