Use Logger Module

This commit is contained in:
Jonathan Jenne 2019-04-16 14:01:35 +02:00
parent 4c86bd4c5c
commit 31bf65a5f0
37 changed files with 938 additions and 859 deletions

View File

@ -16,12 +16,13 @@ Public Class ClassAllgemeineFunktionen
Sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND UPPER(MODULE) = UPPER('Process-Manager')"
End If
If ClassDatabase.Execute_non_Query(Sql, True) = True Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> User logged in....", False)
LOGGER.Debug(" >> User logged in....", False)
Else
ClassLogger.Add(" >> User could not be logged in/out....", False)
LOGGER.Info(" >> User could not be logged in/out....", False)
End If
Catch ex As Exception
ClassLogger.Add("Error in LoginOut: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in LoginOut: " & ex.Message)
End Try
End Sub
@ -30,11 +31,12 @@ Public Class ClassAllgemeineFunktionen
If IsNumeric(PROFIL_ID) Then
Dim insert As String = "INSERT INTO TBPM_ERROR_LOG (PROFIL_ID, ERROR_MSG, ADDED_WHO) VALUES (" & PROFIL_ID & ", '" & ERR_MSG & "', '" & USR & "')"
If ExecuteonMSSQL(insert, CONNECTION_STRING) <> "" Then
ClassLogger.Add("Eintrag in Log-Tabelle konnte nicht erstellt werden!!", True)
LOGGER.Info("Eintrag in Log-Tabelle konnte nicht erstellt werden!!", True)
End If
End If
Catch ex As Exception
ClassLogger.Add("Error in Insert_LogEntry: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in Insert_LogEntry: " & ex.Message)
End Try
@ -55,9 +57,10 @@ Public Class ClassAllgemeineFunktionen
Try
Connection.Open()
Catch ex As Exception
LOGGER.Error(ex)
' DB-Connection schliessen
Me.CloseMssqlDb(Connection)
ClassLogger.Add("ExecuteonMSSQL.Connection definieren - Error: " & ex.Message, True)
LOGGER.Info("ExecuteonMSSQL.Connection definieren - Error: " & ex.Message, True)
Return "ExecuteonMSSQL.Connection definieren - Error: " & ex.Message
End Try
@ -66,7 +69,8 @@ Public Class ClassAllgemeineFunktionen
Try
Command = New SqlCommand(sqlcommand, Connection)
Catch ex As Exception
ClassLogger.Add("ExecuteonMSSQL.sqlcommand definieren - Error: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("ExecuteonMSSQL.sqlcommand definieren - Error: " & ex.Message, True)
' DB-Connection schliessen
Me.CloseMssqlDb(Connection)
Return "ExecuteonMSSQL.sqlcommand definieren - Error: " & ex.Message
@ -81,9 +85,10 @@ Public Class ClassAllgemeineFunktionen
Me.CloseMssqlDb(Connection)
Return ""
Catch ex As Exception
LOGGER.Error(ex)
'bei einem Fehler einen Eintrag in der Logdatei erzeugen
ClassLogger.Add("ExecuteonMSSQL.Execute Command - Error: " & ex.Message, True)
ClassLogger.Add("Command-Befehl: " & Command.CommandText, True)
LOGGER.Info("ExecuteonMSSQL.Execute Command - Error: " & ex.Message, True)
LOGGER.Info("Command-Befehl: " & Command.CommandText, True)
' DB-Connection schliessen
Me.CloseMssqlDb(Connection)
Return "ExecuteonMSSQL.Execute Command - Error: " & ex.Message
@ -92,12 +97,13 @@ Public Class ClassAllgemeineFunktionen
Else
' kann eintreten, wenn entweder die SQL-Anweisung falsch ist oder wenn die DataConnection nicht richtig aufgebaut werden konnte
' Eintrag in Logdatei machen
ClassLogger.Add("ExecuteonMSSQL.SQL-Command ist ungültig. Command-Objekt konnte nicht erstellt werden")
LOGGER.Info("ExecuteonMSSQL.SQL-Command ist ungültig. Command-Objekt konnte nicht erstellt werden")
Return "ExecuteonMSSQL.SQL-Command ist ungültig. Command-Objekt konnte nicht erstellt werden"
End If
Catch ex As Exception
LOGGER.Error(ex)
' an dieser Stelle sollte jeder unvorhergesehene Fehler der Funktion abgefangen werden
ClassLogger.Add("ExecuteonMSSQL.Ein unbekannter Fehler in ExecuteonMSSQL - Error: " & ex.Message, True)
LOGGER.Info("ExecuteonMSSQL.Ein unbekannter Fehler in ExecuteonMSSQL - Error: " & ex.Message, True)
Return "ExecuteonMSSQL.Ein unbekannter Fehler in ExecuteonMSSQL - Error: " & ex.Message
End Try
@ -118,14 +124,15 @@ Public Class ClassAllgemeineFunktionen
Dim xffres As String = Path & "\" & Stammname & ".xffres"
If file_exists(xffres, clsWD) = True Then
System.IO.File.Delete(xffres)
ClassLogger.Add(">> Datei " & xffres & " erfolgreich gelöscht", False)
LOGGER.Info(">> Datei " & xffres & " erfolgreich gelöscht", False)
Return True
Else
Return Nothing
End If
Catch ex As Exception
ClassLogger.Add(" Fehler bei Delete_xffres", True)
ClassLogger.Add(">> Fehlermeldung: " & ex.Message, False)
LOGGER.Error(ex)
LOGGER.Info(" Fehler bei Delete_xffres", True)
LOGGER.Info(">> Fehlermeldung: " & ex.Message, False)
End Try
End Function
'Public Function Delete_File(originFile As String)
@ -133,15 +140,15 @@ Public Class ClassAllgemeineFunktionen
' If file_exists(originFile, False) = True Then
' System.IO.File.Delete(originFile)
' ClassLogger.Add(">> Manuelles Löschen: Datei " & originFile & " erfolgreich gelöscht", False)
' LOGGER.Info(">> Manuelles Löschen: Datei " & originFile & " erfolgreich gelöscht", False)
' Return True
' Else
' MsgBox("Die Datei konnte nicht gelsöcht werden. File NOT EXISTS", MsgBoxStyle.Exclamation)
' Return False
' End If
' Catch ex As Exception
' ClassLogger.Add(" Fehler bei Delete_File", True)
' ClassLogger.Add(">> Fehlermeldung: " & ex.Message, False)
' LOGGER.Info(" Fehler bei Delete_File", True)
' LOGGER.Info(">> Fehlermeldung: " & ex.Message, False)
' End Try
'End Function
@ -149,7 +156,7 @@ Public Class ClassAllgemeineFunktionen
Try
If VIEWER_PDF <> "internal" And vMove_File.EndsWith("pdf") Then
Do While clsWD.CheckFileExists(vMove_File) = True 'func_check_file_use(vMove_File)
ClassLogger.Add(">> MoveRename: Datei noch geöffnet - Warten", False)
LOGGER.Info(">> MoveRename: Datei noch geöffnet - Warten", False)
System.Threading.Thread.Sleep(500)
Loop
End If
@ -169,16 +176,17 @@ Public Class ClassAllgemeineFunktionen
version = version + 1
Loop
My.Computer.FileSystem.MoveFile(vMove_File, _Ziel)
ClassLogger.Add(">> Datei erfolgreich verschoben - Ziel: " & _Ziel, False)
LOGGER.Info(">> Datei erfolgreich verschoben - Ziel: " & _Ziel, False)
Else
ClassLogger.Add(">> Ziel und Quellpfad sind identisch!", False)
LOGGER.Info(">> Ziel und Quellpfad sind identisch!", False)
End If
Return ""
Catch ex As Exception
ClassLogger.Add(" Fehler bei Move2Folder", True)
ClassLogger.Add(">> Fehlermeldung", False)
ClassLogger.Add(">>" & ex.Message, False)
LOGGER.Error(ex)
LOGGER.Info(" Fehler bei Move2Folder", True)
LOGGER.Info(">> Fehlermeldung", False)
LOGGER.Info(">>" & ex.Message, False)
Insert_LogEntry(Profile_ID, "Fehler bei Move2Folder: " & ex.Message, Environment.UserName)
Return ex.Message
End Try
@ -187,7 +195,8 @@ Public Class ClassAllgemeineFunktionen
Try
Return clsWD.CheckFileExists(_file)
Catch ex As Exception
ClassLogger.Add("Fehler in Funktion file_exists - Fehler: ", ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Fehler in Funktion file_exists - Fehler: ", ex.Message)
Return False
End Try
End Function
@ -229,8 +238,9 @@ Public Class ClassAllgemeineFunktionen
End Select
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei checkValue_Exists:")
ClassLogger.Add(" - Unvorhergesehener Fehler bei checkValue_Exists - Fehler: " & vbNewLine & ex.Message)
LOGGER.Info(" - Unvorhergesehener Fehler bei checkValue_Exists - Fehler: " & vbNewLine & ex.Message)
Return False
End Try
End Function
@ -261,11 +271,12 @@ Public Class ClassAllgemeineFunktionen
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unvorhergesehener Fehler bei Execute_Scalar_SQLServer" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei Ausführen sql:")
Insert_LogEntry(profil_id, "Unvorhergesehener Fehler bei Execute_Scalar_Oracle: " & ex.Message, Environment.UserName)
ClassLogger.Add(" - Unvorhergesehener Fehler bei Execute_Scalar_SQLServer" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message)
ClassLogger.Add(" - SQL: " & vsql_statement, False)
ClassLogger.Add(" - Connection: " & vconnectionString, False)
LOGGER.Info(" - Unvorhergesehener Fehler bei Execute_Scalar_SQLServer" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message)
LOGGER.Info(" - SQL: " & vsql_statement, False)
LOGGER.Info(" - Connection: " & vconnectionString, False)
Return 99
End Try
End Function
@ -294,11 +305,12 @@ Public Class ClassAllgemeineFunktionen
cmd.Dispose()
cnn.Close()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unvorhergesehener Fehler bei Execute_Scalar_Oracle" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei Ausführen sql:")
Insert_LogEntry(profil_id, "Unvorhergesehener Fehler bei Execute_Scalar_Oracle: " & ex.Message, Environment.UserName)
ClassLogger.Add(" - Unvorhergesehener Fehler bei Execute_Scalar_Oracle" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message)
ClassLogger.Add(" - SQL: " & vsql_statement, False)
ClassLogger.Add(" - Connection: " & vconnectionString, False)
LOGGER.Info(" - Unvorhergesehener Fehler bei Execute_Scalar_Oracle" & vbNewLine & "Automatischer Index (j/n): " & check.ToString & vbNewLine & "Fehler: " & vbNewLine & ex.Message)
LOGGER.Info(" - SQL: " & vsql_statement, False)
LOGGER.Info(" - Connection: " & vconnectionString, False)
Return 99
End Try
End Function

View File

@ -23,7 +23,8 @@ Public Class ClassAnnotation
doc.Save(CURRENT_DOC_PATH)
Return True
Catch ex As Exception
ClassLogger.Add("Unexpected error in Annotate pdf: " & ex.Message, False)
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in Annotate pdf: " & ex.Message, False)
Return False
End Try

View File

@ -402,7 +402,7 @@ Public Class ClassControlCreator
CURRENT_CONTROL_ID = row("GUID")
CURR_CON_ID = IIf(IsDBNull(row("CONNECTION_ID")), 0, row("CONNECTION_ID"))
If CURR_CON_ID = 0 Then
ClassLogger.Add(" >> CONNECTION NOT DEFINED - CTRL_GUID:" & CURRENT_CONTROL_ID, False)
LOGGER.Info(" >> CONNECTION NOT DEFINED - CTRL_GUID:" & CURRENT_CONTROL_ID, False)
End If
CURR_SELECT_CONTROL = IIf(IsDBNull(row("SQL_UEBERPRUEFUNG")), "", row("SQL_UEBERPRUEFUNG"))
@ -413,7 +413,8 @@ Public Class ClassControlCreator
Return 0
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in GET_CONTROL_PROPERTIES (" & ControlName & "):" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in GET_CONTROL_PROPERTIES (" & ControlName & "):" & ex.Message)
Return 0
End Try
@ -432,7 +433,8 @@ Public Class ClassControlCreator
Return True
Catch ex As Exception
ClassLogger.Add("Unexpected Error in GET_DEPENDING_CONTROLS (" & ControlName & "):" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in GET_DEPENDING_CONTROLS (" & ControlName & "):" & ex.Message)
Return 0
End Try
End Function
@ -452,7 +454,8 @@ Public Class ClassControlCreator
Return Nothing
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in GET_CONNECTION_INFO (" & CON_ID.ToString & "):" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in GET_CONNECTION_INFO (" & CON_ID.ToString & "):" & ex.Message)
Return Nothing
End Try

View File

@ -28,15 +28,16 @@ Public Class ClassDatabase
' Dim conn As New OdbcConnection("dsn=" & DTConnection.Rows(0).Item("SERVER") & ";uid=" & DTConnection.Rows(0).Item("USERNAME") & ";pwd=" + DTConnection.Rows(0).Item("PASSWORD"))
' connectionString = conn.ConnectionString
Case Else
ClassLogger.Add(" - ConnectionType nicht integriert", False)
LOGGER.Info(" - ConnectionType nicht integriert", False)
MsgBox("ConnectionType nicht integriert", MsgBoxStyle.Critical, "Bitte Konfiguration Connection überprüfen!")
End Select
Else
ClassLogger.Add(" No entry for Connection-ID: " & id.ToString, True)
LOGGER.Info(" No entry for Connection-ID: " & id.ToString, True)
End If
Catch ex As Exception
ClassLogger.Add(" - Error in bei Get ConnectionString - Fehler: " & vbNewLine & ex.Message)
LOGGER.Error(ex)
LOGGER.Info(" - Error in bei Get ConnectionString - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Get ConnectionString:")
End Try
Return connectionString
@ -50,7 +51,8 @@ Public Class ClassDatabase
SQLconnect.Close()
Return True
Catch ex As Exception
ClassLogger.Add("Fehler bei Database-Init: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Fehler bei Database-Init: " & ex.Message, True)
Return False
End Try
End Function
@ -59,31 +61,32 @@ Public Class ClassDatabase
Try
Dim SQLconnect As New SqlClient.SqlConnection
Dim SQLcommand As SqlClient.SqlCommand
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> ReturnDatatable: " & Select_anweisung, False)
LOGGER.Debug(">>> ReturnDatatable: " & Select_anweisung, False)
SQLconnect.ConnectionString = SQLSERVERConnectionString
SQLconnect.Open()
SQLcommand = SQLconnect.CreateCommand
SQLcommand.CommandText = Select_anweisung
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute ReturnDatatable: " & Select_anweisung, False)
LOGGER.Debug(">>> Execute ReturnDatatable: " & Select_anweisung, False)
Dim adapter1 As SqlClient.SqlDataAdapter = New SqlClient.SqlDataAdapter(SQLcommand)
Dim dt As DataTable = New DataTable()
adapter1.Fill(dt)
SQLconnect.Close()
Return dt
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in Return Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical)
End If
Clipboard.SetText("Error: " & ex.Message & vbNewLine & "SQL: " & Select_anweisung)
ClassLogger.Add("Fehler bei Return_Datatable: " & ex.Message, True)
ClassLogger.Add("#SQL: " & Select_anweisung, False)
LOGGER.Info("Fehler bei Return_Datatable: " & ex.Message, True)
LOGGER.Info("#SQL: " & Select_anweisung, False)
Return Nothing
End Try
End Function
Public Shared Function Return_Datatable_CS(Select_anweisung As String, Conn_ID As Integer, Optional userInput As Boolean = False)
Try
Dim ConString As String = Get_ConnectionString(Conn_ID)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> ReturnDatatable: " & Select_anweisung, False)
LOGGER.Debug(">>> ReturnDatatable: " & Select_anweisung, False)
Dim SQLconnect As New SqlClient.SqlConnection
Dim SQLcommand As SqlClient.SqlCommand
SQLconnect.ConnectionString = ConString
@ -97,11 +100,12 @@ Public Class ClassDatabase
SQLconnect.Close()
Return dt
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in Return_Datatable_CS - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical)
End If
ClassLogger.Add("Fehler bei Return_Datatable_CS: " & ex.Message, True)
ClassLogger.Add("#SQL: " & Select_anweisung, False)
LOGGER.Info("Fehler bei Return_Datatable_CS: " & ex.Message, True)
LOGGER.Info("#SQL: " & Select_anweisung, False)
Return Nothing
End Try
End Function
@ -110,23 +114,24 @@ Public Class ClassDatabase
Dim SQLconnect As New SqlClient.SqlConnection
Dim SQLcommand As SqlClient.SqlCommand
SQLconnect.ConnectionString = SQLSERVERConnectionString
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute_non_Query: " & ExecuteCMD, False)
LOGGER.Debug(">>> Execute_non_Query: " & ExecuteCMD, False)
SQLconnect.Open()
SQLcommand = SQLconnect.CreateCommand
'Update Last Created Record in Foo
SQLcommand.CommandText = ExecuteCMD
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute NonQuery: " & ExecuteCMD, False)
LOGGER.Debug(">>> Execute NonQuery: " & ExecuteCMD, False)
SQLcommand.ExecuteNonQuery()
SQLcommand.Dispose()
SQLconnect.Close()
Return True
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in Execute non query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & ExecuteCMD, MsgBoxStyle.Critical)
End If
Clipboard.SetText("Error ExecuteCMD: " & ex.Message & vbNewLine & "SQL: " & ExecuteCMD)
ClassLogger.Add("Fehler bei Execute_non_Query: " & ex.Message, True)
ClassLogger.Add("#SQL: " & ExecuteCMD, False)
LOGGER.Info("Fehler bei Execute_non_Query: " & ex.Message, True)
LOGGER.Info("#SQL: " & ExecuteCMD, False)
Return False
End Try
@ -137,23 +142,24 @@ Public Class ClassDatabase
Dim SQLconnect As New SqlClient.SqlConnection
Dim SQLcommand As SqlClient.SqlCommand
SQLconnect.ConnectionString = ConString
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute_non_Query: " & cmdscalar, False)
LOGGER.Debug(">>> Execute_non_Query: " & cmdscalar, False)
SQLconnect.Open()
SQLcommand = SQLconnect.CreateCommand
'Update Last Created Record in Foo
SQLcommand.CommandText = cmdscalar
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> Execute Scalar: " & cmdscalar, False)
LOGGER.Debug(">>> Execute Scalar: " & cmdscalar, False)
result = SQLcommand.ExecuteScalar()
SQLcommand.Dispose()
SQLconnect.Close()
Return result
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in Execute Scalar - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & cmdscalar, MsgBoxStyle.Critical)
End If
Clipboard.SetText("Error Execute_Scalar: " & ex.Message & vbNewLine & "SQL: " & cmdscalar)
ClassLogger.Add("Fehler bei Execute_Scalar: " & ex.Message, True)
ClassLogger.Add("#SQL: " & cmdscalar, False)
LOGGER.Info("Fehler bei Execute_Scalar: " & ex.Message, True)
LOGGER.Info("#SQL: " & cmdscalar, False)
Return Nothing
End Try
End Function
@ -172,8 +178,9 @@ Public Class ClassDatabase
SQLconnect.Close()
Return result
Catch ex As Exception
ClassLogger.Add("Fehler bei OracleExecute_Scalar: " & ex.Message, True)
ClassLogger.Add("#SQL: " & cmdscalar, False)
LOGGER.Error(ex)
LOGGER.Info("Fehler bei OracleExecute_Scalar: " & ex.Message, True)
LOGGER.Info("#SQL: " & cmdscalar, False)
Return Nothing
End Try
End Function
@ -191,11 +198,12 @@ Public Class ClassDatabase
SQLconnect.Close()
Return True
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in OracleExecute_non_Query - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & ExecuteCMD, MsgBoxStyle.Critical)
End If
ClassLogger.Add("Fehler bei OracleExecute_non_Query: " & ex.Message, True)
ClassLogger.Add("#SQL: " & ExecuteCMD, False)
LOGGER.Info("Fehler bei OracleExecute_non_Query: " & ex.Message, True)
LOGGER.Info("#SQL: " & ExecuteCMD, False)
Return False
End Try
@ -216,11 +224,12 @@ Public Class ClassDatabase
SQLconnect.Close()
Return dt
Catch ex As Exception
LOGGER.Error(ex)
If userInput = True Then
MsgBox("Error in Oracle Return Datatable - Error-Message:" & vbNewLine & ex.Message & vbNewLine & "SQL-Command:" & vbNewLine & Select_anweisung, MsgBoxStyle.Critical)
End If
ClassLogger.Add("Fehler bei Oracle_Return_Datatable: " & ex.Message, True)
ClassLogger.Add("#SQL: " & Select_anweisung, False)
LOGGER.Info("Fehler bei Oracle_Return_Datatable: " & ex.Message, True)
LOGGER.Info("#SQL: " & Select_anweisung, False)
Return Nothing
End Try
End Function

