ZooFlow: Include more databasewithfallback calls in zooflow

This commit is contained in:
Jonathan Jenne
2022-01-14 14:15:34 +01:00
parent bcbfba37b2
commit 6f417bb24e
5 changed files with 61 additions and 53 deletions

View File

@@ -80,21 +80,25 @@ Public Class frmGlobix_Index
BringToFront()
Focus()
Try
DocumentViewer1.Init(LogConfig, My.Application.Settings.GdPictureKey)
Catch ex As Exception
Logger.Error(ex)
End Try
Try
Refresh_Dokart()
pnlIndex.Controls.Clear()
My.Application.Globix.CURRENT_ISATTACHMENT = False
Dim oSql = $"SELECT HANDLE_TYPE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CurrentWorkfile.Id}"
DropType = Await My.DatabaseECM.GetScalarValueAsync(oSql)
DropType = Await My.Database.GetScalarValueECMAsync(oSql)
My.Application.Globix.DeleteOriginalFile = My.UIConfig.Globix.DeleteOriginalFile
SplitContainerControl1.SplitterPosition = My.UIConfig.Globix.SplitterDistanceViewer
SourceDeleteItem.Enabled = True
SourceDeleteItem.Checked = My.UIConfig.Globix.DeleteOriginalFile
DocumentViewer1.Init(LogConfig, My.Application.Settings.GdPictureKey)
If DropType Is Nothing Then
Logger.Debug("File with Id [{0}] was not found in TBGI_FILES_USER. Exiting.", My.Application.Globix.CurrentWorkfile.Id)
CancelAttempts = MAX_CANCEL_ATTEMPTS
@@ -112,7 +116,7 @@ Public Class frmGlobix_Index
SetFilePreview(My.UIConfig.Globix.FilePreview)
MultifileCount = Await My.DatabaseECM.GetScalarValueAsync("SELECT COUNT(*) FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CurrentWorkfile.Id & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
MultifileCount = Await My.Database.GetScalarValueECMAsync("SELECT COUNT(*) FROM TBGI_FILES_USER WHERE WORKED = 0 AND GUID <> " & My.Application.Globix.CurrentWorkfile.Id & " AND UPPER(USER@WORK) = UPPER('" & Environment.UserName & "')")
My.Application.Globix.MULTIINDEXING_ACTIVE = False
If MultifileCount > 0 Then
@@ -273,7 +277,7 @@ Public Class frmGlobix_Index
End Sub
Private Sub SkipItem_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles SkipItem.ItemClick
My.DatabaseECM.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CurrentWorkfile.Id}")
My.Database.ExecuteNonQueryECM($"DELETE FROM TBGI_FILES_USER WHERE GUID = {My.Application.Globix.CurrentWorkfile.Id}")
CancelAttempts = MAX_CANCEL_ATTEMPTS
Close()
End Sub
@@ -492,7 +496,7 @@ Public Class frmGlobix_Index
Dim oMeta = DirectCast(pControl.Tag, ControlCreator.ControlMeta)
Dim oIndexName As String = oMeta.IndexName
Dim oSQL = $"SELECT * FROM TBDD_INDEX_MAN WHERE SQL_RESULT LIKE '%{oIndexName}%' AND DOK_ID = {SelectedDocType.Guid}"
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatable(oSQL)
Dim oDatatable As DataTable = My.Database.GetDatatableECM(oSQL)
If Not IsNothing(oDatatable) Then
Logger.Debug("Found [{0}] depending controls for [{1}]", oDatatable.Rows.Count, pControl.Name)
@@ -526,10 +530,7 @@ Public Class frmGlobix_Index
Exit Sub
End If
Dim oConnectionString = GetConnectionString(SqlConnectionId)
Dim oDatatable As DataTable = My.DatabaseECM.GetDatatableWithConnection(pSqlCommand, oConnectionString)
Dim oDatatable As DataTable = My.Database.GetDatatable(pSqlCommand, SqlConnectionId)
Dim oFoundControl As Control = Nothing
For Each oControl As Control In pnlIndex.Controls
@@ -593,7 +594,7 @@ Public Class frmGlobix_Index
pSQLCommand = Patterns2.ReplaceInternalValues(pSQLCommand)
pSQLCommand = Patterns2.ReplaceUserValues(pSQLCommand, My.Application.User)
Dim oDatatable = My.DatabaseECM.GetDatatableWithConnection(pSQLCommand, oConnectionString)
Dim oDatatable = My.Database.GetDatatable(pSQLCommand, pConnectionId)
Return oDatatable
End If
Else
@@ -603,9 +604,9 @@ Public Class frmGlobix_Index
End Function
Function GetPlaceholderValue(InputValue As String, FileName As String) As String
Dim oResult As String = InputValue
Dim oPatterns As New Modules.Patterns.Patterns2(My.LogConfig)
Dim oFileInfo As New FileInfo(FileName)
Dim oPatterns As New Modules.Patterns.Patterns2(My.LogConfig)
oResult = oPatterns.ReplaceInternalValues(oResult)
oResult = oPatterns.ReplaceFileValues(oResult, oFileInfo)
oResult = oPatterns.ReplaceUserValues(oResult, My.Application.User)
@@ -657,7 +658,7 @@ Public Class frmGlobix_Index
Try
My.Application.Globix.ABORT_INDEXING = True
Dim sql As String = $"SELECT * FROM TBGI_FILES_USER WHERE WORKED = 0 AND UPPER(USER@WORK) = UPPER('{My.Application.User.UserName}')"
Dim DT As DataTable = My.DatabaseECM.GetDatatable(sql)
Dim DT As DataTable = My.Database.GetDatatableECM(sql)
Dim anz = DT.Rows.Count
For Each Filerow As DataRow In DT.Rows
@@ -676,7 +677,7 @@ Public Class frmGlobix_Index
End If
Next
'Zuerst die Daten des Ablaufs löschen
If My.DatabaseECM.ExecuteNonQuery($"DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('{My.Application.User.UserName}')") = True Then
If My.Database.ExecuteNonQueryECM($"DELETE FROM TBGI_FILES_USER WHERE UPPER(USER@WORK) = UPPER('{My.Application.User.UserName}')") = True Then
If containsfw_file = True Then
If My.Application.User.Language = "de-DE" Then
MsgBox("Der Indexierungsprozess beinhaltete (auch) Dateien per Folderwatch!" & vbNewLine & "Diese Dateien wurden nicht gelöscht und verbleiben im Folderwatch-Verzeichnis!" & vbNewLine & "Bitte verschieben Sie die Dateien ggfls.", MsgBoxStyle.Information, "Achtung - Hinweis:")