update TBDD_DOKUMENTART & VWDDINDEX_AUTOM

This commit is contained in:
Jonathan Jenne
2023-09-26 15:42:11 +02:00
parent 67bf229525
commit 2eeb773cf8
6 changed files with 3840 additions and 2491 deletions

View File

@@ -830,31 +830,47 @@ Public Class frmIndex
If DTAut.Rows.Count > 0 Then
Dim Count As Integer = 0
For Each row As DataRow In DTAut.Rows
Dim indexiert = CBool(row.Item("Indexiert"))
Dim Indexvalue = row.Item("Indexwert").ToString
Dim indexname = row.Item("INDEXNAME").ToString
If indexiert = True And Indexvalue <> "" Then
If Indexvalue <> "EMPTY_OI" Then
_Logger.Info("Auto Indexname: " & indexname.ToString)
_Logger.Info("Indexvalue: " & Indexvalue.ToString)
Dim oIsIndexed = CBool(row.Item("Indexiert"))
Dim oIndexValue = row.Item("Indexwert").ToString
Dim oIndexName = row.Item("INDEXNAME").ToString
Dim oOverwrite As Boolean = row.ItemEx("VKT_OVERWRITE", False)
Dim oPreventMultipleValues As Boolean = row.ItemEx("VKT_PREVENT_MULTIPLE_VALUES", False)
If oIsIndexed = True And oIndexValue <> "" Then
If oIndexValue <> "EMPTY_OI" Then
_Logger.Info("Auto Indexname: " & oIndexName.ToString)
_Logger.Info("Indexvalue: " & oIndexValue.ToString)
Count += 1
' den Typ des Zielindexes auslesen
Dim indexType As Integer = WINDREAM.GetIndexType(indexname)
Dim indexType As Integer = WINDREAM.GetIndexType(oIndexName)
If indexType < WINDREAM.WMObjectVariableValueTypeVector Then
indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, indexname, Indexvalue, CURR_DOKART_OBJECTTYPE)
indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, oIndexName, oIndexValue, CURR_DOKART_OBJECTTYPE)
Else
Dim oSplitArray = Split(Indexvalue, ClassConstants.VECTORSEPARATOR)
Dim oExistingItems = WINDREAM.GetIndexValue(CURRENT_NEWFILENAME, oIndexName)
Dim oSplitArray = Split(oIndexValue, ClassConstants.VECTORSEPARATOR)
Dim oListofString As New List(Of String)
If oSplitArray.Count = 0 Then
oListofString.Add(Indexvalue)
oListofString.Add(oIndexValue)
Else
For Each oStr In oSplitArray
oListofString.Add(oStr)
Next
End If
indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, indexname, oListofString, CURR_DOKART_OBJECTTYPE)
If oOverwrite = False Then
oListofString = oExistingItems.Concat(oListofString)
End If
If oPreventMultipleValues = True Then
oListofString = oListofString.Distinct()
End If
indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, oIndexName, oListofString, CURR_DOKART_OBJECTTYPE)
End If
'indexierung_erfolgreich = WINDREAM.SetFileIndex(CURRENT_NEWFILENAME, indexname, Indexvalue, CURR_DOKART_OBJECTTYPE)