ms debug wegen dauer aufruf CW
This commit is contained in:
@@ -157,37 +157,45 @@ Public Class frmObjectPropertyDialog
|
||||
End Function
|
||||
|
||||
Private Async Sub cmbBusinessEntity_EditValueChanged(sender As Object, e As EventArgs) Handles cmbBusinessEntity.EditValueChanged
|
||||
Dim oEntityId As Long
|
||||
|
||||
If Long.TryParse(cmbBusinessEntity.EditValue, oEntityId) = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oAttributes = Await GetAttributesForBusinessEntity(oEntityId)
|
||||
|
||||
For Each oAttribute As Attribute In oAttributes
|
||||
Dim oControl = _Controls.GetControlForAttribute(oAttribute, True)
|
||||
Dim oItem As LayoutControlItem = AttributeLayout.AddItem()
|
||||
|
||||
oItem.Text = oAttribute.Title
|
||||
oItem.Name = oAttribute.Title
|
||||
oItem.Control = oControl
|
||||
Next
|
||||
|
||||
For Each oItem As LayoutControlItem In AttributeLayout.Items
|
||||
If TypeOf oItem.Control Is BaseEdit Then
|
||||
Dim oValue = Await GetAttributeValue(oItem.Name, _ObjectId)
|
||||
Dim oEdit = DirectCast(oItem.Control, BaseEdit)
|
||||
oEdit.EditValue = oValue
|
||||
ElseIf TypeOf oItem.Control Is GridControl Then
|
||||
Dim oValueTable = Await GetAttributeValueAsTable(oItem.Name, _ObjectId)
|
||||
Dim oGrid = DirectCast(oItem.Control, GridControl)
|
||||
oGrid.DataSource = oValueTable
|
||||
|
||||
End If
|
||||
Next
|
||||
Load_Attributes()
|
||||
End Sub
|
||||
Private Async Sub Load_Attributes()
|
||||
Try
|
||||
Dim oEntityId As Long
|
||||
|
||||
If Long.TryParse(cmbBusinessEntity.EditValue, oEntityId) = False Then
|
||||
_Logger.Warn("Could not Parse Entity from cmbBusinessEntity")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim oAttributes = Await GetAttributesForBusinessEntity(oEntityId)
|
||||
|
||||
For Each oAttribute As Attribute In oAttributes
|
||||
Dim oControl = _Controls.GetControlForAttribute(oAttribute, True)
|
||||
Dim oItem As LayoutControlItem = AttributeLayout.AddItem()
|
||||
|
||||
oItem.Text = oAttribute.Title
|
||||
oItem.Name = oAttribute.Title
|
||||
oItem.Control = oControl
|
||||
Next
|
||||
|
||||
For Each oItem As LayoutControlItem In AttributeLayout.Items
|
||||
If TypeOf oItem.Control Is BaseEdit Then
|
||||
Dim oValue = Await GetAttributeValue(oItem.Name, _ObjectId)
|
||||
Dim oEdit = DirectCast(oItem.Control, BaseEdit)
|
||||
oEdit.EditValue = oValue
|
||||
ElseIf TypeOf oItem.Control Is GridControl Then
|
||||
Dim oValueTable = Await GetAttributeValueAsTable(oItem.Name, _ObjectId)
|
||||
Dim oGrid = DirectCast(oItem.Control, GridControl)
|
||||
oGrid.DataSource = oValueTable
|
||||
|
||||
End If
|
||||
Next
|
||||
Catch ex As Exception
|
||||
_Logger.Error(ex)
|
||||
End Try
|
||||
|
||||
End Sub
|
||||
Private Function ShowAttributeHistory(pDatatable As DataTable) As Boolean
|
||||
Try
|
||||
If pDatatable.Rows.Count > 0
|
||||
|
||||
Reference in New Issue
Block a user