public void InitFilter(ExportFilterDTO filter, Guid investigationId) { using (var uow = this.UnitOfWorkProvider.Create(investigationId)) { var q = this.MessageFactory(); q.InitFilter(filter); } }
public void InitEmailFilter(ExportFilterDTO filter) { /*using (var uow = this.UnitOfWorkProvider.Create(investigationId)) * { * var q = this.EmailsFactory(); * q.InitEmailFilter(filter); * }*/ }
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 ); }
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 ); }
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 ); }
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 ); }
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); } }
public void InitEmailFilter(ExportFilterDTO filter) { }
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; } } }
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); } } } }
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); } }
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"); } } }
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"); } } }
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"); }