public NotificationDetails GetNotificationDetailsById(int notificationId) { NotificationDetails notification = new NotificationDetails(_databaseQueryService.GetNotificationById(notificationId)); notification.Alert = new AlertDetails(_databaseQueryService.GetAlertById(notification.AlertId)); notification.Alert.Camera = new CameraDetails(_databaseQueryService.GetCameraById(notification.Alert.CameraId)); notification.Alert.Camera.Location = new LocationDetails(_databaseQueryService.GetLocationById(notification.Alert.Camera.LocationId)); return(notification); }
public JpgStatFrameList GetTriggeringStatsFrameList(int notificationId) { DatabaseNotification dbNotification = _dbQueryService.GetNotificationById(notificationId); DatabaseAlert dbAlert = _dbQueryService.GetAlertById(dbNotification.AlertId); List <DatabasePerSecondStat> statsForCamera = _dbQueryService.GetPerSecondStatsWithFrmTriggeringAlert(dbAlert, dbNotification.TriggerDateTime, dbNotification.TriggerDateTime.AddMinutes(30)); JpgStatFrameList frmList = new JpgStatFrameList(); frmList.JpgFramePathList = new List <FrameInformation>(); foreach (DatabasePerSecondStat stat in statsForCamera) { if (!stat.FrameJpgPath.IsNullOrEmpty()) { FrameInformation frmInfo = new FrameInformation(stat); if (frmInfo.FrmJpgRelPath.IsNullOrEmpty() == false) { frmList.JpgFramePathList.Add(frmInfo); } } } return(frmList); }