Logging und Vorbereitung MAPPING wie in taskFLOW

This commit is contained in:
Developer01
2026-05-04 16:40:14 +02:00
parent b586bf496b
commit 734e056248
15 changed files with 303 additions and 268 deletions

View File

@@ -12,7 +12,7 @@ Public Class ctrlObjectPropertyDialog
Implements IBaseForm
Private Property LogConfig As LogConfig Implements IBaseForm.LogConfig
Private Property Logger As Logger Implements IBaseForm.Logger
Private Property _Logger As Logger Implements IBaseForm._Logger
Private Property ControlManager As AttributeControls
Private Property GridBuilder As GridBuilder
Private Property Client As Client
@@ -38,7 +38,7 @@ Public Class ctrlObjectPropertyDialog
Public Sub Initialize(pLogConfig As LogConfig, pHostForm As Form, pClient As Client, pEnv As Environment)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
_Logger = pLogConfig.GetLogger()
HostForm = pHostForm
ControlManager = New AttributeControls(pLogConfig, pEnv, pClient)
Helper = New FormHelper(pLogConfig, pHostForm)
@@ -58,7 +58,7 @@ Public Class ctrlObjectPropertyDialog
Public Async Function SaveChanges() As Task(Of Boolean)
Try
For Each oChange As KeyValuePair(Of String, Object) In Changes
Logger.Info("Updating Attribute [{0}] with value [{1}]", oChange.Key, oChange.Value.ToString)
_Logger.Info("Updating Attribute [{0}] with value [{1}]", oChange.Key, oChange.Value.ToString)
Await Client.SetAttributeValueAsync(ObjectId, oChange.Key, oChange.Value, New Options.SetAttributeValueOptions With {
.Language = Environment.User.Language,
.Username = Environment.User.UserName
@@ -131,7 +131,7 @@ Public Class ctrlObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
Finally
Enabled = True
@@ -145,7 +145,7 @@ Public Class ctrlObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
End Try
End Function
@@ -156,7 +156,7 @@ Public Class ctrlObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
End Try
End Function
@@ -176,14 +176,14 @@ Public Class ctrlObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
End Try
End Function
Private Async Function GetBusinessEntitiesForObjectId(ObjectId As Long) As Task(Of List(Of Long))
Try
Dim oSQL = $"SELECT BE_ID FROM TBIDB_OBJECT_BE WHERE IDB_OBJ_ID = {ObjectId}"
Dim oSQL = $"SELECT BE_ID FROM TBIDB_OBJECT_BE WITH (NOLOCK) WHERE IDB_OBJ_ID = {ObjectId}"
Dim oResult = Await Client.GetDatatableFromIDBAsync(oSQL)
If oResult.OK = False Then
@@ -202,7 +202,7 @@ Public Class ctrlObjectPropertyDialog
Return oEntities
End If
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return New List(Of Long)
End Try
End Function
@@ -230,7 +230,7 @@ Public Class ctrlObjectPropertyDialog
End Function
Private Async Function GetPropertiesForObjectId(ObjectId As Long) As Task(Of DataTable)
Dim oSQL As String = $"SELECT * FROM TBIDB_OBJECT WHERE IDB_OBJ_ID = {ObjectId}"
Dim oSQL As String = $"SELECT * FROM TBIDB_OBJECT WITH (NOLOCK) WHERE IDB_OBJ_ID = {ObjectId}"
Dim oResult = Await Client.GetDatatableFromIDBAsync(oSQL)
Return oResult.Table
@@ -246,7 +246,7 @@ Public Class ctrlObjectPropertyDialog
ControlManager.LoadControlsForAttributes(oAttributes, Root)
Await ControlManager.LoadControlValuesForAttributes(pObjectId, Root)
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
End Try
End Sub

View File

@@ -19,7 +19,7 @@ Public Class frmObjectPropertyDialog
Private Property FormHelper As FormHelper
Private ReadOnly Property LogConfig As LogConfig Implements IBaseForm.LogConfig
Private ReadOnly Property Logger As Logger Implements IBaseForm.Logger
Private ReadOnly Property _Logger As Logger Implements IBaseForm._Logger
Private ReadOnly Changes As New Dictionary(Of String, Object)
@@ -29,7 +29,7 @@ Public Class frmObjectPropertyDialog
' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
_Logger = pLogConfig.GetLogger()
Environment = pEnvironment
Client = pClient
ObjectId = pObjectId
@@ -75,7 +75,7 @@ Public Class frmObjectPropertyDialog
Private Async Function GetBusinessEntitiesForObjectId(ObjectId As Long) As Task(Of List(Of Long))
Try
Dim oSQL = $"SELECT BE_ID FROM TBIDB_OBJECT_BE WHERE IDB_OBJ_ID = {ObjectId}"
Dim oSQL = $"SELECT BE_ID FROM TBIDB_OBJECT_BE WITH (NOLOCK) WHERE IDB_OBJ_ID = {ObjectId}"
Dim oResult = Await Client.GetDatatableFromIDBAsync(oSQL)
If oResult.OK = False Then
@@ -94,7 +94,7 @@ Public Class frmObjectPropertyDialog
Return oEntities
End If
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return New List(Of Long)
End Try
End Function
@@ -122,7 +122,7 @@ Public Class frmObjectPropertyDialog
End Function
Private Async Function GetPropertiesForObjectId(ObjectId As Long) As Task(Of DataTable)
Dim oSQL As String = $"SELECT * FROM TBIDB_OBJECT WHERE IDB_OBJ_ID = {ObjectId}"
Dim oSQL As String = $"SELECT * FROM TBIDB_OBJECT WITH (NOLOCK) WHERE IDB_OBJ_ID = {ObjectId}"
Dim oResult = Await Client.GetDatatableFromIDBAsync(oSQL)
Return oResult.Table
@@ -136,7 +136,7 @@ Public Class frmObjectPropertyDialog
Dim oEntityId As Long
If Long.TryParse(cmbBusinessEntity.EditValue, oEntityId) = False Then
_Logger.Warn("Could not Parse Entity from cmbBusinessEntity")
__Logger.Warn("Could not Parse Entity from cmbBusinessEntity")
Exit Sub
End If
@@ -149,7 +149,7 @@ Public Class frmObjectPropertyDialog
ControlManager.LoadControlsForAttributes(oAttributes, AttributeLayout)
Await ControlManager.LoadControlValuesForAttributes(ObjectId, AttributeLayout)
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
End Try
End Sub
@@ -173,7 +173,7 @@ Public Class frmObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
End Try
End Function
@@ -184,7 +184,7 @@ Public Class frmObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
End Try
End Function
@@ -204,7 +204,7 @@ Public Class frmObjectPropertyDialog
Return True
Catch ex As Exception
Logger.Error(ex)
_Logger.Error(ex)
Return False
End Try
End Function
@@ -212,7 +212,7 @@ Public Class frmObjectPropertyDialog
Private Async Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
Try
For Each oChange As KeyValuePair(Of String, Object) In Changes
Logger.Info("Updating Attribute [{0}] with value [{1}]", oChange.Key, oChange.Value.ToString)
_Logger.Info("Updating Attribute [{0}] with value [{1}]", oChange.Key, oChange.Value.ToString)
Await Client.SetAttributeValueAsync(ObjectId, oChange.Key, oChange.Value, New Options.SetAttributeValueOptions With {
.Language = Environment.User.Language,