fix memoedit loading and saving

This commit is contained in:
Jonathan Jenne 2023-07-18 14:21:50 +02:00
parent b03e11937b
commit 352805d0b7
5 changed files with 191 additions and 174 deletions

View File

@ -6,3 +6,7 @@
- Modernisierung von verschiedenen Elementen (Validator, Startseite) - Modernisierung von verschiedenen Elementen (Validator, Startseite)
- Format Strings für Textboxen (Währung, Fließkommazahlen, Datum & Uhrzeit) - Format Strings für Textboxen (Währung, Fließkommazahlen, Datum & Uhrzeit)
### Bugfixes
- Anzeige-/Indexierungsfehler bei Mehrzeiligen Textboxen

View File

@ -14,7 +14,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")> <Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("TaskFlow")> <Assembly: AssemblyProduct("TaskFlow")>
<Assembly: AssemblyCopyright("Copyright © Digital Data 2023")> <Assembly: AssemblyCopyright("Copyright © Digital Data 2023")>
<Assembly: AssemblyTrademark("2.4.6.0")> <Assembly: AssemblyTrademark("2.4.6.2")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.6.0")> <Assembly: AssemblyVersion("2.4.6.2")>
<Assembly: AssemblyFileVersion("1.0.0.0")> <Assembly: AssemblyFileVersion("1.0.0.0")>
<Assembly: NeutralResourcesLanguage("")> <Assembly: NeutralResourcesLanguage("")>

View File