View File

@ -61,6 +61,7 @@ Public Class ClassDragDrop
Try
dragDropData = row.Item("GUID") & "|" & source
Catch ex As Exception
LOGGER.Error(ex)
Try
dragDropData = row.Item("USER_ID") & "|" & source
Catch ex1 As Exception
@ -78,6 +79,7 @@ Public Class ClassDragDrop
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in view_MouseMove: " & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub

View File

@ -13,14 +13,15 @@ Public Class ClassEmail
'Für jeden Empfänger eine Neue Mail erzeugen
For Each _mailempfaenger As String In empfaenger
' Neue Nachricht erzeugen:
Dim message As New MailMessage(emailfrom, _mailempfaenger, vBetreff & " - Domain: " & Environment.UserDomainName, _
"<font face=""Arial"">" & vBody & "<br>>> Version: " & My.Application.Info.Version.ToString & "<br>>> Maschine: " & Environment.MachineName & "<br>" & "<br>>> Domain-Name: " & Environment.UserDomainName & "<br>" & _
"<br>>> Gesendet am: " & My.Computer.Clock.LocalTime.ToShortDateString & " " & _
Dim message As New MailMessage(emailfrom, _mailempfaenger, vBetreff & " - Domain: " & Environment.UserDomainName,
"<font face=""Arial"">" & vBody & "<br>>> Version: " & My.Application.Info.Version.ToString & "<br>>> Maschine: " & Environment.MachineName & "<br>" & "<br>>> Domain-Name: " & Environment.UserDomainName & "<br>" &
"<br>>> Gesendet am: " & My.Computer.Clock.LocalTime.ToShortDateString & " " &
My.Computer.Clock.LocalTime.ToLongTimeString & "</font>")
If test = False Then
If Log = True Then
' create and add the attachment(s) */
Dim logfile As String = ClassLogger.logDateiname
Dim logfile As String = LOGCONFIG.LogFile
If logfile.Contains("\\") Then
logfile = logfile.Replace("\\", "\")
End If
@ -52,11 +53,12 @@ Public Class ClassEmail
If Log = True Then
MsgBox("Die Support-Email wurde erfolgreich versendet!", MsgBoxStyle.Information, "Erfolgsmeldung:")
End If
'ClassLogger.Add(">> Support/Log Email erfolgreich an " & _mailempfaenger & " versendet!", False)
'LOGGER.Info(">> Support/Log Email erfolgreich an " & _mailempfaenger & " versendet!", False)
Next
Return True
Catch ex As Exception
ClassLogger.Add("### Fehler im Mailversand: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("### Fehler im Mailversand: " & ex.Message)
Return False
End Try
End Function

View File

@ -36,6 +36,7 @@
' Return value
'End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox($"Error in GetValue: {ex.Message}", MsgBoxStyle.Critical)
End Try
End Function
@ -90,6 +91,7 @@
Return props
Catch ex As Exception
LOGGER.Error(ex)
MsgBox($"Error in SetValue: {ex.Message}", MsgBoxStyle.Critical)
End Try
End Function

View File

@ -8,12 +8,12 @@
If CURRENT_DT_FINAL_INDEXING.Rows.Count > 0 Then
'Jetzt finale Indexe setzen
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> working final indices for doc: " & WMObject.aName, False)
LOGGER.Debug(" >> working final indices for doc: " & WMObject.aName, False)
For Each dr As DataRow In CURRENT_DT_FINAL_INDEXING.Rows
Dim value As String = dr.Item("VALUE").ToString
Dim INDEXNAME = dr.Item("INDEXNAME").ToString
If value.ToUpper = "SQL-Command".ToUpper Then '###### Indexierung mit variablen SQL ###
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> indexing with dynamic sql...", False)
LOGGER.Debug(" >> indexing with dynamic sql...", False)
'Dim SQL_COMMAND = dr.Item("SQL_COMMAND")
'' Regulären Ausdruck zum Auslesen der Indexe definieren
'Dim preg As String = "\[%{1}[a-zA-Z0-9\!\$\&\/\(\)\=\?\,\.\-\;\:_öÖüÜäÄ\#\'\+\*\~\{\}\@\€\<\>\ ]+]{1}"
@ -25,23 +25,23 @@
'' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
'For Each element As System.Text.RegularExpressions.Match In elemente
' Try
' If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
' If LogErrorsOnly = False Then LOGGER.Info(" >> element in RegeX: " & element.Value, False)
' Dim WDINDEXNAME = element.Value.Substring(2, element.Value.Length - 3)
' Dim wertWD = WMObject.GetVariableValue(WDINDEXNAME)
' If Not IsNothing(wertWD) Then
' SQL_COMMAND = SQL_COMMAND.ToString.Replace(element.Value, wertWD)
' Else
' ClassLogger.Add(">>Attention: indexvalue is invalid", False)
' LOGGER.Info(">>Attention: indexvalue is invalid", False)
' End If
' Catch ex As Exception
' ClassLogger.Add("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message)
' LOGGER.Info("Unexpected Error in Checking control values for Variable SQL Result - ERROR: " & ex.Message)
' End Try
'Next
Dim sql_Statement = clsPatterns.ReplaceUserValues(dr.Item("SQL_COMMAND"), USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL)
sql_Statement = clsPatterns.ReplaceInternalValues(sql_Statement)
sql_Statement = clsPatterns.ReplaceWindreamIndicies(sql_Statement, WMObject)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">>> sql after ReplaceAllValues: " & sql_Statement, False)
LOGGER.Debug(">>> sql after ReplaceAllValues: " & sql_Statement, False)
Dim dynamic_value = ClassDatabase.Execute_Scalar(sql_Statement, CONNECTION_STRING, True)
If Not IsNothing(dynamic_value) Then
value = dynamic_value
@ -66,11 +66,11 @@
result(0) = value
Dim oIndexType = WINDREAM.GetTypeOfIndex(INDEXNAME)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> oIndexType {oIndexType.ToString}", False)
LOGGER.Debug($" >> oIndexType {oIndexType.ToString}", False)
If oIndexType > 4000 And oIndexType < 5000 Then
'Hier muss nun separat als Vektorfeld indexiert werden
If Indexiere_VektorfeldPM(value, INDEXNAME, WMObject) = False Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> FINALER INDEX '" & INDEXNAME.Replace("[%VKT", "") & "' WURDE ERFOLGREICH GESETZT", False)
LOGGER.Debug(" >> FINALER INDEX '" & INDEXNAME.Replace("[%VKT", "") & "' WURDE ERFOLGREICH GESETZT", False)
Else
MsgBox("Unexpected error in finalindexing vektorvalue - check the log", MsgBoxStyle.Critical)
@ -78,10 +78,10 @@
End If
Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> now indexing..", False)
LOGGER.Debug(" >> now indexing..", False)
If Indexiere_File(INDEXNAME, result, WMObject) = True Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> FINALER INDEX '" & INDEXNAME & "' WURDE ERFOLGREICH GESETZT", False)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add("")
LOGGER.Debug(" >> FINALER INDEX '" & INDEXNAME & "' WURDE ERFOLGREICH GESETZT", False)
LOGGER.Debug("")
'Nun das Logging
If CURRENT_PROFILE_VEKTOR_LOG <> "" Then
Dim logstr = Return_LOGString(value, "DDFINALINDEX", INDEXNAME)
@ -106,7 +106,8 @@
Return True
End If
Catch ex As Exception
ClassLogger.Add(">> unexpected error in Write_Final_Metadata: " & ex.Message.ToString, True)
LOGGER.Error(ex)
LOGGER.Info(">> unexpected error in Write_Final_Metadata: " & ex.Message.ToString, True)
Return False
End Try
End Function
@ -126,7 +127,7 @@
'Das Array der Idnexwerte überprüfen
If idxvalue Is Nothing = False Then
If idxvalue.Length() > 1 Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False)
LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False)
Dim anzahl As Integer = 0
For Each indexvalue As String In idxvalue
ReDim Preserve arrValue(anzahl)
@ -134,7 +135,7 @@
anzahl += 1
Next
Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False)
LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False)
ReDim Preserve arrValue(0)
arrValue(0) = idxvalue(0).ToString
End If
@ -146,7 +147,7 @@
End If
'Catch ex As Exception
' ClassLogger.Add(">> Unvorhergesehener Fehler bei Indexiere_File: " & ex.Message.ToString, True)
' LOGGER.Info(">> Unvorhergesehener Fehler bei Indexiere_File: " & ex.Message.ToString, True)
' Return Err()
'End Try
End Function
@ -198,7 +199,8 @@
Dim Bezeichner As String = VKTBezeichner.Replace("[%VKT", "")
PM_String = "DD-PM#" & Bezeichner & "#" & input & "#" & Environment.UserName & "#" & Now.ToString
Catch ex As Exception
ClassLogger.Add(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True)
PM_String = "DD-PM ERROR: " & ex.Message
End Try
Return PM_String
@ -214,7 +216,8 @@
End If
Catch ex As Exception
ClassLogger.Add(">> Fehler in Return_LOGString: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info(">> Fehler in Return_LOGString: " & ex.Message, True)
PM_String = "DD-PM ERROR: " & ex.Message
End Try
Return PM_String

View File

@ -19,7 +19,7 @@ Public Class ClassInit
LOGGER.Info("## ProcessManager für Windream gestartet - {0}", Now)
'ClassLogger.Init("", Environment.UserName)
'ClassLogger.Add("## ProcessManager für Windream gestartet - " & Now, False)
'LOGGER.Info("## ProcessManager für Windream gestartet - " & Now, False)
'If LogErrorsOnly = False Then
' 'Setzt DetailLog zurück
' LogErrorsOnly = False = False
@ -53,6 +53,7 @@ Public Class ClassInit
USER_MANAGER_PATH = CONFIG.Config.UserManagerPath
LOG_ERRORS_ONLY = CONFIG.Config.LogErrorsOnly
LOGCONFIG.Debug = Not LOG_ERRORS_ONLY
'Settings_Load()
@ -70,6 +71,7 @@ Public Class ClassInit
Try
oPlaintextPassword = oDecryptor.DecryptData(oBuilder.Password)
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Debug("Password {0} could not be decrypted. Assuming plaintext password.")
oPlaintextPassword = oBuilder.Password
End Try
@ -120,11 +122,12 @@ Public Class ClassInit
LICENSE_EXPIRED = True
LICENSE_COUNT = 0
End If
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> license initialized....", False)
LOGGER.Debug(" >> license initialized....", False)
LICENSE_PROFILES = split(2)
Catch ex As Exception
ClassLogger.Add("Unexpected error in Refresh license: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in Refresh license: " & ex.Message, True)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Licensemanager:")
End Try
End Sub
@ -147,18 +150,19 @@ Public Class ClassInit
Exit Sub
End If
Catch ex As Exception
ClassLogger.Add("Unexpected error in checking CLIENT: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in checking CLIENT: " & ex.Message)
CLIENT_SELECTED = 1
End Try
ClassLogger.Add(">> Username: " & USER_USERNAME, False)
LOGGER.Info(">> Username: " & USER_USERNAME, False)
Dim sql = String.Format("SELECT * FROM [dbo].[FNDD_CHECK_USER_MODULE] ('{0}','PM',{1})", Environment.UserName, CLIENT_SELECTED)
Dim DT_CHECKUSER_MODULE As DataTable = ClassDatabase.Return_Datatable(sql)
If DT_CHECKUSER_MODULE.Rows.Count = 0 Then
ClassLogger.Add("DT_CHECKUSER_MODULE.Rows.Count = 0", True)
LOGGER.Info("DT_CHECKUSER_MODULE.Rows.Count = 0", True)
ERROR_STATE = "NO USER"
@ -187,7 +191,7 @@ Public Class ClassInit
USERCOUNT_LOGGED_IN = DT_CHECKUSER_MODULE.Rows(0).Item("USERCOUNT_LOGGED_IN")
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> User exists....", False)
LOGGER.Debug(" >> User exists....", False)
'Am System anmelden
Refresh_Licence()
'Check_User_Exists_in_PMGroups()
@ -198,21 +202,22 @@ Public Class ClassInit
' USERCOUNT_LOGGED_IN = ClassDatabase.Execute_Scalar(sql, MyConnectionString, True)
sql = "DELETE FROM TBDD_USER_MODULE_LOG_IN WHERE USER_ID = " & USER_ID & " AND MODULE = 'Process-Manager'"
ClassDatabase.Execute_non_Query(sql, True)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False)
LOGGER.Debug(" >> Count Users logged in: " & USERCOUNT_LOGGED_IN.ToString, False)
If LICENSE_COUNT < USERCOUNT_LOGGED_IN And LICENSE_EXPIRED = False Then
MsgBox("Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der aktuellen Lizenzen!" & vbNewLine & "Anzahl der Lizenzen: " & LICENSE_COUNT.ToString & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
ClassLogger.Add(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False)
LOGGER.Info(" >> Die Anzahl der aktuell angemeldeten User (" & USERCOUNT_LOGGED_IN.ToString & ") überschreitet die Anzahl der Lizenzen (" & LICENSE_COUNT & ") für Process Manager!", False)
If USER_IS_ADMIN = False Then
ClassAllgemeineFunktionen.LoginOut("LOGOUT")
ClassLogger.Add(" - Wieder abgemeldet - START INCOMPLETE", False)
LOGGER.Info(" - Wieder abgemeldet - START INCOMPLETE", False)
ERROR_STATE = "START INCOMPLETE"
End If
End If
'Alles OK bis hierhin...nun die FolderwatchKonfig laden
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Init Userlogin successfull completed....", False)
LOGGER.Debug(" >> Init Userlogin successfull completed....", False)
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in InitUserLogin: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in InitUserLogin: " & ex.Message, True)
ERROR_STATE = "START INCOMPLETE"
End Try
@ -227,7 +232,8 @@ Public Class ClassInit
CURRENT_DT_TBDD_CONNECTION = ClassDatabase.Return_Datatable(sql)
Settings_LoadBasicConfig()
Catch ex As Exception
ClassLogger.Add("Unexpected Error in InitBasics: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in InitBasics: " & ex.Message, True)
ERROR_STATE = "Basics not initialized"
End Try
End Sub
@ -243,12 +249,14 @@ Public Class ClassInit
LICENSE_VALID = DT.Rows(0).Item("LICENSE_VALID")
WMSESSION_STARTSTOP_STARTUP = DT.Rows(0).Item("WMSESSION_STARTSTOP_STARTUP")
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Settings_LoadBasicConfig: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Settings_LoadBasicConfig: " & ex.Message, True)
End Try
Else
Return False
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in Settings_LoadBasicConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False
End Try

View File

@ -1,215 +0,0 @@
Imports System.IO
Public Class ClassLogger
Public Shared DateiSpeicherort As String = Nothing
Public Shared DateiPrefix As String = ""
Public Shared Datei As IO.File = Nothing
Public Shared logDateiname As String = ""
Private Shared StreamWriter As IO.StreamWriter = Nothing
Private Shared HasInformedAboutError As Boolean = False
' eine Art Konstruktor
Public Shared Sub Init(ByVal speicherort As String, Optional ByVal prefix As String = "", Optional ByVal appendFile As Boolean = True)
' initialisiert den Speicherort
ClassLogger.SetSpeicherort(speicherort)
' wenn ein Prfix gesetzt wurde
If Not prefix = "" Then
' initialisiert das Prefix
ClassLogger.SetPrefix(prefix)
End If
Dim str As String = ClassLogger.DateiSpeicherort & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & ".txt"
Dim anz As Integer = 1
Do While File.Exists(str)
Dim info As New FileInfo(str)
Dim length As Long = info.Length
If length > 5000000 Then
str = IO.Path.GetDirectoryName(str)
str = str & "\" & ClassLogger.DateiPrefix & System.DateTime.Now.ToString("yyyy_MM_dd") & "(" & anz.ToString & ").txt"
anz = anz + 1
Else
Exit Do
End If
Loop
ClassLogger.logDateiname = str
If Not appendFile Then
' der Versuch die Datei zu löschen
'Try
' My.Computer.FileSystem.DeleteFile(ClassNILogger.Dateiname, FileIO.UIOption.OnlyErrorDialogs, FileIO.RecycleOption.DeletePermanently)
'Catch ex As Exception
' ' bei Fehler besteht kein Schreibrecht auf die Datei oder Datei existiert nicht
' ' ALSO: alles Okay soweit
'End Try
My.Computer.FileSystem.WriteAllText(ClassLogger.logDateiname, String.Empty, False)
End If
' testen ob sich die Datei öffnen und beschreiben lässt
'ClassNILogger.CheckIsLogWritable()
End Sub
' legt den Speicherort fest
Public Shared Sub SetSpeicherort(ByVal speicherort As String)
Dim f As New IO.DirectoryInfo(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Digital Data\Process Manager\Log"))
If speicherort = "" Then
If f.Exists = False Then
IO.Directory.CreateDirectory(f.ToString())
End If
ClassLogger.DateiSpeicherort = f.ToString()
Else
ClassLogger.DateiSpeicherort = speicherort
End If
'Dim f As New IO.DirectoryInfo(My.Application.Info.DirectoryPath & "\Log")
'If speicherort = "" Then
' If f.Exists = False Then
' IO.Directory.CreateDirectory(My.Application.Info.DirectoryPath & "\Log")
' End If
' ClassLogger.DateiSpeicherort = My.Application.Info.DirectoryPath & "\Log\"
'Else
' ClassLogger.DateiSpeicherort = speicherort
'End If
End Sub
' legt das Prefix für den Dateinamen fest
Public Shared Sub SetPrefix(ByVal prefix As String)
ClassLogger.DateiPrefix = prefix
End Sub
Public Shared Sub Add(ByVal information As String, Optional ByVal ACHTUNG As Boolean = True)
If ClassLogger.OpenFile Then
Try
If ACHTUNG Then
ClassLogger.StreamWriter.WriteLine(System.DateTime.Now & " #ACHTUNG#: " & information)
Else
ClassLogger.StreamWriter.WriteLine(System.DateTime.Now & " " & information)
End If
ClassLogger.CloseFile()
Catch e As Exception
ClassLogger.ShowErrorMessage()
End Try
Else
ClassLogger.ShowErrorMessage()
End If
End Sub
Public Shared Sub Add(ByVal ex As Exception)
If ClassLogger.OpenFile Then
Try
ClassLogger.StreamWriter.WriteLine("##### Exception (" & System.DateTime.Now & ")")
ClassLogger.StreamWriter.WriteLine("##### Fehler: " & ex.Message & " Source [" & ex.Source & "]")
ClassLogger.CloseFile()
Catch e As Exception
ClassLogger.ShowErrorMessage()
End Try
Else
ClassLogger.ShowErrorMessage()
End If
End Sub
' öffnet eine Datei zum Schreiben
Private Shared Function OpenFile()
Try
' wenn ein Speicherort festgelegt wurde
If Not ClassLogger.DateiSpeicherort = Nothing Then
' den Dateienamen definieren
Dim dateiname As String = ClassLogger.logDateiname
' Datei anlegen wenn noch nicht vorhanden
My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True)
' die Datei zum Schreiben öffnen
ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8)
End If
' wenn die Datei erfolgreich geöffnet wurde
If ClassLogger.StreamWriter IsNot Nothing Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try
End Function
' öffnet eine Datei zum Schreiben
Private Shared Function OpenFile(ByVal DateiSpeicherort As String, ByVal DateiPrefix As String)
Try
' wenn ein Speicherort festgelegt wurde
If Not DateiSpeicherort = Nothing And ClassLogger.CheckIsLogWritable() Then
' den Dateienamen definieren
Dim dateiname As String = ClassLogger.logDateiname
' Datei anlegen wenn noch nicht vorhanden
My.Computer.FileSystem.WriteAllText(dateiname, String.Empty, True)
' die Datei zum Schreiben öffnen
ClassLogger.StreamWriter = New IO.StreamWriter(dateiname, True, System.Text.Encoding.UTF8)
End If
' wenn die Datei erfolgreich geöffnet wurde
If ClassLogger.StreamWriter IsNot Nothing Then
Return True
Else
Return False
End If
Catch ex As Exception
Return False
End Try
End Function
' schliesst die geöffnete Datei
Private Shared Sub CloseFile()
' wenn eine Datei geöffnet ist
If ClassLogger.StreamWriter IsNot Nothing Then
' die Datei schliessen
ClassLogger.StreamWriter.Close()
ClassLogger.StreamWriter = Nothing
End If
End Sub
Public Shared Function CheckIsLogWritable()
If ClassLogger.OpenFile Then
Try
ClassLogger.CloseFile()
Catch e As Exception
ClassLogger.ShowErrorMessage()
Return False
End Try
Else
ClassLogger.ShowErrorMessage()
Return False
End If
Return True
End Function
Public Shared Function CheckIsLogWritable(ByVal vDateiSpeicherort As String, ByVal vDateiPrefix As String)
If ClassLogger.OpenFile(vDateiSpeicherort, vDateiPrefix) Then
Try
ClassLogger.CloseFile()
Catch e As Exception
ClassLogger.ShowErrorMessage()
Return False
End Try
Else
ClassLogger.ShowErrorMessage()
Return False
End If
Return True
End Function
Private Shared Sub ShowErrorMessage()
If Not ClassLogger.HasInformedAboutError Then
MsgBox("Beim Öffnen der Logdatei ist ein Fehler aufgetreten. Bitte stellen Sie sicher das Sie sowohl über entsprechende Schreibrechte im Verzeichnis, als auch über ausreichend Speicherplatz zum Speichern der Logdatei verfügen." & _
vbNewLine & vbNewLine & "Es wird keine Logdatei angelegt oder beschrieben." & vbNewLine & vbNewLine & "Im folgenden werden Sie über Fehler, den Log betreffend nicht weiter informiert, um den Ablauf von " & My.Application.Info.ProductName & " nicht zu stören.", _
MsgBoxStyle.Information, "Fehler beim Öffnen der Logdatei")
ClassLogger.HasInformedAboutError = True
End If
End Sub
End Class

