More logging, attempt at fixing empty lines in grid control, add checkbox validation
This commit is contained in:
parent
9a2b324ef5
commit
92d77dcd80
@ -588,9 +588,6 @@ Public Class ClassControlCreator
|
|||||||
oView.OptionsView.ShowFooter = oShouldDisplayFooter
|
oView.OptionsView.ShowFooter = oShouldDisplayFooter
|
||||||
|
|
||||||
AddHandler oView.InitNewRow, Sub(sender As Object, e As InitNewRowEventArgs)
|
AddHandler oView.InitNewRow, Sub(sender As Object, e As InitNewRowEventArgs)
|
||||||
' TODO: Remove when this works and is properly implemented.
|
|
||||||
'Exit Sub
|
|
||||||
|
|
||||||
Try
|
Try
|
||||||
For Each oColumnData As DataRow In DT_MY_COLUMNS.Rows
|
For Each oColumnData As DataRow In DT_MY_COLUMNS.Rows
|
||||||
For Each oGridColumn As GridColumn In oView.Columns
|
For Each oGridColumn As GridColumn In oView.Columns
|
||||||
@ -634,11 +631,15 @@ Public Class ClassControlCreator
|
|||||||
AddHandler oView.ValidatingEditor, Sub(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
AddHandler oView.ValidatingEditor, Sub(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
||||||
Dim oRow As DataRowView = oView.GetRow(oView.FocusedRowHandle)
|
Dim oRow As DataRowView = oView.GetRow(oView.FocusedRowHandle)
|
||||||
Dim oColumnName = oView.FocusedColumn.FieldName
|
Dim oColumnName = oView.FocusedColumn.FieldName
|
||||||
|
LOGGER.Debug("Validating Editor for Column [{0}]", oColumnName)
|
||||||
GridTables_ValidateColumn(oView, DT_MY_COLUMNS, oColumnName, e.Value, e.Valid, e.ErrorText)
|
GridTables_ValidateColumn(oView, DT_MY_COLUMNS, oColumnName, e.Value, e.Valid, e.ErrorText)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
AddHandler oView.InvalidRowException, AddressOf View_InvalidRowException
|
AddHandler oView.InvalidRowException, AddressOf View_InvalidRowException
|
||||||
AddHandler oView.ValidatingEditor, AddressOf View_ValidatingEditor
|
AddHandler oView.ValidatingEditor, AddressOf View_ValidatingEditor
|
||||||
|
|
||||||
|
' These handlers are all used for the custom DefaultValue functionality
|
||||||
|
' https://supportcenter.devexpress.com/ticket/details/t1035580/how-to-default-a-value-in-a-column-when-add-new-row-in-data-grid
|
||||||
AddHandler oView.ShowingEditor, AddressOf View_ShowingEditor
|
AddHandler oView.ShowingEditor, AddressOf View_ShowingEditor
|
||||||
AddHandler oView.ShownEditor, AddressOf View_ShownEditor
|
AddHandler oView.ShownEditor, AddressOf View_ShownEditor
|
||||||
AddHandler oView.ValidateRow, AddressOf View_ValidateRow
|
AddHandler oView.ValidateRow, AddressOf View_ValidateRow
|
||||||
@ -646,19 +647,6 @@ Public Class ClassControlCreator
|
|||||||
Return oControl
|
Return oControl
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Shared Sub View_ValidateRow(sender As Object, e As ValidateRowEventArgs)
|
|
||||||
Dim view As GridView = TryCast(sender, GridView)
|
|
||||||
If view.IsNewItemRow(e.RowHandle) AndAlso Not newRowModified Then view.DeleteRow(e.RowHandle)
|
|
||||||
newRowModified = False
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Shared Sub View_ShownEditor(sender As Object, e As EventArgs)
|
|
||||||
Dim view As GridView = TryCast(sender, GridView)
|
|
||||||
If view.IsNewItemRow(view.FocusedRowHandle) Then
|
|
||||||
AddHandler view.ActiveEditor.Modified, Sub() newRowModified = True
|
|
||||||
End If
|
|
||||||
End Sub
|
|
||||||
|
|
||||||
Private Shared newRowModified As Boolean
|
Private Shared newRowModified As Boolean
|
||||||
|
|
||||||
Private Shared Sub View_ShowingEditor(sender As Object, e As CancelEventArgs)
|
Private Shared Sub View_ShowingEditor(sender As Object, e As CancelEventArgs)
|
||||||
@ -669,6 +657,28 @@ Public Class ClassControlCreator
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Shared Sub View_ShownEditor(sender As Object, e As EventArgs)
|
||||||
|
Dim view As GridView = TryCast(sender, GridView)
|
||||||
|
If view.IsNewItemRow(view.FocusedRowHandle) Then
|
||||||
|
AddHandler view.ActiveEditor.Modified, Sub()
|
||||||
|
LOGGER.Debug("Row was modified")
|
||||||
|
newRowModified = True
|
||||||
|
End Sub
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Shared Sub View_ValidateRow(sender As Object, e As ValidateRowEventArgs)
|
||||||
|
Dim view As GridView = TryCast(sender, GridView)
|
||||||
|
If view.IsNewItemRow(e.RowHandle) AndAlso Not newRowModified Then
|
||||||
|
LOGGER.Debug("Deleting unused row")
|
||||||
|
view.DeleteRow(e.RowHandle)
|
||||||
|
End If
|
||||||
|
|
||||||
|
LOGGER.Debug("Validating row. Resetting Modified.")
|
||||||
|
|
||||||
|
newRowModified = False
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Shared Sub View_ValidatingEditor(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
Private Shared Sub View_ValidatingEditor(sender As Object, e As BaseContainerValidateEditorEventArgs)
|
||||||
Dim oValue As String = NotNull(e.Value, "")
|
Dim oValue As String = NotNull(e.Value, "")
|
||||||
|
|
||||||
|
|||||||
@ -133,301 +133,305 @@ Public Class ClassPMWindream
|
|||||||
|
|
||||||
Dim i As Integer = 0
|
Dim i As Integer = 0
|
||||||
Dim indexname As String
|
Dim indexname As String
|
||||||
|
|
||||||
If aValues.Length = 1 And aValues(0) = "" Then
|
If aValues.Length = 1 And aValues(0) = "" Then
|
||||||
LOGGER.Debug("Indexwert ist leer/Nothing - Keine Indexierung")
|
LOGGER.Debug("Indexwert ist leer/Nothing - Keine Indexierung")
|
||||||
End If
|
Else
|
||||||
'Jetzt jeden Indexwert durchlaufen
|
'Jetzt jeden Indexwert durchlaufen
|
||||||
For Each aName As String In Indizes
|
For Each aName As String In Indizes
|
||||||
indexname = aName
|
indexname = aName
|
||||||
' das entsprechende Attribut aus windream auslesen
|
' das entsprechende Attribut aus windream auslesen
|
||||||
Dim oAttribute = Me.oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, Indizes(i))
|
Dim oAttribute = Me.oSession.GetWMObjectByName(WINDREAMLib.WMEntity.WMEntityAttribute, Indizes(i))
|
||||||
' den Variablentyp (String, Integer, ...) auslesen
|
' den Variablentyp (String, Integer, ...) auslesen
|
||||||
vType = oAttribute.getVariableValue("dwAttrType")
|
vType = oAttribute.getVariableValue("dwAttrType")
|
||||||
' wenn in aValues an Position i ein Wert steht
|
' wenn in aValues an Position i ein Wert steht
|
||||||
|
|
||||||
If IsNotEmpty(aValues(i)) Then
|
If IsNotEmpty(aValues(i)) Then
|
||||||
Dim _int As Boolean = False
|
Dim _int As Boolean = False
|
||||||
Dim _date As Boolean = False
|
Dim _date As Boolean = False
|
||||||
Dim _dbl As Boolean = False
|
Dim _dbl As Boolean = False
|
||||||
Dim _bool As Boolean = False
|
Dim _bool As Boolean = False
|
||||||
'If indexname = "Tournr" Then
|
'If indexname = "Tournr" Then
|
||||||
' MsgBox("Index: " & indexname & vbNewLine & "wert: " & aValues(i), MsgBoxStyle.Information, "Index: " & aName.ToString)
|
' MsgBox("Index: " & indexname & vbNewLine & "wert: " & aValues(i), MsgBoxStyle.Information, "Index: " & aName.ToString)
|
||||||
'End If
|
'End If
|
||||||
LOGGER.Debug(" ### Indexierung von Index: " & indexname & " ####")
|
LOGGER.Debug(" ### Indexierung von Index: " & indexname & " ####")
|
||||||
'MsgBox(oDocument.aName & vbNewLine & aValues(i) & vbNewLine & vType, MsgBoxStyle.Exclamation, "Zeile 87")
|
'MsgBox(oDocument.aName & vbNewLine & aValues(i) & vbNewLine & vType, MsgBoxStyle.Exclamation, "Zeile 87")
|
||||||
Dim value = aValues(i)
|
Dim value = aValues(i)
|
||||||
Dim convertValue
|
Dim convertValue
|
||||||
Dim vektor As Boolean = False
|
Dim vektor As Boolean = False
|
||||||
'Den Typ des Index-Feldes auslesen
|
'Den Typ des Index-Feldes auslesen
|
||||||
'MsgBox(value.GetType.ToString)
|
'MsgBox(value.GetType.ToString)
|
||||||
Select Case vType
|
|
||||||
'Case WMObjectVariableValueTypeUndefined
|
|
||||||
Case WMObjectVariableValueTypeString
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeString")
|
|
||||||
convertValue = CStr(value)
|
|
||||||
Case WMObjectVariableValueTypeInteger
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeInteger")
|
|
||||||
If IsNumeric(value) = False Then
|
|
||||||
frmValidator.idxerr_message = "Unerlaubte Eingabe in Numerisches Feld: " & value
|
|
||||||
LOGGER.Debug("Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!")
|
|
||||||
oDocument.Save()
|
|
||||||
oDocument.unlock()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
convertValue = CInt(value)
|
|
||||||
_int = True
|
|
||||||
Case WMObjectVariableValueTypeInteger64bit
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: Integer64bit")
|
|
||||||
If IsNumeric(value) = False Then
|
|
||||||
frmValidator.idxerr_message = "Unerlaubte Eingabe in Numerisches Feld: " & value
|
|
||||||
LOGGER.Debug("Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!")
|
|
||||||
oDocument.Save()
|
|
||||||
oDocument.unlock()
|
|
||||||
Return False
|
|
||||||
End If
|
|
||||||
convertValue = CInt(value)
|
|
||||||
_int = True
|
|
||||||
Case WMObjectVariableValueTypeFloat
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFloat")
|
|
||||||
Try
|
|
||||||
convertValue = CDbl(value)
|
|
||||||
Catch ex As Exception
|
|
||||||
LOGGER.Error(ex)
|
|
||||||
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
|
|
||||||
oDocument.Save()
|
|
||||||
oDocument.unlock()
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
|
|
||||||
Case WMObjectVariableValueTypeFixedPoint
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFixedPoint")
|
|
||||||
Try
|
|
||||||
convertValue = CDbl(value)
|
|
||||||
Catch ex As Exception
|
|
||||||
LOGGER.Error(ex)
|
|
||||||
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
|
|
||||||
oDocument.Save()
|
|
||||||
oDocument.unlock()
|
|
||||||
Return False
|
|
||||||
End Try
|
|
||||||
|
|
||||||
_dbl = True
|
|
||||||
Case WMObjectVariableValueTypeBoolean
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeBoolean")
|
|
||||||
convertValue = CBool(value)
|
|
||||||
_bool = True
|
|
||||||
Case WMObjectVariableValueTypeDate
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeDate")
|
|
||||||
_date = True
|
|
||||||
'Dim _date As Date = value
|
|
||||||
convertValue = value
|
|
||||||
Case WMObjectVariableValueTypeTimeStamp
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeTimeStamp")
|
|
||||||
convertValue = CInt(value)
|
|
||||||
Case WMObjectVariableValueTypeCurrency
|
|
||||||
LOGGER.Info(" >> Typ des windream-Indexes: WMObjectVariableValueTypeCurrency")
|
|
||||||
'Wegen currency muß ein eigenes Objekt vom typ Variant erzeugt werden
|
|
||||||
Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(value))
|
|
||||||
convertValue = aValueWrapper
|
|
||||||
Case WMObjectVariableValueTypeTime
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeTime", False)
|
|
||||||
'If ((value)) Then
|
|
||||||
' convertValue = CDate(value)
|
|
||||||
'Else
|
|
||||||
' convertValue = ""
|
|
||||||
'End If
|
|
||||||
'Dim _date As Date = value
|
|
||||||
convertValue = convertValue '*_date.ToShortTimeString
|
|
||||||
Case WMObjectVariableValueTypeFloat
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False)
|
|
||||||
convertValue = CStr(value)
|
|
||||||
Case WMObjectVariableValueTypeVariant
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeVariant", False)
|
|
||||||
convertValue = CStr(value)
|
|
||||||
Case WMObjectVariableValueTypeFulltext
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFulltext", False)
|
|
||||||
convertValue = CStr(value)
|
|
||||||
Case 4100
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 4100 Vektor Boolean", False)
|
|
||||||
vektor = True
|
|
||||||
Case 4101
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 4101 Vektor Date", False)
|
|
||||||
vektor = True
|
|
||||||
Case 4104
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 4104 Vektor Currency", False)
|
|
||||||
vektor = True
|
|
||||||
Case 4097
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 4097 Vektor alphanumerisch", False)
|
|
||||||
vektor = True
|
|
||||||
Case 4098
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 4098 Vektor Numerisch", False)
|
|
||||||
vektor = True
|
|
||||||
Case 4099
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 4099 Vektor Kommazahl", False)
|
|
||||||
vektor = True
|
|
||||||
Case 36865
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes: 36865 Vektor alphanumerisch", False)
|
|
||||||
vektor = True
|
|
||||||
Case Else
|
|
||||||
LOGGER.Debug("Typ des windream-Indexes konnte nicht bestimmt werden!", False)
|
|
||||||
LOGGER.Debug("Versuch des Auslesens (vType): " & vType)
|
|
||||||
'MsgBox(vType & vbNewLine & CStr(value), MsgBoxStyle.Exclamation, "Marlon-Case Else")
|
|
||||||
convertValue = ""
|
|
||||||
End Select
|
|
||||||
If vektor = False Then
|
|
||||||
If convertValue.ToString Is Nothing = False Then
|
|
||||||
LOGGER.Debug("Konvertierter Wert: '" & convertValue.ToString & "'", False)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
'############################################################################################
|
|
||||||
'####################### Der eigentliche Indexierungsvorgang ################################
|
|
||||||
'############################################################################################
|
|
||||||
If vektor = False Then
|
|
||||||
If convertValue.ToString Is Nothing = False Then
|
|
||||||
Try
|
|
||||||
LOGGER.Debug("Jetzt indexieren: oDocument.SetVariableValue(" & aName & ", " & convertValue.ToString & ")", False)
|
|
||||||
Catch ex As Exception
|
|
||||||
LOGGER.Error(ex)
|
|
||||||
LOGGER.Info(" >> Unexpected Error in Logging SetVariableValue for " & aName & ": " & ex.Message, False)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
'Dim ArrValues()
|
|
||||||
'ReDim ArrValues(0)
|
|
||||||
'ArrValues(0) = convertValue
|
|
||||||
'Dim ArrName()
|
|
||||||
'ReDim ArrName(0)
|
|
||||||
'ArrName(0) = "Tournr"
|
|
||||||
'oDocument.SetValues(ArrName, ArrValues)
|
|
||||||
If _int = True Then
|
|
||||||
oDocument.SetVariableValue(aName, CInt(convertValue))
|
|
||||||
ElseIf _date = True Then
|
|
||||||
oDocument.SetVariableValue(aName, CDate(convertValue))
|
|
||||||
ElseIf _bool Then
|
|
||||||
oDocument.SetVariableValue(aName, CBool(convertValue))
|
|
||||||
ElseIf _dbl Then
|
|
||||||
oDocument.SetVariableValue(aName, CDbl(convertValue))
|
|
||||||
Else
|
|
||||||
oDocument.SetVariableValue(aName, convertValue)
|
|
||||||
End If
|
|
||||||
LOGGER.Debug("Index '" & aName & "' wurde geschrieben", False)
|
|
||||||
Else
|
|
||||||
LOGGER.Info(" >> Kein Indexwert vorhanden", False)
|
|
||||||
End If
|
|
||||||
Else
|
|
||||||
'VEKTORFELDER, ALSO ÜBERPRÜFEN OB ERGEBNIS-ARRAY GEFÜLLT IST
|
|
||||||
LOGGER.Debug("VEKTORFELD: Vorbereiten des Arrays", False)
|
|
||||||
Dim myArray()
|
|
||||||
'Dim anz As Integer = 0
|
|
||||||
'For Each obj In aValues
|
|
||||||
'ReDim Preserve myArray(anz)
|
|
||||||
Select Case vType
|
Select Case vType
|
||||||
|
'Case WMObjectVariableValueTypeUndefined
|
||||||
|
Case WMObjectVariableValueTypeString
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeString")
|
||||||
|
convertValue = CStr(value)
|
||||||
|
Case WMObjectVariableValueTypeInteger
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeInteger")
|
||||||
|
If IsNumeric(value) = False Then
|
||||||
|
frmValidator.idxerr_message = "Unerlaubte Eingabe in Numerisches Feld: " & value
|
||||||
|
LOGGER.Debug("Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!")
|
||||||
|
oDocument.Save()
|
||||||
|
oDocument.unlock()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
convertValue = CInt(value)
|
||||||
|
_int = True
|
||||||
|
Case WMObjectVariableValueTypeInteger64bit
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: Integer64bit")
|
||||||
|
If IsNumeric(value) = False Then
|
||||||
|
frmValidator.idxerr_message = "Unerlaubte Eingabe in Numerisches Feld: " & value
|
||||||
|
LOGGER.Debug("Achtung: Value " & value & " kann nicht in Zahl konvertiert werden!")
|
||||||
|
oDocument.Save()
|
||||||
|
oDocument.unlock()
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
convertValue = CInt(value)
|
||||||
|
_int = True
|
||||||
|
Case WMObjectVariableValueTypeFloat
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFloat")
|
||||||
|
Try
|
||||||
|
convertValue = CDbl(value)
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
|
||||||
|
oDocument.Save()
|
||||||
|
oDocument.unlock()
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
Case WMObjectVariableValueTypeFixedPoint
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFixedPoint")
|
||||||
|
Try
|
||||||
|
convertValue = CDbl(value)
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
frmValidator.idxerr_message = "Could't convert value '" & value & "' to double!"
|
||||||
|
oDocument.Save()
|
||||||
|
oDocument.unlock()
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
|
||||||
|
_dbl = True
|
||||||
|
Case WMObjectVariableValueTypeBoolean
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeBoolean")
|
||||||
|
convertValue = CBool(value)
|
||||||
|
_bool = True
|
||||||
|
Case WMObjectVariableValueTypeDate
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeDate")
|
||||||
|
_date = True
|
||||||
|
'Dim _date As Date = value
|
||||||
|
convertValue = value
|
||||||
|
Case WMObjectVariableValueTypeTimeStamp
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeTimeStamp")
|
||||||
|
convertValue = CInt(value)
|
||||||
|
Case WMObjectVariableValueTypeCurrency
|
||||||
|
LOGGER.Info(" >> Typ des windream-Indexes: WMObjectVariableValueTypeCurrency")
|
||||||
|
'Wegen currency muß ein eigenes Objekt vom typ Variant erzeugt werden
|
||||||
|
Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(value))
|
||||||
|
convertValue = aValueWrapper
|
||||||
|
Case WMObjectVariableValueTypeTime
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeTime", False)
|
||||||
|
'If ((value)) Then
|
||||||
|
' convertValue = CDate(value)
|
||||||
|
'Else
|
||||||
|
' convertValue = ""
|
||||||
|
'End If
|
||||||
|
'Dim _date As Date = value
|
||||||
|
convertValue = convertValue '*_date.ToShortTimeString
|
||||||
|
Case WMObjectVariableValueTypeFloat
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFloat", False)
|
||||||
|
convertValue = CStr(value)
|
||||||
|
Case WMObjectVariableValueTypeVariant
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeVariant", False)
|
||||||
|
convertValue = CStr(value)
|
||||||
|
Case WMObjectVariableValueTypeFulltext
|
||||||
|
LOGGER.Debug("Typ des windream-Indexes: WMObjectVariableValueTypeFulltext", False)
|
||||||
|
convertValue = CStr(value)
|
||||||
Case 4100
|
Case 4100
|
||||||
'Vektortyp Boolean
|
LOGGER.Debug("Typ des windream-Indexes: 4100 Vektor Boolean", False)
|
||||||
'Umwandeln in Boolean
|
vektor = True
|
||||||
'Die Größe des Arrays festlegen
|
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
Select Case obj.ToString.ToLower
|
|
||||||
Case "falsch"
|
|
||||||
obj = False
|
|
||||||
Case "wahr"
|
|
||||||
obj = True
|
|
||||||
Case "nein"
|
|
||||||
obj = False
|
|
||||||
Case "ja"
|
|
||||||
obj = True
|
|
||||||
End Select
|
|
||||||
myArray(i1) = CBool(obj)
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
Case 4101
|
Case 4101
|
||||||
'Vektortyp Date
|
LOGGER.Debug("Typ des windream-Indexes: 4101 Vektor Date", False)
|
||||||
'Umwandeln in String
|
vektor = True
|
||||||
'Die Größe des Arrays festlegen
|
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
myArray(i1) = CDate(obj)
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
Case 4104
|
Case 4104
|
||||||
'Vektortyp Currency
|
LOGGER.Debug("Typ des windream-Indexes: 4104 Vektor Currency", False)
|
||||||
'Die Größe des Arrays festlegen
|
vektor = True
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(obj))
|
|
||||||
myArray(i1) = aValueWrapper
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
Case 4097
|
Case 4097
|
||||||
'Vektortyp ALPHANUMERISCH
|
LOGGER.Debug("Typ des windream-Indexes: 4097 Vektor alphanumerisch", False)
|
||||||
'Umwandeln in String
|
vektor = True
|
||||||
'Die Größe des Arrays festlegen
|
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
myArray(i1) = CStr(obj)
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
|
|
||||||
Case 4098
|
Case 4098
|
||||||
'Umwandeln in Integer
|
LOGGER.Debug("Typ des windream-Indexes: 4098 Vektor Numerisch", False)
|
||||||
'Die Größe des Arrays festlegen
|
vektor = True
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
myArray(i1) = CInt(obj)
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
Case 4099
|
Case 4099
|
||||||
'Umwandeln in Double
|
LOGGER.Debug("Typ des windream-Indexes: 4099 Vektor Kommazahl", False)
|
||||||
'Die Größe des Arrays festlegen
|
vektor = True
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
Dim Str As String = obj
|
|
||||||
myArray(i1) = CDbl(Str.Replace(".", ","))
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
|
|
||||||
Case 36865
|
Case 36865
|
||||||
'Umwandeln in String
|
LOGGER.Debug("Typ des windream-Indexes: 36865 Vektor alphanumerisch", False)
|
||||||
'Die Größe des Arrays festlegen
|
vektor = True
|
||||||
ReDim myArray(aValues.Length - 1)
|
|
||||||
Dim i1 As Integer = 0
|
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
myArray(i1) = CStr(obj)
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
Case Else
|
Case Else
|
||||||
'Umwandeln in String
|
LOGGER.Debug("Typ des windream-Indexes konnte nicht bestimmt werden!", False)
|
||||||
'Die Größe des Arrays festlegen
|
LOGGER.Debug("Versuch des Auslesens (vType): " & vType)
|
||||||
ReDim myArray(aValues.Length - 1)
|
'MsgBox(vType & vbNewLine & CStr(value), MsgBoxStyle.Exclamation, "Marlon-Case Else")
|
||||||
Dim i1 As Integer = 0
|
convertValue = ""
|
||||||
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
|
||||||
For Each obj In aValues
|
|
||||||
myArray(i1) = CStr(obj)
|
|
||||||
i1 = i1 + 1
|
|
||||||
Next
|
|
||||||
End Select
|
End Select
|
||||||
|
If vektor = False Then
|
||||||
|
If convertValue.ToString Is Nothing = False Then
|
||||||
|
LOGGER.Debug("Konvertierter Wert: '" & convertValue.ToString & "'", False)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
'############################################################################################
|
||||||
|
'####################### Der eigentliche Indexierungsvorgang ################################
|
||||||
|
'############################################################################################
|
||||||
|
If vektor = False Then
|
||||||
|
If convertValue.ToString Is Nothing = False Then
|
||||||
|
Try
|
||||||
|
LOGGER.Debug("Jetzt indexieren: oDocument.SetVariableValue(" & aName & ", " & convertValue.ToString & ")", False)
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
LOGGER.Info(" >> Unexpected Error in Logging SetVariableValue for " & aName & ": " & ex.Message, False)
|
||||||
|
End Try
|
||||||
|
|
||||||
'Jetzt die Nachindexierung für Vektor-Felder
|
'Dim ArrValues()
|
||||||
oDocument.SetVariableValue(aName, myArray)
|
'ReDim ArrValues(0)
|
||||||
LOGGER.Debug("'SetVariableValue' für VEKTOR erfolgreich", False)
|
'ArrValues(0) = convertValue
|
||||||
|
'Dim ArrName()
|
||||||
|
'ReDim ArrName(0)
|
||||||
|
'ArrName(0) = "Tournr"
|
||||||
|
'oDocument.SetValues(ArrName, ArrValues)
|
||||||
|
If _int = True Then
|
||||||
|
oDocument.SetVariableValue(aName, CInt(convertValue))
|
||||||
|
ElseIf _date = True Then
|
||||||
|
oDocument.SetVariableValue(aName, CDate(convertValue))
|
||||||
|
ElseIf _bool Then
|
||||||
|
oDocument.SetVariableValue(aName, CBool(convertValue))
|
||||||
|
ElseIf _dbl Then
|
||||||
|
oDocument.SetVariableValue(aName, CDbl(convertValue))
|
||||||
|
Else
|
||||||
|
oDocument.SetVariableValue(aName, convertValue)
|
||||||
|
End If
|
||||||
|
LOGGER.Debug("Index '" & aName & "' wurde geschrieben", False)
|
||||||
|
Else
|
||||||
|
LOGGER.Info(" >> Kein Indexwert vorhanden", False)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
'VEKTORFELDER, ALSO ÜBERPRÜFEN OB ERGEBNIS-ARRAY GEFÜLLT IST
|
||||||
|
LOGGER.Debug("VEKTORFELD: Vorbereiten des Arrays", False)
|
||||||
|
Dim myArray()
|
||||||
|
'Dim anz As Integer = 0
|
||||||
|
'For Each obj In aValues
|
||||||
|
'ReDim Preserve myArray(anz)
|
||||||
|
Select Case vType
|
||||||
|
Case 4100
|
||||||
|
'Vektortyp Boolean
|
||||||
|
'Umwandeln in Boolean
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
Select Case obj.ToString.ToLower
|
||||||
|
Case "falsch"
|
||||||
|
obj = False
|
||||||
|
Case "wahr"
|
||||||
|
obj = True
|
||||||
|
Case "nein"
|
||||||
|
obj = False
|
||||||
|
Case "ja"
|
||||||
|
obj = True
|
||||||
|
End Select
|
||||||
|
myArray(i1) = CBool(obj)
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
Case 4101
|
||||||
|
'Vektortyp Date
|
||||||
|
'Umwandeln in String
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
myArray(i1) = CDate(obj)
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
Case 4104
|
||||||
|
'Vektortyp Currency
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
Dim aValueWrapper As System.Runtime.InteropServices.CurrencyWrapper = New System.Runtime.InteropServices.CurrencyWrapper(CDec(obj))
|
||||||
|
myArray(i1) = aValueWrapper
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
Case 4097
|
||||||
|
'Vektortyp ALPHANUMERISCH
|
||||||
|
'Umwandeln in String
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
myArray(i1) = CStr(obj)
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
Case 4098
|
||||||
|
'Umwandeln in Integer
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
myArray(i1) = CInt(obj)
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
Case 4099
|
||||||
|
'Umwandeln in Double
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
Dim Str As String = obj
|
||||||
|
myArray(i1) = CDbl(Str.Replace(".", ","))
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
|
||||||
|
Case 36865
|
||||||
|
'Umwandeln in String
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
myArray(i1) = CStr(obj)
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
Case Else
|
||||||
|
'Umwandeln in String
|
||||||
|
'Die Größe des Arrays festlegen
|
||||||
|
ReDim myArray(aValues.Length - 1)
|
||||||
|
Dim i1 As Integer = 0
|
||||||
|
'Das Array durchlaufen und Werte für den Index in Array schreiben
|
||||||
|
For Each obj In aValues
|
||||||
|
myArray(i1) = CStr(obj)
|
||||||
|
i1 = i1 + 1
|
||||||
|
Next
|
||||||
|
End Select
|
||||||
|
|
||||||
|
LOGGER.Debug("Wert für Index vor Indexierung: [{0}]", myArray)
|
||||||
|
|
||||||
|
'Jetzt die Nachindexierung für Vektor-Felder
|
||||||
|
oDocument.SetVariableValue(aName, myArray)
|
||||||
|
LOGGER.Debug("'SetVariableValue' für VEKTOR erfolgreich", False)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End If
|
i += 1
|
||||||
i += 1
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
End If
|
||||||
|
|
||||||
' oDocument.LockRights()
|
' oDocument.LockRights()
|
||||||
|
|
||||||
|
|||||||
@ -3585,7 +3585,11 @@ Public Class frmValidator
|
|||||||
Where TypeOf oControl Is GridControl
|
Where TypeOf oControl Is GridControl
|
||||||
Select oControl).ToList()
|
Select oControl).ToList()
|
||||||
|
|
||||||
|
LOGGER.Debug("Forcing grid Validation")
|
||||||
|
|
||||||
For Each oGrid As GridControl In oGrids
|
For Each oGrid As GridControl In oGrids
|
||||||
|
LOGGER.Debug("Validating Grid [{0}]", oGrid.Name)
|
||||||
|
|
||||||
Dim oView As GridView = oGrid.MainView
|
Dim oView As GridView = oGrid.MainView
|
||||||
|
|
||||||
If oView.RowCount = 0 Then
|
If oView.RowCount = 0 Then
|
||||||
@ -3594,9 +3598,10 @@ Public Class frmValidator
|
|||||||
|
|
||||||
If oView.UpdateCurrentRow() = False Then
|
If oView.UpdateCurrentRow() = False Then
|
||||||
oValidation = False
|
oValidation = False
|
||||||
Return False
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
LOGGER.Debug("Validation of Grid [{0}] ended with Result: [{1}]", oGrid.Name, oValidation)
|
||||||
|
|
||||||
If oValidation = False Then
|
If oValidation = False Then
|
||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
@ -4671,11 +4676,12 @@ Public Class frmValidator
|
|||||||
Dim chk As CheckBox = oControl
|
Dim chk As CheckBox = oControl
|
||||||
oMyInput = chk.Checked.ToString
|
oMyInput = chk.Checked.ToString
|
||||||
|
|
||||||
'If chk.Checked = False And oIsRequired = True Then
|
If chk.CheckState = CheckState.Indeterminate And oIsRequired = True Then
|
||||||
' oMissing = True
|
oMissing = True
|
||||||
' oErrorMessage = "Option '" & chk.Name & "' is required."
|
oErrMsgMissingInput = "Please set Checkbox value for field '" & chk.Name & "'"
|
||||||
' Exit For
|
LOGGER.Warn(oErrMsgMissingInput)
|
||||||
'End If
|
Exit For
|
||||||
|
End If
|
||||||
|
|
||||||
'den aktuellen Wert in windream auslesen
|
'den aktuellen Wert in windream auslesen
|
||||||
Dim WertWD As String
|
Dim WertWD As String
|
||||||
@ -4881,6 +4887,12 @@ Public Class frmValidator
|
|||||||
|
|
||||||
str = String.Join(PMDelimiter, oValueList.ToArray)
|
str = String.Join(PMDelimiter, oValueList.ToArray)
|
||||||
|
|
||||||
|
' 22.10.2021 Attempt at fixing empty lines appearing in indexes
|
||||||
|
If str.Trim.Length = 0 Or str.Trim.Replace(PMDelimiter, "").Length = 0 Then
|
||||||
|
LOGGER.Debug("Empty line in Grid [{0}]. Skipping.", oControlName)
|
||||||
|
Continue For
|
||||||
|
End If
|
||||||
|
|
||||||
'Den Wert im Array speichern
|
'Den Wert im Array speichern
|
||||||
myVektorArr(ZeilenGrid) = str
|
myVektorArr(ZeilenGrid) = str
|
||||||
ZeilenGrid += 1
|
ZeilenGrid += 1
|
||||||
@ -4975,7 +4987,7 @@ Public Class frmValidator
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
End Function
|
End Function
|
||||||
Private Function Indexiere_File(_dok As WINDREAMLib.WMObject, idxxname As String, idxvalue As Object) As Boolean
|
Private Function Indexiere_File(_dok As WINDREAMLib.WMObject, pIndexName As String, pIndexValues As Object) As Boolean
|
||||||
Dim File_indexiert As Boolean = False
|
Dim File_indexiert As Boolean = False
|
||||||
idxerr_message = ""
|
idxerr_message = ""
|
||||||
Try
|
Try
|
||||||
@ -4986,21 +4998,30 @@ Public Class frmValidator
|
|||||||
arrValue = Nothing
|
arrValue = Nothing
|
||||||
'Den Indexnamen übergeben
|
'Den Indexnamen übergeben
|
||||||
ReDim Preserve arrIndex(0)
|
ReDim Preserve arrIndex(0)
|
||||||
arrIndex(0) = idxxname
|
arrIndex(0) = pIndexName
|
||||||
'Das Array der Idnexwerte überprüfen
|
'Das Array der Idnexwerte überprüfen
|
||||||
If idxvalue Is Nothing = False Then
|
If pIndexValues Is Nothing = False Then
|
||||||
If idxvalue.Length() > 1 Then
|
If pIndexValues.Length() > 1 Then
|
||||||
LOGGER.Debug("Indexing Index '" & idxxname & "' with Arrayvalue")
|
LOGGER.Debug("Indexing Index '" & pIndexName & "' with Arrayvalue")
|
||||||
|
|
||||||
|
For Each oValue In pIndexValues
|
||||||
|
Try
|
||||||
|
LOGGER.Debug("Current Index Value for [{0}] is [{1}]", pIndexName, oValue)
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Debug("Current Index Value for [{0}] could not be read!", pIndexName)
|
||||||
|
End Try
|
||||||
|
Next
|
||||||
|
|
||||||
Dim anzahl As Integer = 0
|
Dim anzahl As Integer = 0
|
||||||
For Each indexvalue As String In idxvalue
|
For Each indexvalue As String In pIndexValues
|
||||||
ReDim Preserve arrValue(anzahl)
|
ReDim Preserve arrValue(anzahl)
|
||||||
arrValue(anzahl) = indexvalue
|
arrValue(anzahl) = indexvalue
|
||||||
anzahl += 1
|
anzahl += 1
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
LOGGER.Debug("Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'")
|
LOGGER.Debug("Indexing Index '" & pIndexName & "' with value '" & pIndexValues(0) & "'")
|
||||||
ReDim Preserve arrValue(0)
|
ReDim Preserve arrValue(0)
|
||||||
arrValue(0) = idxvalue(0).ToString
|
arrValue(0) = pIndexValues(0).ToString
|
||||||
End If
|
End If
|
||||||
'Jetzt das eigentliche Indexieren der Datei
|
'Jetzt das eigentliche Indexieren der Datei
|
||||||
'File_indexiert = Me._windreamPM.RunIndexing(_dok, arrIndex, arrValue)
|
'File_indexiert = Me._windreamPM.RunIndexing(_dok, arrIndex, arrValue)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user