add depending controls for lookupgrid

This commit is contained in:
Jonathan Jenne
2020-02-11 14:44:25 +01:00
parent acf61c9ca5
commit b4e410291a
6 changed files with 2769 additions and 487 deletions

View File

@@ -1,4 +1,5 @@
Imports System.Text.RegularExpressions
Imports DigitalData.Controls.LookupGrid
Imports WINDREAMLib
''' <summary>
@@ -151,8 +152,8 @@ Public Class ClassPatterns
End If
Dim controlName As String = GetNextPattern(result, PATTERN_CTRL).Value
'Dim control As Control = panel.Controls.Find(controlName, False).FirstOrDefault()
Dim oFoundControl As Control = Nothing
Dim oFoundType As String = Nothing
For Each oControl As Control In panel.Controls
If TypeOf oControl Is Label Then
@@ -160,10 +161,10 @@ Public Class ClassPatterns
End If
Dim oMeta = DirectCast(oControl.Tag, ClassControls.ControlMeta)
Dim oIndex As String = oMeta.IndexName
If oIndex = controlName Then
If oMeta.IndexName = controlName Then
oFoundControl = oControl
oFoundType = oMeta.IndexType
Exit For
End If
Next
@@ -175,6 +176,20 @@ Public Class ClassPatterns
oValue = DirectCast(oFoundControl, TextBox).Text
ElseIf TypeOf oFoundControl Is CheckBox Then
oValue = IIf(DirectCast(oFoundControl, CheckBox).Checked, 1, 0)
ElseIf TypeOf oFoundControl Is LookupControl2 Then
Dim oLookupControl = DirectCast(oFoundControl, LookupControl2)
If oLookupControl.MultiSelect Then
Select Case oFoundType
Case "INTEGER"
oValue = String.Join(",", oLookupControl.SelectedValues)
Case "VARCHAR"
Dim oWrapped = oLookupControl.SelectedValues.Select(Function(v) $"'{v}'")
oValue = String.Join(",", oWrapped)
End Select
Else
oValue = NotNull(oLookupControl.SelectedValues.Item(0), "")
End If
Else
oValue = ""
End If