diff --git a/app/TaskFlow/Changelog.md b/app/TaskFlow/Changelog.md index 4a33952..eab7006 100644 --- a/app/TaskFlow/Changelog.md +++ b/app/TaskFlow/Changelog.md @@ -6,3 +6,7 @@ - Modernisierung von verschiedenen Elementen (Validator, Startseite) - Format Strings für Textboxen (Währung, Fließkommazahlen, Datum & Uhrzeit) + +### Bugfixes + +- Anzeige-/Indexierungsfehler bei Mehrzeiligen Textboxen diff --git a/app/TaskFlow/My Project/AssemblyInfo.vb b/app/TaskFlow/My Project/AssemblyInfo.vb index e3f03da..17f5a54 100644 --- a/app/TaskFlow/My Project/AssemblyInfo.vb +++ b/app/TaskFlow/My Project/AssemblyInfo.vb @@ -14,7 +14,7 @@ Imports System.Runtime.InteropServices - + @@ -32,6 +32,6 @@ Imports System.Runtime.InteropServices ' übernehmen, indem Sie "*" eingeben: ' - + diff --git a/app/TaskFlow/Validator/Validator.vb b/app/TaskFlow/Validator/Validator.vb index 7b2c494..a48fbe5 100644 --- a/app/TaskFlow/Validator/Validator.vb +++ b/app/TaskFlow/Validator/Validator.vb @@ -12,7 +12,7 @@ Public Class Validator Public Class ControlRow Public Id As Integer Public IndexName As String - Public Validation As Boolean + Public IsRequired As Boolean Public [ReadOnly] As Boolean Public ValidationSql As String Public RegexMatch As String @@ -25,7 +25,7 @@ Public Class Validator Return New ControlRow With { .Id = pDataRow.ItemEx("GUID", 0), .IndexName = pDataRow.ItemEx("INDEX_NAME", ""), - .Validation = pDataRow.ItemEx("VALIDATION", False), + .IsRequired = pDataRow.ItemEx("VALIDATION", False), .[ReadOnly] = pDataRow.ItemEx("READ_ONLY", False), .ValidationSql = pDataRow.ItemEx("SQL_UEBERPRUEFUNG", ""), .RegexMatch = pDataRow.ItemEx("REGEX_MATCH", ""), @@ -35,130 +35,136 @@ Public Class Validator } End Function - Public Function CheckTextbox(oControl As Control, pControlRow As DataRow) - Try - Dim oControlRow = ConvertToControlRow(pControlRow) + 'Public Function CheckTextbox(oControl As Control, pControlRow As DataRow) + 'Try + ' Dim oMissing = False + ' Dim oErrMsgMissingInput = "" + ' Dim oControlRow = ConvertToControlRow(pControlRow) - 'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl") - Dim oWrongInputMessage = S.Falsche_Eingabe + ' 'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl") + ' Dim oWrongInputMessage = S.Falsche_Eingabe - If oControlRow.RegexMatch <> String.Empty AndAlso Not Regex.IsMatch(oControl.Text, oControlRow.RegexMatch) Then - oMissing = True + ' If oControlRow.RegexMatch <> String.Empty AndAlso Not Regex.IsMatch(oControl.Text, oControlRow.RegexMatch) Then + ' oMissing = True - oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'" + ' oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'" - Logger.Warn(oErrMsgMissingInput) - If oControlRow.RegexMessage <> String.Empty Then - oErrMsgMissingInput &= ":" & vbCrLf & oControlRow.RegexMessage - End If + ' Logger.Warn(oErrMsgMissingInput) + ' If oControlRow.RegexMessage <> String.Empty Then + ' oErrMsgMissingInput &= ":" & vbCrLf & oControlRow.RegexMessage + ' End If - oControl.BackColor = Color.Red - Exit For - End If + ' oControl.BackColor = Color.Red - 'as erstes überprüfen ob überhaupt etwas eingetragen worden ist - If Check_Missing_Control_Value(oControl, "txt") = True And oIsRequired = True Then 'NICHTS EINGETRAGEN - oMissing = True - 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) + ' 'TODO + ' 'Exit For + ' End If - 'den aktuellen Wert in windream auslesen - Dim oSourceValue = GetVariableValuefromSource(oIndexName, oIDBTyp) + ' 'as erstes überprüfen ob überhaupt etwas eingetragen worden ist + ' 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 - oSourceValue = ReturnVektor_IndexValue(oIndexName) - Else - 'wertWD = CURRENT_WMFILE.GetVariableValue(oIndexName) - If Not IsNothing(oSourceValue) Then - If oSourceValue.ToString = "System.Object[]" Then - If oSourceValue.Length = 1 Then - oSourceValue = oSourceValue(0) - Else ' - Logger.Info(" >> Vectorfield " & oIndexName & "' contains more then one value - First value will be used") - oSourceValue = oSourceValue(0) - End If - End If - Else - oSourceValue = "" - End If - End If - Dim oSetValue As Boolean = False - If IsDBNull(oSourceValue) Then - oSetValue = True - End If - If oSetValue = False Then - If IsNothing(oSourceValue) Then - oSetValue = True - End If - End If - If oSetValue = False Then - Try - If oSourceValue <> oMyInput Then - oSetValue = True - End If - Catch ex As Exception - oSetValue = True - End Try + ' If oIndexName.StartsWith("[%VKT") Then + ' oSourceValue = ReturnVektor_IndexValue(oIndexName) + ' Else + ' 'wertWD = CURRENT_WMFILE.GetVariableValue(oIndexName) + ' If Not IsNothing(oSourceValue) Then + ' If oSourceValue.ToString = "System.Object[]" Then + ' If oSourceValue.Length = 1 Then + ' oSourceValue = oSourceValue(0) + ' Else ' + ' Logger.Info(" >> Vectorfield " & oIndexName & "' contains more then one value - First value will be used") + ' oSourceValue = oSourceValue(0) + ' End If + ' End If + ' Else + ' oSourceValue = "" + ' End If + ' End If + ' Dim oSetValue As Boolean = False + ' If IsDBNull(oSourceValue) Then + ' oSetValue = True + ' End If + ' If oSetValue = False Then + ' If IsNothing(oSourceValue) Then + ' oSetValue = True + ' End If + ' End If + ' If oSetValue = False Then + ' Try + ' If oSourceValue <> oMyInput Then + ' oSetValue = True + ' End If + ' Catch ex As Exception + ' oSetValue = True + ' End Try - End If - 'wenn Wert in Windream <> der Eingabe darf indexiert werden - If oSetValue = True Then - 'Wenn der Wert in ein Vektorfeld geschrieben wird - If oIndexName.StartsWith("[%VKT") Then - oMyInput = Return_PM_VEKTOR(oMyInput, oIndexName) - 'Hier muss nun separat as Vektorfeld indexiert werden - If WMIndexVectofield(oMyInput, PROFIL_VEKTORINDEX) = True Then - oMissing = True - oErrMsgMissingInput = "Error while indexing textbox as VEKTOR - ERROR: " & idxerr_message - Logger.Warn(oErrMsgMissingInput) - Exit For - End If - Else - If IDB_ACTIVE = False Then - Dim result() As String - ReDim Preserve result(0) - result(0) = oMyInput - If Indexiere_File(CURRENT_WMFILE, oIndexName, result) = False Then - oMissing = True - oErrMsgMissingInput = "Error while indexing Textbox - ERROR: " & idxerr_message - Logger.Warn(oErrMsgMissingInput) - Exit For - End If - Else - If IDBData.SetVariableValue(oIndexName, oMyInput) = False Then - Exit For - End If - End If - If IDB_ACTIVE = False Then - If PROFIL_LOGINDEX <> "" Then - Dim oMyLogString = Return_LOGString(oMyInput, oSourceValue, oIndexName) - WMIndexVectofield(oMyLogString, PROFIL_LOGINDEX) - 'Else - 'IDBData.SetVariableValue(PROFIL_LOGINDEX, oMyLogString) + ' End If + ' 'wenn Wert in Windream <> der Eingabe darf indexiert werden + ' If oSetValue = True Then + ' 'Wenn der Wert in ein Vektorfeld geschrieben wird + ' If oIndexName.StartsWith("[%VKT") Then + ' oMyInput = Return_PM_VEKTOR(oMyInput, oIndexName) + ' 'Hier muss nun separat as Vektorfeld indexiert werden + ' If WMIndexVectofield(oMyInput, PROFIL_VEKTORINDEX) = True Then + ' oMissing = True + ' oErrMsgMissingInput = "Error while indexing textbox as VEKTOR - ERROR: " & idxerr_message + ' Logger.Warn(oErrMsgMissingInput) + ' Exit For + ' End If + ' Else + ' If IDB_ACTIVE = False Then + ' Dim result() As String + ' ReDim Preserve result(0) + ' result(0) = oMyInput + ' If Indexiere_File(CURRENT_WMFILE, oIndexName, result) = False Then + ' oMissing = True + ' oErrMsgMissingInput = "Error while indexing Textbox - ERROR: " & idxerr_message + ' Logger.Warn(oErrMsgMissingInput) + ' Exit For + ' End If + ' Else + ' If IDBData.SetVariableValue(oIndexName, oMyInput) = False Then + ' Exit For + ' End If + ' End If + ' If IDB_ACTIVE = False Then + ' If PROFIL_LOGINDEX <> "" Then + ' Dim oMyLogString = Return_LOGString(oMyInput, oSourceValue, oIndexName) + ' WMIndexVectofield(oMyLogString, PROFIL_LOGINDEX) + ' 'Else + ' 'IDBData.SetVariableValue(PROFIL_LOGINDEX, oMyLogString) - End If - End If + ' End If + ' End If - End If + ' End If - End If - End If - Catch ex As Exception - oErrMsgMissingInput = "Unexpected error in Check_UpdateIndexe TextBox '" & oControl.Name & "' - Check the log" - Logger.Error(ex) - Dim st As New StackTrace(True) - st = New StackTrace(ex, True) - Logger.Warn("Unexpected error in Check_UpdateIndexe TextBox :" & ex.Message, True) - Return False - End Try - End Function + ' End If + ' End If + ' Catch ex As Exception + ' oErrMsgMissingInput = "Unexpected error in Check_UpdateIndexe TextBox '" & oControl.Name & "' - Check the log" + ' Logger.Error(ex) + ' Dim st As New StackTrace(True) + ' st = New StackTrace(ex, True) + ' Logger.Warn("Unexpected error in Check_UpdateIndexe TextBox :" & ex.Message, True) + ' Return False + ' End Try + 'End Function End Class diff --git a/app/TaskFlow/clsPatterns.vb b/app/TaskFlow/clsPatterns.vb index c83d068..1047c15 100644 --- a/app/TaskFlow/clsPatterns.vb +++ b/app/TaskFlow/clsPatterns.vb @@ -214,6 +214,9 @@ Public Class clsPatterns Case GetType(TextEdit) oReplaceValue = Utils.NotNull(DirectCast(oControl, TextEdit).EditValue, String.Empty) + Case GetType(MemoEdit) + oReplaceValue = Utils.NotNull(DirectCast(oControl, MemoEdit).EditValue, String.Empty) + Case GetType(LookupControl3) Dim oLookupControl3 As LookupControl3 = oControl If oLookupControl3.Properties.SelectedValues.Count = 1 Then diff --git a/app/TaskFlow/frmValidator.vb b/app/TaskFlow/frmValidator.vb index 3e08830..15ce25e 100644 --- a/app/TaskFlow/frmValidator.vb +++ b/app/TaskFlow/frmValidator.vb @@ -619,13 +619,13 @@ Public Class frmValidator Logger.Warn("Error in LookUpLoadSQLData: " & ex.Message) End Try - ElseIf TypeOf control Is TextEdit Then + ElseIf TypeOf control Is TextEdit Or TypeOf control Is memoedit Then Try Dim firstRow As DataRow = oDTContent.Rows(0) Dim value = firstRow.Item(0) - control.Text = value + DirectCast(control, BaseEdit).EditValue = value oValue = value Catch ex As Exception Logger.Warn("Error in TextBoxLoadSQLData: " & ex.Message) @@ -769,7 +769,7 @@ Public Class frmValidator oControlInfo = ClassControlCreator.PREFIX_TEXTBOX & "#" & oControlInfo 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.LostFocus, AddressOf OnTextBoxLostFocus AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp @@ -1033,21 +1033,19 @@ Public Class frmValidator End Sub Sub Clear_all_Input() For Each inctrl As Control In Me.PanelValidatorControl.Controls - Dim Type As String = inctrl.GetType.ToString - Select Case inctrl.GetType - Case GetType(DevExpress.XtraEditors.TextEdit) + Dim Type As Type = inctrl.GetType + Select Case True + Case Type = GetType(TextEdit) Or Type = GetType(MemoEdit) 'inctrl.Text = "" - DirectCast(inctrl, TextEdit).EditValue = Nothing - Case GetType(System.Windows.Forms.ComboBox) + DirectCast(inctrl, BaseEdit).EditValue = Nothing + Case Type = GetType(Windows.Forms.ComboBox) Dim cmb As Windows.Forms.ComboBox = inctrl cmb.SelectedIndex = -1 - Case GetType(System.Windows.Forms.DataGridView) + Case Type = GetType(DataGridView) Dim dgv As DataGridView = inctrl If dgv.Rows.Count > 0 Then dgv.Rows.Clear() End If - Case GetType(System.Windows.Forms.CheckBox) - End Select Next @@ -1055,11 +1053,10 @@ Public Class frmValidator If first_control Is Nothing = False Then first_control.Focus() End If - End Sub 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 If oMeta.ReadOnly = False Then @@ -1070,7 +1067,7 @@ Public Class frmValidator End Sub 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 If oMeta.ReadOnly = False Then @@ -1096,7 +1093,7 @@ Public Class frmValidator Exit Sub 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 (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..") - Select Case oControl.GetType() - Case GetType(TextEdit) + Select Case True + Case oControl.GetType() = GetType(TextEdit) Or oControl.GetType() = GetType(MemoEdit) If oControlTextOption = "Replace" Then oControl.Text = oControlCaption Else @@ -1508,7 +1505,7 @@ Public Class frmValidator btnSave.BackColor = oControlBackColor btnSave.ForeColor = oControlFontColor - Case GetType(LookupControl3) + Case oControl.GetType() = GetType(LookupControl3) Dim oDependingLookup As LookupControl3 = oControl If oDependingLookup.Properties.MultiSelect = True Then If oControlTextOption = "Replace" Then @@ -1576,8 +1573,8 @@ Public Class frmValidator If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then oFound = True Logger.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..") - Select Case oControl.GetType.ToString - Case GetType(TextEdit).ToString + Select Case True + Case oControl.GetType() = GetType(TextEdit) Or oControl.GetType() = GetType(MemoEdit) Try Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0) oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing) @@ -1612,14 +1609,14 @@ Public Class frmValidator Catch ex As Exception btnSave.BackColor = Color.Transparent End Try - Case GetType(LookupControl3).ToString + Case oControl.GetType() = GetType(LookupControl3) Dim oDependingLookup As LookupControl3 = oControl oDependingLookup.Properties.DataSource = oDTDEPENDING_RESULT oDependingLookup.Properties.ValueMember = 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 - Case GetType(CheckBox).ToString + Case oControl.GetType() = GetType(CheckBox) Try Dim oCheckState = CBool(oDTDEPENDING_RESULT.Rows(0).Item(0)) Dim oDependingChk As CheckBox = oControl @@ -1699,8 +1696,8 @@ Public Class frmValidator If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then oFound = True Logger.Debug($"Got the depending control ID:{oDEPENDING_GUID}..Setting the values..") - Select Case oControl.GetType.ToString - Case GetType(TextEdit).ToString + Select Case True + Case oControl.GetType = GetType(TextEdit) Or oControl.GetType = GetType(MemoEdit) Try Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0) oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing) @@ -1734,14 +1731,14 @@ Public Class frmValidator Catch ex As Exception btnSave.BackColor = Color.Transparent End Try - Case GetType(LookupControl3).ToString + Case oControl.GetType = GetType(LookupControl3) Dim oDependingLookup As LookupControl3 = oControl oDependingLookup.Properties.DataSource = oDTDEPENDING_RESULT oDependingLookup.Properties.ValueMember = 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 - Case GetType(CheckBox).ToString + Case oControl.GetType = GetType(CheckBox) Try Dim oCheckState = CBool(oDTDEPENDING_RESULT.Rows(0).Item(0)) Dim oDependingChk As CheckBox = oControl @@ -2872,8 +2869,10 @@ Public Class frmValidator Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE") 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") Try @@ -2922,15 +2921,19 @@ Public Class frmValidator End If End If + Logger.Debug("Value from Source: [{0}]", oValueFromSource) + Try 'Dim oFormatString As String = oControlRow.ItemEx("CTRL_FORMAT_STRING", "") 'oFormattedValue = ClassFormat.GetFormattedValue(oControl.Name, oValueFromSource, oFormatString) - If Not IsNothing(oFormattedValue) And oFormattedValue <> String.Empty Then - oTextBox.EditValue = ObjectEx.NotNull(oFormattedValue, oDefaultValue) - Else - oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue) - End If + 'If Not IsNothing(oFormattedValue) And oFormattedValue <> String.Empty Then + ' oTextBox.EditValue = ObjectEx.NotNull(oFormattedValue, oDefaultValue) + 'Else + ' oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue) + 'End If + + oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue) Try Dim oBackColor As String = oControlRow.Item("CTRL_BACKCOLOR_IF") @@ -2959,10 +2962,8 @@ Public Class frmValidator Logger.Error(ex) End Try - ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) - Catch ex As Exception Logger.Info("Error While converting defaultValue [" & oDefaultValue & "]: " & ex.Message) oTextBox.EditValue = "" @@ -2981,7 +2982,7 @@ Public Class frmValidator Exit Sub End Try - Case GetType(System.Windows.Forms.ComboBox) + Case oControl.GetType = GetType(Windows.Forms.ComboBox) If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/ComboBox") oControlType = "ComboBox" @@ -3064,7 +3065,7 @@ Public Class frmValidator End Try - Case GetType(DevExpress.XtraGrid.GridControl) + Case oControl.GetType = GetType(GridControl) If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/GridControl") oControlType = "DevExpress.XtraGrid.GridControl" @@ -3228,7 +3229,8 @@ Public Class frmValidator Logger.Error(ex) End Try End If - Case GetType(System.Windows.Forms.CheckBox) + + Case oControl.GetType = GetType(CheckBox) Logger.Debug("Loading checkbox...") oControlType = "CheckBox" If oSourceIndexName = "" Then @@ -3332,7 +3334,7 @@ Public Class frmValidator End If End If - Case GetType(DigitalData.Controls.LookupGrid.LookupControl3) + Case oControl.GetType = GetType(LookupControl3) If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/LookupControl") Try @@ -3383,7 +3385,7 @@ Public Class frmValidator MsgBox(ex.Message, MsgBoxStyle.Critical, "Unvorhergesehener Unexpected error in Add LookupControl3:") End Try - Case GetType(System.Windows.Forms.DateTimePicker) + Case oControl.GetType = GetType(DateTimePicker) oControlType = "DateTimePicker" Dim DTP As DateTimePicker = oControl If oSourceIndexName = "" Then @@ -3430,7 +3432,8 @@ Public Class frmValidator End Select oCount += 1 Next - ' set_foreground() + + If first_control Is Nothing = False Then first_control.Focus() Try 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 '###### - Select Case oControl.GetType - Case GetType(DevExpress.XtraEditors.TextEdit) + Select Case True + Case oControl.GetType() = GetType(TextEdit) Or oControl.GetType() = GetType(MemoEdit) Try - value_from_control = oControl.Text + Dim oBaseEdit As BaseEdit = oControl + value_from_control = oBaseEdit.EditValue Catch ex As Exception Logger.Error(ex) value_from_control = String.Empty End Try - Case GetType(System.Windows.Forms.ComboBox) + Case oControl.GetType() = GetType(System.Windows.Forms.ComboBox) Dim cmb As Windows.Forms.ComboBox = oControl Try value_from_control = cmb.Text @@ -4010,7 +4014,7 @@ Public Class frmValidator Logger.Error(ex) value_from_control = String.Empty End Try - Case GetType(System.Windows.Forms.DateTimePicker) + Case oControl.GetType() = GetType(System.Windows.Forms.DateTimePicker) Dim dtp As DateTimePicker = oControl Try value_from_control = dtp.Value.ToString @@ -4019,7 +4023,7 @@ Public Class frmValidator value_from_control = String.Empty End Try - Case GetType(System.Windows.Forms.CheckBox) + Case oControl.GetType() = GetType(System.Windows.Forms.CheckBox) Dim chk As CheckBox = oControl Try 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 Select Case typ Case "txt" - Dim oTextBox As TextEdit = control + Dim oTextBox As BaseEdit = control If IsNothing(oTextBox.EditValue) Then Return True @@ -4297,8 +4301,8 @@ Public Class frmValidator Logger.Info(" >> Indexname is unexpected empty.") Continue For End If - Select Case oControl.GetType - Case GetType(DigitalData.Controls.LookupGrid.LookupControl3) + Select Case True + Case oControl.GetType = GetType(LookupControl3) Try Dim lookup As LookupControl3 = oControl If lookup.Properties.SelectedValues.Count = 0 And oIsRequired = True Then @@ -4483,7 +4487,7 @@ Public Class frmValidator End Try - Case GetType(DevExpress.XtraEditors.TextEdit) + Case oControl.GetType = GetType(TextEdit) Or oControl.GetType = GetType(MemoEdit) Try 'Dim oWrongInputMessage = ClassAllgemeineFunktionen.GUI_LANGUAGE_INFO("frmValidator.WrongInputControl") Dim oWrongInputMessage = S.Falsche_Eingabe @@ -4514,7 +4518,7 @@ Public Class frmValidator Else 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) Logger.Debug("Form Value: [{0}]", oMyInput) @@ -4613,7 +4617,7 @@ Public Class frmValidator Return False End Try - Case GetType(System.Windows.Forms.ComboBox) + Case oControl.GetType = GetType(System.Windows.Forms.ComboBox) Try Logger.Debug($"Working on Combobox...") Dim cmb As Windows.Forms.ComboBox = oControl @@ -4730,7 +4734,7 @@ Public Class frmValidator Return False End Try - Case GetType(System.Windows.Forms.DateTimePicker) + Case oControl.GetType = GetType(DateTimePicker) Try Dim dtp As DateTimePicker = oControl 'Wenn kein Wert ausgewählt wurde und der Index aber gesetzt werden muss @@ -4804,7 +4808,7 @@ Public Class frmValidator Logger.Error(ex) End Try - Case GetType(System.Windows.Forms.CheckBox) + Case oControl.GetType = GetType(CheckBox) Try Dim chk As CheckBox = oControl oMyInput = chk.Checked.ToString @@ -4900,7 +4904,7 @@ Public Class frmValidator Logger.Error(ex) End Try - Case GetType(System.Windows.Forms.DataGridView) + Case oControl.GetType = GetType(DataGridView) Try Dim dgv As DataGridView = oControl @@ -4981,11 +4985,11 @@ Public Class frmValidator Logger.Error(ex) End Try - Case GetType(DevExpress.XtraGrid.GridControl) + Case oControl.GetType = GetType(GridControl) Dim oGrid As GridControl = oControl Dim oSettings = New ControlSettings() With { .IndexName = oIndexName, - .ControlType = GetType(DevExpress.XtraGrid.GridControl).ToString, + .ControlType = GetType(GridControl).ToString, .Name = oControlName, .IsRequired = oIsRequired, .IDBAttributeType = oIDBTyp