jj 14.03 add props for dgv, new value structure for clb
This commit is contained in:
@@ -159,15 +159,15 @@ Public Class ClassControlValues
|
||||
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
|
||||
|
||||
' Wert per LINQ aus DT_ControlValues suchen der zur aktuellen controlId passt
|
||||
Dim value = (From row In DT_ControlValues.AsEnumerable()
|
||||
Dim values As List(Of Object) = (From row In DT_ControlValues.AsEnumerable()
|
||||
Where row.Item("CONTROL_ID") = ControlId
|
||||
Select row.Item("VALUE")).FirstOrDefault()
|
||||
Select row.Item("VALUE")).ToList()
|
||||
|
||||
If TypeOf control Is GroupBox Then
|
||||
Dim groupbox As GroupBox = DirectCast(control, GroupBox)
|
||||
LoadControlValues(RecordId, ParentRecordId, FormId, groupbox.Controls)
|
||||
Else
|
||||
LoadControlValue(RecordId, ParentRecordId, ControlId, control, value)
|
||||
LoadControlValue(RecordId, ParentRecordId, ControlId, control, values)
|
||||
End If
|
||||
|
||||
Next
|
||||
@@ -178,8 +178,15 @@ Public Class ClassControlValues
|
||||
|
||||
End Sub
|
||||
|
||||
Private Shared Sub LoadControlValue(recordId As Integer, parentRecordId As Integer, controlId As Integer, control As Control, value As Object)
|
||||
Private Shared Sub LoadControlValue(recordId As Integer, parentRecordId As Integer, controlId As Integer, control As Control, values As List(Of Object))
|
||||
Try
|
||||
' Für die meisten Controls wird nur das erste Element der Liste benötigt
|
||||
Dim value As String = Nothing
|
||||
|
||||
If values.Count > 0 Then
|
||||
value = values.Item(0)
|
||||
End If
|
||||
|
||||
Select Case control.GetType()
|
||||
Case GetType(TextBox)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> Sub LoadControlValueNeu - GetType(TextBox) ", False)
|
||||
@@ -219,7 +226,7 @@ Public Class ClassControlValues
|
||||
Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> Sub LoadControlValueNeu - GetType(CheckedListBoxControl) ", False)
|
||||
Dim checkedlistbox As DevExpress.XtraEditors.CheckedListBoxControl = DirectCast(control, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadValue(checkedlistbox, value)
|
||||
ControlLoader.CheckedListBox.LoadValue(checkedlistbox, values)
|
||||
|
||||
Case GetType(PictureBox)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(">> Sub LoadControlValueNeu - GetType(PictureBox) ", False)
|
||||
@@ -290,6 +297,11 @@ Public Class ClassControlValues
|
||||
Dim chlistbox = DirectCast(Ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadList(chlistbox, FormID, ConnID, sqlcommand)
|
||||
|
||||
Case GetType(DataGridView)
|
||||
Dim gridview = DirectCast(Ctrl, DataGridView)
|
||||
Dim noSQL As String = ""
|
||||
ControlLoader.DataGridView.LoadList(gridview, FormID, ConnID, noSQL)
|
||||
|
||||
End Select
|
||||
|
||||
swcontrol.Stop()
|
||||
|
||||
Reference in New Issue
Block a user