This commit is contained in:
SchreiberM
2017-01-04 17:09:26 +01:00
128 changed files with 17813 additions and 20419 deletions

View File

@@ -84,16 +84,24 @@ Public Class ClassFolderWatcher
'Die Datei übergeben
If LogErrorsOnly = False Then ClassLogger.Add(" >> OnCreated-File:" & e.FullPath, False)
If FileExistsinDropTable(CURRENT_FILENAME) = False Then
Insert_SCAN_File(e.FullPath, handleType)
Insert_USER_File(e.FullPath, handleType)
Else
Console.WriteLine("File existiert bereits")
End If
Create_USER_FILE_TABLE()
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei folder_watch_Created")
End Try
End Sub
Public Shared Sub Create_USER_FILE_TABLE()
Try
Dim sql = String.Format("SELECT * FROM TBPMO_FILES_USER WHERE (UPPER(USER_WORK) = UPPER('{0}')) AND WORKED = 0", USER_USERNAME)
Dim CURRENT_TBPMO_FILES_USER As DataTable = ClassDatabase.Return_Datatable(sql, True)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected error while creating User_File_Table")
End Try
End Sub
Public Shared Function FileExistsinDropTable(Filename As String)
Dim check As String
Try
@@ -106,7 +114,7 @@ Public Class ClassFolderWatcher
End Try
End Function
Private Shared Function Insert_SCAN_File(filename As String, handleType As String)
Public Shared Function Insert_USER_File(filename As String, handleType As String)
Try
Dim filename_only As String = Path.GetFileName(filename)
@@ -117,5 +125,34 @@ Public Class ClassFolderWatcher
Return False
End Try
End Function
Public Shared Function DELETE_SCAN_File(filename As String)
Try
Dim filename_only As String = Path.GetFileName(filename)
Dim del As String = String.Format("DELETE FROM TBPMO_FILES_USER WHERE UPPER(FILENAME2WORK) = UPPER('{0}')", filename)
Return ClassDatabase.Execute_non_Query(del, True)
Catch ex As Exception
MsgBox("Unexpected Error in DELETE_SCAN_File: " & ex.Message, MsgBoxStyle.Critical)
Return False
End Try
End Function
Public Shared Function DELETE_SCAN_File_User()
Try
Dim del As String = String.Format("DELETE FROM TBPMO_FILES_USER WHERE UPPER(USER_WORK) = UPPER('{0}') AND HANDLE_TYPE = 'SCAN'", USER_USERNAME)
Return ClassDatabase.Execute_non_Query(del, True)
Catch ex As Exception
MsgBox("Unexpected Error in DELETE_SCAN_File_User: " & ex.Message, MsgBoxStyle.Critical)
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)
Catch ex As Exception
MsgBox("Unexpected Error in DELETE_SCAN_File_User: " & ex.Message, MsgBoxStyle.Critical)
Return Nothing
End Try
End Function
End Class