@ -12,7 +12,7 @@ Public Class Validator
Public Class ControlRow Public Class ControlRow
Public Id As Integer Public Id As Integer
Public IndexName As String Public IndexName As String
Public Validation As Boolean Public IsRequired As Boolean
Public [ReadOnly] As Boolean Public [ReadOnly] As Boolean
Public ValidationSql As String Public ValidationSql As String
Public RegexMatch As String Public RegexMatch As String
@ -25,7 +25,7 @@ Public Class Validator
Return New ControlRow With { Return New ControlRow With {
.Id = pDataRow.ItemEx("GUID", 0), .Id = pDataRow.ItemEx("GUID", 0),
.IndexName = pDataRow.ItemEx("INDEX_NAME", ""), .IndexName = pDataRow.ItemEx("INDEX_NAME", ""),
.Validation = pDataRow.ItemEx("VALIDATION", False), .IsRequired = pDataRow.ItemEx("VALIDATION", False),
.[ReadOnly] = pDataRow.ItemEx("READ_ONLY", False), .[ReadOnly] = pDataRow.ItemEx("READ_ONLY", False),
.ValidationSql = pDataRow.ItemEx("SQL_UEBERPRUEFUNG", ""), .ValidationSql = pDataRow.ItemEx("SQL_UEBERPRUEFUNG", ""),
.RegexMatch = pDataRow.ItemEx("REGEX_MATCH", ""), .RegexMatch = pDataRow.ItemEx("REGEX_MATCH", ""),
@ -35,130 +35,136 @@ Public Class Validator
} }
End Function End Function
Public Function CheckTextbox(oControl As Control, pControlRow As DataRow) 'Public Function CheckTextbox(oControl As Control, pControlRow As DataRow)
Try 'Try
Dim oControlRow = ConvertToControlRow(pControlRow) ' Dim oMissing = False
' Dim oErrMsgMissingInput = ""
' Dim oControlRow = ConvertToControlRow(pControlRow)
'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl") ' 'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl")
Dim oWrongInputMessage = S.Falsche_Eingabe ' Dim oWrongInputMessage = S.Falsche_Eingabe
If oControlRow.RegexMatch <> String.Empty AndAlso Not Regex.IsMatch(oControl.Text, oControlRow.RegexMatch) Then ' If oControlRow.RegexMatch <> String.Empty AndAlso Not Regex.IsMatch(oControl.Text, oControlRow.RegexMatch) Then
oMissing = True ' oMissing = True
oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'" ' oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'"
Logger.Warn(oErrMsgMissingInput) ' Logger.Warn(oErrMsgMissingInput)
If oControlRow.RegexMessage <> String.Empty Then ' If oControlRow.RegexMessage <> String.Empty Then
oErrMsgMissingInput &= ":" & vbCrLf & oControlRow.RegexMessage ' oErrMsgMissingInput &= ":" & vbCrLf & oControlRow.RegexMessage
End If ' End If
oControl.BackColor = Color.Red ' oControl.BackColor = Color.Red
Exit For
End If
'as erstes überprüfen ob überhaupt etwas eingetragen worden ist ' 'TODO
If Check_Missing_Control_Value(oControl, "txt") = True And oIsRequired = True Then 'NICHTS EINGETRAGEN ' 'Exit For
oMissing = True ' End If
oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'"
Logger.Warn(oErrMsgMissingInput)
oControl.BackColor = Color.Red
Exit For
Else
Dim oTextEdit As TextEdit = DirectCast(oControl, TextEdit)
oMyInput = ClassFormat.GetStringValue(oTextEdit.EditValue)
'den aktuellen Wert in windream auslesen ' 'as erstes überprüfen ob überhaupt etwas eingetragen worden ist
Dim oSourceValue = GetVariableValuefromSource(oIndexName, oIDBTyp) ' If Check_Missing_Control_Value(oControl, "txt") = True And oControlRow.IsRequired = True Then 'NICHTS EINGETRAGEN
' oMissing = True
' oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'"
' Logger.Warn(oErrMsgMissingInput)
' oControl.BackColor = Color.Red
' 'TODO
' 'Exit For
' Else
' Dim oTextEdit As TextEdit = DirectCast(oControl, TextEdit)
' oMyInput = ClassFormat.GetStringValue(oTextEdit.EditValue)
' 'den aktuellen Wert in windream auslesen
' Dim oSourceValue = GetVariableValuefromSource(oIndexName, oIDBTyp)
If oIndexName.StartsWith("[%VKT") Then ' If oIndexName.StartsWith("[%VKT") Then
oSourceValue = ReturnVektor_IndexValue(oIndexName) ' oSourceValue = ReturnVektor_IndexValue(oIndexName)
Else ' Else
'wertWD = CURRENT_WMFILE.GetVariableValue(oIndexName) ' 'wertWD = CURRENT_WMFILE.GetVariableValue(oIndexName)
If Not IsNothing(oSourceValue) Then ' If Not IsNothing(oSourceValue) Then
If oSourceValue.ToString = "System.Object[]" Then ' If oSourceValue.ToString = "System.Object[]" Then
If oSourceValue.Length = 1 Then ' If oSourceValue.Length = 1 Then
oSourceValue = oSourceValue(0) ' oSourceValue = oSourceValue(0)
Else ' ' Else '
Logger.Info(" >> Vectorfield " & oIndexName & "' contains more then one value - First value will be used") ' Logger.Info(" >> Vectorfield " & oIndexName & "' contains more then one value - First value will be used")
oSourceValue = oSourceValue(0) ' oSourceValue = oSourceValue(0)
End If ' End If
End If ' End If
Else ' Else
oSourceValue = "" ' oSourceValue = ""
End If ' End If
End If ' End If
Dim oSetValue As Boolean = False ' Dim oSetValue As Boolean = False
If IsDBNull(oSourceValue) Then ' If IsDBNull(oSourceValue) Then
oSetValue = True ' oSetValue = True
End If ' End If
If oSetValue = False Then ' If oSetValue = False Then
If IsNothing(oSourceValue) Then ' If IsNothing(oSourceValue) Then
oSetValue = True ' oSetValue = True
End If ' End If
End If ' End If
If oSetValue = False Then ' If oSetValue = False Then
Try ' Try
If oSourceValue <> oMyInput Then ' If oSourceValue <> oMyInput Then
oSetValue = True ' oSetValue = True
End If ' End If
Catch ex As Exception ' Catch ex As Exception
oSetValue = True ' oSetValue = True
End Try ' End Try
End If ' End If
'wenn Wert in Windream <> der Eingabe darf indexiert werden ' 'wenn Wert in Windream <> der Eingabe darf indexiert werden
If oSetValue = True Then ' If oSetValue = True Then
'Wenn der Wert in ein Vektorfeld geschrieben wird ' 'Wenn der Wert in ein Vektorfeld geschrieben wird
If oIndexName.StartsWith("[%VKT") Then ' If oIndexName.StartsWith("[%VKT") Then
oMyInput = Return_PM_VEKTOR(oMyInput, oIndexName) ' oMyInput = Return_PM_VEKTOR(oMyInput, oIndexName)
'Hier muss nun separat as Vektorfeld indexiert werden ' 'Hier muss nun separat as Vektorfeld indexiert werden
If WMIndexVectofield(oMyInput, PROFIL_VEKTORINDEX) = True Then ' If WMIndexVectofield(oMyInput, PROFIL_VEKTORINDEX) = True Then
oMissing = True ' oMissing = True
oErrMsgMissingInput = "Error while indexing textbox as VEKTOR - ERROR: " & idxerr_message ' oErrMsgMissingInput = "Error while indexing textbox as VEKTOR - ERROR: " & idxerr_message
Logger.Warn(oErrMsgMissingInput) ' Logger.Warn(oErrMsgMissingInput)
Exit For ' Exit For
End If ' End If
Else ' Else
If IDB_ACTIVE = False Then ' If IDB_ACTIVE = False Then
Dim result() As String ' Dim result() As String
ReDim Preserve result(0) ' ReDim Preserve result(0)
result(0) = oMyInput ' result(0) = oMyInput
If Indexiere_File(CURRENT_WMFILE, oIndexName, result) = False Then ' If Indexiere_File(CURRENT_WMFILE, oIndexName, result) = False Then
oMissing = True ' oMissing = True
oErrMsgMissingInput = "Error while indexing Textbox - ERROR: " & idxerr_message ' oErrMsgMissingInput = "Error while indexing Textbox - ERROR: " & idxerr_message
Logger.Warn(oErrMsgMissingInput) ' Logger.Warn(oErrMsgMissingInput)
Exit For ' Exit For
End If ' End If
Else ' Else
If IDBData.SetVariableValue(oIndexName, oMyInput) = False Then ' If IDBData.SetVariableValue(oIndexName, oMyInput) = False Then
Exit For ' Exit For
End If ' End If
End If ' End If
If IDB_ACTIVE = False Then ' If IDB_ACTIVE = False Then
If PROFIL_LOGINDEX <> "" Then ' If PROFIL_LOGINDEX <> "" Then
Dim oMyLogString = Return_LOGString(oMyInput, oSourceValue, oIndexName) ' Dim oMyLogString = Return_LOGString(oMyInput, oSourceValue, oIndexName)
WMIndexVectofield(oMyLogString, PROFIL_LOGINDEX) ' WMIndexVectofield(oMyLogString, PROFIL_LOGINDEX)
'Else ' 'Else
'IDBData.SetVariableValue(PROFIL_LOGINDEX, oMyLogString) ' 'IDBData.SetVariableValue(PROFIL_LOGINDEX, oMyLogString)
End If ' End If
End If ' End If
End If ' End If
End If ' End If
End If ' End If
Catch ex As Exception ' Catch ex As Exception
oErrMsgMissingInput = "Unexpected error in Check_UpdateIndexe TextBox '" & oControl.Name & "' - Check the log" ' oErrMsgMissingInput = "Unexpected error in Check_UpdateIndexe TextBox '" & oControl.Name & "' - Check the log"
Logger.Error(ex) ' Logger.Error(ex)
Dim st As New StackTrace(True) ' Dim st As New StackTrace(True)
st = New StackTrace(ex, True) ' st = New StackTrace(ex, True)
Logger.Warn("Unexpected error in Check_UpdateIndexe TextBox :" & ex.Message, True) ' Logger.Warn("Unexpected error in Check_UpdateIndexe TextBox :" & ex.Message, True)
Return False ' Return False
End Try ' End Try
End Function 'End Function
End Class End Class

