MS Bodytext, Bugfixing deleting

This commit is contained in:
Developer01
2025-04-10 17:46:33 +02:00
parent 7481691b4e
commit 8a9d5f92f3
19 changed files with 1028 additions and 63 deletions

View File

@@ -25,7 +25,7 @@ Public Class frmSplashScreen
Dim oLogPath = IO.Path.Combine(Application.LocalUserAppDataPath, "Log")
CurrLogConfig = New LogConfig(LogConfig.PathType.CustomPath, oLogPath, CompanyName:="Digital Data", ProductName:="Envelope Generator")
Logger = CurrLogConfig.GetLogger()
MyLogger = Logger
Try
ConfigManager = New ConfigManager(Of Config)(CurrLogConfig, Application.UserAppDataPath, Application.CommonAppDataPath, Application.StartupPath)
@@ -60,25 +60,25 @@ Public Class frmSplashScreen
End Sub
Private Sub Worker_DoWork(sender As Object, e As DoWorkEventArgs) Handles Worker.DoWork
Dim oState As State = DirectCast(e.Argument, State)
MyState = DirectCast(e.Argument, State)
Worker.ReportProgress(20, "Initializing Database")
Thread.Sleep(300)
Dim oConnectionString = MSSQLServer.DecryptConnectionString(oState.Config.ConnectionString)
oState.Database = New MSSQLServer(oState.LogConfig, oConnectionString)
Dim oConnectionString = MSSQLServer.DecryptConnectionString(MyState.Config.ConnectionString)
MyState.Database = New MSSQLServer(MyState.LogConfig, oConnectionString)
If oState.Database?.DBInitialized = False Then
If MyState.Database?.DBInitialized = False Then
Throw New ApplicationException("Could not connect to the database. Application will close!")
Else
DB_DD_ECM = oState.Database
DB_DD_ECM = MyState.Database
End If
Worker.ReportProgress(40, "Initializing Configuration")
Thread.Sleep(300)
Dim oSQl = "SELECT * FROM TBDD_SQL_COMMANDS"
Dim oDT = oState.Database.GetDatatable(oSQl)
Dim oDT = MyState.Database.GetDatatable(oSQl)
For Each oROW As DataRow In oDT.Rows
If oROW.Item("TITLE") = "REPORT ENV USER THIS_MONTH" Then
SQL_REP_ENV_USER_TM = oROW.Item("SQL_COMMAND")
@@ -92,39 +92,39 @@ Public Class frmSplashScreen
Next
oSQl = "SELECT * FROM TBSIG_CHART"
DT_CHARTS = oState.Database.GetDatatable(oSQl)
DT_CHARTS = MyState.Database.GetDatatable(oSQl)
Dim ConfigModel = New ConfigModel(oState)
oState.DbConfig = ConfigModel.LoadConfiguration()
DEF_TF_ENABLED = oState.DbConfig.Default_TFA_Enabled
DEF_TF_ENABLED_WITH_PHONE = oState.DbConfig.Default_TFA_WithPhone
Dim ConfigModel = New ConfigModel(MyState)
MyState.DbConfig = ConfigModel.LoadConfiguration()
DEF_TF_ENABLED = MyState.DbConfig.Default_TFA_Enabled
DEF_TF_ENABLED_WITH_PHONE = MyState.DbConfig.Default_TFA_WithPhone
' DOCUMENT_PATH_MOVE_AFTSEND = oState.DbConfig.DOCUMENT_PATH_MOVE_AFTSEND
Worker.ReportProgress(60, "Initializing User")
Dim oKey = oState.Database.GetScalarValue("SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE' and ACTIVE = 1")
Thread.Sleep(300)
Dim oKey = MyState.Database.GetScalarValue("SELECT LICENSE FROM TBDD_3RD_PARTY_MODULES WHERE NAME = 'GDPICTURE' and ACTIVE = 1")
Thread.Sleep(300)
If oKey.ToString <> String.Empty Then
MS_GDPICTUREKEY = oKey
End If
Dim oUserModel = New UserModel(oState)
oState.UserId = oUserModel.SelectUserId()
MyUserModel = New UserModel(MyState)
MyState.UserId = MyUserModel.SelectUserId(Environment.UserName)
Dim oUser = oUserModel.SelectUser()
Dim oUser = MyUserModel.SelectUser()
Worker.ReportProgress(80, "Initializing Rights")
Thread.Sleep(300)
' This checks for module access and admin rights
If oUser IsNot Nothing Then
oUserModel.CheckUserLogin(oUser)
MyUserModel.CheckUserLogin(oUser)
End If
MYUSER = oUser
Worker.ReportProgress(100, "Starting Application")
Thread.Sleep(300)
oState.User = oUser
MyState.User = oUser
e.Result = oState
e.Result = MyState
End Sub
Private Sub Worker_ProgressChanged(sender As Object, e As ProgressChangedEventArgs) Handles Worker.ProgressChanged
@@ -174,4 +174,14 @@ Public Class frmSplashScreen
End Try
End Sub
Private Sub frmSplashScreen_KeyDown(sender As Object, e As KeyEventArgs) Handles Me.KeyDown
If Not IsNothing(MYUSER) Then
If MYUSER.IsAdmin Then
If e.KeyCode = Keys.Escape Then
USER_GHOST_MODE_ACTIVE = True
lblGhostMode.Visible = True
End If
End If
End If
End Sub
End Class