From 088c330f0c33b940a472de6ac6ae1e9c1cfdc3b3 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 23 Dec 2020 16:14:02 +0100 Subject: [PATCH] ZooFlow: integrate service config --- GUIs.ZooFlow/ClassInit.vb | 21 ++++++++++++--------- GUIs.ZooFlow/Config/ClassConfig.vb | 3 +++ GUIs.ZooFlow/Search/frmSearchStart.vb | 3 ++- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/GUIs.ZooFlow/ClassInit.vb b/GUIs.ZooFlow/ClassInit.vb index d59c38eb..84c41409 100644 --- a/GUIs.ZooFlow/ClassInit.vb +++ b/GUIs.ZooFlow/ClassInit.vb @@ -18,11 +18,6 @@ Public Class ClassInit Public Sub New(LogConfig As LogConfig, ParentForm As frmFlowForm) _MainForm = ParentForm _Logger = LogConfig.GetLogger() - Try - - Catch ex As Exception - - End Try End Sub Public Sub InitializeApplication() @@ -42,7 +37,8 @@ Public Class ClassInit ' === Init Schritte definieren oInit.AddStep("Checking connectivity..", AddressOf CheckConnectivity, True) oInit.AddStep("Initializing User..", AddressOf InitializeUser, True) - oInit.AddStep("Initializing IDB..", AddressOf InitializeIDB, True) + oInit.AddStep("Initializing IDB Database..", AddressOf InitializeIDBDatabase, True) + oInit.AddStep("Initializing IDB Service..", AddressOf InitializeIDBService, True) oInit.AddStep("Initializing Language..", AddressOf InitializeLanguage, False) oInit.AddStep("Loading 3rd-party licenses..", AddressOf Initialize3rdParty, False) oInit.AddStep("Loading Basic Configs..", AddressOf InitBasicData, False) @@ -139,16 +135,23 @@ Public Class ClassInit Dim oSql = "SELECT * FROM TBGI_FUNCTION_REGEX" My.Application.Globix.DT_FUNCTION_REGEX = My.Database.GetDatatable(oSql) + Catch ex As Exception + _Logger.Error(ex) + Throw New InitException("Error in InitBasicData") + End Try + End Sub - - + Private Sub InitializeIDBService(MyApplication As My.MyApplication) + Try + MyApplication.Service.Address = My.SystemConfig.AppServerConfig + MyApplication.Service.IsActive = True Catch ex As Exception _Logger.Error(ex) Throw New InitException("Error in InitBasicData") End Try End Sub - Private Sub InitializeIDB(MyApplication As My.MyApplication) + Private Sub InitializeIDBDatabase(MyApplication As My.MyApplication) If MyApplication.ModulesActive.Contains(MODULE_ZOOFLOW) Then If My.Database.DBInitialized Then Dim oSQl = "SELECT * FROM TBDD_CONNECTION WHERE BEZEICHNUNG = 'IDB'" diff --git a/GUIs.ZooFlow/Config/ClassConfig.vb b/GUIs.ZooFlow/Config/ClassConfig.vb index 84fc6230..08837da5 100644 --- a/GUIs.ZooFlow/Config/ClassConfig.vb +++ b/GUIs.ZooFlow/Config/ClassConfig.vb @@ -40,6 +40,9 @@ Public Class ClassConfig Public Property ConnectionString As String = String.Empty + + Public Property AppServerConfig As String = "172.24.12.39:9000" + ' === Logging Configuration Public Property LogDebug As Boolean = False diff --git a/GUIs.ZooFlow/Search/frmSearchStart.vb b/GUIs.ZooFlow/Search/frmSearchStart.vb index 02fffad0..b425ee4b 100644 --- a/GUIs.ZooFlow/Search/frmSearchStart.vb +++ b/GUIs.ZooFlow/Search/frmSearchStart.vb @@ -944,7 +944,8 @@ Public Class frmSearchStart .Modules = My.Application.Modules, .Database = My.Database, .DatabaseIDB = My.DatabaseIDB, - .Settings = My.Application.Settings + .Settings = My.Application.Settings, + .Service = My.Application.Service } Dim oDTSearchResult As DataTable = My.DatabaseIDB.GetDatatable(oSearchSQL) If oDTSearchResult.Rows.Count > 0 Then