View File

@ -93,6 +93,7 @@ Public Class ClassPMWindream
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in GetValuesfromAuswahlliste:")
Return Nothing
End Try
@ -105,6 +106,7 @@ Public Class ClassPMWindream
Dim vType = oAttribute.getVariableValue("dwAttrType")
Return vType.ToString
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Return_Type:")
Return ""
End Try
@ -124,7 +126,7 @@ Public Class ClassPMWindream
Dim i As Integer = 0
Dim indexname As String
If aValues.Length = 1 And aValues(0) = "" Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert ist leer/Nothing - Keine Indexierung", False)
LOGGER.Debug(" >> Indexwert ist leer/Nothing - Keine Indexierung", False)
End If
'Jetzt jeden Indexwert durchlaufen
For Each aName As String In Indizes
@ -143,7 +145,7 @@ Public Class ClassPMWindream
'If indexname = "Tournr" Then
' MsgBox("Index: " & indexname & vbNewLine & "wert: " & aValues(i), MsgBoxStyle.Information, "Index: " & aName.ToString)
'End If
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" ### Indexierung von Index: " & indexname & " ####", False)
LOGGER.Debug(" ### Indexierung von Index: " & indexname & " ####", False)
'MsgBox(oDocument.aName & vbNewLine & aValues(i) & vbNewLine & vType, MsgBoxStyle.Exclamation, "Zeile 87")
Dim value = aValues(i)
Dim convertValue
@ -153,13 +155,13 @@ Public Class ClassPMWindream
Select Case vType
'Case WMObjectVariableValueTypeUndefined
Case WMObjectVariableValueTypeString
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeString", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeString", False)
convertValue = CStr(value)
Case WMObjectVariableValueTypeInteger
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeInteger", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeInteger", False)
If IsNumeric(value) = False Then
frmValidator.idxerr_message = "Unerlaubte Eingabe in Numerisches Feld: " & value
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!", False)
LOGGER.Debug(" >> Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!", False)
oDocument.Save()
oDocument.unlock()
Return False
@ -167,10 +169,11 @@ Public Class ClassPMWindream
convertValue = CInt(value)
_int = True
Case WMObjectVariableValueTypeFloat
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False)
Try
convertValue = CDbl(value)
Catch ex As Exception
LOGGER.Error(ex)
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
oDocument.Save()
oDocument.unlock()
@ -178,10 +181,11 @@ Public Class ClassPMWindream
End Try
Case WMObjectVariableValueTypeFixedPoint
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFixedPoint", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFixedPoint", False)
Try
convertValue = CDbl(value)
Catch ex As Exception
LOGGER.Error(ex)
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
oDocument.Save()
oDocument.unlock()
@ -190,24 +194,24 @@ Public Class ClassPMWindream
_dbl = True
Case WMObjectVariableValueTypeBoolean
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeBoolean", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeBoolean", False)
convertValue = CBool(value)
_bool = True
Case WMObjectVariableValueTypeDate
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeDate", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeDate", False)
_date = True
'Dim _date As Date = value
convertValue = value
Case WMObjectVariableValueTypeTimeStamp
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTimeStamp", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTimeStamp", False)
convertValue = CInt(value)
Case WMObjectVariableValueTypeCurrency
ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeCurrency", False)
LOGGER.Info(" >> Typ des windream-Indexes: WMObjectVariableValueTypeCurrency", False)
'Wegen currency muß ein eigenes Objekt vom typ Variant erzeugt werden
Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(value))
convertValue = aValueWrapper
Case WMObjectVariableValueTypeTime
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTime", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeTime", False)
'If ((value)) Then
' convertValue = CDate(value)
'Else
@ -216,44 +220,44 @@ Public Class ClassPMWindream
'Dim _date As Date = value
convertValue = convertValue '*_date.ToShortTimeString
Case WMObjectVariableValueTypeFloat
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False)
convertValue = CStr(value)
Case WMObjectVariableValueTypeVariant
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeVariant", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeVariant", False)
convertValue = CStr(value)
Case WMObjectVariableValueTypeFulltext
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFulltext", False)
LOGGER.Debug(" >> Typ des windream-Indexes: WMObjectVariableValueTypeFulltext", False)
convertValue = CStr(value)
Case 4100
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4100 Vektor Boolean", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 4100 Vektor Boolean", False)
vektor = True
Case 4101
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4101 Vektor Date", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 4101 Vektor Date", False)
vektor = True
Case 4104
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4104 Vektor Currency", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 4104 Vektor Currency", False)
vektor = True
Case 4097
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4097 Vektor alphanumerisch", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 4097 Vektor alphanumerisch", False)
vektor = True
Case 4098
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4098 Vektor Numerisch", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 4098 Vektor Numerisch", False)
vektor = True
Case 4099
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 4099 Vektor Kommazahl", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 4099 Vektor Kommazahl", False)
vektor = True
Case 36865
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes: 36865 Vektor alphanumerisch", False)
LOGGER.Debug(" >> Typ des windream-Indexes: 36865 Vektor alphanumerisch", False)
vektor = True
Case Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Typ des windream-Indexes konnte nicht bestimmt werden!", False)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch des Auslesens (vType): " & vType)
LOGGER.Debug(" >> Typ des windream-Indexes konnte nicht bestimmt werden!", False)
LOGGER.Debug(" >> Versuch des Auslesens (vType): " & vType)
'MsgBox(vType & vbNewLine & CStr(value), MsgBoxStyle.Exclamation, "Marlon-Case Else")
convertValue = ""
End Select
If vektor = False Then
If convertValue.ToString Is Nothing = False Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Konvertierter Wert: '" & convertValue.ToString & "'", False)
LOGGER.Debug(" >> Konvertierter Wert: '" & convertValue.ToString & "'", False)
End If
End If
'############################################################################################
@ -262,9 +266,10 @@ Public Class ClassPMWindream
If vektor = False Then
If convertValue.ToString Is Nothing = False Then
Try
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Jetzt indexieren: oDocument.SetVariableValue(" & aName & ", " & convertValue.ToString & ")", False)
LOGGER.Debug(" >> Jetzt indexieren: oDocument.SetVariableValue(" & aName & ", " & convertValue.ToString & ")", False)
Catch ex As Exception
ClassLogger.Add(" >> Unexpected Error in Logging SetVariableValue for " & aName & ": " & ex.Message, False)
LOGGER.Error(ex)
LOGGER.Info(" >> Unexpected Error in Logging SetVariableValue for " & aName & ": " & ex.Message, False)
End Try
'Dim ArrValues()
@ -285,13 +290,13 @@ Public Class ClassPMWindream
Else
oDocument.SetVariableValue(aName, convertValue)
End If
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Index '" & aName & "' wurde geschrieben", False)
LOGGER.Debug(" >> Index '" & aName & "' wurde geschrieben", False)
Else
ClassLogger.Add(" >> Kein Indexwert vorhanden", False)
LOGGER.Info(" >> Kein Indexwert vorhanden", False)
End If
Else
'VEKTORFELDER, ALSO ÜBERPRÜFEN OB ERGEBNIS-ARRAY GEFÜLLT IST
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> VEKTORFELD: Vorbereiten des Arrays", False)
LOGGER.Debug(" >> VEKTORFELD: Vorbereiten des Arrays", False)
Dim myArray()
'Dim anz As Integer = 0
'For Each obj In aValues
@ -398,7 +403,7 @@ Public Class ClassPMWindream
'Jetzt die Nachindexierung für Vektor-Felder
oDocument.SetVariableValue(aName, myArray)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> 'SetVariableValue' für VEKTOR erfolgreich", False)
LOGGER.Debug(" >> 'SetVariableValue' für VEKTOR erfolgreich", False)
End If
End If
i += 1
@ -410,21 +415,22 @@ Public Class ClassPMWindream
'SetRights(WMObject, User)
oDocument.Save()
oDocument.unlock()
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" ### Indexierung erfolgreich beendet (Save und Unlock durchgeführt) ###", False)
LOGGER.Debug(" ### Indexierung erfolgreich beendet (Save und Unlock durchgeführt) ###", False)
Return True
Else
ClassLogger.Add(" ### Dokument ist gesperrt, Indexierung nicht möglich! ###", False)
LOGGER.Info(" ### Dokument ist gesperrt, Indexierung nicht möglich! ###", False)
frmValidator.idxerr_message = "Dokument " & oDocument.aName & " ist gesperrt, Indexierung nicht möglich"
Return False
End If
End If
Catch ex As Exception
ClassLogger.Add("ClassSearchResult.RunIndexing - " & ex.Message, True)
frmValidator.idxerr_message = "Unvorhergesehener Fehler in Indexing: " & ex.Message & vbNewLine & "vType: " & vType.ToString
allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler beim Indexieren der Datei: " & oDocument.aName & " - ERROR: " & ex.Message, Environment.UserName)
oDocument.Save()
oDocument.unlock()
Return False
LOGGER.Error(ex)
LOGGER.Info("ClassSearchResult.RunIndexing - " & ex.Message, True)
frmValidator.idxerr_message = "Unvorhergesehener Fehler in Indexing: " & ex.Message & vbNewLine & "vType: " & vType.ToString
allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Unvorhergesehener Fehler beim Indexieren der Datei: " & oDocument.aName & " - ERROR: " & ex.Message, Environment.UserName)
oDocument.Save()
oDocument.unlock()
Return False
End Try
End Function
@ -445,29 +451,30 @@ Public Class ClassPMWindream
Dim value = _state
Dim convertValue
'Den Typ des Index-Feldes auslesen
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">> Typ des windream-Indexes: " & vType.ToString)
LOGGER.Debug(">> Typ des windream-Indexes: " & vType.ToString)
Select Case (vType)
Case WMObjectVariableValueTypeBoolean
convertValue = CBool(value)
Case Else
ClassLogger.Add(">> Typ des windream-Indexes ist nicht BOOLEAN also Abbruch:")
LOGGER.Info(">> Typ des windream-Indexes ist nicht BOOLEAN also Abbruch:")
End Select
'############################################################################################
'####################### Der eigentliche Indexierungsvorgang ################################
oDocument.SetVariableValue(Indexname, convertValue)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(">> Index '" & Indexname & "' wurde gesetzt")
LOGGER.Debug(">> Index '" & Indexname & "' wurde gesetzt")
oDocument.Save()
oDocument.unlock()
ClassLogger.Add(">> DATEI wurde erfolgreich als fertig nachindexiert gekennzeichnet")
LOGGER.Info(">> DATEI wurde erfolgreich als fertig nachindexiert gekennzeichnet")
Else
ClassLogger.Add(">> Dokument ist gesperrt, Indexierung erst im nächsten Durchlauf!")
LOGGER.Info(">> Dokument ist gesperrt, Indexierung erst im nächsten Durchlauf!")
End If
End If
Catch ex As Exception
ClassLogger.Add("ClassSearchResult.SetfinalIndex - " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("ClassSearchResult.SetfinalIndex - " & ex.Message, True)
'If My.Settings.vNIMailsenden = True Then
' email.Send_EMail("Fehler bei SetfinalIndex - Datei: " & oDocument.aName.ToString & " - Fehler: " & ex.Message)
'End If
@ -486,12 +493,13 @@ Public Class ClassPMWindream
Try
wmsearch_exists = System.IO.File.Exists(WD_Search)
Catch ex As Exception
LOGGER.Error(ex)
wmsearch_exists = clsWM.CheckFileExists(WD_Search)
End Try
If wmsearch_exists = False Then
ClassLogger.Add(">> Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden! Die Datei '" & WD_Search & "' existiert nicht!", False)
LOGGER.Info(">> Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden! Die Datei '" & WD_Search & "' existiert nicht!", False)
MsgBox("Windream Suche für Profil: '" & Profil & "' konnte nicht ausgeführt werden!" & vbNewLine & "Die Datei '" & WD_Search & "' existiert nicht!", MsgBoxStyle.Exclamation, "Achtung:")
'wenn die gesuchte File eine Suche ist: per MAil informierne und Indexierung abbrechen
'If My.Settings.vNIMailsenden = True Then
@ -512,7 +520,8 @@ Public Class ClassPMWindream
End If
End If
Catch ex As Exception
ClassLogger.Add(ex.Message)
LOGGER.Error(ex)
LOGGER.Info(ex.Message)
Return 0
End Try
@ -572,7 +581,7 @@ Public Class ClassPMWindream
oSearch = srchObjectType.GetSearch()
Case Else
ClassLogger.Add("KEIN GÜLTIGER WINDREAM-SUCHTYP")
LOGGER.Info("KEIN GÜLTIGER WINDREAM-SUCHTYP")
Return Nothing
End Select
Dim WMObjects As Object
@ -580,8 +589,9 @@ Public Class ClassPMWindream
Return oSearch.execute
Catch ex As Exception
LOGGER.Error(ex)
' bei einem Fehler einen Eintrag in der Logdatei machen
ClassLogger.Add("Fehler in GetSearchDocuments - " & ex.Message, True)
LOGGER.Info("Fehler in GetSearchDocuments - " & ex.Message, True)
Return Nothing
End Try
@ -602,6 +612,7 @@ Public Class ClassPMWindream
IndexwertAusWindream = _dok.GetVariableValue(_indexname)
Return IndexwertAusWindream.ToString
Catch ex As Exception
LOGGER.Error(ex)
'MsgBox(ex.Message)
Return Nothing
End Try

View File

@ -5,7 +5,7 @@
Dim DT As DataTable = ClassDatabase.Return_Datatable(sel)
If Not IsNothing(DT) Then
If DT.Rows.Count = 1 Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> User is in UM_ADMINS-Group....", False)
LOGGER.Debug(" >> User is in UM_ADMINS-Group....", False)
Return True
Else
Return False
@ -15,6 +15,7 @@
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Check_User_Exists_in_UMGroups:")
Return False
End Try

View File

@ -51,12 +51,13 @@ Public Class ClassWindream_allgemein
Try
' Session-Objekt instanziieren und mit dem im Client ausgewählten Server belegen
Me.oSession = CreateObject("Windream.WMSession", Me.GetCurrentServer)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> windream-Server: '" & Me.GetCurrentServer & "'", False)
LOGGER.Debug(" >> windream-Server: '" & Me.GetCurrentServer & "'", False)
' Connection-Objekt instanziieren
Me.oConnect = CreateObject("Windream.WMConnect")
'MsgBox("windrem init 'ed")
Catch ex As Exception
If LOG_ERRORS_ONLY = False Then ClassLogger.Add($"Error while creating WMConnect Object: {vbCrLf}{ex.Message}", False)
LOGGER.Error(ex)
LOGGER.Debug($"Error while creating WMConnect Object: {vbCrLf}{ex.Message}", False)
Return False
End Try
@ -85,7 +86,7 @@ Public Class ClassWindream_allgemein
End If
If LOG_ERRORS_ONLY = False Then
ClassLogger.Add(" >> windream-Version: '" & oSession.GetSystemInfo("WindreamVersion") & "'", False)
LOGGER.Info(" >> windream-Version: '" & oSession.GetSystemInfo("WindreamVersion") & "'", False)
End If
' AUSGABE VON SYSTEMINFORMATIONEN
@ -110,15 +111,17 @@ Public Class ClassWindream_allgemein
' Ordnertypen ausgelesen werden
Me.oDokumentTypen = Me.oSession.GetWMObjectTypes(WINDREAMLib.WMEntity.WMEntityDocument)
Catch ex As Exception
LOGGER.Error(ex)
Return False
End Try
End If
If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> windream login successful", False)
LOGGER.Debug($" >> windream login successful", False)
Return True
Catch ex As Exception
LOGGER.Error(ex)
If Err.Number = -2147220985 Then
MsgBox("Die installierte windream-Version ist nicht ausreichend für den Betrieb der Tool Collection für windream." & vbNewLine &
"Bitte kontaktieren Sie Digital Data." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & Err.Description, MsgBoxStyle.Exclamation, "Unzureichende windream-Version")
@ -139,7 +142,7 @@ Public Class ClassWindream_allgemein
If WMSESSION_STARTSTOP_STARTUP = True Then
'And userExistsInServerUserGroup Is Nothing
ClassLogger.Add(">> WINDREAM-Start on ApplicationStart is active!", False)
LOGGER.Info(">> WINDREAM-Start on ApplicationStart is active!", False)
Dim owindreamControlCenter = CreateObject("Wmcc.ControlCenter")
Dim owindreamIndexService = CreateObject("WMIndexServer.WMIdxSvControl")
@ -150,7 +153,8 @@ Public Class ClassWindream_allgemein
End If
Create_Session()
Catch ex As Exception
ClassLogger.Add("Error while starting up WMCC and IndexService: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Error while starting up WMCC and IndexService: " & ex.Message, True)
End Try
End Function
Public Function Stop_WMCC_andCo()
@ -169,7 +173,8 @@ Public Class ClassWindream_allgemein
owindreamControlCenter.ExitCC(0)
End If
Catch ex As Exception
ClassLogger.Add("Error while Stopping WMCC and IndexService: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Error while Stopping WMCC and IndexService: " & ex.Message, True)
End Try
End Function
#End Region
@ -189,6 +194,7 @@ Public Class ClassWindream_allgemein
Return Me.oDokumentTypen
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen der Objekttypen")
Return Nothing
End Try
@ -211,6 +217,7 @@ Public Class ClassWindream_allgemein
Return objektTypenStr
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen der Objekttypen als String")
Return Nothing
End Try
@ -222,6 +229,7 @@ Public Class ClassWindream_allgemein
Dim vType = oAttribute.getVariableValue("dwAttrType")
Return vType
Catch ex As Exception
LOGGER.Error(ex)
Return Nothing
End Try
@ -256,6 +264,7 @@ Public Class ClassWindream_allgemein
WMObject = oSession.GetWMObjectByPath(WINDREAMLib.WMEntity.WMEntityDocument, oNormalizedPath)
Return True
Catch ex As Exception
LOGGER.Error(ex)
Return False
End Try
End Function
@ -303,6 +312,7 @@ Public Class ClassWindream_allgemein
Return aIndexNames
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen der windream-Indexe")
Return Nothing
End Try
@ -328,6 +338,7 @@ Public Class ClassWindream_allgemein
Return Nothing
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Es konnte ein Objekttyp nicht erstellt werden." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Exclamation, "Objekttyp konnte nicht erstellt werden")
Return Nothing
End Try
@ -351,6 +362,7 @@ Public Class ClassWindream_allgemein
Next
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Beim Prüfen ob ein Index für einen Objekttypen existiert, ist ein Fehler aufgetreten." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Prüfen auf Existenz eines Index in einem Objekttyp")
End Try
@ -373,6 +385,7 @@ Public Class ClassWindream_allgemein
Try
Return Me.oSession.aLoggedin
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Es konnte nicht erfolgreich geprüft werden, ob das Programm am windream-Server angemeldted ist." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler bei Loggedin-Prüfung")
End Try
@ -388,6 +401,7 @@ Public Class ClassWindream_allgemein
Try
Return Me.oBrowser.GetCurrentServer 'ClassWindream.oBrowser.GetCurrentServer
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Der aktuell gewählte windream-Server konnte nicht ausgelesen werden." & vbNewLine & vbNewLine & "Fehlernachricht:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler beim Auslesen des windream-Servers")
End Try
@ -468,6 +482,7 @@ Public Class ClassWindream_allgemein
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in GetValuesfromAuswahlliste:")
Return Nothing
End Try

