MS Vorbereitungen WISAG wie PM
This commit is contained in:
@@ -3,6 +3,7 @@ Imports DD_LIB_Standards
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.EDMI.API
|
||||
|
||||
Public Class ClassInit
|
||||
Public _lizenzManager As clsLicenseManager
|
||||
@@ -11,6 +12,21 @@ Public Class ClassInit
|
||||
Public Sub InitLogger()
|
||||
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, Application.CompanyName, Application.ProductName)
|
||||
Logger = LogConfig.GetLogger()
|
||||
Try
|
||||
Dim directory As New IO.DirectoryInfo(LogConfig.LogDirectory)
|
||||
|
||||
For Each file As IO.FileInfo In directory.GetFiles
|
||||
If (Now - file.CreationTime).Days > 29 Then
|
||||
file.Delete()
|
||||
Else
|
||||
Exit For
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
Catch ex As Exception
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
Public Function InitDatabase()
|
||||
Dim dbResult As Boolean
|
||||
@@ -55,7 +71,15 @@ Public Class ClassInit
|
||||
End Function
|
||||
|
||||
Public Function InitBasics()
|
||||
ConfigManager = New ConfigManager(Of ClassConfig)(LogConfig, Application.UserAppDataPath, Application.CommonAppDataPath)
|
||||
Dim UserAppDataPath = Application.UserAppDataPath
|
||||
Dim CommonAppDataPath = Application.CommonAppDataPath
|
||||
Dim StartupPath = Application.StartupPath
|
||||
If My.Settings.UseAppConfigConString = True Then
|
||||
' UserAppDataPath = StartupPath
|
||||
CommonAppDataPath = StartupPath
|
||||
End If
|
||||
|
||||
ConfigManager = New ConfigManager(Of ClassConfig)(LogConfig, UserAppDataPath, CommonAppDataPath, StartupPath)
|
||||
|
||||
With ConfigManager.Config
|
||||
MyConnectionString = DecryptConnectionString(.ConnectionString)
|
||||
@@ -65,6 +89,32 @@ Public Class ClassInit
|
||||
|
||||
LogConfig.Debug = Not .LogErrorsOnly
|
||||
End With
|
||||
If ConfigManager.Config.ConnectionStringAppServer <> String.Empty Then
|
||||
Logger.Debug("ConnectionStringAppServer will be used")
|
||||
CONNECTION_STRING_APP_SERVER = DecryptConnectionString(ConfigManager.Config.ConnectionStringAppServer)
|
||||
End If
|
||||
|
||||
If ConfigManager.Config.AppServerConfig <> String.Empty Then
|
||||
Try
|
||||
Dim oSplit() = ConfigManager.Config.AppServerConfig.ToString.Split(";")
|
||||
Dim oAppServer = oSplit(0)
|
||||
Dim oAppServerPort = 9000
|
||||
If oSplit.Length = 2 Then
|
||||
oAppServerPort = oSplit(1)
|
||||
End If
|
||||
_Client = New Client(LogConfig, oAppServer, oAppServerPort)
|
||||
If Not IsNothing(_Client) Then
|
||||
If _Client.Connect() Then
|
||||
APPSERVER_ACTIVE = True
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
|
||||
Catch ex As Exception
|
||||
Logger.Warn($"Could not initialize the AppServer: {ex.Message}")
|
||||
End Try
|
||||
End If
|
||||
|
||||
Return True
|
||||
End Function
|
||||
@@ -113,8 +163,10 @@ Public Class ClassInit
|
||||
|
||||
USER_IN_MODULE = DT_CHECKUSER_MODULE.Rows(0).Item("MODULE_ACCESS")
|
||||
USER_IS_ADMIN = DT_CHECKUSER_MODULE.Rows(0).Item("IS_ADMIN")
|
||||
|
||||
|
||||
ADDITIONAL_TITLE = DT_CHECKUSER_MODULE.Rows(0).Item("ADDITIONAL_TITLE")
|
||||
If ADDITIONAL_TITLE = String.Empty Then
|
||||
ADDITIONAL_TITLE = My.Application.Info.ProductName
|
||||
End If
|
||||
USERCOUNT_LOGGED_IN = DT_CHECKUSER_MODULE.Rows(0).Item("USERCOUNT_LOGGED_IN")
|
||||
USERCOUNT_LOGGED_IN += 1
|
||||
Return True
|
||||
|
||||
Reference in New Issue
Block a user