update new form designer

This commit is contained in:
Jonathan Jenne
2020-01-14 16:27:16 +01:00
parent 407a5979ac
commit 9b564f98b0
24 changed files with 1556 additions and 129 deletions

View File

@@ -4,14 +4,14 @@ Imports DigitalData.Modules.Logging
Public Class ControlLoader
Public Const CONTROL_TEXTEDIT = "TextBox"
Public Const CONTROL_MEMOEDIT = "Memoedit"
Public Const CONTROL_COMBOEDIT = "Combobox"
Public Const CONTROL_CHECKEDIT = "Checkbox"
Public Const CONTROL_RADIOEDIT = "Radiobutton"
Public Const CONTROL_DATEEDIT = "Datepicker"
Public Const CONTROL_TEXTEDIT = "TextBox"
Public Const CONTROL_MEMOEDIT = "Memoedit"
Public Const CONTROL_COMBOEDIT = "Combobox"
Public Const CONTROL_CHECKEDIT = "Checkbox"
Public Const CONTROL_RADIOEDIT = "Radiobutton"
Public Const CONTROL_DATEEDIT = "Datepicker"
Private _LayoutControlGroup As LayoutControlGroup
Private _LayoutControlGroup As LayoutControlGroup
Private _LayoutControls As List(Of BaseEdit)
Private _LogConfig As LogConfig
Private _LOgger As Logger
@@ -32,57 +32,57 @@ Public Class ControlLoader
End Sub
Public Sub AddControl(Name As String, Value As String, LayoutControlGroup As LayoutControlGroup)
Dim oTextEdit As New SimpleLabelItem() With {
.Name = Name,
.Text = Name & " - " & Value
}
Dim oTextEdit As New SimpleLabelItem() With {
.Name = Name,
.Text = Name & " - " & Value
}
LayoutControlGroup.AddItem(oTextEdit)
End Sub
Public Sub AddControl(Name As String, Value As String)
AddControl(Name, Value, _LayoutControlGroup)
End Sub
LayoutControlGroup.AddItem(oTextEdit)
End Sub
Public Sub AddControl(Name As String, Value As String)
AddControl(Name, Value, _LayoutControlGroup)
End Sub
Public Sub AddSeparator(LayoutControlGroup As LayoutControlGroup)
Dim oSeparator = New SimpleSeparator()
Public Sub AddSeparator(LayoutControlGroup As LayoutControlGroup)
Dim oSeparator = New SimpleSeparator()
LayoutControlGroup.AddItem(oSeparator)
End Sub
Public Sub AddSeparator()
AddSeparator(_LayoutControlGroup)
End Sub
LayoutControlGroup.AddItem(oSeparator)
End Sub
Public Sub AddSeparator()
AddSeparator(_LayoutControlGroup)
End Sub
Public Sub LoadControls(Datatable As DataTable, LayoutControlGroup As LayoutControlGroup)
For Each oRow As DataRow In Datatable.Rows
Dim oCaption As String = oRow.Item("COLNAME")
Dim oControlType As String = oRow.Item("CTRLTYPE")
Dim oControlId As Int64 = oRow.Item("RECORD_ID")
Dim oEditor As BaseEdit = CreateLayoutControl(oControlType, oControlId, oControlId)
Public Sub LoadControls(Datatable As DataTable, LayoutControlGroup As LayoutControlGroup)
For Each oRow As DataRow In Datatable.Rows
Dim oCaption As String = oRow.Item("COLNAME")
Dim oControlType As String = oRow.Item("CTRLTYPE")
Dim oControlId As Int64 = oRow.Item("RECORD_ID")
Dim oEditor As BaseEdit = CreateLayoutControl(oControlType, oControlId, oControlId)
If oEditor Is Nothing Then
Continue For
End If
If oEditor Is Nothing Then
Continue For
End If
oEditor.Tag = New Metadata() With {
.Id = oControlId,
.Type = oControlType,
.Caption = oCaption
}
oEditor.Tag = New Metadata() With {
.Id = oControlId,
.Type = oControlType,
.Caption = oCaption
}
LayoutControls.Add(oEditor)
LayoutControlGroup.AddItem(oCaption, oEditor)
Next
LayoutControls.Add(oEditor)
LayoutControlGroup.AddItem(oCaption, oEditor)
Next
LayoutControlGroup.AddItem(New EmptySpaceItem())
End Sub
Public Sub LoadControls(Datatable As DataTable)
LoadControls(Datatable, _LayoutControlGroup)
End Sub
LayoutControlGroup.AddItem(New EmptySpaceItem())
End Sub
Public Sub LoadControls(Datatable As DataTable)
LoadControls(Datatable, _LayoutControlGroup)
End Sub
Public Function CreateLayoutControl(Type As String, Name As String, Id As Int64)
Dim oEditor As BaseEdit = Nothing
Public Function CreateLayoutControl(Type As String, Name As String, Id As Int64)
Dim oEditor As BaseEdit = Nothing
LOGGER.Debug("Create new Control of type {0} with name {1}", Type, Name)
LOGGER.Debug("Create new Control of type {0} with name {1}", Type, Name)
Select Case Type
Case CONTROL_TEXTEDIT
@@ -102,8 +102,8 @@ Public Class ControlLoader
End Select
Return oEditor
End Function
End Class
End Function
End Class