ZooFlow: Use BaseClass in Globix classes

This commit is contained in:
Jonathan Jenne
2021-12-14 11:40:24 +01:00
parent 2436fd296f
commit a595a75065
5 changed files with 74 additions and 101 deletions

View File

@@ -72,6 +72,7 @@ Public Class frmFlowForm
' === Initialize AppServer Database Connection with Failover
AppServerOrDB = New ClassDataASorDB(My.LogConfig)
' === Initialization ===
Init = New ClassInit(My.LogConfig, Me)
AddHandler Init.Completed, AddressOf Init_Completed
@@ -110,7 +111,7 @@ Public Class frmFlowForm
AddHandler Watcher.ClipboardChanged, AddressOf Watcher_ClipboardChanged
Dim oSQL = My.Queries.Common.FNIDB_GET_SEARCH_PROFILES(My.Application.User.UserId, My.Application.User.Language)
Dim oDatatable As DataTable = My.DatabaseIDB.GetDatatable(oSql)
Dim oDatatable As DataTable = My.DatabaseIDB.GetDatatable(oSQL)
PictureBoxSearch1.Visible = False
If Not IsNothing(oDatatable) OrElse oDatatable.Rows.Count > 0 Then
IDBSearchActive = True
@@ -161,9 +162,8 @@ Public Class frmFlowForm
If My.Application.ModulesActive.Contains(MODULE_GLOBAL_INDEXER) Then
FileDrop = New ClassFileDrop(My.LogConfig)
FileHandle = New ClassFilehandle()
FolderWatch = New ClassFolderwatcher()
NNRefresh_RegexTable()
FileHandle = New ClassFilehandle(My.LogConfig)
FolderWatch = New ClassFolderwatcher(My.LogConfig)
Dim oFileExclusions As New ClassExclusions()
If oFileExclusions.Load(My.Application.Globix.PATH_FileExclusions) = False Then
@@ -180,9 +180,10 @@ Public Class frmFlowForm
GlobixToolStripMenuItem.Visible = True
End If
oSQL = "SELECT * FROM TBIDB_ATTRIBUTE"
oSQL = "SELECT * FROM TBIDB_ATTRIBUTE"
My.Tables.DTIDB_ATTRIBUTE = AppServerOrDB.GetDatatable("IDB", oSQL, "TBIDB_ATTRIBUTE", "", "")
Me.Cursor = Cursors.Default
End Sub
@@ -204,7 +205,6 @@ Public Class frmFlowForm
If oFolderWatchPath = String.Empty Then
Logger.Info("Init_Folderwatch: folderwatchPath is empty")
My.Application.Globix.Folderwatchstarted = False
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "False")
My.UIConfig.Globix.FolderWatchStarted = False
My.UIConfigManager.Save()
@@ -213,7 +213,6 @@ Public Class frmFlowForm
If Not IO.Directory.Exists(oFolderWatchPath) Then
Logger.Info("Init_Folderwatch: folderwatchPath does not exists or is invalid path")
My.Application.Globix.Folderwatchstarted = False
'SaveConfigValue("my.Application.Globix.Folderwatchstarted", "False")
My.UIConfig.Globix.FolderWatchStarted = False
My.UIConfigManager.Save()
@@ -493,21 +492,18 @@ Public Class frmFlowForm
End Sub
Sub Globix_Check_Dropped_Files()
Try
My.DatabaseECM.ExecuteNonQuery("DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
My.DatabaseECM.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE WORKED = 1 AND UPPER(USER@WORK) = UPPER('{Environment.UserName}')")
Dim i As Integer
For Each Str As Object In FileDrop.files_dropped
If Not Str Is Nothing Then
Logger.Info(" Check Drop-File: " & Str.ToString)
Dim handleType As String = Str.Substring(0, Str.LastIndexOf("|") + 1)
Dim filename As String = Str.Substring(Str.LastIndexOf("|") + 1)
For Each pFile As String In FileDrop.files_dropped
If Not pFile Is Nothing Then
Logger.Info(" Check Drop-File: " & pFile.ToString)
Dim handleType As String = pFile.Substring(0, pFile.LastIndexOf("|") + 1)
Dim filename As String = pFile.Substring(pFile.LastIndexOf("|") + 1)
If FileHandle.CheckDuplicateFiles(filename, "Manuelle Ablage") Then
FileHandle.Decide_FileHandle(filename, handleType)
i += 1
Else
' Console.WriteLine("File gibt es bereits")
End If
End If
Next
@@ -530,11 +526,12 @@ Public Class frmFlowForm
My.Application.Globix.DTACTUAL_FILES = My.DatabaseECM.GetDatatable(sql)
End If
For Each oFileRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows
Dim oFilePath As String = oFileRow.Item("FILENAME2WORK").ToString
For Each oRow As DataRow In My.Application.Globix.DTACTUAL_FILES.Rows
Dim oFilePath As String = oRow.Item("FILENAME2WORK").ToString
Dim oFileId As Integer = oRow.Item("GUID")
My.Application.Globix.CurrentWorkfile = New Globix.Models.WorkFile With {
.Id = oFileRow.Item(0),
.Id = oFileId,
.FilePath = oFilePath
}
@@ -597,12 +594,6 @@ Public Class frmFlowForm
End If
If My.Application.Globix.CurrentFolderWatchPath <> "" Or My.Application.Globix.CURRENT_SCAN_FOLDERWATCH <> "" Then
'If My.Application.Globix.Folderwatchstarted = True Then
' tslblFW.Visible = True
'Else
' tslblFW.Visible = False
'End If
Try
If My.UIConfigManager.Config.Globix.FolderWatchScanStarted = True Then
Logger.Info("FWSCAN started - Checking file:" & My.Application.Globix.CURRENT_SCAN_FOLDERWATCH)