finish first pass of switching to TextEdit
This commit is contained in:
parent
a2b051401b
commit
d889bd7e28
@ -57,4 +57,26 @@ Public Class ClassFormat
|
|||||||
|
|
||||||
Return oConvertedValue
|
Return oConvertedValue
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Shared Function GetStringValue(pValue As Object) As String
|
||||||
|
Select Case pValue.GetType
|
||||||
|
Case GetType(Single)
|
||||||
|
Return DirectCast(pValue, Single).ToString(CultureInfo.InvariantCulture)
|
||||||
|
|
||||||
|
Case GetType(Double)
|
||||||
|
Return DirectCast(pValue, Double).ToString(CultureInfo.InvariantCulture)
|
||||||
|
|
||||||
|
Case GetType(Decimal)
|
||||||
|
Return DirectCast(pValue, Decimal).ToString(CultureInfo.InvariantCulture)
|
||||||
|
|
||||||
|
Case GetType(Date)
|
||||||
|
Return DirectCast(pValue, Date).ToString(CultureInfo.InvariantCulture)
|
||||||
|
|
||||||
|
Case GetType(DateTime)
|
||||||
|
Return DirectCast(pValue, DateTime).ToString(CultureInfo.InvariantCulture)
|
||||||
|
|
||||||
|
Case Else
|
||||||
|
Return pValue.ToString
|
||||||
|
End Select
|
||||||
|
End Function
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@ -21,6 +21,7 @@ Imports DevExpress.XtraBars
|
|||||||
Imports DevExpress.XtraGrid.Columns
|
Imports DevExpress.XtraGrid.Columns
|
||||||
Imports DevExpress.XtraEditors
|
Imports DevExpress.XtraEditors
|
||||||
Imports DevExpress.Data
|
Imports DevExpress.Data
|
||||||
|
Imports DigitalData.Modules.Logging
|
||||||
|
|
||||||
Public Class frmValidator
|
Public Class frmValidator
|
||||||
Private Property Current_Document As DocumentResultList.Document = Nothing
|
Private Property Current_Document As DocumentResultList.Document = Nothing
|
||||||
@ -96,6 +97,8 @@ Public Class frmValidator
|
|||||||
|
|
||||||
Private Documentloader As Loader
|
Private Documentloader As Loader
|
||||||
Private ControlCreator As ClassControlCreator
|
Private ControlCreator As ClassControlCreator
|
||||||
|
Private PerformanceLogger As Logger
|
||||||
|
Private Const LOG_PERF = True
|
||||||
|
|
||||||
Private Property OperationMode As OperationMode
|
Private Property OperationMode As OperationMode
|
||||||
Private ReadOnly Environment As Environment
|
Private ReadOnly Environment As Environment
|
||||||
@ -107,6 +110,9 @@ Public Class frmValidator
|
|||||||
End Class
|
End Class
|
||||||
|
|
||||||
Public Sub New(pEnvironment As Environment)
|
Public Sub New(pEnvironment As Environment)
|
||||||
|
PerformanceLogger = LOGCONFIG.GetLoggerFor("PERF")
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("New")
|
||||||
|
|
||||||
'MyBase.New
|
'MyBase.New
|
||||||
LOGGER.Debug("Initialize Components...")
|
LOGGER.Debug("Initialize Components...")
|
||||||
InitializeComponent()
|
InitializeComponent()
|
||||||
@ -119,6 +125,7 @@ Public Class frmValidator
|
|||||||
LOGGER.Error(ex)
|
LOGGER.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Function GetOperationMode() As OperationMode
|
Private Function GetOperationMode() As OperationMode
|
||||||
@ -141,8 +148,8 @@ Public Class frmValidator
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub frmValidation_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
Private Sub frmValidation_Load(sender As Object, e As System.EventArgs) Handles Me.Load
|
||||||
|
|
||||||
Try
|
Try
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("frmValidation_Load")
|
||||||
LOGGER.Debug("###frmValidation_Load###")
|
LOGGER.Debug("###frmValidation_Load###")
|
||||||
LOGGER.Debug("Current User Language: [{0}]", USER_LANGUAGE)
|
LOGGER.Debug("Current User Language: [{0}]", USER_LANGUAGE)
|
||||||
|
|
||||||
@ -704,8 +711,11 @@ Public Class frmValidator
|
|||||||
End If
|
End If
|
||||||
End Function
|
End Function
|
||||||
Sub Create_Controls()
|
Sub Create_Controls()
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("Create_Controls")
|
||||||
|
|
||||||
Dim oControlInfo As String
|
Dim oControlInfo As String
|
||||||
Try
|
Try
|
||||||
|
|
||||||
PanelValidatorControl.Controls.Clear()
|
PanelValidatorControl.Controls.Clear()
|
||||||
Dim oSQL = $"SELECT [dbo].[FNPM_LANGUAGE_CONTROL_TEXT] (NAME,'{USER_LANGUAGE}',CTRL_TYPE,CTRL_TEXT) CTRL_CAPTION_LANG, * FROM TBPM_PROFILE_CONTROLS WHERE CONTROL_ACTIVE = 1 AND PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY Y_LOC, X_LOC"
|
Dim oSQL = $"SELECT [dbo].[FNPM_LANGUAGE_CONTROL_TEXT] (NAME,'{USER_LANGUAGE}',CTRL_TYPE,CTRL_TEXT) CTRL_CAPTION_LANG, * FROM TBPM_PROFILE_CONTROLS WHERE CONTROL_ACTIVE = 1 AND PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY Y_LOC, X_LOC"
|
||||||
DT_CONTROLS = DatabaseFallback.GetDatatable("TBPM_PROFILE_CONTROLS_LANGUAGE", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
DT_CONTROLS = DatabaseFallback.GetDatatable("TBPM_PROFILE_CONTROLS_LANGUAGE", New GetDatatableOptions(oSQL, DatabaseType.ECM) With {
|
||||||
@ -763,6 +773,8 @@ Public Class frmValidator
|
|||||||
Try
|
Try
|
||||||
Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper
|
Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper
|
||||||
Case ClassControlCreator.PREFIX_TEXTBOX
|
Case ClassControlCreator.PREFIX_TEXTBOX
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("Create_Controls/Textbox")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
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...")
|
||||||
@ -781,6 +793,8 @@ Public Class frmValidator
|
|||||||
oControlInfo = "LBL#" & oControlInfo
|
oControlInfo = "LBL#" & oControlInfo
|
||||||
oMyControl = ControlCreator.CreateExistingLabel(oControlRow, False)
|
oMyControl = ControlCreator.CreateExistingLabel(oControlRow, False)
|
||||||
Case "CMB"
|
Case "CMB"
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("Create_Controls/ComboBox")
|
||||||
|
|
||||||
oControlInfo = "CMB#" & oControlInfo
|
oControlInfo = "CMB#" & oControlInfo
|
||||||
LOGGER.Debug($"[{oControlInfo}] - CMB Try to create control...")
|
LOGGER.Debug($"[{oControlInfo}] - CMB Try to create control...")
|
||||||
If oControlRow.Item("READ_ONLY") Then
|
If oControlRow.Item("READ_ONLY") Then
|
||||||
@ -881,6 +895,8 @@ Public Class frmValidator
|
|||||||
oMyControl = dgv
|
oMyControl = dgv
|
||||||
|
|
||||||
Case "LOOKUP"
|
Case "LOOKUP"
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("Create_Controls/Lookup")
|
||||||
|
|
||||||
oControlInfo = "LOOKUP#" & oControlInfo
|
oControlInfo = "LOOKUP#" & oControlInfo
|
||||||
Dim oMultiselect = oControlRow.Item("MULTISELECT")
|
Dim oMultiselect = oControlRow.Item("MULTISELECT")
|
||||||
Dim oReadonly = oControlRow.Item("READ_ONLY")
|
Dim oReadonly = oControlRow.Item("READ_ONLY")
|
||||||
@ -958,6 +974,8 @@ Public Class frmValidator
|
|||||||
|
|
||||||
|
|
||||||
Case "TABLE"
|
Case "TABLE"
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("Create_Controls/Table")
|
||||||
|
|
||||||
oControlInfo = "TABLE#" & oControlInfo
|
oControlInfo = "TABLE#" & oControlInfo
|
||||||
|
|
||||||
Dim oFilteredDatatable As DataTable = DT_COLUMNS_GRID.Clone()
|
Dim oFilteredDatatable As DataTable = DT_COLUMNS_GRID.Clone()
|
||||||
@ -1047,7 +1065,8 @@ Public Class frmValidator
|
|||||||
Dim Type As String = inctrl.GetType.ToString
|
Dim Type As String = inctrl.GetType.ToString
|
||||||
Select Case inctrl.GetType
|
Select Case inctrl.GetType
|
||||||
Case GetType(DevExpress.XtraEditors.TextEdit)
|
Case GetType(DevExpress.XtraEditors.TextEdit)
|
||||||
inctrl.Text = ""
|
'inctrl.Text = ""
|
||||||
|
DirectCast(inctrl, TextEdit).EditValue = Nothing
|
||||||
Case GetType(System.Windows.Forms.ComboBox)
|
Case GetType(System.Windows.Forms.ComboBox)
|
||||||
Dim cmb As Windows.Forms.ComboBox = inctrl
|
Dim cmb As Windows.Forms.ComboBox = inctrl
|
||||||
cmb.SelectedIndex = -1
|
cmb.SelectedIndex = -1
|
||||||
@ -1709,13 +1728,11 @@ Public Class frmValidator
|
|||||||
Select Case oControl.GetType.ToString
|
Select Case oControl.GetType.ToString
|
||||||
Case GetType(TextEdit).ToString
|
Case GetType(TextEdit).ToString
|
||||||
Try
|
Try
|
||||||
Dim oTEXT = oDTDEPENDING_RESULT.Rows(0).Item(0)
|
Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0)
|
||||||
|
oValue = Utils.NotNull(Of Object)(oValue, Nothing)
|
||||||
Try
|
Try
|
||||||
If Not IsNothing(oTEXT) Then
|
'oControl.Text = oValue
|
||||||
If Not IsDBNull(oTEXT) Then
|
DirectCast(oControl, TextEdit).EditValue = oValue
|
||||||
oControl.Text = oTEXT
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Warn($"Unexpected error in Checking oTEXT: {ex.Message}")
|
LOGGER.Warn($"Unexpected error in Checking oTEXT: {ex.Message}")
|
||||||
End Try
|
End Try
|
||||||
@ -1834,16 +1851,15 @@ Public Class frmValidator
|
|||||||
Select Case oControl.GetType.ToString
|
Select Case oControl.GetType.ToString
|
||||||
Case GetType(TextEdit).ToString
|
Case GetType(TextEdit).ToString
|
||||||
Try
|
Try
|
||||||
Dim oTEXT = oDTDEPENDING_RESULT.Rows(0).Item(0)
|
Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0)
|
||||||
|
oValue = Utils.NotNull(Of Object)(oValue, Nothing)
|
||||||
Try
|
Try
|
||||||
If Not IsNothing(oTEXT) Then
|
'oControl.Text = oValue
|
||||||
If Not IsDBNull(oTEXT) Then
|
DirectCast(oControl, TextEdit).EditValue = oValue
|
||||||
oControl.Text = oTEXT
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Warn($"Unexpected error in Checking oTEXT: {ex.Message}")
|
LOGGER.Warn($"Unexpected error in Checking oTEXT: {ex.Message}")
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Warn($"Unexpected error in Dim oTEXT = oDTDEPENDING_RESULT.Rows(0).Item(0): {ex.Message}")
|
LOGGER.Warn($"Unexpected error in Dim oTEXT = oDTDEPENDING_RESULT.Rows(0).Item(0): {ex.Message}")
|
||||||
End Try
|
End Try
|
||||||
@ -2153,6 +2169,8 @@ Public Class frmValidator
|
|||||||
' End Try
|
' End Try
|
||||||
'End Sub
|
'End Sub
|
||||||
Private Sub Controls2B_EnDisabled_on_Load()
|
Private Sub Controls2B_EnDisabled_on_Load()
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("Controls2B_EnDisabled_on_Load")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
|
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
|
||||||
Dim oExpression = $"LEN(SQL_ENABLE_ON_LOAD) > 0"
|
Dim oExpression = $"LEN(SQL_ENABLE_ON_LOAD) > 0"
|
||||||
@ -2975,6 +2993,8 @@ Public Class frmValidator
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Sub FillIndexValues(first As Boolean, Optional SingleAttribute As String = "")
|
Sub FillIndexValues(first As Boolean, Optional SingleAttribute As String = "")
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues")
|
||||||
|
|
||||||
Dim oControlType As String
|
Dim oControlType As String
|
||||||
Dim oIndexName As String
|
Dim oIndexName As String
|
||||||
Dim oControName As String
|
Dim oControName As String
|
||||||
@ -3013,6 +3033,8 @@ Public Class frmValidator
|
|||||||
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()
|
Select Case oControl.GetType()
|
||||||
Case GetType(DevExpress.XtraEditors.TextEdit)
|
Case GetType(DevExpress.XtraEditors.TextEdit)
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/TextEdit")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
oControlType = "Textbox"
|
oControlType = "Textbox"
|
||||||
Dim oTextBox As TextEdit = oControl
|
Dim oTextBox As TextEdit = oControl
|
||||||
@ -3119,6 +3141,8 @@ Public Class frmValidator
|
|||||||
End Try
|
End Try
|
||||||
|
|
||||||
Case GetType(System.Windows.Forms.ComboBox)
|
Case GetType(System.Windows.Forms.ComboBox)
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/ComboBox")
|
||||||
|
|
||||||
oControlType = "ComboBox"
|
oControlType = "ComboBox"
|
||||||
Dim oMyCombobox As Windows.Forms.ComboBox = oControl
|
Dim oMyCombobox As Windows.Forms.ComboBox = oControl
|
||||||
Try
|
Try
|
||||||
@ -3200,6 +3224,8 @@ Public Class frmValidator
|
|||||||
|
|
||||||
|
|
||||||
Case GetType(DevExpress.XtraGrid.GridControl)
|
Case GetType(DevExpress.XtraGrid.GridControl)
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/GridControl")
|
||||||
|
|
||||||
oControlType = "DevExpress.XtraGrid.GridControl"
|
oControlType = "DevExpress.XtraGrid.GridControl"
|
||||||
Dim oMyGridControl As GridControl = oControl
|
Dim oMyGridControl As GridControl = oControl
|
||||||
Dim oDTColumnsPerDevExGrid As DataTable = DT_COLUMNS_GRID.Clone()
|
Dim oDTColumnsPerDevExGrid As DataTable = DT_COLUMNS_GRID.Clone()
|
||||||
@ -3466,6 +3492,8 @@ Public Class frmValidator
|
|||||||
|
|
||||||
End If
|
End If
|
||||||
Case GetType(DigitalData.Controls.LookupGrid.LookupControl3)
|
Case GetType(DigitalData.Controls.LookupGrid.LookupControl3)
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/LookupControl")
|
||||||
|
|
||||||
Try
|
Try
|
||||||
Dim oLookup As LookupControl3 = oControl
|
Dim oLookup As LookupControl3 = oControl
|
||||||
oValueFromSource = GetVariableValuefromSource(oSourceIndexName, oIDBTyp, oIDBOverride)
|
oValueFromSource = GetVariableValuefromSource(oSourceIndexName, oIDBTyp, oIDBOverride)
|
||||||
@ -3605,7 +3633,7 @@ Public Class frmValidator
|
|||||||
LOGGER.Warn($"FillIndexValues - Unexpected error in creating dropdown for Grid: " & ex.Message)
|
LOGGER.Warn($"FillIndexValues - Unexpected error in creating dropdown for Grid: " & ex.Message)
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
If LOG_PERF Then PerformanceLogger.Info("FillIndexValues/Postload")
|
||||||
|
|
||||||
If IDB_ACTIVE = True Then
|
If IDB_ACTIVE = True Then
|
||||||
Try
|
Try
|
||||||
@ -4642,7 +4670,9 @@ Public Class frmValidator
|
|||||||
oControl.BackColor = Color.Red
|
oControl.BackColor = Color.Red
|
||||||
Exit For
|
Exit For
|
||||||
Else
|
Else
|
||||||
oMyInput = oControl.Text
|
Dim oTextEdit As TextEdit = DirectCast(oControl, TextEdit)
|
||||||
|
oMyInput = ClassFormat.GetStringValue(oTextEdit.EditValue)
|
||||||
|
|
||||||
'den aktuellen Wert in windream auslesen
|
'den aktuellen Wert in windream auslesen
|
||||||
Dim oSourceValue = GetVariableValuefromSource(oIndexName, oIDBTyp)
|
Dim oSourceValue = GetVariableValuefromSource(oIndexName, oIDBTyp)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user