diff --git a/GUIs.ZooFlow/ClassIDBData.vb b/GUIs.ZooFlow/ClassIDBData.vb index d34c6675..7a79ccbb 100644 --- a/GUIs.ZooFlow/ClassIDBData.vb +++ b/GUIs.ZooFlow/ClassIDBData.vb @@ -10,20 +10,18 @@ Public Class ClassIDBData ''' Title of Business Entity ''' Array with all Indices Private _Logger As Logger - Private _DataASorDB As ClassDataASorDB Private _Database As DatabaseWithFallback Public Sub New(LogConfig As LogConfig) _Logger = LogConfig.GetLogger _Database = New DatabaseWithFallback(LogConfig, My.Application.Service.Client, My.DatabaseECM, My.DatabaseIDB) - _DataASorDB = New ClassDataASorDB(LogConfig) Dim oSQL = $"SELECT * FROM VWIDB_BE_ATTRIBUTE WHERE LANG_ID = {My.Application.User.LanguageId}" - DTVWIDB_BE_ATTRIBUTE = _Database.GetDatatable("VWIDB_BE_ATTRIBUTE", oSQL, DatabaseType.IDB, $"LANG_ID = {My.Application.User.LanguageId}") - 'DTVWIDB_BE_ATTRIBUTE = _DataASorDB.GetDatatable("IDB", oSQL, "VWIDB_BE_ATTRIBUTE", $"LANG_ID = {My.Application.User.LanguageID}") End Sub + Public IDBSystemIndices As List(Of String) + Public Function GetIndicesByBE(ByVal pBusinessEntity As String) As List(Of String) Try IDBSystemIndices = New List(Of String) From { diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index 4a752818..789de859 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -18,7 +18,6 @@ Public Class ClassInit Inherits Base.BaseClass Private ReadOnly _MainForm As frmFlowForm - Private ReadOnly _DataASorDB As ClassDataASorDB Private ReadOnly _Database As DatabaseWithFallback Private _Loader As ClassInitLoader @@ -27,9 +26,6 @@ Public Class ClassInit Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm) MyBase.New(LogConfig) _MainForm = ParentForm - - 'TODO: Remove when Globix uses DatabaseWithFallback - clsDataASorDB = New ClassDataASorDB(LogConfig) End Sub Public Sub InitializeApplication() diff --git a/GUIs.ZooFlow/Globix/ClassValidator.vb b/GUIs.ZooFlow/Globix/ClassValidator.vb index f4c897c0..4bde1088 100644 --- a/GUIs.ZooFlow/Globix/ClassValidator.vb +++ b/GUIs.ZooFlow/Globix/ClassValidator.vb @@ -129,7 +129,7 @@ Public Class ClassValidator End Try End Function - Function GetControlValues(pPanel As Panel) + Function GetControlValues(pPanel As Panel) As List(Of UserAttributeValue) Dim oAttributeValues As New List(Of UserAttributeValue) For Each oControl As Control In pPanel.Controls diff --git a/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb b/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb index 1272fbde..687baae0 100644 --- a/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb +++ b/GUIs.ZooFlow/Globix/frmGlobixBasicConfig.vb @@ -99,16 +99,16 @@ Public Class frmGlobixBasicConfig Private Sub frmGlobixBasicConfig_Load(sender As Object, e As EventArgs) Handles Me.Load Logger = My.LogConfig.GetLogger() - clsFW = New ClassFolderwatcher() + clsFW = New ClassFolderwatcher(My.LogConfig) Try oReload = True Dim oFolderwatch = My.DatabaseECM.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 oFolderwatch IsNot Nothing Then My.Application.Globix.CurrentFolderWatchPath = oFolderwatch End If Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath Dim oSCANFolderwatch = My.DatabaseECM.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 oSCANFolderwatch IsNot Nothing Then My.Application.Globix.CURRENT_SCAN_FOLDERWATCH = oSCANFolderwatch End If Me.txtFolderWatch.Text = My.Application.Globix.CurrentFolderWatchPath diff --git a/GUIs.ZooFlow/ModuleHelpers.vb b/GUIs.ZooFlow/ModuleHelpers.vb index 8dd33e65..4b69b50a 100644 --- a/GUIs.ZooFlow/ModuleHelpers.vb +++ b/GUIs.ZooFlow/ModuleHelpers.vb @@ -35,7 +35,9 @@ Module ModuleHelpers Dim connectionString As String = "" Try Dim oSQL = "SELECT * FROM TBDD_CONNECTION WHERE GUID = " & id - Dim DTConnection As DataTable = clsDataASorDB.GetDatatable("DD_ECM", oSQL, "TBDD_CONNECTION", "GUID = " & id, "") + Dim DTConnection As DataTable = My.Database.GetDatatable("TBDD_CONNECTION", oSQL, Modules.EDMI.API.Constants.DatabaseType.ECM, $"GUID = {id}") + + If DTConnection.Rows.Count = 1 Then Dim CSType = DTConnection.Rows(0).Item("SQL_PROVIDER").ToString.ToUpper Select Case CSType diff --git a/GUIs.ZooFlow/frmFlowForm.vb b/GUIs.ZooFlow/frmFlowForm.vb index 884c5581..12fbb0cf 100644 --- a/GUIs.ZooFlow/frmFlowForm.vb +++ b/GUIs.ZooFlow/frmFlowForm.vb @@ -22,7 +22,6 @@ Public Class frmFlowForm ' Common Helpers Classes Private Init As ClassInit - Private AppServerOrDB As ClassDataASorDB Private FileClass As Filesystem.File ' Globix Helper Classes @@ -69,10 +68,6 @@ Public Class frmFlowForm ' === Show Splash Screen === SplashScreenManager.ShowForm(Me, GetType(frmSplash), False, False) - ' === Initialize AppServer Database Connection with Failover - AppServerOrDB = New ClassDataASorDB(My.LogConfig) - - ' === Initialization === Init = New ClassInit(My.LogConfig, Me) AddHandler Init.Completed, AddressOf Init_Completed @@ -182,7 +177,7 @@ Public Class frmFlowForm End If oSQL = "SELECT * FROM TBIDB_ATTRIBUTE" - My.Tables.DTIDB_ATTRIBUTE = AppServerOrDB.GetDatatable("IDB", oSQL, "TBIDB_ATTRIBUTE", "", "") + My.Tables.DTIDB_ATTRIBUTE = My.Database.GetDatatable("TBIDB_ATTRIBUTE", "SELECT * FROM TBIDB_ATTRIBUTE", EDMI.API.Constants.DatabaseType.IDB) Me.Cursor = Cursors.Default End Sub @@ -190,8 +185,7 @@ Public Class frmFlowForm Public Sub Init_Folderwatch() Try 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("DD_ECM", oSql, "TBGI_FOLDERWATCH_USER", $"FOLDER_TYPE = 'DEFAULT' AND USER_ID = {My.Application.User.UserId}") + Dim oDT = My.Database.GetDatatable("TBGI_FOLDERWATCH_USER", oSql, EDMI.API.Constants.DatabaseType.ECM, $"FOLDER_TYPE = 'DEFAULT' AND USER_ID = {My.Application.User.UserId}") If oDT.Rows.Count = 0 Then 'Throw New ApplicationException("No Default Path configured for User!") diff --git a/GUIs.ZooFlow/frmtest.vb b/GUIs.ZooFlow/frmtest.vb index b3e322ed..791f8b6f 100644 --- a/GUIs.ZooFlow/frmtest.vb +++ b/GUIs.ZooFlow/frmtest.vb @@ -4,6 +4,7 @@ Imports DigitalData.Modules.EDMI.API Imports System.IO Imports System.Text Imports DigitalData.Modules.EDMI.API.Client +Imports DigitalData.Modules.EDMI.API.EDMIServiceReference Public Class frmtest @@ -36,7 +37,7 @@ Public Class frmtest Private Async Sub btnImportFile_Click_(sender As Object, e As EventArgs) Handles btnImportFile.Click - Dim oObjectId As Long = Await My.Application.Service.Client.ImportFileAsync( + Dim oResponse As ImportFileResponse = Await My.Application.Service.Client.ImportFileAsync( txtFile2Import.Text, txtProfileId.Text, New List(Of EDMIServiceReference.UserAttributeValue) From { @@ -50,11 +51,13 @@ Public Class frmtest "DEFAULT" ) - If oObjectId <> INVALID_OBEJCT_ID Then + If oResponse.OK Then MsgBox("File Imported!", MsgBoxStyle.Information, Text) + txtIDB_OBJ_ID.Text = oResponse.ObjectId Else - MsgBox("File was not imported. Check the server logs!") + MsgBox("File was not imported. Check the server logs!", MsgBoxStyle.Critical, Text) End If - txtIDB_OBJ_ID.Text = oObjectId + + End Sub End Class \ No newline at end of file diff --git a/GUIs.ZooFlow/modCurrent.vb b/GUIs.ZooFlow/modCurrent.vb index 30120a91..7f8b8cf9 100644 --- a/GUIs.ZooFlow/modCurrent.vb +++ b/GUIs.ZooFlow/modCurrent.vb @@ -12,6 +12,5 @@ Module modCurrent Public Property NI_TITLE As String = "" Public Property NI_MESSAGE As String = "" Public Property NI_TYPE As String = "INFO" - Public Property clsDataASorDB As ClassDataASorDB Public Property GLOBIX_JUMP_DOCTYPE_ID As Integer End Module diff --git a/Modules.EDMIAPI/DatabaseWithFallback.vb b/Modules.EDMIAPI/DatabaseWithFallback.vb index 716a7d5b..63dea9d3 100644 --- a/Modules.EDMIAPI/DatabaseWithFallback.vb +++ b/Modules.EDMIAPI/DatabaseWithFallback.vb @@ -48,7 +48,7 @@ Public Class DatabaseWithFallback End Try If oTableResult Is Nothing OrElse oTableResult.OK = False Then - _Logger.Warn("Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.") + _Logger.Warn("Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.", pDataTableName) Return GetDatatableFromDatabase(pFallbackSQL, pFallbackType) End If