MS V2.7 .Net Logger etc

This commit is contained in:
2021-06-15 16:28:55 +02:00
parent e2619eb3ad
commit e796ae91cb
109 changed files with 295499 additions and 8793 deletions

View File

@@ -346,7 +346,7 @@ Public Class ClassControlCommandsUI
Function SaveRecord(RecordID As Integer, FormID As Integer, Optional foreignRecordID As Integer = 0) As String
Try
Dim ADDED_WHO As String = USER_USERNAME
If LogErrorsOnly = False Then ClassLogger.Add(" >> (SaveRecord) Update RecordID: " & RecordID, False)
LOGGER.Debug("(SaveRecord) Update RecordID: " & RecordID, False)
If UpdateAllControls(FormID, RecordID, _CtrlBuilder.AllControls) = True Then
Return "Datensatz aktualisiert - " & Now
Else
@@ -513,7 +513,7 @@ Public Class ClassControlCommandsUI
Console.WriteLine("Updating Control " + ctrl.Name)
Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id 'GetControlID_for_RecordID(ctrl.Name, RecordID)
If LogErrorsOnly = False Then ClassLogger.Add(" >> CONTROL_ID: " & CONTROL_ID, False)
LOGGER.Debug("CONTROL_ID: " & CONTROL_ID, False)
Dim CONTROL_VALUE As String = GetControlValue(ctrl)
Dim controltype = ctrl.GetType.ToString
If TypeOf ctrl Is PictureBox Then
@@ -554,7 +554,7 @@ Public Class ClassControlCommandsUI
'If CONTROL_ID = 995 Or CONTROL_ID = 996 Or CONTROL_ID = 997 Or CONTROL_ID = 810 Then
' Console.WriteLine("sdasd")
'End If
If LogErrorsOnly = False Then ClassLogger.Add(" >> InsertControlValue: " & CONTROL_ID & "|" & RecordID & "|" & CONTROL_VALUE, False)
LOGGER.Debug("InsertControlValue: " & CONTROL_ID & "|" & RecordID & "|" & CONTROL_VALUE, False)
If Not IsNothing(CONTROL_VALUE) Then
If TypeOf ctrl Is CustomComboBox And CONTROL_VALUE = "" Then
'Exit Sub - Zuviel des guten
@@ -657,14 +657,14 @@ Public Class ClassControlCommandsUI
Dim type = ctrl.GetType().Name
Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id ' GetControlID_for_RecordID(ctrl.Name, CURRENT_RECORD_ID)
If LogErrorsOnly = False Then ClassLogger.Add(" >> GetControlValue CONTROL_ID: " & CONTROL_ID, False)
LOGGER.Debug("GetControlValue CONTROL_ID: " & CONTROL_ID, False)
Dim CONTROL_VALUE As String = Nothing
If LogErrorsOnly = False Then ClassLogger.Add(" >> type = " & type.ToString, False)
LOGGER.Debug("type = " & type.ToString, False)
Select Case type
Case "TextBox"
Return DirectCast(ctrl, TextBox).Text
Case "CustomComboBox"
If LogErrorsOnly = False Then ClassLogger.Add(" >> Return Value: " & DirectCast(ctrl, CustomComboBox).Text, False)
LOGGER.Debug("Return Value: " & DirectCast(ctrl, CustomComboBox).Text, False)
Return DirectCast(ctrl, CustomComboBox).Text
Case "CheckBox"
Return DirectCast(ctrl, CheckBox).Checked.ToString()
@@ -721,7 +721,7 @@ Public Class ClassControlCommandsUI
If ClassDatabase.Execute_Scalar(SQL, True) = 1 Then
SQL = "DELETE FROM TBPMO_RECORD_CONNECT WHERE RECORD1_ID = " & CURRENT_RECORD_ID & " AND RECORD2_ID = " & CInt(row(0))
If ClassDatabase.Execute_non_Query(SQL) = True Then
If LogErrorsOnly = False Then ClassLogger.Add(" >> TBPMO_RECORD_CONNECT-Entry after 'deselect CheckedListBox' deleted", False)
LOGGER.Debug("TBPMO_RECORD_CONNECT-Entry after 'deselect CheckedListBox' deleted", False)
End If
End If
End If
@@ -749,14 +749,14 @@ Public Class ClassControlCommandsUI
MsgBox("Attention: no current record Selected!", MsgBoxStyle.Exclamation)
Else
If ClassRecordCommands.ConnectRecord(CURRENT_RECORD_ID, CInt(row(0)), "CheckedListBox;" & ctrl.Name) = True Then
If LogErrorsOnly = False Then ClassLogger.Add(" >> Checked ListBox record '" & rid.ToString & "' was linked successfully.", False)
LOGGER.Debug("Checked ListBox record '" & rid.ToString & "' was linked successfully.", False)
End If
End If
End If
End If
Catch ex As Exception
ClassLogger.Add("Error in CheckedListBoxGetControlValue: " & ex.Message, True)
LOGGER.Warn("Error in CheckedListBoxGetControlValue: " & ex.Message)
End Try
Next
@@ -881,7 +881,7 @@ Public Class ClassControlCommandsUI
Return Value
Catch ex As Exception
MsgBox("Unexpected Error in Check_and_Format_Value: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
ClassLogger.Add("Unexpected Error in Check_and_Format_Value: " & ex.Message, True)
LOGGER.Warn("Unexpected Error in Check_and_Format_Value: " & ex.Message)
Return Nothing
End Try
End Function
@@ -915,7 +915,7 @@ Public Class ClassControlCommandsUI
Catch ex As Exception
Dim name = clsDatabase.Execute_Scalar("SELECT NAME FROM TBPMO_CONTROL WHERE GUID = " & ControlID, True)
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in CreateControlProcedure für Control: " & name)
ClassLogger.Add("Error in CreateControlProcedure: " & ex.Message, True)
LOGGER.Warn("Error in CreateControlProcedure: " & ex.Message, True)
Return 0
End Try
End Function
@@ -940,7 +940,7 @@ Public Class ClassControlCommandsUI
End If
Catch ex As Exception
MsgBox("Unexpected Error in inserting Control-Value: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
ClassLogger.Add("Unexpected Error in inserting Control-Value: " & ex.Message, True)
LOGGER.Warn("Unexpected Error in inserting Control-Value: " & ex.Message)
Return False
End Try
End Function
@@ -954,7 +954,7 @@ Public Class ClassControlCommandsUI
Dim upd = String.Format("UPDATE TBPMO_CONTROL_VALUE SET VALUE = '{0}', CHANGED_WHO = '{1}', CHANGE_STEP = {2} WHERE CONTROL_ID = {3} AND RECORD_ID = {4}",
converted_value, CHANGED_WHO, CURRENT_CHANGE_STEP, ControlID, RecordID)
If ControlID = 279 Or ControlID = 745 Then
ClassLogger.Add(upd, False, False)
LOGGER.Warn(upd)
End If
If LICENSE_PROXY = True Or clsDatabase.DB_PROXY_INITIALIZED = True Then
If ClassDatabase.Execute_non_Query(upd) = True Then
@@ -966,7 +966,7 @@ Public Class ClassControlCommandsUI
Return ClassDatabase.Execute_non_Query(upd)
End If
Catch ex As Exception
ClassLogger.Add("Unerwarteter Fehler in UpdateControlValue: " & ex.Message, True)
LOGGER.Warn("Unerwarteter Fehler in UpdateControlValue: " & ex.Message)
Return False
End Try
End Function