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 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) Public Shared Function GetValue(obj As Object, indexName As String, indcies As List(Of String), types As List(Of Integer), isVector As Boolean)
Try Try
Dim props As FinalIndexProperties = obj Dim props As FinalIndexProperties = obj
@ -101,11 +114,7 @@
End Function End Function
Public Shared Function IsVectorIndex(type As Integer) As Boolean 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 LIST_VECTOR_INDICIES.Contains(type)
Return True
Else
Return False
End If
End Function End Function
Public Shared Function GetIndexType(indexName As String, indicies As List(Of String), types As List(Of Integer)) 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 Public Property VectorIndex As Boolean
<Category("Index")> <Category("Index")>
<DisplayName("Allow Multivalues")>
<PropertyAttributesProvider("VectorIndexBooleanProvider")> <PropertyAttributesProvider("VectorIndexBooleanProvider")>
Public Property AllowAddNewValues As Boolean Public Property AllowAddNewValues As Boolean
<Category("Index")> <Category("Index")>

View File

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