This commit is contained in:
SchreiberM
2017-02-15 09:07:26 +01:00
parent a815c8ab5d
commit 81c3ebe35e
25 changed files with 7215 additions and 7503 deletions

View File

@@ -1,10 +1,13 @@
Imports System.IO
Imports Independentsoft
Imports System.Threading
Imports DD_LIB_Standards
Public Class ClassFolderWatcher
Public Shared FolderWatcher_SCAN As FileSystemWatcher
Public Shared NEW_FILES As Boolean = True
Public Shared Function Restart_FolderWatchSCAN()
Try
If FolderWatcher_SCAN.EnableRaisingEvents = True Then
'Gestartet also Stoppen
@@ -23,7 +26,7 @@ Public Class ClassFolderWatcher
Catch ex As Exception
MsgBox("Error in Restart_FolderWatchSCAN:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Function
Public Shared Function StartStop_FolderWatchSCAN()
Try
@@ -74,7 +77,7 @@ Public Class ClassFolderWatcher
Exit Sub
End If
Next
Dim handleType As String
If e.FullPath.EndsWith(".msg") Then
handleType = "SCAN_OUTLOOK_MESSAGE"
@@ -89,12 +92,13 @@ Public Class ClassFolderWatcher
Console.WriteLine("File existiert bereits")
End If
ClassHelper.Create_USER_FILE_TABLE()
NEW_FILES = True
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei folder_watch_Created")
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in folder_watch_Created")
End Try
End Sub
Public Shared Function FileExistsinDropTable(Filename As String)
Dim check As String
Try
@@ -136,11 +140,17 @@ Public Class ClassFolderWatcher
Return False
End Try
End Function
Public Shared Function Check_Scan_Files()
Try
Dim sql1 As String = String.Format("select * from TBPMO_FILES_USER where HANDLE_TYPE = 'SCAN' and WORKED = 0 AND UPPER(USER_WORK) = '{0}'", USER_USERNAME)
Return ClassDatabase.Return_Datatable(sql1, True)
Dim sql As String = String.Format("select * from TBPMO_FILES_USER where HANDLE_TYPE = 'SCAN' and WORKED = 0 AND UPPER(USER_WORK) = '{0}'", USER_USERNAME)
Dim DT As DataTable = clsDatabase.Return_Datatable(sql, True)
For Each row As DataRow In DT.Rows
If System.IO.File.Exists(row.Item("FILENAME2WORK")) = False Then
DELETE_SCAN_File(row.Item("FILENAME2WORK"))
End If
Next
CURRENT_SCAN_TABLE = clsDatabase.Return_Datatable(sql, True)
Catch ex As Exception
MsgBox("Unexpected Error in DELETE_SCAN_File_User: " & ex.Message, MsgBoxStyle.Critical)
Return Nothing