Compare commits
2 Commits
2bbdc4c902
...
eb59a4e13d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb59a4e13d | ||
|
|
4d8d00f6df |
@@ -19,7 +19,7 @@ Public Class ClassFolderwatcher
|
|||||||
FWFolderWatcher.EnableRaisingEvents = False
|
FWFolderWatcher.EnableRaisingEvents = False
|
||||||
My.Application.Globix.Folderwatchstarted = False
|
My.Application.Globix.Folderwatchstarted = False
|
||||||
'FolderWatch neu instanzieren
|
'FolderWatch neu instanzieren
|
||||||
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_FOLDERWATCH, "*.*")
|
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
|
||||||
Logger.Info(" >> FolderWatch neu instanziert")
|
Logger.Info(" >> FolderWatch neu instanziert")
|
||||||
FWFolderWatcher.IncludeSubdirectories = False
|
FWFolderWatcher.IncludeSubdirectories = False
|
||||||
FWFolderWatcher.EnableRaisingEvents = True
|
FWFolderWatcher.EnableRaisingEvents = True
|
||||||
@@ -56,12 +56,12 @@ Public Class ClassFolderwatcher
|
|||||||
End Function
|
End Function
|
||||||
Public Function StartStop_FolderWatch()
|
Public Function StartStop_FolderWatch()
|
||||||
Try
|
Try
|
||||||
If My.Application.Globix.CURRENT_FOLDERWATCH = "" Then
|
If My.Application.Globix.CurrentFolderWatchPath = "" Then
|
||||||
'MsgBox("Bitte definieren Sie einen Überwachungsordner:", MsgBoxStyle.Exclamation)
|
'MsgBox("Bitte definieren Sie einen Überwachungsordner:", MsgBoxStyle.Exclamation)
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
If FWFolderWatcher Is Nothing Then
|
If FWFolderWatcher Is Nothing Then
|
||||||
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_FOLDERWATCH, "*.*")
|
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
|
||||||
Logger.Info(" >> FolderWatch Gestartet")
|
Logger.Info(" >> FolderWatch Gestartet")
|
||||||
FWFolderWatcher.IncludeSubdirectories = False
|
FWFolderWatcher.IncludeSubdirectories = False
|
||||||
FWFolderWatcher.EnableRaisingEvents = True
|
FWFolderWatcher.EnableRaisingEvents = True
|
||||||
@@ -75,7 +75,7 @@ Public Class ClassFolderwatcher
|
|||||||
If FWFolderWatcher.EnableRaisingEvents = False Then
|
If FWFolderWatcher.EnableRaisingEvents = False Then
|
||||||
' Dim watcher As New FileSystemWatcher()
|
' Dim watcher As New FileSystemWatcher()
|
||||||
' watcher.Path = CURRENT_FOLDERWATCH
|
' watcher.Path = CURRENT_FOLDERWATCH
|
||||||
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_FOLDERWATCH, "*.*")
|
FWFolderWatcher = New System.IO.FileSystemWatcher(My.Application.Globix.CurrentFolderWatchPath, "*.*")
|
||||||
Logger.Info(" >> FolderWatch Gestartet")
|
Logger.Info(" >> FolderWatch Gestartet")
|
||||||
FWFolderWatcher.IncludeSubdirectories = False
|
FWFolderWatcher.IncludeSubdirectories = False
|
||||||
FWFolderWatcher.EnableRaisingEvents = True
|
FWFolderWatcher.EnableRaisingEvents = True
|
||||||
@@ -97,6 +97,7 @@ Public Class ClassFolderwatcher
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex.Message)
|
||||||
MsgBox("Error in StartStop_FolderWatch:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Error in StartStop_FolderWatch:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
Return 99
|
Return 99
|
||||||
End Try
|
End Try
|
||||||
@@ -118,7 +119,7 @@ Public Class ClassFolderwatcher
|
|||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
If FWScan Is Nothing Then
|
If FWScan Is Nothing Then
|
||||||
FWScan = New System.IO.FileSystemWatcher(My.Application.Globix.CURRENT_SCAN_FOLDERWATCH, "*.*")
|
FWScan = New FileSystemWatcher(My.Application.Globix.CURRENT_SCAN_FOLDERWATCH, "*.*")
|
||||||
Logger.Info(" >> FolderWatch Scan Gestartet")
|
Logger.Info(" >> FolderWatch Scan Gestartet")
|
||||||
FWScan.IncludeSubdirectories = False
|
FWScan.IncludeSubdirectories = False
|
||||||
FWScan.EnableRaisingEvents = True
|
FWScan.EnableRaisingEvents = True
|
||||||
@@ -149,6 +150,7 @@ Public Class ClassFolderwatcher
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex.Message)
|
||||||
MsgBox("Error in StartStop_FolderWatchSCAN:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
MsgBox("Error in StartStop_FolderWatchSCAN:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||||
Return 99
|
Return 99
|
||||||
End Try
|
End Try
|
||||||
@@ -194,6 +196,7 @@ Public Class ClassFolderwatcher
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
|
Logger.Error(ex.Message)
|
||||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in folder_watch_Created")
|
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in folder_watch_Created")
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ Namespace Globix
|
|||||||
Public Property TEMP_FILES As List(Of String) = New List(Of String)
|
Public Property TEMP_FILES As List(Of String) = New List(Of String)
|
||||||
Public Property CurrMessageID As String
|
Public Property CurrMessageID As String
|
||||||
Public Property CURRENT_FILENAME As String
|
Public Property CURRENT_FILENAME As String
|
||||||
Public Property CURRENT_FOLDERWATCH As String
|
Public Property CurrentFolderWatchPath As String
|
||||||
Public Property CURRENT_SCAN_FOLDERWATCH As String
|
Public Property CURRENT_SCAN_FOLDERWATCH As String
|
||||||
Public Property CURRENT_WORKFILE_GUID As Long
|
Public Property CURRENT_WORKFILE_GUID As Long
|
||||||
Public Property CURRENT_WORKFILE As String
|
Public Property CURRENT_WORKFILE As String
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ Public Class frmGlobixBasicConfig
|
|||||||
'SaveConfigValue("FW_started", "False")
|
'SaveConfigValue("FW_started", "False")
|
||||||
My.UIConfig.Globix.FolderWatchStarted = False
|
My.UIConfig.Globix.FolderWatchStarted = False
|
||||||
My.UIConfigManager.Save()
|
My.UIConfigManager.Save()
|
||||||
My.Application.Globix.CURRENT_FOLDERWATCH = ""
|
My.Application.Globix.CurrentFolderWatchPath = ""
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Exit Sub
|
Exit Sub
|
||||||
@@ -81,8 +81,8 @@ Public Class frmGlobixBasicConfig
|
|||||||
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = folderwatch
|
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = folderwatch
|
||||||
Me.txtScanFolderWatch.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
|
Me.txtScanFolderWatch.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
|
||||||
Else
|
Else
|
||||||
My.Application.Globix.CURRENT_FOLDERWATCH = folderwatch
|
My.Application.Globix.CurrentFolderWatchPath = folderwatch
|
||||||
Me.txtFolderWatch.Text = My.Application.Globix.CURRENT_FOLDERWATCH
|
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
If My.Application.Globix.Folderwatchstarted = True And FOLDER_TYPE = "DEFAULT" Then
|
If My.Application.Globix.Folderwatchstarted = True And FOLDER_TYPE = "DEFAULT" Then
|
||||||
@@ -104,14 +104,14 @@ Public Class frmGlobixBasicConfig
|
|||||||
oReload = True
|
oReload = True
|
||||||
Dim oFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId)
|
Dim oFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId)
|
||||||
If Not oFolderwatch Is Nothing Then
|
If Not oFolderwatch Is Nothing Then
|
||||||
My.Application.Globix.CURRENT_FOLDERWATCH = oFolderwatch
|
My.Application.Globix.CurrentFolderWatchPath = oFolderwatch
|
||||||
End If
|
End If
|
||||||
Me.txtFolderWatch.Text = My.Application.Globix.CURRENT_FOLDERWATCH
|
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
|
||||||
Dim oSCANFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId)
|
Dim oSCANFolderwatch = My.Database.GetScalarValue("SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'SCAN' AND USER_ID = " & My.Application.User.UserId)
|
||||||
If Not oSCANFolderwatch Is Nothing Then
|
If Not oSCANFolderwatch Is Nothing Then
|
||||||
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch
|
My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch
|
||||||
End If
|
End If
|
||||||
Me.txtFolderWatch.Text = My.Application.Globix.CURRENT_FOLDERWATCH
|
Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath
|
||||||
Me.txtScanFolderWatch.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
|
Me.txtScanFolderWatch.Text = My.Application.Globix.CURRENT_SCAN_FOLDERWATCH
|
||||||
|
|
||||||
If Not ClassFolderwatcher.FWFolderWatcher Is Nothing Then
|
If Not ClassFolderwatcher.FWFolderWatcher Is Nothing Then
|
||||||
|
|||||||
@@ -280,9 +280,14 @@ Public Class frmFlowForm
|
|||||||
Try
|
Try
|
||||||
Dim oSql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId
|
Dim oSql As String = "SELECT FOLDER_PATH FROM TBGI_FOLDERWATCH_USER WHERE FOLDER_TYPE = 'DEFAULT' AND USER_ID = " & My.Application.User.UserId
|
||||||
|
|
||||||
Dim oDT As DataTable = AppServerOrDB.GetDatatable("IDB", oSql, "TBGI_FOLDERWATCH_USER", $"FOLDER_TYPE = 'DEFAULT' AND USER_ID = {My.Application.User.UserId}")
|
Dim oDT As DataTable = AppServerOrDB.GetDatatable("DD_ECM", oSql, "TBGI_FOLDERWATCH_USER", $"FOLDER_TYPE = 'DEFAULT' AND USER_ID = {My.Application.User.UserId}")
|
||||||
Dim oFolderWatchPath = oDT.Rows(0).Item("FOLDER_PATH")
|
|
||||||
oFolderWatchPath = NotNull(oFolderWatchPath, String.Empty)
|
If oDT.Rows.Count = 0 Then
|
||||||
|
Throw New ApplicationException("No Default Path configured for User!")
|
||||||
|
End If
|
||||||
|
|
||||||
|
Dim oFolderWatchPath = oDT.Rows.Item(0).Item("FOLDER_PATH")
|
||||||
|
oFolderWatchPath = NotNull(oFolderWatchPath, String.Empty).ToString
|
||||||
|
|
||||||
If oFolderWatchPath = String.Empty Then
|
If oFolderWatchPath = String.Empty Then
|
||||||
Logger.Info("Init_Folderwatch: folderwatchPath is empty")
|
Logger.Info("Init_Folderwatch: folderwatchPath is empty")
|
||||||
@@ -302,13 +307,13 @@ Public Class frmFlowForm
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
My.Application.Globix.CURRENT_FOLDERWATCH = oFolderWatchPath
|
My.Application.Globix.CurrentFolderWatchPath = oFolderWatchPath
|
||||||
|
|
||||||
My.Application.Globix.Folderwatchstarted = True
|
My.Application.Globix.Folderwatchstarted = True
|
||||||
'FWFunction_STARTED = True
|
'FWFunction_STARTED = True
|
||||||
FolderWatch.StartStop_FolderWatch()
|
FolderWatch.StartStop_FolderWatch()
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
MsgBox($"Init_Folderwatch: Unexpected error while starting FolderWatch: {ex.Message}", MsgBoxStyle.Critical)
|
MsgBox($"Init_Folderwatch: Unexpected error while starting FolderWatch: {ex.Message}", MsgBoxStyle.Critical)
|
||||||
|
Logger.Error(ex)
|
||||||
Logger.Info($"Init_Folderwatch: Unexpected error: {ex.Message}")
|
Logger.Info($"Init_Folderwatch: Unexpected error: {ex.Message}")
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
@@ -672,7 +677,7 @@ Public Class frmFlowForm
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
Sub Start_Folderwatch()
|
Sub Start_Folderwatch()
|
||||||
If My.Application.Globix.CURRENT_FOLDERWATCH = String.Empty Then
|
If My.Application.Globix.CurrentFolderWatchPath = String.Empty Then
|
||||||
My.Application.Globix.Folderwatchstarted = False
|
My.Application.Globix.Folderwatchstarted = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -681,7 +686,7 @@ Public Class frmFlowForm
|
|||||||
My.UIConfigManager.Save()
|
My.UIConfigManager.Save()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If My.Application.Globix.CURRENT_FOLDERWATCH <> "" Or My.Application.Globix.CURRENT_SCAN_FOLDERWATCH <> "" Then
|
If My.Application.Globix.CurrentFolderWatchPath <> "" Or My.Application.Globix.CURRENT_SCAN_FOLDERWATCH <> "" Then
|
||||||
'If My.Application.Globix.Folderwatchstarted = True Then
|
'If My.Application.Globix.Folderwatchstarted = True Then
|
||||||
' tslblFW.Visible = True
|
' tslblFW.Visible = True
|
||||||
'Else
|
'Else
|
||||||
@@ -727,8 +732,8 @@ Public Class frmFlowForm
|
|||||||
|
|
||||||
Try
|
Try
|
||||||
If My.Application.Globix.Folderwatchstarted = True Then
|
If My.Application.Globix.Folderwatchstarted = True Then
|
||||||
Logger.Info("Folderwatchstarted - Checking file:" & My.Application.Globix.CURRENT_FOLDERWATCH)
|
Logger.Info("Folderwatchstarted - Checking file:" & My.Application.Globix.CurrentFolderWatchPath)
|
||||||
Dim fileEntries As String() = Directory.GetFiles(My.Application.Globix.CURRENT_FOLDERWATCH)
|
Dim fileEntries As String() = Directory.GetFiles(My.Application.Globix.CurrentFolderWatchPath)
|
||||||
' Process the list of files found in the directory.
|
' Process the list of files found in the directory.
|
||||||
Dim fileName As String
|
Dim fileName As String
|
||||||
For Each fileName In fileEntries
|
For Each fileName In fileEntries
|
||||||
|
|||||||
Reference in New Issue
Block a user