This commit is contained in:
SchreiberM
2017-02-01 12:33:22 +01:00
parent 877eaa2411
commit 5023a28d75
52 changed files with 7752 additions and 3992 deletions

View File

@@ -0,0 +1,85 @@
Imports System.ComponentModel
Imports System.IO
Imports DD_LIB_Standards
Public Class ClassInit
Public Sub New()
End Sub
Public Sub InitLogger()
ClassLogger.Init("", "VersionChecker")
clsLogger.LOGFILE_PATH = ClassLogger.logDateiname
End Sub
Public Function InitDatabase()
Try
Dim dbResult As Boolean
clsDatabase.GUI = True
If MyConnectionString <> String.Empty Then
dbResult = clsDatabase.Init(MyConnectionString)
Return dbResult
Else
Return False
End If
Catch ex As Exception
MsgBox("Unexpected Error in Init Database:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False
End Try
End Function
Public Sub InitBasics()
Try
Dim sql = String.Format("SELECT * FROM TBPMO_KONFIGURATION WHERE GUID = 1")
Dim KONFIG_DT As DataTable = clsDatabase.Return_Datatable(sql, False)
If KONFIG_DT.Rows.Count = 1 Then
Try
MyServer_UpdatePath = KONFIG_DT.Rows(0).Item("UPDATE_PATH")
VERSION_SERVER = KONFIG_DT.Rows(0).Item("VERSION_CLIENT")
Catch ex As Exception
End Try
End If
Catch ex As Exception
MsgBox("Unexpected Error in InitBasics:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
Public Shared Function InitUserLogin(Optional _User As String = "")
Try
Dim sql = ""
USER_USERNAME = Environment.UserName
sql = String.Format("SELECT * FROM TBDD_USER WHERE (LOWER(USERNAME) = LOWER('{0}'))", USER_USERNAME)
Dim USER_DT As DataTable = clsDatabase.Return_Datatable(sql, True)
If USER_DT.Rows.Count = 0 Then
ClassLogger.Add(" - User '" & USER_USERNAME & "' not listed in Useradministration!", False)
'MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt." & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
'Me.Close()
Dim msg = String.Format("You are not listed in the Useradministration." & vbNewLine & "Please contact the admin.")
MsgBox(msg, MsgBoxStyle.Exclamation)
Return False
Else
USER_GUID = USER_DT.Rows(0).Item("GUID")
sql = String.Format("SELECT UPDATE_PATH FROM TBPMO_USER_UPDATE_PATH WHERE USER_ID = {0}", USER_GUID)
Dim USER_UPDATE_PATH = clsDatabase.Execute_Scalar(sql)
If Not IsNothing(USER_UPDATE_PATH) Then
If USER_UPDATE_PATH <> String.Empty Then
MyServer_UpdatePath = USER_UPDATE_PATH
End If
End If
sql = String.Format("SELECT CASE VERSION_CLIENT WHEN '' THEN '1.0.0.0' ELSE VERSION_CLIENT END AS VERSION_CLIENT FROM VWDD_LOGIN_USER_HISTORY WHERE GUID = (select MAX(GUID) from VWDD_LOGIN_USER_HISTORY where USER_ID = {0} AND VERSION_CLIENT <> '')", USER_GUID)
VERSION_USER = clsDatabase.Execute_Scalar(sql)
Return True
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in InitUserLogin: " & ex.Message, True)
MsgBox("Unexpected Error in InitUserLogin: " & ex.Message, MsgBoxStyle.Critical)
Return False
End Try
End Function
End Class