small fixes to final indicies

This commit is contained in:
Jonathan Jenne 2019-04-25 13:38:07 +02:00
parent 0ceb91667c
commit 7edb2b6037
3 changed files with 60 additions and 10 deletions

View File

@ -15,6 +15,19 @@
Public Const PREFIX_VECTOR = "[%VKT"
Public Shared LIST_VECTOR_INDICIES As New List(Of Integer) From {
INDEX_TYPE_VECTOR_INTEGER_64,
INDEX_TYPE_VECTOR_INTEGER,
INDEX_TYPE_VECTOR_STRING,
INDEX_TYPE_VECTOR_BOOLEAN,
INDEX_TYPE_VECTOR_DATE,
INDEX_TYPE_VECTOR_CURRENCY,
INDEX_TYPE_VECTOR_FLOAT,
INDEX_TYPE_VECTOR_DATETIME
}
Public Shared Function GetValue(obj As Object, indexName As String, indcies As List(Of String), types As List(Of Integer), isVector As Boolean)
Try
Dim props As FinalIndexProperties = obj
@ -101,11 +114,7 @@
End Function
Public Shared Function IsVectorIndex(type As Integer) As Boolean
If type = INDEX_TYPE_VECTOR_BOOLEAN Or type = INDEX_TYPE_VECTOR_DATE Or type = INDEX_TYPE_VECTOR_INTEGER_64 Or type = INDEX_TYPE_VECTOR_STRING Then
Return True
Else
Return False
End If
Return LIST_VECTOR_INDICIES.Contains(type)
End Function
Public Shared Function GetIndexType(indexName As String, indicies As List(Of String), types As List(Of Integer))

View File

@ -59,6 +59,7 @@ Module ModuleFinalIndexProperties
Public Property VectorIndex As Boolean
<Category("Index")>
<DisplayName("Allow Multivalues")>
<PropertyAttributesProvider("VectorIndexBooleanProvider")>
Public Property AllowAddNewValues As Boolean
<Category("Index")>

View File

@ -25,6 +25,7 @@ Public Class frmFormDesigner
Private Windream_AllIndicies As List(Of String)
Private Windream_VectorIndicies As List(Of String)
Private Windream_SimpleIndicies As List(Of String)
Private Windream_LookupIndicies As List(Of String)
Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load
@ -48,6 +49,14 @@ Public Class frmFormDesigner
Windream_AllIndicies = sortedIndicies
Windream_VectorIndicies = Windream_AllIndicies.FindAll(AddressOf IsVectorIndex)
Windream_SimpleIndicies = Windream_AllIndicies.Except(Windream_VectorIndicies).ToList()
Windream_LookupIndicies = Windream_AllIndicies.
Where(AddressOf IsNotVectorBooleanIndex).
Where(AddressOf IsNotVectorDateIndex).
Where(AddressOf IsNotVectorDatetimeIndex).
Where(AddressOf IsNotBooleanIndex).
Where(AddressOf IsNotDateIndex).
ToList()
Windream_ChoiceLists = New List(Of String)
Windream_ChoiceLists.Add(String.Empty)
@ -109,11 +118,40 @@ Public Class frmFormDesigner
''' <summary>
''' Filtert aus der Liste von Indexen die Vektor Indexe heraus
''' </summary>
Private Function IsVectorIndex(index As String) As Boolean
Dim type As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(index)
Private Function IsVectorIndex(IndexName As String) As Boolean
Dim oType As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(IndexName)
'Vektor Zahl Oder Vektor String
Return (type = 4107 Or type = 4097)
Return ClassFinalIndex.IsVectorIndex(oType)
End Function
Private Function IsNotBooleanIndex(IndexName As String) As Boolean
Dim oType As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(IndexName)
Return oType <> ClassFinalIndex.INDEX_TYPE_BOOLEAN
End Function
Private Function IsNotDateIndex(IndexName As String) As Boolean
Dim oType As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(IndexName)
Return oType <> ClassFinalIndex.INDEX_TYPE_DATE
End Function
Private Function IsNotVectorBooleanIndex(IndexName As String) As Boolean
Dim oType As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(IndexName)
Return oType <> ClassFinalIndex.INDEX_TYPE_VECTOR_BOOLEAN
End Function
Private Function IsNotVectorDateIndex(IndexName As String) As Boolean
Dim oType As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(IndexName)
Return oType <> ClassFinalIndex.INDEX_TYPE_VECTOR_DATE
End Function
Private Function IsNotVectorDatetimeIndex(IndexName As String) As Boolean
Dim oType As Integer = clsWD_GET.GetTypeOfIndexAsIntByName(IndexName)
Return oType <> ClassFinalIndex.INDEX_TYPE_VECTOR_DATETIME
End Function
Sub LoadControls()
@ -388,6 +426,8 @@ Public Class frmFormDesigner
inctrl.BackColor = Color.Transparent
Case "DD_PM_WINDREAM.ClassControlCreator+LineLabel"
inctrl.BackColor = inctrl.ForeColor
Case "DigitalData.Controls.LookupGrid.LookupControl2"
inctrl.BackColor = Color.White
End Select
End If
Next
@ -754,7 +794,7 @@ Public Class frmFormDesigner
ElseIf TypeOf sender Is LookupControl2 Then
Dim grid As LookupControl2 = sender
Dim lookupProps As LookupControlProperties = CreatePropsObjectWithIndicies(New LookupControlProperties, row, Windream_VectorIndicies)
Dim lookupProps As LookupControlProperties = CreatePropsObjectWithIndicies(New LookupControlProperties, row, Windream_LookupIndicies)
lookupProps.MultiSelect = StrToBool(row.Item("MULTISELECT"))
lookupProps.PreventDuplicates = StrToBool(row.Item("VKT_PREVENT_MULTIPLE_VALUES"))
lookupProps.AllowAddNewValues = StrToBool(row.Item("VKT_ADD_ITEM"))