More logging, attempt at fixing empty lines in grid control, add checkbox validation

This commit is contained in:
Jonathan Jenne
2021-11-01 14:02:51 +01:00
parent 9a2b324ef5
commit 92d77dcd80
3 changed files with 344 additions and 309 deletions

View File

@@ -3585,7 +3585,11 @@ Public Class frmValidator
Where TypeOf oControl Is GridControl
Select oControl).ToList()
LOGGER.Debug("Forcing grid Validation")
For Each oGrid As GridControl In oGrids
LOGGER.Debug("Validating Grid [{0}]", oGrid.Name)
Dim oView As GridView = oGrid.MainView
If oView.RowCount = 0 Then
@@ -3594,9 +3598,10 @@ Public Class frmValidator
If oView.UpdateCurrentRow() = False Then
oValidation = False
Return False
End If
LOGGER.Debug("Validation of Grid [{0}] ended with Result: [{1}]", oGrid.Name, oValidation)
If oValidation = False Then
Return False
End If
@@ -4671,11 +4676,12 @@ Public Class frmValidator
Dim chk As CheckBox = oControl
oMyInput = chk.Checked.ToString
'If chk.Checked = False And oIsRequired = True Then
' oMissing = True
' oErrorMessage = "Option '" & chk.Name & "' is required."
' Exit For
'End If
If chk.CheckState = CheckState.Indeterminate And oIsRequired = True Then
oMissing = True
oErrMsgMissingInput = "Please set Checkbox value for field '" & chk.Name & "'"
LOGGER.Warn(oErrMsgMissingInput)
Exit For
End If
'den aktuellen Wert in windream auslesen
Dim WertWD As String
@@ -4881,6 +4887,12 @@ Public Class frmValidator
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
myVektorArr(ZeilenGrid) = str
ZeilenGrid += 1
@@ -4975,7 +4987,7 @@ Public Class frmValidator
End Try
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
idxerr_message = ""
Try
@@ -4986,21 +4998,30 @@ Public Class frmValidator
arrValue = Nothing
'Den Indexnamen übergeben
ReDim Preserve arrIndex(0)
arrIndex(0) = idxxname
arrIndex(0) = pIndexName
'Das Array der Idnexwerte überprüfen
If idxvalue Is Nothing = False Then
If idxvalue.Length() > 1 Then
LOGGER.Debug("Indexing Index '" & idxxname & "' with Arrayvalue")
If pIndexValues Is Nothing = False Then
If pIndexValues.Length() > 1 Then
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
For Each indexvalue As String In idxvalue
For Each indexvalue As String In pIndexValues
ReDim Preserve arrValue(anzahl)
arrValue(anzahl) = indexvalue
anzahl += 1
Next
Else
LOGGER.Debug("Indexing Index '" & idxxname & "' with value '" & idxvalue(0) & "'")
LOGGER.Debug("Indexing Index '" & pIndexName & "' with value '" & pIndexValues(0) & "'")
ReDim Preserve arrValue(0)
arrValue(0) = idxvalue(0).ToString
arrValue(0) = pIndexValues(0).ToString
End If
'Jetzt das eigentliche Indexieren der Datei
'File_indexiert = Me._windreamPM.RunIndexing(_dok, arrIndex, arrValue)