View File

@ -214,6 +214,9 @@ Public Class clsPatterns
Case GetType(TextEdit) Case GetType(TextEdit)
oReplaceValue = Utils.NotNull(DirectCast(oControl, TextEdit).EditValue, String.Empty) oReplaceValue = Utils.NotNull(DirectCast(oControl, TextEdit).EditValue, String.Empty)
Case GetType(MemoEdit)
oReplaceValue = Utils.NotNull(DirectCast(oControl, MemoEdit).EditValue, String.Empty)
Case GetType(LookupControl3) Case GetType(LookupControl3)
Dim oLookupControl3 As LookupControl3 = oControl Dim oLookupControl3 As LookupControl3 = oControl
If oLookupControl3.Properties.SelectedValues.Count = 1 Then If oLookupControl3.Properties.SelectedValues.Count = 1 Then

View File

@ -619,13 +619,13 @@ Public Class frmValidator
Logger.Warn("Error in LookUpLoadSQLData: " & ex.Message) Logger.Warn("Error in LookUpLoadSQLData: " & ex.Message)
End Try End Try
ElseIf TypeOf control Is TextEdit Then ElseIf TypeOf control Is TextEdit Or TypeOf control Is memoedit Then
Try Try
Dim firstRow As DataRow = oDTContent.Rows(0) Dim firstRow As DataRow = oDTContent.Rows(0)
Dim value = firstRow.Item(0) Dim value = firstRow.Item(0)
control.Text = value DirectCast(control, BaseEdit).EditValue = value
oValue = value oValue = value
Catch ex As Exception Catch ex As Exception
Logger.Warn("Error in TextBoxLoadSQLData: " & ex.Message) Logger.Warn("Error in TextBoxLoadSQLData: " & ex.Message)
@ -769,7 +769,7 @@ Public Class frmValidator
oControlInfo = ClassControlCreator.PREFIX_TEXTBOX & "#" & oControlInfo oControlInfo = ClassControlCreator.PREFIX_TEXTBOX & "#" & oControlInfo
Logger.Debug($"[{oControlInfo}] - TXT Try to create control...") Logger.Debug($"[{oControlInfo}] - TXT Try to create control...")
Dim txt As TextEdit = ControlCreator.CreateExistingTextbox(oControlRow, False) Dim txt As BaseEdit = ControlCreator.CreateExistingTextbox(oControlRow, False)
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
@ -1033,21 +1033,19 @@ Public Class frmValidator
End Sub End Sub
Sub Clear_all_Input() Sub Clear_all_Input()
For Each inctrl As Control In Me.PanelValidatorControl.Controls For Each inctrl As Control In Me.PanelValidatorControl.Controls
Dim Type As String = inctrl.GetType.ToString Dim Type As Type = inctrl.GetType
Select Case inctrl.GetType Select Case True
Case GetType(DevExpress.XtraEditors.TextEdit) Case Type = GetType(TextEdit) Or Type = GetType(MemoEdit)
'inctrl.Text = "" 'inctrl.Text = ""
DirectCast(inctrl, TextEdit).EditValue = Nothing DirectCast(inctrl, BaseEdit).EditValue = Nothing
Case GetType(System.Windows.Forms.ComboBox) Case Type = GetType(Windows.Forms.ComboBox)
Dim cmb As Windows.Forms.ComboBox = inctrl Dim cmb As Windows.Forms.ComboBox = inctrl
cmb.SelectedIndex = -1 cmb.SelectedIndex = -1
Case GetType(System.Windows.Forms.DataGridView) Case Type = GetType(DataGridView)
Dim dgv As DataGridView = inctrl Dim dgv As DataGridView = inctrl
If dgv.Rows.Count > 0 Then If dgv.Rows.Count > 0 Then
dgv.Rows.Clear() dgv.Rows.Clear()
End If End If
Case GetType(System.Windows.Forms.CheckBox)
End Select End Select
Next Next
@ -1055,11 +1053,10 @@ Public Class frmValidator
If first_control Is Nothing = False Then If first_control Is Nothing = False Then
first_control.Focus() first_control.Focus()
End If End If
End Sub End Sub
Public Sub OnTextBoxFocus(sender As Object, e As EventArgs) Public Sub OnTextBoxFocus(sender As Object, e As EventArgs)
Dim oTextbox As TextEdit = sender Dim oTextbox As BaseEdit = sender
Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag
If oMeta.ReadOnly = False Then If oMeta.ReadOnly = False Then
@ -1070,7 +1067,7 @@ Public Class frmValidator
End Sub End Sub
Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs) Public Sub OnTextBoxLostFocus(sender As System.Object, e As System.EventArgs)
Dim oTextbox As TextEdit = sender Dim oTextbox As BaseEdit = sender
Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag Dim oMeta As ClassControlCreator.ControlMetadata = oTextbox.Tag
If oMeta.ReadOnly = False Then If oMeta.ReadOnly = False Then
@ -1096,7 +1093,7 @@ Public Class frmValidator
Exit Sub Exit Sub
End If End If
Dim oTextBox As TextEdit = sender Dim oTextBox As BaseEdit = sender
If oTextBox.Text <> String.Empty And _FormClosing = False And _Indexe_Loaded = True And oTextBox.Height < 25 Then If oTextBox.Text <> String.Empty And _FormClosing = False And _Indexe_Loaded = True And oTextBox.Height < 25 Then
If (e.KeyCode = Keys.Return) Or (e.KeyCode = Keys.Tab) Or (e.KeyCode = Keys.Enter) Then If (e.KeyCode = Keys.Return) Or (e.KeyCode = Keys.Tab) Or (e.KeyCode = Keys.Enter) Then
@ -1497,8 +1494,8 @@ Public Class frmValidator
Logger.Debug($"Got the Control22Set: {oControlId2Set}..Setting the values..") Logger.Debug($"Got the Control22Set: {oControlId2Set}..Setting the values..")
Select Case oControl.GetType() Select Case True
Case GetType(TextEdit) Case oControl.GetType() = GetType(TextEdit) Or oControl.GetType() = GetType(MemoEdit)
If oControlTextOption = "Replace" Then If oControlTextOption = "Replace" Then
oControl.Text = oControlCaption oControl.Text = oControlCaption
Else Else
@ -1508,7 +1505,7 @@ Public Class frmValidator
btnSave.BackColor = oControlBackColor btnSave.BackColor = oControlBackColor
btnSave.ForeColor = oControlFontColor btnSave.ForeColor = oControlFontColor
Case GetType(LookupControl3) Case oControl.GetType() = GetType(LookupControl3)
Dim oDependingLookup As LookupControl3 = oControl Dim oDependingLookup As LookupControl3 = oControl
If oDependingLookup.Properties.MultiSelect = True Then If oDependingLookup.Properties.MultiSelect = True Then
If oControlTextOption = "Replace" Then If oControlTextOption = "Replace" Then
@ -1576,8 +1573,8 @@ Public Class frmValidator
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then
oFound = True oFound = True
Logger.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..") Logger.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..")
Select Case oControl.GetType.ToString Select Case True
Case GetType(TextEdit).ToString Case oControl.GetType() = GetType(TextEdit) Or oControl.GetType() = GetType(MemoEdit)
Try Try
Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0) Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0)
oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing) oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing)
@ -1612,14 +1609,14 @@ Public Class frmValidator
Catch ex As Exception Catch ex As Exception
btnSave.BackColor = Color.Transparent btnSave.BackColor = Color.Transparent
End Try End Try
Case GetType(LookupControl3).ToString Case oControl.GetType() = GetType(LookupControl3)
Dim oDependingLookup As LookupControl3 = oControl Dim oDependingLookup As LookupControl3 = oControl
oDependingLookup.Properties.DataSource = oDTDEPENDING_RESULT oDependingLookup.Properties.DataSource = oDTDEPENDING_RESULT
oDependingLookup.Properties.ValueMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName oDependingLookup.Properties.ValueMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName
oDependingLookup.Properties.DisplayMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName oDependingLookup.Properties.DisplayMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName
Case GetType(GridControl).ToString Case oControl.GetType() = GetType(GridControl)
'ClassControlCreator.GridTables 'ClassControlCreator.GridTables
Case GetType(CheckBox).ToString Case oControl.GetType() = GetType(CheckBox)
Try Try
Dim oCheckState = CBool(oDTDEPENDING_RESULT.Rows(0).Item(0)) Dim oCheckState = CBool(oDTDEPENDING_RESULT.Rows(0).Item(0))
Dim oDependingChk As CheckBox = oControl Dim oDependingChk As CheckBox = oControl
@ -1699,8 +1696,8 @@ Public Class frmValidator
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then
oFound = True oFound = True
Logger.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..") Logger.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..")
Select Case oControl.GetType.ToString Select Case True
Case GetType(TextEdit).ToString Case oControl.GetType = GetType(TextEdit) Or oControl.GetType = GetType(MemoEdit)
Try Try
Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0) Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0)
oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing) oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing)
@ -1734,14 +1731,14 @@ Public Class frmValidator
Catch ex As Exception Catch ex As Exception
btnSave.BackColor = Color.Transparent btnSave.BackColor = Color.Transparent
End Try End Try
Case GetType(LookupControl3).ToString Case oControl.GetType = GetType(LookupControl3)
Dim oDependingLookup As LookupControl3 = oControl Dim oDependingLookup As LookupControl3 = oControl
oDependingLookup.Properties.DataSource = oDTDEPENDING_RESULT oDependingLookup.Properties.DataSource = oDTDEPENDING_RESULT
oDependingLookup.Properties.ValueMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName oDependingLookup.Properties.ValueMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName
oDependingLookup.Properties.DisplayMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName oDependingLookup.Properties.DisplayMember = oDTDEPENDING_RESULT.Columns.Item(0).ColumnName
Case GetType(GridControl).ToString Case oControl.GetType = GetType(GridControl)
'ClassControlCreator.GridTables 'ClassControlCreator.GridTables
Case GetType(CheckBox).ToString Case oControl.GetType = GetType(CheckBox)
Try Try
Dim oCheckState = CBool(oDTDEPENDING_RESULT.Rows(0).Item(0)) Dim oCheckState = CBool(oDTDEPENDING_RESULT.Rows(0).Item(0))
Dim oDependingChk As CheckBox = oControl Dim oDependingChk As CheckBox = oControl
@ -2872,8 +2869,10 @@ Public Class frmValidator
Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE") Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE")
Logger.Debug("INDEX: " & oSourceIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString) Logger.Debug("INDEX: " & oSourceIndexName & " - CONTROLNAME: " & oControl.Name & " - LOAD IDXVALUES: " & oLoadIndex.ToString)
Select Case oControl.GetType()
Case GetType(DevExpress.XtraEditors.TextEdit)
Select Case True
Case oControl.GetType = GetType(TextEdit) Or oControl.GetType = GetType(MemoEdit)
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/TextEdit") If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/TextEdit")
Try Try
@ -2922,15 +2921,19 @@ Public Class frmValidator
End If End If
End If End If
Logger.Debug("Value from Source: [{0}]", oValueFromSource)
Try Try
'Dim oFormatString As String = oControlRow.ItemEx("CTRL_FORMAT_STRING", "") 'Dim oFormatString As String = oControlRow.ItemEx("CTRL_FORMAT_STRING", "")
'oFormattedValue = ClassFormat.GetFormattedValue(oControl.Name, oValueFromSource, oFormatString) 'oFormattedValue = ClassFormat.GetFormattedValue(oControl.Name, oValueFromSource, oFormatString)
If Not IsNothing(oFormattedValue) And oFormattedValue <> String.Empty Then 'If Not IsNothing(oFormattedValue) And oFormattedValue <> String.Empty Then
oTextBox.EditValue = ObjectEx.NotNull(oFormattedValue, oDefaultValue) ' oTextBox.EditValue = ObjectEx.NotNull(oFormattedValue, oDefaultValue)
Else 'Else
oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue) ' oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue)
End If 'End If
oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue)
Try Try
Dim oBackColor As String = oControlRow.Item("CTRL_BACKCOLOR_IF") Dim oBackColor As String = oControlRow.Item("CTRL_BACKCOLOR_IF")
@ -2959,10 +2962,8 @@ Public Class frmValidator
Logger.Error(ex) Logger.Error(ex)
End Try End Try
ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
Catch ex As Exception Catch ex As Exception
Logger.Info("Error While converting defaultValue [" & oDefaultValue & "]: " & ex.Message) Logger.Info("Error While converting defaultValue [" & oDefaultValue & "]: " & ex.Message)
oTextBox.EditValue = "" oTextBox.EditValue = ""
@ -2981,7 +2982,7 @@ Public Class frmValidator
Exit Sub Exit Sub
End Try End Try
Case GetType(System.Windows.Forms.ComboBox) Case oControl.GetType = GetType(Windows.Forms.ComboBox)
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/ComboBox") If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/ComboBox")
oControlType = "ComboBox" oControlType = "ComboBox"
@ -3064,7 +3065,7 @@ Public Class frmValidator
End Try End Try
Case GetType(DevExpress.XtraGrid.GridControl) Case oControl.GetType = GetType(GridControl)
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/GridControl") If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/GridControl")
oControlType = "DevExpress.XtraGrid.GridControl" oControlType = "DevExpress.XtraGrid.GridControl"
@ -3228,7 +3229,8 @@ Public Class frmValidator
Logger.Error(ex) Logger.Error(ex)
End Try End Try
End If End If
Case GetType(System.Windows.Forms.CheckBox)
Case oControl.GetType = GetType(CheckBox)
Logger.Debug("Loading checkbox...") Logger.Debug("Loading checkbox...")
oControlType = "CheckBox" oControlType = "CheckBox"
If oSourceIndexName = "" Then If oSourceIndexName = "" Then
@ -3332,7 +3334,7 @@ Public Class frmValidator
End If End If
End If End If
Case GetType(DigitalData.Controls.LookupGrid.LookupControl3) Case oControl.GetType = GetType(LookupControl3)
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/LookupControl") If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/LookupControl")
Try Try
@ -3383,7 +3385,7 @@ Public Class frmValidator
MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl3:") MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl3:")
End Try End Try
Case GetType(System.Windows.Forms.DateTimePicker) Case oControl.GetType = GetType(DateTimePicker)
oControlType = "DateTimePicker" oControlType = "DateTimePicker"
Dim DTP As DateTimePicker = oControl Dim DTP As DateTimePicker = oControl
If oSourceIndexName = "" Then If oSourceIndexName = "" Then
@ -3430,7 +3432,8 @@ Public Class frmValidator
End Select End Select
oCount += 1 oCount += 1
Next Next
' set_foreground()
If first_control Is Nothing = False Then first_control.Focus() If first_control Is Nothing = False Then first_control.Focus()
Try Try
Dim oDataTable As DataTable = DT_COLUMNS_GRID_WITH_SQL.Clone() Dim oDataTable As DataTable = DT_COLUMNS_GRID_WITH_SQL.Clone()
@ -3993,16 +3996,17 @@ Public Class frmValidator
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = CTRL_ID Then If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = CTRL_ID Then
'###### '######
Select Case oControl.GetType Select Case True
Case GetType(DevExpress.XtraEditors.TextEdit) Case oControl.GetType() = GetType(TextEdit) Or oControl.GetType() = GetType(MemoEdit)
Try Try
value_from_control = oControl.Text Dim oBaseEdit As BaseEdit = oControl
value_from_control = oBaseEdit.EditValue
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
value_from_control = String.Empty value_from_control = String.Empty
End Try End Try
Case GetType(System.Windows.Forms.ComboBox) Case oControl.GetType() = GetType(System.Windows.Forms.ComboBox)
Dim cmb As Windows.Forms.ComboBox = oControl Dim cmb As Windows.Forms.ComboBox = oControl
Try Try
value_from_control = cmb.Text value_from_control = cmb.Text
@ -4010,7 +4014,7 @@ Public Class frmValidator
Logger.Error(ex) Logger.Error(ex)
value_from_control = String.Empty value_from_control = String.Empty
End Try End Try
Case GetType(System.Windows.Forms.DateTimePicker) Case oControl.GetType() = GetType(System.Windows.Forms.DateTimePicker)
Dim dtp As DateTimePicker = oControl Dim dtp As DateTimePicker = oControl
Try Try
value_from_control = dtp.Value.ToString value_from_control = dtp.Value.ToString
@ -4019,7 +4023,7 @@ Public Class frmValidator
value_from_control = String.Empty value_from_control = String.Empty
End Try End Try
Case GetType(System.Windows.Forms.CheckBox) Case oControl.GetType() = GetType(System.Windows.Forms.CheckBox)
Dim chk As CheckBox = oControl Dim chk As CheckBox = oControl
Try Try
value_from_control = chk.Checked value_from_control = chk.Checked
@ -4154,7 +4158,7 @@ Public Class frmValidator
Function Check_Missing_Control_Value(control As Control, typ As String) As Boolean Function Check_Missing_Control_Value(control As Control, typ As String) As Boolean
Select Case typ Select Case typ
Case "txt" Case "txt"
Dim oTextBox As TextEdit = control Dim oTextBox As BaseEdit = control
If IsNothing(oTextBox.EditValue) Then If IsNothing(oTextBox.EditValue) Then
Return True Return True
@ -4297,8 +4301,8 @@ Public Class frmValidator
Logger.Info(" >> Indexname is unexpected empty.") Logger.Info(" >> Indexname is unexpected empty.")
Continue For Continue For
End If End If
Select Case oControl.GetType Select Case True
Case GetType(DigitalData.Controls.LookupGrid.LookupControl3) Case oControl.GetType = GetType(LookupControl3)
Try Try
Dim lookup As LookupControl3 = oControl Dim lookup As LookupControl3 = oControl
If lookup.Properties.SelectedValues.Count = 0 And oIsRequired = True Then If lookup.Properties.SelectedValues.Count = 0 And oIsRequired = True Then
@ -4483,7 +4487,7 @@ Public Class frmValidator
End Try End Try
Case GetType(DevExpress.XtraEditors.TextEdit) Case oControl.GetType = GetType(TextEdit) Or oControl.GetType = GetType(MemoEdit)
Try Try
'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl") 'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl")
Dim oWrongInputMessage = S.Falsche_Eingabe Dim oWrongInputMessage = S.Falsche_Eingabe
@ -4514,7 +4518,7 @@ Public Class frmValidator
Else Else
Logger.Debug("Reading current value from Textbox") Logger.Debug("Reading current value from Textbox")
Dim oTextEdit As TextEdit = DirectCast(oControl, TextEdit) Dim oTextEdit As BaseEdit = DirectCast(oControl, BaseEdit)
oMyInput = ClassFormat.GetStringValue(oTextEdit.EditValue) oMyInput = ClassFormat.GetStringValue(oTextEdit.EditValue)
Logger.Debug("Form Value: [{0}]", oMyInput) Logger.Debug("Form Value: [{0}]", oMyInput)
@ -4613,7 +4617,7 @@ Public Class frmValidator
Return False Return False
End Try End Try
Case GetType(System.Windows.Forms.ComboBox) Case oControl.GetType = GetType(System.Windows.Forms.ComboBox)
Try Try
Logger.Debug($"Working on Combobox...") Logger.Debug($"Working on Combobox...")
Dim cmb As Windows.Forms.ComboBox = oControl Dim cmb As Windows.Forms.ComboBox = oControl
@ -4730,7 +4734,7 @@ Public Class frmValidator
Return False Return False
End Try End Try
Case GetType(System.Windows.Forms.DateTimePicker) Case oControl.GetType = GetType(DateTimePicker)
Try Try
Dim dtp As DateTimePicker = oControl Dim dtp As DateTimePicker = oControl
'Wenn kein Wert ausgewählt wurde und der Index aber gesetzt werden muss 'Wenn kein Wert ausgewählt wurde und der Index aber gesetzt werden muss
@ -4804,7 +4808,7 @@ Public Class frmValidator
Logger.Error(ex) Logger.Error(ex)
End Try End Try
Case GetType(System.Windows.Forms.CheckBox) Case oControl.GetType = GetType(CheckBox)
Try Try
Dim chk As CheckBox = oControl Dim chk As CheckBox = oControl
oMyInput = chk.Checked.ToString oMyInput = chk.Checked.ToString
@ -4900,7 +4904,7 @@ Public Class frmValidator
Logger.Error(ex) Logger.Error(ex)
End Try End Try
Case GetType(System.Windows.Forms.DataGridView) Case oControl.GetType = GetType(DataGridView)
Try Try
Dim dgv As DataGridView = oControl Dim dgv As DataGridView = oControl
@ -4981,11 +4985,11 @@ Public Class frmValidator
Logger.Error(ex) Logger.Error(ex)
End Try End Try
Case GetType(DevExpress.XtraGrid.GridControl) Case oControl.GetType = GetType(GridControl)
Dim oGrid As GridControl = oControl Dim oGrid As GridControl = oControl
Dim oSettings = New ControlSettings() With { Dim oSettings = New ControlSettings() With {
.IndexName = oIndexName, .IndexName = oIndexName,
.ControlType = GetType(DevExpress.XtraGrid.GridControl).ToString, .ControlType = GetType(GridControl).ToString,
.Name = oControlName, .Name = oControlName,
.IsRequired = oIsRequired, .IsRequired = oIsRequired,
.IDBAttributeType = oIDBTyp .IDBAttributeType = oIDBTyp