Common: Show Grid in Property Dialog
This commit is contained in:
@@ -6,6 +6,8 @@ Imports DevExpress.XtraSplashScreen
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports DevExpress.XtraGrid
|
||||
|
||||
Public Class frmObjectPropertyDialog
|
||||
Private _LogConfig As LogConfig
|
||||
@@ -40,7 +42,6 @@ Public Class frmObjectPropertyDialog
|
||||
Dim oCombobox As RepositoryItemComboBox = DirectCast(cmbBusinessEntity.Edit, RepositoryItemComboBox)
|
||||
oCombobox.Items.AddRange(oEntityIds)
|
||||
|
||||
|
||||
ShowAttributeHistory(oHistoryDataTable)
|
||||
ShowObjectProperties(oObjectProperties)
|
||||
|
||||
@@ -121,6 +122,14 @@ Public Class frmObjectPropertyDialog
|
||||
Return oTermValue
|
||||
End Function
|
||||
|
||||
Private Async Function GetAttributeValueAsTable(AttributeName As String, ObjectId As Long, Optional LanguageCode As String = "de-DE", Optional IsForeign As Boolean = False) As Task(Of DataTable)
|
||||
Dim oIsForeign = IIf(IsForeign, 1, 0)
|
||||
Dim oSQL = $"SELECT TERM_VALUE FROM [dbo].[FNIDB_PM_GET_VARIABLE_VALUE] ({ObjectId}, '{AttributeName}', '{LanguageCode}', {oIsForeign})"
|
||||
Dim oDatatable = Await _Db.GetDatatableAsync(oSQL)
|
||||
|
||||
Return oDatatable
|
||||
End Function
|
||||
|
||||
Private Async Sub cmbBusinessEntity_EditValueChanged(sender As Object, e As EventArgs) Handles cmbBusinessEntity.EditValueChanged
|
||||
Dim oEntityId As Long
|
||||
|
||||
@@ -131,17 +140,25 @@ Public Class frmObjectPropertyDialog
|
||||
Dim oAttributes = Await GetAttributesForBusinessEntity(oEntityId)
|
||||
|
||||
For Each oAttribute As Attribute In oAttributes
|
||||
Dim oControl = _Controls.GetControlForAttribute(oAttribute)
|
||||
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
|
||||
Dim oValue = Await GetAttributeValue(oItem.Name, _ObjectId)
|
||||
Dim oEdit = DirectCast(oItem.Control, BaseEdit)
|
||||
oEdit.EditValue = oValue
|
||||
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
|
||||
End Sub
|
||||
|
||||
@@ -166,8 +183,12 @@ Public Class frmObjectPropertyDialog
|
||||
txtObjectId.Text = oRow.Item("IDB_OBJ_ID")
|
||||
txtCreatedWhen.Text = oRow.Item("ADDED_WHEN")
|
||||
txtCreatedWho.Text = oRow.Item("ADDED_WHO")
|
||||
txtChangedWhen.Text = oRow.Item("CHANGED_WHEN")
|
||||
txtChangedWho.Text = oRow.Item("CHANGED_WHO")
|
||||
txtChangedWhen.Text = Utils.NotNull(oRow.Item("CHANGED_WHEN"), String.Empty)
|
||||
txtChangedWho.Text = Utils.NotNull(oRow.Item("CHANGED_WHO"), String.Empty)
|
||||
|
||||
lbLifecycleStart.Text = DirectCast(oRow.Item("ADDED_WHEN"), Date).ToShortDateString
|
||||
lbLifecycleEnd.Text = Date.MaxValue.ToShortDateString
|
||||
progressLifecycle.Position = 30
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
|
||||
Reference in New Issue
Block a user