DocumentResultList: Layout et al

This commit is contained in:
Jonathan Jenne
2022-03-21 16:35:01 +01:00
parent 9ff649e793
commit 53e702374b
12 changed files with 414 additions and 231 deletions

View File

@@ -5,6 +5,7 @@ Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Imports DigitalData.Modules.ZooFlow
Imports DevExpress.XtraSplashScreen
Public Class ctrlObjectPropertyDialog
Implements IBaseForm
@@ -18,7 +19,15 @@ Public Class ctrlObjectPropertyDialog
Private Property ObjectId As Long
Private ReadOnly Changes As New Dictionary(Of String, Object)
Private Property Loading As Boolean = False
Private Loading As Boolean = False
Private LastEntityId As Integer = 0
Private Sub ctrlObjectPropertyDialog_Load(sender As Object, e As EventArgs) Handles Me.Load
XtraTabControl1.SelectedTabPage = XtraTabPageAttributes
End Sub
Public Sub Initialize(pLogConfig As LogConfig, pHostForm As Form, pClient As Client, pEnv As Environment)
LogConfig = pLogConfig
@@ -44,6 +53,8 @@ Public Class ctrlObjectPropertyDialog
Public Async Function LoadObject(pObjectId As Long, pEntityId As Long) As Task(Of Boolean)
Loading = True
Dim oLoadingHandle = SplashScreenManager.ShowOverlayForm(Me)
Try
ObjectId = pObjectId
@@ -59,12 +70,27 @@ Public Class ctrlObjectPropertyDialog
Dim oObjectProperties = Await GetPropertiesForObjectId(ObjectId)
ShowObjectProperties(oObjectProperties)
' Load Attribute controls and values
' Load All attributes for current entity id
Dim oAttributes = Await ControlManager.GetAttributesForBusinessEntity(cmbEntityId.EditValue)
Await ControlManager.LoadControlsForAttributes(ObjectId, oAttributes, Root)
' Load Attribute controls
If pEntityId <> LastEntityId Then
ControlManager.LoadControlsForAttributes(oAttributes, Root)
End If
' Load values for all controls
Await ControlManager.LoadControlValuesForAttributes(pObjectId, Root)
' Save the current entity id
LastEntityId = pEntityId
Return True
Catch ex As Exception
Logger.Error(ex)
Return False
Finally
SplashScreenManager.CloseOverlayForm(oLoadingHandle)
Loading = False
End Try
End Function
@@ -166,15 +192,17 @@ Public Class ctrlObjectPropertyDialog
Return oResult.Table
End Function
Private Async Sub Load_Attributes(pObject As Long, pBusinessEntityId As Long)
Private Async Sub Load_Attributes(pObjectId As Long, pBusinessEntityId As Long)
Try
Dim oAttributes = Await ControlManager.GetAttributesForBusinessEntity(pBusinessEntityId)
If oAttributes.Count = 0 Then
MsgBox($"Es konnten keine Attribute für das Objekt '{pObject}' geladen werden!", MsgBoxStyle.Critical, Text)
MsgBox($"Es konnten keine Attribute für das Objekt '{pObjectId}' geladen werden!", MsgBoxStyle.Critical, Text)
End If
Await ControlManager.LoadControlsForAttributes(pObject, oAttributes, Root)
ControlManager.LoadControlsForAttributes(oAttributes, Root)
Await ControlManager.LoadControlValuesForAttributes(pObjectId, Root)
Catch ex As Exception
Logger.Error(ex)
End Try
@@ -184,7 +212,7 @@ Public Class ctrlObjectPropertyDialog
Dim oEntityId As Long
If Integer.TryParse(cmbEntityId.EditValue, oEntityId) AndAlso Loading = False Then
LoadObject(ObjectId, oEntityId)
Await LoadObject(ObjectId, oEntityId)
End If
End Sub
End Class