View File

@ -204,7 +204,6 @@
<Compile Include="ClassFinalizeDoc.vb" />
<Compile Include="ClassIndexListConverter.vb" />
<Compile Include="ClassInit.vb" />
<Compile Include="ClassLogger.vb" />
<Compile Include="ClassSQLEditor.vb" />
<Compile Include="ClassSQLTypeConverter.vb" />
<Compile Include="ClassSQLValue.vb" />

View File

@ -24,6 +24,7 @@
Try
result = Convert.ToBoolean(str)
Catch ex As Exception
LOGGER.Error(ex)
result = False
End Try

View File

@ -73,7 +73,8 @@ Module ModuleMySettings
Try
PWplainText = wrapper.DecryptData(oBuilder.Password)
Catch ex As Exception
ClassLogger.Add("- the Password '" & oBuilder.Password & "' could not be decrypted", False)
LOGGER.Error(ex)
LOGGER.Info("- the Password '" & oBuilder.Password & "' could not be decrypted", False)
PWplainText = oBuilder.Password
End Try
oConnectionString = oRow.Item("Value").ToString.Replace(oBuilder.Password, PWplainText)
@ -111,6 +112,7 @@ Module ModuleMySettings
Next
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in LoadMyConfig" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False
End Try
@ -121,6 +123,7 @@ Module ModuleMySettings
oDataset.ReadXml(ConfigPath)
Return oDataset.Tables(0)
Catch ex As Exception
LOGGER.Error(ex)
Dim oDataTable = CreateConfigTable()
oDataTable.WriteXml(GetUserConfigPath())
MsgBox("Fehler beim Laden der Konfiguration. Es wurde die Standard Konfiguration geladen. Fehler:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
@ -192,6 +195,7 @@ Module ModuleMySettings
oTable.AcceptChanges()
Return oTable
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in CreateConfigTable" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return Nothing
End Try
@ -216,6 +220,7 @@ Module ModuleMySettings
oDatatable.WriteXml(oUserConfigPath)
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in SaveConfigValue" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return False
End Try

View File

@ -55,7 +55,8 @@ Public Class clsPatterns
Return result
Catch ex As Exception
ClassLogger.Add("Error in ReplaceAllValues:" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in ReplaceAllValues:" & ex.Message)
End Try
End Function
@ -80,7 +81,8 @@ Public Class clsPatterns
Return result
Catch ex As Exception
ClassLogger.Add("Error in ReplaceInternalValues:" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in ReplaceInternalValues:" & ex.Message)
End Try
End Function
@ -107,7 +109,8 @@ Public Class clsPatterns
Return result
Catch ex As Exception
ClassLogger.Add("Error in ReplaceUserValues:" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in ReplaceUserValues:" & ex.Message)
End Try
End Function
@ -128,7 +131,8 @@ Public Class clsPatterns
Return result
Catch ex As Exception
ClassLogger.Add("Error in ReplaceControlValues:" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in ReplaceControlValues:" & ex.Message)
End Try
End Function
@ -147,7 +151,8 @@ Public Class clsPatterns
Return result
Catch ex As Exception
ClassLogger.Add("Error in ReplaceWindreamIndicies:" & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in ReplaceWindreamIndicies:" & ex.Message)
End Try
End Function

View File

@ -8,6 +8,7 @@ Public Class frmAdminPasswort
Me.TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = CONNECTION_STRING
akt_pw = TBPM_KONFIGURATIONTableAdapter.cmdGetAdminPW
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Form Load:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try

View File

@ -54,6 +54,7 @@ Public Class frmAdministration
tabctrl_Profilkonfig.SelectedIndex = 0
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Laden der Wertehilfen und Konfig-Daten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@ -63,6 +64,7 @@ Public Class frmAdministration
'Windream initialisieren (Connection, Session, ... aufbauen)
'_windreamPM.Create_Session()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
ObjekttypenEintragen()
@ -79,6 +81,7 @@ Public Class frmAdministration
Next
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Indexe_eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
End Sub
@ -119,6 +122,7 @@ Public Class frmAdministration
cmbLOGIndex.SelectedIndex = -1
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Indexe_eintragen: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
PM_VEKTOR_INDEXComboBox.SelectedIndex = -1
cmbLOGIndex.SelectedIndex = -1
@ -145,6 +149,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Refresh_Profildaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@ -158,6 +163,7 @@ Public Class frmAdministration
Me.cmbObjekttypen.Items.Add(aType.aName)
Next
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Es konnte keine Verbindung zum windream-Server hergestellt werden.", MsgBoxStyle.Critical, "Fehler beim Zugriff auf windream-Server")
End Try
@ -184,6 +190,7 @@ Public Class frmAdministration
p.Close()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei öffnen der windream-Suche:")
End Try
End Sub
@ -198,6 +205,7 @@ Public Class frmAdministration
tstrlblSave.Visible = False
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Speichern des Profils:")
End Try
@ -267,6 +275,7 @@ Public Class frmAdministration
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der User zu Profil:")
End Try
End Sub
@ -295,6 +304,7 @@ Public Class frmAdministration
FillProfile_User(profileId)
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox($"Error while calling FillProfile_User", MsgBoxStyle.Critical)
End Try
End If
@ -308,6 +318,7 @@ Public Class frmAdministration
TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, Environment.UserName)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen eines Users:")
End Try
End Sub
@ -321,6 +332,7 @@ Public Class frmAdministration
TBPROFILE_USERTableAdapter.CmdDelete(profileId, userId)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen eines Users:")
End Try
End Sub
@ -336,6 +348,7 @@ Public Class frmAdministration
' TBPROFILE_USERTableAdapter.CMDInsert(profileId, userId, Environment.UserName)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Hinzufügen einer Gruppe:")
End Try
End Sub
@ -351,6 +364,7 @@ Public Class frmAdministration
'TBPROFILE_USERTableAdapter.cmdDelete(userId)
FillProfile_User(profileId)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Entfernen einer Gruppe:")
End Try
End Sub
@ -429,6 +443,7 @@ Public Class frmAdministration
TBPM_ERROR_LOGTableAdapter.CmdDelete()
Refresh_log()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Delete Log:")
End Try
End Sub
@ -436,6 +451,7 @@ Public Class frmAdministration
Try
Me.TBPM_ERROR_LOGTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_ERROR_LOG)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Refresh Error:")
End Try
End Sub
@ -625,6 +641,7 @@ Public Class frmAdministration
Refresh_Profildaten()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Anlage Profilkopie:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
@ -640,6 +657,7 @@ Public Class frmAdministration
SQLconnection.Close()
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler in Execute_SQL: " & vbNewLine & ex.Message & vbNewLine & vbNewLine & " SQL: " & SQL)
Return False
End Try
@ -662,6 +680,7 @@ Public Class frmAdministration
MsgBox("Das Profil " & NAMETextBox.Text & " wurde erfolgreich gelöscht!", MsgBoxStyle.Information, "Erfolgsmeldung")
Refresh_Profildaten()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Löschen des Profils:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
@ -726,6 +745,7 @@ Public Class frmAdministration
Try
Me.TBDD_USERTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBDD_USER)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei LoadUsers: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Fehler:")
End Try
End Sub
@ -903,6 +923,7 @@ Public Class frmAdministration
Process.Start(USER_MANAGER_PATH)
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while startign User Manager:" & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -992,8 +1013,9 @@ Public Class frmAdministration
PropertyGrid1.SelectedObject = obj
PropertyGrid1.Refresh()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox($"Error while loading Final Index properties: {ex.Message}")
ClassLogger.Add($"Error while loading Final Index properties: {ex.Message}")
LOGGER.Info($"Error while loading Final Index properties: {ex.Message}")
End Try
End Sub
@ -1066,8 +1088,9 @@ Public Class frmAdministration
Refresh_Final_indexe()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while Saving Final Index: " & ex.Message, MsgBoxStyle.Critical)
ClassLogger.Add("Error while Saving Final Index: " & ex.Message)
LOGGER.Info("Error while Saving Final Index: " & ex.Message)
Finally
tsBtnCancel.Visible = False
BindingNavigatorAddNewItem.Visible = True

View File

@ -11,6 +11,7 @@ Public Class frmAnnotations
Me.Cursor = Cursors.Default
Me.Close()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical)
Me.Cursor = Cursors.Default
End Try

View File

@ -13,6 +13,7 @@
cmbClients.DisplayMember = DT_CLIENT_USER.Columns("CLIENT_NAME").ColumnName
cmbClients.ValueMember = DT_CLIENT_USER.Columns("CLIENT_ID").ColumnName
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in Loading Data: " & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub

View File

@ -125,6 +125,7 @@ Public Class frmConnection
MsgBox("Die Verbindung wurde erfolgreich aufgebaut!", MsgBoxStyle.Information, "Erfolg:")
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message & vbNewLine & vbNewLine & connstr, MsgBoxStyle.Critical, "Fehler bei Verbindungsaufbau Oracle:")
End Try
Case Else
@ -133,6 +134,7 @@ Public Class frmConnection
End If
Catch ex As Exception
LOGGER.Error(ex)
Cursor = Cursors.Default
Dim template As String = ex.Message
MsgBox("Fehler beim Verbindungsaufbau: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
@ -149,6 +151,7 @@ Public Class frmConnection
MsgBox("Änderungen wurden erfolgreich gespeichert!", MsgBoxStyle.Information)
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler beim Speichern: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
End Try
@ -159,6 +162,7 @@ Public Class frmConnection
load_connections()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Laden der Grunddaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -168,6 +172,7 @@ Public Class frmConnection
Me.TBDD_CONNECTIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBDD_CONNECTION)
TBDD_CONNECTIONDataGridView.AutoResizeColumns()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Connections laden: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -259,6 +264,7 @@ Public Class frmConnection
'End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Löschen Connection: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -321,6 +327,7 @@ Public Class frmConnection
connection.Close()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while loading Databases. Default Database will be set!" & vbCrLf & ex.Message, MsgBoxStyle.Critical)
DD_LIB_Standards.clsLogger.Add("Error while loading Databases:" & ex.Message)
Finally

View File

@ -31,6 +31,7 @@ Public Class frmControl_Detail
tslblAenderungen.Visible = False
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Speichern:")
End Try
@ -49,6 +50,7 @@ Public Class frmControl_Detail
End If
Me.TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden der Formulardaten:")
End Try

View File

@ -8,6 +8,7 @@
txtLocation.Text = CURRENT_DOC_PATH
txtCreation.Text = CURRENT_DOC_CREATION_DATE
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub

View File

@ -53,6 +53,7 @@ Public Class frmFormDesigner
Windream_ChoiceLists.Add(String.Empty)
Windream_ChoiceLists.AddRange(clsWD_GET.GetChoiceLists())
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@ -63,11 +64,13 @@ Public Class frmFormDesigner
TBPM_CONTROL_TABLETableAdapter.Connection.ConnectionString = CONNECTION_STRING
TBDD_CONNECTIONTableAdapter.Fill(DD_DMSLiteDataSet.TBDD_CONNECTION)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Laden der Connection-Strings und Grunddaten: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
LoadControls()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "error loading form:")
End Try
End Sub
@ -193,6 +196,7 @@ Public Class frmFormDesigner
End Select
Next
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei LoadControls " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@ -204,6 +208,7 @@ Public Class frmFormDesigner
Try
TBPM_PROFILE_CONTROLSBindingSource.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
@ -343,8 +348,9 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(line)
End Select
Catch ex As Exception
ClassLogger.Add($"Error while Adding new control {e.Data.GetData(DataFormats.Text)}:")
ClassLogger.Add(ex)
LOGGER.Error(ex)
LOGGER.Info($"Error while Adding new control {e.Data.GetData(DataFormats.Text)}:")
LOGGER.Info(ex)
End Try
End Sub
@ -412,6 +418,7 @@ Public Class frmFormDesigner
frmTableColumn.Show()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -432,6 +439,7 @@ Public Class frmFormDesigner
frmTableColumn.Text = "Konfiguration von Spalte: " & dgvColumn.Name
frmTableColumn.Show()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error while loading Column Configuration: " & vbCrLf & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -449,6 +457,7 @@ Public Class frmFormDesigner
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "DeleteControl:")
End Try
End Sub
@ -609,6 +618,7 @@ Public Class frmFormDesigner
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
Mouse_IsMoving = False
End Try
End Sub
@ -674,8 +684,9 @@ Public Class frmFormDesigner
Try
TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil(DD_DMSLiteDataSet.TBPM_PROFILE_CONTROLS, ProfileId)
Catch ex As Exception
ClassLogger.Add("Error while executing TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil in LoadControlProperties:")
ClassLogger.Add(ex)
LOGGER.Error(ex)
LOGGER.Info("Error while executing TBPM_PROFILE_CONTROLSTableAdapter.FillByProfil in LoadControlProperties:")
LOGGER.Info(ex)
End Try
row = dt.AsEnumerable().Where(Function(r As DataRow)
@ -684,7 +695,7 @@ Public Class frmFormDesigner
' Control-Id wurde nicht in DataRow gefunden
If IsNothing(row) Then
ClassLogger.Add($"Error while filtering Controls by Guid '{sender.Tag}' in LoadControlProperties:")
LOGGER.Info($"Error while filtering Controls by Guid '{sender.Tag}' in LoadControlProperties:")
MsgBox($"Control mit der Id {sender.Tag} wurde nicht gefunden!", MsgBoxStyle.Critical, "Fehler beim Laden der Control Eigenschaften")
Exit Sub
@ -877,9 +888,10 @@ Public Class frmFormDesigner
Catch ex As Exception
LOGGER.Error(ex)
Dim msg = $"UpdateSingleValue - Fehler beim Speichern von Control (Id: {guid}, column: {columnName}): {vbCrLf}{ex.Message}"
MsgBox(msg)
ClassLogger.Add(msg)
LOGGER.Info(msg)
End Try
End Sub
End Class

View File

@ -46,6 +46,7 @@ Public Class frmKonfig
Me.txtpdfxchange.Text = VIEWER_XCHANGE
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Formload Grundkonfig:")
End Try
End Sub
@ -112,6 +113,7 @@ Public Class frmKonfig
End If
connection.Close()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Datenbank-Connect:")
End Try
Cursor = Cursors.Default
@ -119,14 +121,14 @@ Public Class frmKonfig
Private Sub BtnConnect_Click(sender As System.Object, e As System.EventArgs) Handles BtnConnect.Click
Try
Dim con As String
Dim oPlainConnectionString, oEncryptedConnectionString As String
If chkbxUserAut.Checked Then
con = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;"
oPlainConnectionString = "Data Source=" & Me.txtServer.Text & ";Initial Catalog=" & Me.cmbDatenbank.Text & ";Trusted_Connection=True;"
Else
con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
oPlainConnectionString = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & Me.txtPasswort.Text & ";"
End If
Dim connection As New SqlClient.SqlConnection(con) 'csb.ConnectionString)
Dim connection As New SqlClient.SqlConnection(oPlainConnectionString) 'csb.ConnectionString)
'während Verbindungsaufbau Sanduhr-Mauszeiger
Cursor = Cursors.WaitCursor
connection.Open()
@ -136,21 +138,23 @@ Public Class frmKonfig
result = MessageBox.Show("Die Verbindung wurde erfolgreich aufgebaut!" & vbNewLine & "Möchten Sie diese Verbindung nun in der Anwendung speichern?", "Erfolgsmeldung:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = MsgBoxResult.Yes Then
'ConnectionString in Anwendung speichern
CONNECTION_STRING = con
CONNECTION_STRING = oPlainConnectionString
ClassDatabase.Init()
'Das Passwort verschlüsseln
If chkbxUserAut.Checked = False Then
Dim wrapper As New ClassEncryption("!35452didalog=")
Dim cipherText As String = wrapper.EncryptData(Me.txtPasswort.Text)
Dim pw As String = cipherText
con = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";"
oEncryptedConnectionString = "Server=" & Me.txtServer.Text & ";Database=" & Me.cmbDatenbank.Text & ";User Id=" & Me.txtUser.Text & ";Password=" & pw & ";"
Else
oEncryptedConnectionString = oPlainConnectionString
End If
'SaveMySettingsValue("MyConnectionString", con)
'My.Settings.Save()
CONNECTION_STRING = con
CONFIG.Config.ConnectionString = con
CONNECTION_STRING = oPlainConnectionString
CONFIG.Config.ConnectionString = oEncryptedConnectionString
CONFIG.Save()
Load_ConString(CONNECTION_STRING)
@ -158,6 +162,7 @@ Public Class frmKonfig
Me.TBPM_KONFIGURATIONTableAdapter.Fill(Me.DD_DMSLiteDataSet.TBPM_KONFIGURATION)
End If
Catch ex As Exception
LOGGER.Error(ex)
Cursor = Cursors.Default
MsgBox("Fehler beim Verbindungsaufbau: " & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
End Try
@ -198,7 +203,6 @@ Public Class frmKonfig
End If
Case "system"
rbSystem.Checked = True
End Select
End Sub
@ -267,7 +271,6 @@ Public Class frmKonfig
Me.Validate()
Me.TBPM_KONFIGURATIONBindingSource.EndEdit()
Me.TableAdapterManager.UpdateAll(Me.DD_DMSLiteDataSet)
End Sub
Private Sub Button1_Click_3(sender As Object, e As EventArgs) Handles Button1.Click
@ -338,7 +341,8 @@ Public Class frmKonfig
End Sub
Private Sub btnopenlog_Click(sender As Object, e As EventArgs) Handles btnopenlog.Click
Process.Start(ClassLogger.DateiSpeicherort)
'Process.Start(ClassLogger.DateiSpeicherort)
Process.Start(LOGCONFIG.LogDirectory)
End Sub
Private Sub txtIntervall_TextChanged(sender As Object, e As EventArgs) Handles txtIntervall.TextChanged
@ -348,6 +352,7 @@ Public Class frmKonfig
Private Sub chkLogErrorsOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkLogErrorsOnly.CheckedChanged
LOG_ERRORS_ONLY = chkLogErrorsOnly.Checked
LOGCONFIG.Debug = Not LOG_ERRORS_ONLY
CONFIG.Config.LogErrorsOnly = LOG_ERRORS_ONLY
CONFIG.Save()
'SaveMySettingsValue("LogErrorsOnly", chkLogErrorsOnly.Checked)

View File

@ -31,6 +31,7 @@ Public Class frmLicense
'MsgBox("Die Lizenzen wurden erfolgreich aktualisiert!", MsgBoxStyle.Exclamation, "Erfolgsmeldung:")
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei New Licenses:")
End Try
End Sub
@ -51,6 +52,7 @@ Public Class frmLicense
Try
dtp_Gültigkeit.Value = CDate(split(1))
Catch ex As Exception
LOGGER.Error(ex)
Dim oLicDateString As String = split(1)
Dim cultureInfo As System.Globalization.CultureInfo
cultureInfo = New System.Globalization.CultureInfo("de-DE")
@ -75,6 +77,7 @@ Public Class frmLicense
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Unexpected error in LicenseManager-RefreshLicense:")
End Try
End Sub
@ -83,6 +86,7 @@ Public Class frmLicense
Try
TBPM_KONFIGURATIONTableAdapter.Connection.ConnectionString = CONNECTION_STRING
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Formular Load:")
End Try
End Sub

View File

@ -9,6 +9,7 @@ Public Class frmLoginAdmin
Me.txtPW.Focus()
Me.txtPW.Text = ""
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Form Load:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -54,6 +55,7 @@ Public Class frmLoginAdmin
frmAdminPasswort.ShowDialog()
akt_pw = TBPM_KONFIGURATIONTableAdapter.cmdGetAdminPW
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Admin PW:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try

View File

@ -33,7 +33,8 @@ Public Class frmMain
My.Settings.Save()
SaveGridLayout()
Catch ex As Exception
ClassLogger.Add("Error in Save FormLayout: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in Save FormLayout: " & ex.Message)
End Try
If WINDREAM?.oSession?.aLoggedin = True Then
WINDREAM.Stop_WMCC_andCo()
@ -44,11 +45,12 @@ Public Class frmMain
Try
ClassAllgemeineFunktionen.LoginOut("LOGOUT")
ClassLogger.Add("## ProcessManager beendet - " & Now, False)
ClassLogger.Add("", False)
LOGGER.Info("## ProcessManager beendet - " & Now, False)
LOGGER.Info("", False)
Catch ex As Exception
ClassLogger.Add("### Fehler bei LogOut")
ClassLogger.Add("### Fehler: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("### Fehler bei LogOut")
LOGGER.Info("### Fehler: " & ex.Message)
End Try
End Sub
@ -60,10 +62,11 @@ Public Class frmMain
End Sub
Private Sub frmMain_Load(sender As Object, e As System.EventArgs) Handles Me.Load
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Initializing MainForm....", False)
LOGGER.Debug(" >> Initializing MainForm....", False)
Try
UserLookAndFeel.Default.SetSkinStyle("VS2010")
Catch ex As Exception
LOGGER.Error(ex)
End Try
@ -74,18 +77,19 @@ Public Class frmMain
End If
Try
If CultureInfo.CurrentUICulture.ThreeLetterISOLanguageName = "eng" Then
ClassLogger.Add("## CurrentUICulture.Name: " & CultureInfo.CurrentUICulture.Name, False)
LOGGER.Info("## CurrentUICulture.Name: " & CultureInfo.CurrentUICulture.Name, False)
INDEX_DMS_ERSTELLT = "DMS Created"
INDEX_DMS_ERSTELLT_ZEIT = "DMS Created Time"
My.Settings.Save()
End If
Catch ex As Exception
LOGGER.Error(ex)
MessageBox.Show("Fehler bei Laden der CurrentUICulture-Info!", "Achtung:", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
If Refresh_ConnectionString() = True Then
Try
tslblLicenses.Text = "Anzahl Lizenzen: " & LICENSE_COUNT
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Initializing MainForm....", False)
LOGGER.Debug(" >> Initializing MainForm....", False)
If ERROR_STATE = "NO USER" Then
MsgBox("Achtung: Sie sind nicht in der Userverwaltung hinterlegt!" & vbNewLine & "Bitte setzen Sie sich mit dem Systembetreuer in Verbindung!", MsgBoxStyle.Critical, "Achtung:")
Me.Close()
@ -95,7 +99,7 @@ Public Class frmMain
Me.Close()
End If
Else
ClassLogger.Add(">> Username: " & Environment.UserName, False)
LOGGER.Info(">> Username: " & Environment.UserName, False)
'Wenn license abgelaufen und der User nicht admin ist!
If LICENSE_EXPIRED = True Then
If USER_IS_ADMIN = False Then
@ -113,6 +117,7 @@ Public Class frmMain
tslblUserLoggedin.Text = "Anzahl User eingeloggt: " & USERCOUNT_LOGGED_IN
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei User Check:")
End Try
@ -121,6 +126,7 @@ Public Class frmMain
Decide_Load()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Laden des Formulars: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@ -133,6 +139,7 @@ Public Class frmMain
TimerRefresh.Start()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in LoadForm - Step 4: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
End Try
@ -151,10 +158,11 @@ Public Class frmMain
Me.Close()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in windream-login - Step 5: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
End Try
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> MainForm initialized!", False)
LOGGER.Debug(" >> MainForm initialized!", False)
End If
End Sub
@ -169,6 +177,7 @@ Public Class frmMain
TimerReminder.Stop()
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
@ -188,7 +197,8 @@ Public Class frmMain
Me.Size = My.Settings.frmMainSize
End If
Catch ex As Exception
ClassLogger.Add("Error in Load FormLayout: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in Load FormLayout: " & ex.Message)
End Try
End Sub
Function Refresh_ConnectionString()
@ -200,6 +210,7 @@ Public Class frmMain
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Fehler bei Refresh_ConnectionString:")
Return False
End Try
@ -217,7 +228,8 @@ Public Class frmMain
Dim xml As String = GetXML_LayoutName()
GridView_Docs.SaveLayoutToXml(xml, OptionsLayoutBase.FullLayout)
Catch ex As Exception
ClassLogger.Add("Error while saving GridLayout: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error while saving GridLayout: " & ex.Message)
End Try
End Sub
@ -230,7 +242,8 @@ Public Class frmMain
Dim xml As String = GetXML_LayoutName()
GridView_Docs.RestoreLayoutFromXml(xml, OptionsLayoutBase.FullLayout)
Catch ex As Exception
ClassLogger.Add("Error while restoring layout: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error while restoring layout: " & ex.Message)
End Try
End Sub
@ -258,7 +271,8 @@ Public Class frmMain
End If
Catch ex As Exception
ClassLogger.Add("Error while resetting layout: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error while resetting layout: " & ex.Message)
End Try
End Sub
@ -273,7 +287,8 @@ Public Class frmMain
CurrGroup.ItemLinks.Clear()
Catch ex As Exception
ClassLogger.Add("CurrGroupClear - Error: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("CurrGroupClear - Error: " & ex.Message)
End Try
@ -303,7 +318,8 @@ Public Class frmMain
CurrGroup.Expanded = profileGroupOpen
Catch ex As Exception
ClassLogger.Add("Load_Profile_items - Error: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Load_Profile_items - Error: " & ex.Message)
MsgBox("Unexpected Error in Load_Profile_items - Error: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
Cursor = Cursors.Default
@ -342,7 +358,8 @@ Public Class frmMain
Return True
Catch ex As Exception
ClassLogger.Add("Load_Profiles_for_User - Error: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Load_Profiles_for_User - Error: " & ex.Message)
Return False
End Try
End Function
@ -396,6 +413,7 @@ Public Class frmMain
Try
chart.Series.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
' Set DataSource
@ -439,6 +457,7 @@ Public Class frmMain
Try
chart.Series.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
' Set DataSource
@ -459,7 +478,8 @@ Public Class frmMain
End If
End If
Catch ex As Exception
ClassLogger.Add("Layout Dashboard - Error: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Layout Dashboard - Error: " & ex.Message)
MsgBox("Unexpected Error in Layout Dashboard - Error: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -555,7 +575,8 @@ Public Class frmMain
End If
Catch ex As Exception
ClassLogger.Add("Load_single_Profile - Error: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Load_single_Profile - Error: " & ex.Message)
End Try
End Sub
@ -565,6 +586,7 @@ Public Class frmMain
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
@ -640,6 +662,7 @@ Public Class frmMain
Columns_Removed = True
GRID_INV_COL_REMOVED = True
Catch ex As Exception
LOGGER.Error(ex)
End Try
@ -648,7 +671,8 @@ Public Class frmMain
Next
Return Columns_Removed
Catch ex As Exception
ClassLogger.Add("Unexpected Error in GridView_CheckInvalidColumns: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in GridView_CheckInvalidColumns: " & ex.Message)
End Try
End Function
Sub LoadProfile_PM()
@ -692,14 +716,15 @@ Public Class frmMain
GridView_Docs.OptionsBehavior.AutoExpandAllGroups = True
GridView_Docs.OptionsView.ShowGroupedColumns = False
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Formatting Grid: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Formatting Grid: " & ex.Message)
End Try
Dim Columns_Removed = GridView_CheckInvalidColumns()
RestoreLayout()
If GridView_Docs.Columns.Count <= 2 Then
ClassLogger.Add("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False)
LOGGER.Info("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False)
Reset_GridLayout()
End If
@ -708,12 +733,14 @@ Public Class frmMain
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
End If
End If
Catch ex As Exception
ClassLogger.Add("LoadProfile_PM - Fehler: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("LoadProfile_PM - Fehler: " & ex.Message)
MsgBox("Fehler LoadProfile_PM - Fehler: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
@ -725,6 +752,7 @@ Public Class frmMain
' Load_Profil()
Check_Timer_Notification()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler beim Laden Grundeinstellungen:")
End Try
@ -740,7 +768,7 @@ Public Class frmMain
Load_Profile_items()
Decide_Load()
tsslblLastSysnc.Text = "Letzte Synchronisation: " & Now.ToLongTimeString
End Sub
Private Sub NotifyIcon1_Click(sender As System.Object, e As System.EventArgs) Handles NotifyIcon1.Click
@ -761,7 +789,8 @@ Public Class frmMain
Load_single_Profile()
End If
Catch ex As Exception
ClassLogger.Add("Unexpected error in Decide_load: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in Decide_load: " & ex.Message)
End Try
If TimerRefresh.Enabled = False Then
TimerRefresh.Start()
@ -798,13 +827,15 @@ Public Class frmMain
Try
splash.ShowDialog()
Catch ex As Exception
ClassLogger.Add($"Error in Splash: {ex.Message}")
LOGGER.Error(ex)
LOGGER.Info($"Error in Splash: {ex.Message}")
End Try
Try
InitializeComponent()
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
Catch ex As Exception
ClassLogger.Add($"Error in InitializeComponent: {ex.Message}")
LOGGER.Error(ex)
LOGGER.Info($"Error in InitializeComponent: {ex.Message}")
End Try
@ -833,6 +864,7 @@ Public Class frmMain
frmValidator.ShowDialog()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical)
End Try
Me.Visible = True
@ -942,6 +974,7 @@ Public Class frmMain
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected error in Item_Scope: " & ex.Message, MsgBoxStyle.Critical)
End Try
End Sub
@ -954,11 +987,12 @@ Public Class frmMain
WINDREAM = New ClassPMWindream()
WINDREAM.Create_Session()
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> windream initialized", False)
LOGGER.Debug(" >> windream initialized", False)
Return True
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error Init_windream:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
ClassLogger.Add(">> Unexpected error in Init_windream: " & ex.Message, True)
LOGGER.Info(">> Unexpected error in Init_windream: " & ex.Message, True)
Return False
End Try
End Function
@ -1027,6 +1061,7 @@ Public Class frmMain
End If
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unhandled Error in tsmiMarkedFilesFinish_Click: " & ex.Message)
End Try
End Sub
@ -1053,7 +1088,7 @@ Public Class frmMain
tslblmessage.Text = ""
If CURRENT_DT_VW_PROFILE_USER.Rows.Count = 0 Then
ClassLogger.Add(" >> no profiles for user: '" & Environment.UserName & "' configured!", False)
LOGGER.Info(" >> no profiles for user: '" & Environment.UserName & "' configured!", False)
NO_WORKFLOWITEMS = True
tslblmessage.Text = "Keine Profile für Ihren User hinterlegt"
Cursor = Cursors.Default
@ -1083,7 +1118,8 @@ Public Class frmMain
Try
DTGRID_GROUPS = ClassDatabase.Return_Datatable($"SELECT * FROM TBPM_MAIN_VIEW_GROUPS WHERE ACTIVE = 1", True)
Catch ex As Exception
ClassLogger.Add(ex.Message)
LOGGER.Error(ex)
LOGGER.Info(ex.Message)
End Try
@ -1101,6 +1137,7 @@ Public Class frmMain
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
Cursor = Cursors.Default
@ -1150,7 +1187,7 @@ Public Class frmMain
Dim oindex As Integer = 0
If Not IsNothing(DTGRID_GROUPS) Then
For Each oGridGroup As DataRow In DTGRID_GROUPS.Rows
If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Addig group [{oGridGroup.Item("GROUPNAME")}] for Grid...", False)
LOGGER.Debug($" >> Addig group [{oGridGroup.Item("GROUPNAME")}] for Grid...", False)
GridView_Docs.Columns.Item(oGridGroup.Item("GROUPNAME")).GroupIndex = oindex
oindex += 1
Next
@ -1158,13 +1195,13 @@ Public Class frmMain
GridView_Docs.Columns.Item("PROFILE_GROUP_TEXT").GroupIndex = oindex
End If
GridView_Docs.Columns.Item("PROFILE_GROUP_TEXT").Visible = False
GridView_Docs.Columns.Item("PROFILE_GROUP_COLOR").Visible = False
For index = 0 To GridView_Docs.GroupCount - 1
Dim v = GridView_Docs.GroupedColumns(index).ToString
If LOG_ERRORS_ONLY = False Then ClassLogger.Add($" >> Addig tag [{GridView_Docs.Columns.Item("PROFILE_ID")}] for group...", False)
LOGGER.Debug($" >> Addig tag [{GridView_Docs.Columns.Item("PROFILE_ID")}] for group...", False)
GridView_Docs.GroupedColumns(index).Tag = GridView_Docs.Columns.Item("PROFILE_ID")
Next
@ -1180,7 +1217,8 @@ Public Class frmMain
GridView_Docs.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
GridView_Docs.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Formatting Grid: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Formatting Grid: " & ex.Message)
End Try
Try
For Each grid_column As GridColumn In GridView_Docs.Columns
@ -1202,6 +1240,7 @@ Public Class frmMain
Try
grid_column.Dispose()
Catch ex As Exception
LOGGER.Error(ex)
End Try
@ -1211,7 +1250,8 @@ Public Class frmMain
End If
Next
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Checking ColumnsGrid: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Checking ColumnsGrid: " & ex.Message)
End Try
@ -1219,7 +1259,7 @@ Public Class frmMain
'GridView_Docs.SaveLayoutToXml(GetXML_LayoutName())
SaveGridLayout()
If GridView_Docs.Columns.Count <= 2 Then
ClassLogger.Add("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False)
LOGGER.Info("GridView_Docs.Columns.Count <= 2 - Reset_Gridlayout will be forced...", False)
Reset_GridLayout()
End If
@ -1231,6 +1271,7 @@ Public Class frmMain
Try
GridView_Docs.Columns.Clear()
Catch ex As Exception
LOGGER.Error(ex)
End Try
End If
@ -1240,7 +1281,8 @@ Public Class frmMain
Catch ex As Exception
ClassLogger.Add("Load_Grid_Overview - Fehler: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Load_Grid_Overview - Fehler: " & ex.Message)
MsgBox("Fehler Load_Grid_Overview - Fehler: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
Cursor = Cursors.Default
@ -1308,6 +1350,7 @@ Public Class frmMain
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
@ -1347,6 +1390,7 @@ Public Class frmMain
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub

View File

@ -35,11 +35,12 @@ Public Class frmMassValidator
'_windreamPM.Create_Session()
If LOG_ERRORS_ONLY = False Then ClassLogger.Add("windream initialized frmMassValidator", False)
LOGGER.Debug("windream initialized frmMassValidator", False)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error Init_windream:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
ClassLogger.Add(">> Fehler in Init_windream: " & ex.Message, True)
LOGGER.Info(">> Fehler in Init_windream: " & ex.Message, True)
Exit Sub
End Try
@ -53,10 +54,11 @@ Public Class frmMassValidator
End If
Try
DT_PROFILE_CONTROLS = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_PROFILE_CONTROLS WHERE CTRL_TYPE <> 'TABLE' AND SQL_UEBERPRUEFUNG NOT LIKE '%WMI%' AND PROFIL_ID = " & CURRENT_ProfilGUID)
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Profile Data geladen", False)
LOGGER.Debug(" >> Profile Data geladen", False)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error LOADING profile-data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
ClassLogger.Add(">> Fehler in LOADING profile-data: " & ex.Message, True)
LOGGER.Info(">> Fehler in LOADING profile-data: " & ex.Message, True)
Me.Close()
End Try
@ -64,7 +66,7 @@ Public Class frmMassValidator
Delimiter = CURRENT_DT_CONFIG.Rows(0).Item("VEKTOR_DELIMITER")
If CURRENT_DT_PROFILE.Rows.Count = 0 Then
ClassLogger.Add(">> Profildaten konnten nicht geladen werden - Übergebenes Profil: : " & CURRENT_ProfilName, True)
LOGGER.Info(">> Profildaten konnten nicht geladen werden - Übergebenes Profil: : " & CURRENT_ProfilName, True)
MsgBox("Achtung: Profildaten konnten nicht übergeben oder geladen werden.", MsgBoxStyle.Critical, "Achtung:")
Me.Close()
End If
@ -95,10 +97,10 @@ Public Class frmMassValidator
Next
If LOG_ERRORS_ONLY = False Then
ClassLogger.Add(" >> Profildaten gespeichert", False)
ClassLogger.Add(" >> WD_Search: " & WM_SEARCH, False)
ClassLogger.Add(" >> finalProfile: " & FINAL_PROFILE, False)
ClassLogger.Add(" >> Move2Folder: " & MOVE2Folder, False)
LOGGER.Info(" >> Profildaten gespeichert", False)
LOGGER.Info(" >> WD_Search: " & WM_SEARCH, False)
LOGGER.Info(" >> finalProfile: " & FINAL_PROFILE, False)
LOGGER.Info(" >> Move2Folder: " & MOVE2Folder, False)
End If
@ -110,7 +112,7 @@ Public Class frmMassValidator
'Catch ex As Exception
' MsgBox("Error SAVING Profile-Data:" & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Attention:")
' ClassLogger.Add(">> Fehler in SAVING Profile-Data: " & ex.Message, True)
' LOGGER.Info(">> Fehler in SAVING Profile-Data: " & ex.Message, True)
'End Try
'Me.lblerror.Visible = False
@ -118,100 +120,100 @@ Public Class frmMassValidator
btnSave.Text = String.Format("Finish all documents (#{0})", CURRENT_DT_MASS_CHANGE_DOCS.Rows.Count.ToString)
Else
btnSave.Text = String.Format("Alle Dokumente (#{0}) abschliessen.", CURRENT_DT_MASS_CHANGE_DOCS.Rows.Count.ToString)
End If
End If
End Sub
Sub Load_Controls()
' Try
pnldesigner.Controls.Clear()
'Dim dt As DataTable = DD_DMSLiteDataSet.VWPM_CONTROL_INDEX
'Dim dt As DataTable = DD_DMSLiteDataSet.VWPM_CONTROL_INDEX
For Each dr As DataRow In DT_PROFILE_CONTROLS.Rows
Dim ctrl As Control
For Each dr As DataRow In DT_PROFILE_CONTROLS.Rows
Dim ctrl As Control
Select Case dr.Item("CTRL_TYPE").ToString.ToUpper
Case "TXT"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch TXT zu laden", False)
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(dr, False)
Select Case dr.Item("CTRL_TYPE").ToString.ToUpper
Case "TXT"
LOGGER.Debug(" >> Versuch TXT zu laden", False)
Dim txt As TextBox = ClassControlCreator.CreateExistingTextbox(dr, False)
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
ctrl = txt
Case "LBL"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch LBL zu laden", False)
ctrl = ClassControlCreator.CreateExistingLabel(dr, False)
Case "CMB"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch CMB zu laden", False)
ctrl = txt
Case "LBL"
LOGGER.Debug(" >> Versuch LBL zu laden", False)
ctrl = ClassControlCreator.CreateExistingLabel(dr, False)
Case "CMB"
LOGGER.Debug(" >> Versuch CMB zu laden", False)
Dim cmb = ClassControlCreator.CreateExistingCombobox(dr, False)
Dim cmb = ClassControlCreator.CreateExistingCombobox(dr, False)
AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex
AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex
#Region "CONTROL LIST"
If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
Dim CURR_SQL_PROVIDER As String
If CURRENT_CONTROL_ID > 0 Then
If CURR_CON_ID > 0 Then
Dim commandsql = CURR_SELECT_CONTROL
If commandsql <> "" Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> ConID > 0 And commandsql <> ''", False)
Dim connectionString As String
If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
Dim CURR_SQL_PROVIDER As String
If CURRENT_CONTROL_ID > 0 Then
If CURR_CON_ID > 0 Then
Dim commandsql = CURR_SELECT_CONTROL
If commandsql <> "" Then
LOGGER.Debug(" >> ConID > 0 And commandsql <> ''", False)
Dim connectionString As String
Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID)
If ConRow Is Nothing Then
MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID)
If ConRow Is Nothing Then
MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
For Each row As DataRow In ConRow
Select Case row("SQL_PROVIDER").ToString.ToLower
Case "ms-sql"
CURR_SQL_PROVIDER = "ms-sql"
If row("USERNAME") = "WINAUTH" Then
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;"
Else
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";"
End If
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> ConnString Sql-Server: " & connectionString)
Case "oracle"
CURR_SQL_PROVIDER = "oracle"
Dim conn As New OracleConnectionStringBuilder
Dim connstr As String
If row("SERVER") <> "" And row("DATENBANK").GetType.ToString <> "system.dbnull" Then
connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & row("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" &
For Each row As DataRow In ConRow
Select Case row("SQL_PROVIDER").ToString.ToLower
Case "ms-sql"
CURR_SQL_PROVIDER = "ms-sql"
If row("USERNAME") = "WINAUTH" Then
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog=" & row("DATENBANK") & ";Trusted_Connection=True;"
Else
connectionString = "Data Source=" & row("SERVER") & ";Initial Catalog= " & row("DATENBANK") & ";User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";"
End If
LOGGER.Debug(" >> ConnString Sql-Server: " & connectionString)
Case "oracle"
CURR_SQL_PROVIDER = "oracle"
Dim conn As New OracleConnectionStringBuilder
Dim connstr As String
If row("SERVER") <> "" And row("DATENBANK").GetType.ToString <> "system.dbnull" Then
connstr = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=" & row("SERVER") & ")(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=" &
row("DATENBANK") & ")));User Id=" & row("USERNAME") & ";Password=" & row("PASSWORD") & ";"
Else
conn.DataSource = row("SERVER")
conn.UserID = row("USERNAME")
conn.Password = row("PASSWORD")
conn.PersistSecurityInfo = True
conn.ConnectionTimeout = 120
connstr = conn.ConnectionString
End If
Else
conn.DataSource = row("SERVER")
conn.UserID = row("USERNAME")
conn.Password = row("PASSWORD")
conn.PersistSecurityInfo = True
conn.ConnectionTimeout = 120
connstr = conn.ConnectionString
End If
connectionString = connstr
Case Else
ClassLogger.Add("ConnectionString-Type not integrated", False)
MsgBox("ConnectionString-Type not integrated", MsgBoxStyle.Critical)
Exit Sub
End Select
connectionString = connstr
Case Else
LOGGER.Info("ConnectionString-Type not integrated", False)
MsgBox("ConnectionString-Type not integrated", MsgBoxStyle.Critical)
Exit Sub
End Select
Next
Next
If connectionString Is Nothing = False And CURR_SQL_PROVIDER = "ms-sql" Then
Try
Dim sqlCnn As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim NewDataset As New DataSet
Dim i As Integer
If connectionString Is Nothing = False And CURR_SQL_PROVIDER = "ms-sql" Then
Try
Dim sqlCnn As SqlClient.SqlConnection
Dim sqlCmd As SqlClient.SqlCommand
Dim adapter As New SqlClient.SqlDataAdapter
Dim NewDataset As New DataSet
Dim i As Integer
'sql = ClassPatterns.ReplaceAllValues(sql, pnldesigner, aktivesDokument)
@ -234,61 +236,62 @@ Public Class frmMassValidator
sqlCnn.Close()
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in running depending sql-command: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in running depending sql-command: " & ex.Message)
Clipboard.SetText("Error: " & ex.Message & vbNewLine & "SQL: " & CURR_SELECT_CONTROL)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unexpected Error in running depending sql-command:")
End Try
End If
Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Else Row 571", False)
End If
Else
If CURR_CHOICE_LIST <> "" Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> In add_ComboBox - AListe: " & CURR_CHOICE_LIST, False)
LOGGER.Debug(" >> Else Row 571", False)
End If
Else
If CURR_CHOICE_LIST <> "" Then
LOGGER.Debug(" >> In add_ComboBox - AListe: " & CURR_CHOICE_LIST, False)
Dim liste = WINDREAM.GetValuesfromAuswahlliste(CURR_CHOICE_LIST)
If liste IsNot Nothing Then
cmb.Items.Add("")
For Each index As String In liste
cmb.Items.Add(index)
Next
cmb.SelectedIndex = -1
Else
MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST)
End If
cmb.Items.Add("")
For Each index As String In liste
cmb.Items.Add(index)
Next
cmb.SelectedIndex = -1
Else
MsgBox("Resultliste windream is nothing!", MsgBoxStyle.Exclamation, CURR_CHOICE_LIST)
End If
End If
End If
End If
#End Region
Dim maxWith As Integer = cmb.Width
Using g As Graphics = Me.CreateGraphics
For Each oItem As Object In cmb.Items 'Für alle Einträge...
Dim g1 As Graphics = cmb.CreateGraphics
If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then
maxWith = g1.MeasureString(Text, cmb.Font).Width + 30
End If
g1.Dispose()
Next oItem
End Using
cmb.DropDownWidth = maxWith
Dim maxWith As Integer = cmb.Width
Using g As Graphics = Me.CreateGraphics
For Each oItem As Object In cmb.Items 'Für alle Einträge...
Dim g1 As Graphics = cmb.CreateGraphics
If g1.MeasureString(Text, cmb.Font).Width + 30 > maxWith Then
maxWith = g1.MeasureString(Text, cmb.Font).Width + 30
End If
g1.Dispose()
Next oItem
End Using
cmb.DropDownWidth = maxWith
ctrl = cmb
Case "DTP"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch DTP zu laden", False)
ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False)
Case "DGV"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch DGV zu laden", False)
Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False)
ctrl = cmb
Case "DTP"
LOGGER.Debug(" >> Versuch DTP zu laden", False)
ctrl = ClassControlCreator.CreateExistingDatepicker(dr, False)
Case "DGV"
LOGGER.Debug(" >> Versuch DGV zu laden", False)
Dim dgv = ClassControlCreator.CreateExistingDataGridView(dr, False)
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
ctrl = dgv
Case "CHK"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Checkbox zu laden", False)
ctrl = dgv
Case "CHK"
LOGGER.Debug(" >> Versuch Checkbox zu laden", False)
ctrl = ClassControlCreator.CreateExisingCheckbox(dr, False)
ctrl = ClassControlCreator.CreateExisingCheckbox(dr, False)
'Case "TABLE"
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Versuch Tabelle zu laden", False)
' If LogErrorsOnly = False Then LOGGER.Info(" >> Versuch Tabelle zu laden", False)
' For Each c As DataColumn In DT_PROFILE_CONTROLS.Columns
' '... = c.ColumnName
@ -300,32 +303,32 @@ Public Class frmMassValidator
' ctrl = ClassControlCreator.CreateExistingTable(dr, columns, False)
Case "LINE"
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Versuch Linie zu laden", False)
Case "LINE"
LOGGER.Debug(" >> Versuch Linie zu laden", False)
ctrl = ClassControlCreator.CreateExistingLine(dr, False)
End Select
ctrl = ClassControlCreator.CreateExistingLine(dr, False)
End Select
If TypeOf ctrl IsNot Label Then
' If first_control Is Nothing Then
'first_control = ctrl
'End If
'last_control = ctrl
End If
If TypeOf ctrl IsNot Label Then
' If first_control Is Nothing Then
'first_control = ctrl
'End If
'last_control = ctrl
End If
pnldesigner.Controls.Add(ctrl)
pnldesigner.Controls.Add(ctrl)
LoadSimpleData(ctrl, dr.Item("GUID"))
Next
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Controls geladen", False)
ClassLogger.Add("", False)
CTRLS_Loaded = True
FillIndexValues()
LoadSimpleData(ctrl, dr.Item("GUID"))
Next
LOGGER.Debug(" >> Controls geladen", False)
LOGGER.Info("", False)
CTRLS_Loaded = True
FillIndexValues()
'Catch ex As Exception
' If LogErrorsOnly = False Then MsgBox("Error Load_Controls: " & ex.Message, MsgBoxStyle.Critical, "Attention error:")
' ' allgFunk.Insert_LogEntry(CURRENT_ProfilGUID, "Error Load_Controls: " & ex.Message, Environment.UserName)
' ClassLogger.Add("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message)
' ClassLogger.Add("", False)
' LOGGER.Info("Unvorhergesehener Fehler bei Load_Controls:" & ex.Message)
' LOGGER.Info("", False)
'End Try
@ -354,7 +357,7 @@ Public Class frmMassValidator
Dim defaultValue As String = NotNull(controlRow.Item("DEFAULT_VALUE"), String.Empty)
indexname = idxname
Dim LoadIDX As Boolean = controlRow.Item("LOAD_IDX_VALUE")
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> INDEX: " & idxname & " - CONTROLNAME: " & inctrl.Name & " - LOAD IDXVALUES: " & LoadIDX.ToString, False)
LOGGER.Debug(" >> INDEX: " & idxname & " - CONTROLNAME: " & inctrl.Name & " - LOAD IDXVALUES: " & LoadIDX.ToString, False)
Dim wertWD
Select Case Type
Case "System.Windows.Forms.TextBox"
@ -368,7 +371,7 @@ Public Class frmMassValidator
If LoadIDX = False Or idxname = "DD PM-ONLY FOR DISPLAY" Then
' Wenn kein Index exisitiert, defaultValue laden
inctrl.Text = defaultValue
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False)
LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False)
Exit Select
End If
@ -381,12 +384,13 @@ Public Class frmMassValidator
End If
Catch ex As Exception
LOGGER.Error(ex)
errormessage = "Unexpected error in FillIndexValues TextBox(MI):" & vbNewLine & ex.Message & vbNewLine & "Check Logfile"
My.Settings.Save()
frmError.ShowDialog()
ClassLogger.Add(">> Unexpected error in FillIndexValues TextBox(MI): " & ex.Message, True)
ClassLogger.Add(">> Controltype: " & controltype, False)
ClassLogger.Add(">> Indexname windream: " & indexname, False)
LOGGER.Info(">> Unexpected error in FillIndexValues TextBox(MI): " & ex.Message, True)
LOGGER.Info(">> Controltype: " & controltype, False)
LOGGER.Info(">> Indexname windream: " & indexname, False)
Exit Sub
End Try
@ -404,7 +408,7 @@ Public Class frmMassValidator
Else
cmb.Text = defaultValue
End If
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False)
LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False)
Exit Select
End If
wertWD = GetWM_Value_Multiple_Docs(idxname)
@ -428,7 +432,7 @@ Public Class frmMassValidator
End If
If idxname Is Nothing = False Then
If LoadIDX = False Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False)
LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False)
Exit Select
End If
@ -501,7 +505,7 @@ Public Class frmMassValidator
Dim chk As CheckBox = inctrl
If LoadIDX = False Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexwert soll nicht geladen werden.", False)
LOGGER.Debug(" >> Indexwert soll nicht geladen werden.", False)
If defaultValue <> String.Empty Then
Dim result
@ -515,7 +519,7 @@ Public Class frmMassValidator
wertWD = GetWM_Value_Multiple_Docs(idxname)
If wertWD Is Nothing Then
ClassLogger.Add(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & indexname & "' ist nothing. Check defaultvalue", False)
LOGGER.Info(">> Zurückgegebener Wert des Wertes für Checkbox mit Indexname '" & indexname & "' ist nothing. Check defaultvalue", False)
chk.Checked = False
Else
If wertWD.ToString = "" Then
@ -531,11 +535,11 @@ Public Class frmMassValidator
Else
Dim _value
If wertWD.ToString = "System.Object[]" Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> CheckBoxValue with VektorField: " & idxname, False)
LOGGER.Debug(" >> CheckBoxValue with VektorField: " & idxname, False)
If wertWD.length = 1 Then
_value = wertWD(0)
Else '
ClassLogger.Add(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False)
LOGGER.Info(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False)
_value = wertWD(0)
End If
Else
@ -549,7 +553,8 @@ Public Class frmMassValidator
chk.Checked = False
End Select
Catch ex As Exception
ClassLogger.Add(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True)
LOGGER.Error(ex)
LOGGER.Info(">> Unvorhergesehener Fehler bei CBool(wertWD) - CheckBox: " & ex.Message & vbNewLine & "Wert WD: " & wertWD.ToString, True)
chk.Checked = False
End Try
End If
@ -566,12 +571,13 @@ Public Class frmMassValidator
End Select
Next
Catch ex As Exception
LOGGER.Error(ex)
errormessage = "Unexpected Error in FillIndexValues(MI):" & vbNewLine & ex.Message & vbNewLine & "Check Logfile"
My.Settings.Save()
frmError.ShowDialog()
ClassLogger.Add(">> Unexpected Error in FillIndexValues(MIs: " & ex.Message, True)
ClassLogger.Add(">> Controltype: " & controltype, False)
ClassLogger.Add(">> Indexname windream: " & indexname, False)
LOGGER.Info(">> Unexpected Error in FillIndexValues(MIs: " & ex.Message, True)
LOGGER.Info(">> Controltype: " & controltype, False)
LOGGER.Info(">> Indexname windream: " & indexname, False)
End Try
@ -588,7 +594,8 @@ Public Class frmMassValidator
Try
WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH"))
Catch ex As Exception
ClassLogger.Add("error while creating WMObject in (textCheckIndex): " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("error while creating WMObject in (textCheckIndex): " & ex.Message)
Exit For
End Try
If Not IsNothing(WMDOC) Then
@ -599,11 +606,11 @@ Public Class frmMassValidator
tempIndexValue = WMDOC.GetVariableValue(idxname)
If IsNothing(tempIndexValue) Then tempIndexValue = ""
If tempIndexValue.ToString = "System.Object[]" Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> TextBox with VektorField: " & idxname, False)
LOGGER.Debug(" >> TextBox with VektorField: " & idxname, False)
If tempIndexValue.Length = 1 Then
tempIndexValue = tempIndexValue(0)
Else '
ClassLogger.Add(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False)
LOGGER.Info(" >> Vectorfield " & idxname & "' contains more then one value - First value will be used", False)
tempIndexValue = tempIndexValue(0)
End If
End If
@ -625,7 +632,8 @@ Public Class frmMassValidator
Next
Return valueAllOver
Catch ex As Exception
ClassLogger.Add("Unexpected error in GetWM_Value_Multiple_Docs: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in GetWM_Value_Multiple_Docs: " & ex.Message, True)
Return "Unexp. error in GetWM_Value_Multiple_Docs"
End Try
End Function
@ -665,8 +673,9 @@ Public Class frmMassValidator
If value Is Nothing Then value = ""
Return value
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error in ReturnVektor_IndexValue(MV): " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
ClassLogger.Add("Unexpected Error in ReturnVektor_IndexValue(MV): " & ex.Message)
LOGGER.Info("Unexpected Error in ReturnVektor_IndexValue(MV): " & ex.Message)
Return ""
End Try
@ -703,22 +712,23 @@ Public Class frmMassValidator
For Each ROW As DataRow In CURR_DT_DEPENDING_CONTROLS.Rows
'Try
Dim displayboxname = ROW.Item(Name).ToString
If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then
Dim sql_Statement = ROW.Item(2)
If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then
Dim sql_Statement = ROW.Item(2)
sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, WMObject, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL)
_dependingControl_in_action = True
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
_dependingControl_in_action = False
End If
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
_dependingControl_in_action = False
End If
'Catch ex As Exception
' ClassLogger.Add("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
' LOGGER.Info("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
'End Try
Next
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Eventhandler OnTextBoxKeyUp - ERROR: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Eventhandler OnTextBoxKeyUp - ERROR: " & ex.Message)
End Try
End If
@ -728,9 +738,9 @@ Public Class frmMassValidator
Private Sub Depending_Control_Set_Result(displayboxname As String, sqlCommand As String, sqlConnection As String)
'Try
Dim resultDT As DataTable = ClassDatabase.Return_Datatable_CS(sqlCommand, sqlConnection)
If Not IsNothing(resultDT) Then
'Ist das Control ein Control was mehrfachwerte enthalten kann
If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_DATAGRIDVIEW) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then
If Not IsNothing(resultDT) Then
'Ist das Control ein Control was mehrfachwerte enthalten kann
If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_DATAGRIDVIEW) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then
If displayboxname.StartsWith(ClassControlCreator.PREFIX_COMBOBOX) Then
Dim cmbpanel As ComboBox = pnldesigner.Controls(displayboxname)
If IsNothing(cmbpanel) Then
@ -743,17 +753,17 @@ Public Class frmMassValidator
ElseIf displayboxname.StartsWith(ClassControlCreator.PREFIX_DATAGRIDVIEW) Or displayboxname.StartsWith(ClassControlCreator.PREFIX_TABLE) Then
'not implemented
End If
Else
Else
If resultDT.Rows.Count = 1 Then
pnldesigner.Controls(displayboxname).Text = resultDT.Rows(0).Item(0).ToString
Else
pnldesigner.Controls(displayboxname).Text = "RESULT = resultDT.Rows.Count <> 1"
ClassLogger.Add(">> Datatable-SQL: " & sqlCommand, False)
LOGGER.Info(">> Datatable-SQL: " & sqlCommand, False)
End If
End If
End If
End If
'Catch ex As Exception
' ClassLogger.Add("Unexpected Ersror in Depending_Control_Set_Result - ERROR: " & ex.Message)
' LOGGER.Info("Unexpected Ersror in Depending_Control_Set_Result - ERROR: " & ex.Message)
' MsgBox("Unexpected error in Depending_Control_Set_Result: " & ex.Message, MsgBoxStyle.Critical)
'End Try
End Sub
@ -762,14 +772,14 @@ Public Class frmMassValidator
If cmb.SelectedIndex <> -1 And CTRLS_Loaded = True And FORM_Shown = True Then
' Try
If ClassControlCreator.GET_CONTROL_PROPERTIES(DT_PROFILE_CONTROLS, cmb.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties CMB - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
MsgBox("Unexpected Error in getting control-properties CMB - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
If ClassControlCreator.GET_DEPENDING_CONTROLS(DT_PROFILE_CONTROLS, cmb.Name) = False Then
MsgBox("Unexpected Error in getting dependent controls CMB- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
If ClassControlCreator.GET_DEPENDING_CONTROLS(DT_PROFILE_CONTROLS, cmb.Name) = False Then
MsgBox("Unexpected Error in getting dependent controls CMB- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub
End If
If _dependingControl_in_action = True Or CURR_DT_DEPENDING_CONTROLS Is Nothing Then
Exit Sub
End If
@ -777,24 +787,24 @@ Public Class frmMassValidator
For Each ROW As DataRow In CURR_DT_DEPENDING_CONTROLS.Rows
'Try
Dim displayboxname = ROW.Item("NAME").ToString
If Not IsDBNull(ROW.Item("CONNECTION_ID")) And Not IsDBNull(ROW.Item("SQL_UEBERPRUEFUNG")) Then
Dim sql_Statement = ROW.Item("SQL_UEBERPRUEFUNG")
If Not IsDBNull(ROW.Item("CONNECTION_ID")) And Not IsDBNull(ROW.Item("SQL_UEBERPRUEFUNG")) Then
Dim sql_Statement = ROW.Item("SQL_UEBERPRUEFUNG")
sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, WMObject, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL)
_dependingControl_in_action = True
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
_dependingControl_in_action = False
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
_dependingControl_in_action = False
End If
End If
'Catch ex As Exception
' ClassLogger.Add("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
' LOGGER.Info("Unexpected Error in displaying SQL-result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
'End Try
Next
'Catch ex As Exception
' ClassLogger.Add("Unexpected Error in Eventhandler OnCmbselectedIndex - ERROR: " & ex.Message)
' LOGGER.Info("Unexpected Error in Eventhandler OnCmbselectedIndex - ERROR: " & ex.Message)
'End Try
SendKeys.Send("{TAB}")
@ -846,7 +856,8 @@ Public Class frmMassValidator
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
End Try
Next
@ -854,7 +865,8 @@ Public Class frmMassValidator
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message)
End Try
End Sub
@ -924,7 +936,8 @@ Public Class frmMassValidator
Try
WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH"))
Catch ex As Exception
ClassLogger.Add("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message)
Exit For
End Try
If Not IsNothing(WMDOC) Then
@ -943,6 +956,7 @@ Public Class frmMassValidator
WORK_HISTORY_ENTRY = Nothing
End If
Catch ex As Exception
LOGGER.Error(ex)
WORK_HISTORY_ENTRY = Nothing
End Try
If Not IsNothing(WORK_HISTORY_ENTRY) Then
@ -956,7 +970,7 @@ Public Class frmMassValidator
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
For Each element As System.Text.RegularExpressions.Match In elemente
Try
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False)
LOGGER.Debug(" >> element in RegeX WORK_HISTORY_ENTRY: " & element.Value, False)
Dim CTRL_ID = element.Value.Substring(2, element.Value.Length - 3)
CTRL_ID = CTRL_ID.Replace("CTRLID", "")
Dim value_from_control
@ -972,6 +986,7 @@ Public Class frmMassValidator
Try
value_from_control = inctrl.Text
Catch ex As Exception
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
@ -980,6 +995,7 @@ Public Class frmMassValidator
Try
value_from_control = cmb.Text
Catch ex As Exception
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
Case "System.Windows.Forms.DateTimePicker"
@ -987,6 +1003,7 @@ Public Class frmMassValidator
Try
value_from_control = dtp.Value.ToString
Catch ex As Exception
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
@ -995,6 +1012,7 @@ Public Class frmMassValidator
Try
value_from_control = chk.Checked
Catch ex As Exception
LOGGER.Error(ex)
value_from_control = String.Empty
End Try
End Select
@ -1005,7 +1023,8 @@ Public Class frmMassValidator
WORK_HISTORY_ENTRY = WORK_HISTORY_ENTRY.ToString.Replace(element.Value, value_from_control)
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Checking control values for WORK_HISTORY_ENTRY - ERROR: " & ex.Message)
End Try
Next
If WORK_HISTORY_ENTRY.ToString.Contains("@DATE") Then
@ -1086,7 +1105,7 @@ Public Class frmMassValidator
' errormessage = "Unvorhergesehener Fehler bei Abschluss:" & ex.Message
' My.Settings.Save()
' frmError.ShowDialog()
' ClassLogger.Add(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True)
' LOGGER.Info(">> Unvorhergesehener Fehler bei Abschluss: " & ex.Message, True)
'End Try
Else
'lblerror.Visible = True
@ -1119,9 +1138,9 @@ Public Class frmMassValidator
Dim ctrl = dr.Item("NAME")
'Nur wenn der Name der Zeile entspricht und der Index READ_ONLY FALSE ist
If dr.Item("NAME") = inctrl.Name And (_READ_ONLY = False Or dr.Item("SQL_UEBERPRUEFUNG") <> "") And _IDXName <> "DD PM-ONLY FOR DISPLAY" Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexierung für Control (" & CONTROL_ID & ") '" & ctrl & "' gestartet. Indexname '" & _IDXName & "'", False)
LOGGER.Debug(" >> Indexierung für Control (" & CONTROL_ID & ") '" & ctrl & "' gestartet. Indexname '" & _IDXName & "'", False)
If _IDXName = "" Then
ClassLogger.Add(" >> Indexname is unexpected empty.", False)
LOGGER.Info(" >> Indexname is unexpected empty.", False)
Continue For
End If
Dim Type As String = inctrl.GetType.ToString
@ -1166,10 +1185,11 @@ Public Class frmMassValidator
End If
Catch ex As Exception
LOGGER.Error(ex)
Dim st As New StackTrace(True)
st = New StackTrace(ex, True)
MsgBox("Unvorhergesehener Fehler in Check_UpdateIndexe TextBox: " & vbNewLine & ex.Message & vbNewLine & "Line: " & st.GetFrame(0).GetFileLineNumber().ToString, MsgBoxStyle.Critical, "Error:")
ClassLogger.Add("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True)
LOGGER.Info("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True)
Return True
End Try
@ -1247,7 +1267,7 @@ Public Class frmMassValidator
End If
Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> DateValue is 01.01.0001 00:00:00", False)
LOGGER.Debug(" >> DateValue is 01.01.0001 00:00:00", False)
End If
Case "System.Windows.Forms.CheckBox"
Dim chk As CheckBox = inctrl
@ -1364,7 +1384,7 @@ Public Class frmMassValidator
' Dim st As New StackTrace(True)
' st = New StackTrace(ex, True)
' MsgBox("Unvorhergesehener Fehler in Check_UpdateIndexe: " & vbNewLine & ex.Message & vbNewLine & "Line: " & st.GetFrame(0).GetFileLineNumber().ToString, MsgBoxStyle.Critical, "Error:")
' ClassLogger.Add("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True)
' LOGGER.Info("Unvorhergesehener Fehler in Check_UpdateIndexe:" & ex.Message & " - Line: " & st.GetFrame(0).GetFileLineNumber().ToString, True)
' Return True
'End Try
@ -1387,7 +1407,8 @@ Public Class frmMassValidator
Try
WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH"))
Catch ex As Exception
ClassLogger.Add("error while creating WMObject in (IndexMultipleFiles): " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("error while creating WMObject in (IndexMultipleFiles): " & ex.Message)
_allfine = False
Exit For
@ -1404,7 +1425,7 @@ Public Class frmMassValidator
'Das Array der Idnexwerte überprüfen
If idxvalue Is Nothing = False Then
If idxvalue.Length() > 1 Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False)
LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False)
Dim anzahl As Integer = 0
For Each indexvalue As String In idxvalue
ReDim Preserve arrValue(anzahl)
@ -1412,7 +1433,7 @@ Public Class frmMassValidator
anzahl += 1
Next
Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False)
LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False)
ReDim Preserve arrValue(0)
arrValue(0) = idxvalue(0).ToString
End If
@ -1427,7 +1448,8 @@ Public Class frmMassValidator
Return _allfine
Catch ex As Exception
ClassLogger.Add("Unexpected error in IndexMultipleFiles: " & ex.Message.ToString, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected error in IndexMultipleFiles: " & ex.Message.ToString, True)
Return False
End Try
End Function
@ -1439,7 +1461,8 @@ Public Class frmMassValidator
Try
WMDOC = WINDREAM.oSession.GetWMObjectByPath(WMEntity.WMEntityDocument, docrow.Item("FULL_PATH"))
Catch ex As Exception
ClassLogger.Add("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("error while creating WMObject in (IndexVKTMultipleFiles): " & ex.Message)
_allfine = False
missing = True
Exit For
@ -1498,7 +1521,7 @@ Public Class frmMassValidator
'Das Array der Idnexwerte überprüfen
If idxvalue Is Nothing = False Then
If idxvalue.Length() > 1 Then
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False)
LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with Arrayvalue", False)
Dim anzahl As Integer = 0
For Each indexvalue As String In idxvalue
ReDim Preserve arrValue(anzahl)
@ -1506,7 +1529,7 @@ Public Class frmMassValidator
anzahl += 1
Next
Else
If LOG_ERRORS_ONLY = False Then ClassLogger.Add(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False)
LOGGER.Debug(" >> Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'", False)
ReDim Preserve arrValue(0)
arrValue(0) = idxvalue(0).ToString
End If
@ -1516,7 +1539,8 @@ Public Class frmMassValidator
End If
Catch ex As Exception
ClassLogger.Add("Unexpected Error in IndexSinglefile: " & ex.Message.ToString, True)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in IndexSinglefile: " & ex.Message.ToString, True)
Return Err()
End Try
End Function
@ -1526,7 +1550,8 @@ Public Class frmMassValidator
Dim Bezeichner As String = VKTBezeichner.Replace("[%VKT", "")
PM_String = "DD-PM" & Delimiter & Bezeichner & Delimiter & input & Delimiter & Environment.UserName & Delimiter & Now.ToString
Catch ex As Exception
ClassLogger.Add(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info(">> Fehler in Return_PM_VEKTOR: " & ex.Message, True)
PM_String = "DD-PM ERROR: " & ex.Message
End Try
Return PM_String
@ -1542,7 +1567,8 @@ Public Class frmMassValidator
End If
Catch ex As Exception
ClassLogger.Add(">> Fehler in Return_LOGString: " & ex.Message, True)
LOGGER.Error(ex)
LOGGER.Info(">> Fehler in Return_LOGString: " & ex.Message, True)
PM_String = "DD-PM ERROR: " & ex.Message
End Try
Return PM_String

View File

@ -26,6 +26,7 @@ Public Class frmSQL_Admin
MsgBox("Der SQL-Befehl wurde erfolgreich ausgeführt!", MsgBoxStyle.Information, "Erfolgsmeldung:")
connection.Close()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Datenbank-Connect:")
End Try
Cursor = Cursors.Default
@ -49,7 +50,7 @@ Public Class frmSQL_Admin
Try
With OpenFileDialog1
' Do
.Title = "Wählen Sie bitte die SQL-File:"
If .ShowDialog() = DialogResult.OK Then
Dim FILE_NAME As String = .FileName
@ -58,8 +59,9 @@ Public Class frmSQL_Admin
objReader.Close()
End If
End With
Catch ex As Exception
LOGGER.Error(ex)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei open-File:")
End Try

View File

@ -58,6 +58,7 @@ Public Class frmSQL_DESIGNER
'Windream initialisieren (Connection, Session, ... aufbauen)
'_windreamPM.Create_Session()
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Fehler bei Initialisieren von windream: " & vbNewLine & ex.Message, MsgBoxStyle.Critical, "Achtung:")
End Try
cmbIndexe.Items.Clear()
@ -82,6 +83,7 @@ Public Class frmSQL_DESIGNER
btnAddControl.Visible = False
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Unexpected Error while loading form: " & ex.Message, MsgBoxStyle.Critical)
End Try
@ -183,7 +185,7 @@ Public Class frmSQL_DESIGNER
Return dataset
Else
If LOG_ERRORS_ONLY = True Then ClassLogger.Add(" >> It's an Oracle-Connection (ExecuteWithConnection)", False)
If LOG_ERRORS_ONLY = True Then LOGGER.Info(" >> It's an Oracle-Connection (ExecuteWithConnection)", False)
Dim sqlConnection As OracleConnection
Dim sqlCommand As OracleCommand
Dim sqlAdapter As New OracleDataAdapter
@ -204,7 +206,8 @@ Public Class frmSQL_DESIGNER
End If
Catch ex As Exception
ClassLogger.Add(" - Unvorhergesehener Fehler bei TestSQL - Fehler: " & vbNewLine & ex.Message)
LOGGER.Error(ex)
LOGGER.Info(" - Unvorhergesehener Fehler bei TestSQL - Fehler: " & vbNewLine & ex.Message)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei TestSQL:")
Return Nothing
End Try

View File

@ -112,7 +112,7 @@ Public NotInheritable Class frmSplash
Private Sub bw_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs)
' Bei Fehler MsgBox anzeigen und Programm beenden
If e.Error IsNot Nothing Then
ClassLogger.Add("Unexpected error in Initializing application....")
LOGGER.Info("Unexpected error in Initializing application....")
MsgBox(e.Error.Message, MsgBoxStyle.Critical, "Unexpected error in Initializing application")
Application.Exit()
End If

View File

@ -13,6 +13,7 @@ Public Class frmUserKonfig_AddUsers
Dim XMLPath = System.IO.Path.Combine(Application.UserAppDataPath(), Filename)
GridViewUsers.SaveLayoutToXml(XMLPath)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in SaveGrid_Layout:" & vbNewLine & ex.Message)
End Try
End Sub
@ -40,6 +41,7 @@ Public Class frmUserKonfig_AddUsers
'DT_GROUPS_EXCLUSIVE = ClassDatabase.Return_Datatable(sql)
GetGroups(USER_USERNAME)
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in Load Groups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
Try
@ -51,6 +53,7 @@ Public Class frmUserKonfig_AddUsers
GridViewUsers.ClearSelection()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in Load Grid_Layout:" & vbNewLine & ex.Message)
End Try
Cursor = Cursors.Default
@ -78,6 +81,7 @@ Public Class frmUserKonfig_AddUsers
Next
Return groups
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in GetActiveDirectoryGroups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
Return Nothing
End Try
@ -114,6 +118,7 @@ Public Class frmUserKonfig_AddUsers
Try
newUserRow("Username") = userldap.SamAccountName
Catch ex As Exception
LOGGER.Error(ex)
newUserRow("Username") = user.ToString
End Try
Dim email As String = userldap.EmailAddress
@ -121,7 +126,8 @@ Public Class frmUserKonfig_AddUsers
newUserRow("Surname") = NAME
newUserRow("Email") = email
Catch ex As Exception
ClassLogger.Add("Unexpected Error in Read User LDAP-Configurations: " & vbNewLine)
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Read User LDAP-Configurations: " & vbNewLine)
End Try
DT_ADD_USERS.Rows.Add(newUserRow)
TBAD_UsersBindingSource.DataSource = DT_ADD_USERS
@ -144,12 +150,14 @@ Public Class frmUserKonfig_AddUsers
Try
PRENAME = row.Item(2)
Catch ex As Exception
LOGGER.Error(ex)
PRENAME = ""
End Try
Dim NAME As String = row.Item(3)
Try
NAME = row.Item(3)
Catch ex As Exception
LOGGER.Error(ex)
NAME = ""
End Try
@ -157,6 +165,7 @@ Public Class frmUserKonfig_AddUsers
Try
email = row.Item(4)
Catch ex As Exception
LOGGER.Error(ex)
email = ""
End Try
Dim SQL
@ -165,7 +174,7 @@ Public Class frmUserKonfig_AddUsers
If ClassDatabase.Execute_non_Query(SQL, False) = True Then
Dim ID = ClassDatabase.Execute_Scalar("SELECT MAX(GUID) FROM TBDD_USER", CONNECTION_STRING)
Dim msg = String.Format(">> USER {0}, {1} - {2} ADDED TO CONFIGURATION", NAME, PRENAME, USERNAME)
ClassLogger.Add(msg, False)
LOGGER.Info(msg, False)
SQL = String.Format("INSERT INTO TBDD_USER_MODULES (USER_ID,MODULE_ID) VALUES ({0},(SELECT GUID FROM TBDD_MODULES WHERE SHORT_NAME = 'PM'))", ID)
If ClassDatabase.Execute_non_Query(SQL, False) = False Then
MsgBox("Attention: could not add user to module! - Please check the log.", MsgBoxStyle.Exclamation)
@ -204,6 +213,7 @@ Public Class frmUserKonfig_AddUsers
Return True
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in UserExists: " & vbNewLine & ex.Message)
Return False
End Try
@ -284,9 +294,9 @@ Public Class frmUserKonfig_AddUsers
And Not groupname.StartsWith("Einstellungen eingehender") And Not groupname.StartsWith("Windows-Auth") And Not groupname.StartsWith("Terminalserver-Liz") And Not groupname.StartsWith("Zulässige") And Not groupname.StartsWith("Abgelehnte") And Not groupname.StartsWith("Schreibgeschützte Domänen") _
And Not groupname.StartsWith("Klonbare") And Not groupname.StartsWith("PrivUser") And Not groupname.StartsWith("Protected User") And Not groupname.StartsWith("Dns") And Not groupname.StartsWith("DHCP") And Not groupname.StartsWith("IIS_IUSR") And Not groupname.StartsWith("Richtlinien-Ersteller") _
And Not groupname.StartsWith("Abgelehnte RODC-Kenn") And Not groupname.StartsWith("Reporting") Then
' Console.WriteLine(CStr(sidResult.Properties("name")(0)))
lbGroups.Items.Add(groupname)
End If
' Console.WriteLine(CStr(sidResult.Properties("name")(0)))
lbGroups.Items.Add(groupname)
End If
' End If
'End If
@ -297,6 +307,7 @@ Public Class frmUserKonfig_AddUsers
lblgroup_refresh()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in GetGroups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
Cursor = Cursors.Default
@ -325,6 +336,7 @@ Public Class frmUserKonfig_AddUsers
lblgroup_refresh()
End If
Catch ex As Exception
LOGGER.Error(ex)
MsgBox("Error in Load Groups:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
End Try
Cursor = Cursors.Default

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,8 @@
My.Settings.frmValidatorSearchPosition = Me.Location
My.Settings.Save()
Catch ex As Exception
ClassLogger.Add("Error in Save FormLayout: " & ex.Message)
LOGGER.Error(ex)
LOGGER.Info("Error in Save FormLayout: " & ex.Message)
End Try
End Sub