This commit is contained in:
Jonathan Jenne 2023-06-09 08:57:52 +02:00
parent d77369523e
commit 22691f30c4
2 changed files with 110 additions and 283 deletions

View File

@ -102,9 +102,8 @@ Public Class ClassAllgemeineFunktionen
LOGGER.Error(ex) LOGGER.Error(ex)
LOGGER.Info("Error in Insert_LogEntry: " & ex.Message) LOGGER.Info("Error in Insert_LogEntry: " & ex.Message)
End Try End Try
End Function End Function
Public Function ExecuteonMSSQL(ByVal sqlcommand As String, ConString As String) Public Function ExecuteonMSSQL(ByVal sqlcommand As String, ConString As String)
Try Try
' die nötigen Variablen definieren ' die nötigen Variablen definieren

View File

@ -1,25 +1,24 @@
Imports WINDREAMLib Imports DevExpress.XtraBars
Imports System.Threading Imports DevExpress.XtraEditors
Imports System.Runtime.InteropServices Imports DevExpress.XtraGrid
Imports System.IO Imports DevExpress.XtraGrid.Columns
Imports System.Text.RegularExpressions Imports DevExpress.XtraGrid.Views.Grid
Imports System.ComponentModel
Imports System.Globalization
Imports DigitalData.Controls.LookupGrid Imports DigitalData.Controls.LookupGrid
Imports DigitalData.Modules.Base Imports DigitalData.GUIs.Common
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
Imports DigitalData.Modules.EDMI.API.Constants
Imports DigitalData.GUIs.Common.DocumentResultList Imports DigitalData.GUIs.Common.DocumentResultList
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.EDMI.API.Constants
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow Imports DigitalData.Modules.ZooFlow
Imports DigitalData.Modules.ZooFlow.Constants Imports DigitalData.Modules.ZooFlow.Constants
Imports DigitalData.GUIs.Common Imports System.ComponentModel
Imports DevExpress.XtraGrid Imports System.Globalization
Imports DevExpress.XtraGrid.Views.Grid Imports System.IO
Imports DevExpress.XtraBars Imports System.Runtime.InteropServices
Imports DevExpress.XtraGrid.Columns Imports System.Text.RegularExpressions
Imports DevExpress.XtraEditors Imports System.Threading
Imports DevExpress.Data Imports WINDREAMLib
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
@ -51,47 +50,41 @@ Public Class frmValidator
Private Property oErrMsgMissingInput Private Property oErrMsgMissingInput
Private Property PMDelimiter As String Private Const PMDelimiter As String = "~"
Private Property WD_Search As String
Private Property finalProfile As Boolean Private Property finalProfile As Boolean
Private Property Move2Folder As String Private Property Move2Folder As String
'Private Property DataASorDB As ClassDataASorDB 'Private Property DataASorDB As ClassDataASorDB
Private Property allgFunk As New ClassAllgemeineFunktionen Private Property allgFunk As New ClassAllgemeineFunktionen
'speichert die DocumentDaten
Private Property navStep As String = Nothing
Public Shared Property WMDocPathWindows As String Public Shared Property WMDocPathWindows As String
Private Property WMDocFileString As String
Private Property DocPathWindows As String Private Property DocPathWindows As String
Private Property OLD_Document_Path As String = ""
Private Property ValueDTP As Date
Private Property docCounter As Integer = 1
'Anzahl der Validierungsdokumente 'Anzahl der Validierungsdokumente
Private Property Amount_Docs2Validate As Integer Private Property Amount_Docs2Validate As Integer
Private Property me_closing As Boolean = False
Private Property first_control As Control Private Property first_control As Control
Private Property last_control As Control Private Property last_control As Control
Private Property _Indexe_Loaded As Boolean = False
Public Shared Property idxerr_message As String = "" Public Shared Property idxerr_message As String = ""
Private Property _frmValidatorSearch As frmValidatorSearch 'You need a reference to Form1 Private Property _frmValidatorSearch As frmValidatorSearch
Private Property _dependingControl_in_action As Boolean = False
Private Property _dependingColumn_in_action As Boolean = False
Private Property _SetControlValue_in_action As Boolean = False
Private Property DT_AdditionalSearches_Resultset_Docs As DataTable Private Property DT_AdditionalSearches_Resultset_Docs As DataTable
Public Property FormLoaded As Boolean = False Private Property _Indexe_Loaded As Boolean = False
Private Property ItemWorked As Boolean = False Private Property _DependingControl_In_Action As Boolean = False
Private Property _DependingColumn_In_Action As Boolean = False
Private Property _SetControlValue_In_Action As Boolean = False
Public Property _FormLoaded As Boolean = False
Private Property _FormClosing As Boolean = False
Private Property _ControlHandleStarted As Boolean = False
Private Property _ItemWorked As Boolean = False
Private Property Override As Boolean = False Private Property Override As Boolean = False
Private Property OverrideAll As Boolean = False Private Property OverrideAll As Boolean = False
Private Property Override_SQLCommand As String = "" Private Property Override_SQLCommand As String = ""
Private Property listChangedLookup As New List(Of String) Private Property listChangedLookup As New List(Of String)
Private Property ControlHandleStarted As Boolean = False
Private Documentloader As Loader Private Documentloader As Loader
Private ControlCreator As ClassControlCreator Private ControlCreator As ClassControlCreator
@ -158,16 +151,13 @@ Public Class frmValidator
Documentloader = New Loader(LOGCONFIG, OperationMode, Environment.Service.Client, Environment.User) Documentloader = New Loader(LOGCONFIG, OperationMode, Environment.Service.Client, Environment.User)
ControlCreator = New ClassControlCreator(LOGCONFIG) ControlCreator = New ClassControlCreator(LOGCONFIG)
PMDelimiter = "~"
Override = False Override = False
ItemWorked = False _ItemWorked = False
SplitContainer1.Panel2Collapsed = True SplitContainer1.Panel2Collapsed = True
docCounter = 1
OLD_Document_Path = ""
first_control = Nothing first_control = Nothing
me_closing = False _FormClosing = False
FormLoaded = False _FormLoaded = False
Attmt_bbtnitmShow.Visibility = BarItemVisibility.Never Attmt_bbtnitmShow.Visibility = BarItemVisibility.Never
Attmnt_bbtnitm_LoadonClick.Visibility = BarItemVisibility.Never Attmnt_bbtnitm_LoadonClick.Visibility = BarItemVisibility.Never
@ -280,7 +270,6 @@ Public Class frmValidator
PROFIL_LOGINDEX = "" PROFIL_LOGINDEX = ""
End If End If
WD_Search = oProfileRow.Item("WD_SEARCH")
finalProfile = oProfileRow.Item("FINAL_PROFILE") finalProfile = oProfileRow.Item("FINAL_PROFILE")
Move2Folder = IIf(IsDBNull(oProfileRow.Item("MOVE2Folder")), "", oProfileRow.Item("MOVE2Folder")) Move2Folder = IIf(IsDBNull(oProfileRow.Item("MOVE2Folder")), "", oProfileRow.Item("MOVE2Folder"))
Try Try
@ -313,13 +302,10 @@ Public Class frmValidator
End If End If
Next Next
If DEBUG = False Then LOGGER.Debug(" >> profiledata saved:")
LOGGER.Info(" >> profiledata saved:") LOGGER.Debug(" >> finalProfile: " & finalProfile)
LOGGER.Info(" >> WD_Search: " & WD_Search) LOGGER.Debug(" >> Move2Folder: " & Move2Folder)
LOGGER.Info(" >> finalProfile: " & finalProfile) LOGGER.Debug(" >> Right_Delete: " & USER_RIGHT_FILE_DELETE)
LOGGER.Info(" >> Move2Folder: " & Move2Folder)
LOGGER.Info(" >> Right_Delete: " & USER_RIGHT_FILE_DELETE)
End If
PROFIL_sortbynewest = CURRENT_DT_PROFILE.Rows(0).Item("SORT_BY_LATEST") PROFIL_sortbynewest = CURRENT_DT_PROFILE.Rows(0).Item("SORT_BY_LATEST")
LOGGER.Debug("PROFIL_sortbynewest: " & PROFIL_sortbynewest.ToString) LOGGER.Debug("PROFIL_sortbynewest: " & PROFIL_sortbynewest.ToString)
@ -360,7 +346,7 @@ Public Class frmValidator
Private Sub frmValidation_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing Private Sub frmValidation_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
Try Try
me_closing = True _FormClosing = True
Try Try
' Position und Größe speichern ' Position und Größe speichern
My.Settings.frmValidatorSize = Me.Size My.Settings.frmValidatorSize = Me.Size
@ -909,7 +895,7 @@ Public Class frmValidator
lookup.Properties.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM") lookup.Properties.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM")
lookup.Properties.MultiSelect = oMultiselect lookup.Properties.MultiSelect = oMultiselect
If GenericEx.NotNull(oControlRow.Item("DEFAULT_VALUE"), "") <> "" Then If ObjectEx.NotNull(oControlRow.Item("DEFAULT_VALUE"), "") <> "" Then
lookup.Properties.SelectedValues = New List(Of String) From {oControlRow.Item("DEFAULT_VALUE")} lookup.Properties.SelectedValues = New List(Of String) From {oControlRow.Item("DEFAULT_VALUE")}
End If End If
@ -1118,13 +1104,13 @@ Public Class frmValidator
Public Sub OnTextBoxKeyUp(sender As Object, e As KeyEventArgs) Public Sub OnTextBoxKeyUp(sender As Object, e As KeyEventArgs)
If ControlHandleStarted = True Then If _ControlHandleStarted = True Then
ControlHandleStarted = False _ControlHandleStarted = False
Exit Sub Exit Sub
End If End If
Dim oTextBox As TextEdit = sender Dim oTextBox As TextEdit = sender
If oTextBox.Text <> String.Empty And me_closing = 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
Try Try
@ -1145,9 +1131,9 @@ Public Class frmValidator
If Not IsDBNull(oSqlStatement) And Not IsDBNull(oConnectionId) Then If Not IsDBNull(oSqlStatement) And Not IsDBNull(oConnectionId) Then
oSqlStatement = clsPatterns.ReplaceAllValues(oSqlStatement, PanelValidatorControl, True) oSqlStatement = clsPatterns.ReplaceAllValues(oSqlStatement, PanelValidatorControl, True)
_dependingControl_in_action = True _DependingControl_In_Action = True
Depending_Control_Set_Result(oControlName, oSqlStatement, oConnectionId) Depending_Control_Set_Result(oControlName, oSqlStatement, oConnectionId)
_dependingControl_in_action = False _DependingControl_In_Action = False
End If End If
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
@ -1166,7 +1152,7 @@ Public Class frmValidator
End Try End Try
If oTextBox.Name <> last_control.Name Then If oTextBox.Name <> last_control.Name Then
SendKeys.Send("{TAB}") SendKeys.Send("{TAB}")
ControlHandleStarted = True _ControlHandleStarted = True
End If End If
End If End If
End If End If
@ -1376,7 +1362,7 @@ Public Class frmValidator
End Sub End Sub
Public Sub onLookUpselectedValue(sender As Object, SelectedValues As List(Of String)) Public Sub onLookUpselectedValue(sender As Object, SelectedValues As List(Of String))
LOGGER.Debug("onLookUpselectedValue") LOGGER.Debug("onLookUpselectedValue")
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
Dim oRepositoryItem As RepositoryItemLookupControl3 = sender Dim oRepositoryItem As RepositoryItemLookupControl3 = sender
@ -1397,7 +1383,7 @@ Public Class frmValidator
End Try End Try
End Sub End Sub
Public Sub LookupListChanged(sender As Object, SelectedValues As List(Of String)) Public Sub LookupListChanged(sender As Object, SelectedValues As List(Of String))
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
@ -1414,7 +1400,7 @@ Public Class frmValidator
Public Sub onCheckBox_CheckedChange(sender As Object, e As EventArgs) Public Sub onCheckBox_CheckedChange(sender As Object, e As EventArgs)
LOGGER.Debug("onCheckBox_CheckedChange") LOGGER.Debug("onCheckBox_CheckedChange")
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
Dim oCheckbox As CheckBox = sender Dim oCheckbox As CheckBox = sender
@ -1430,7 +1416,7 @@ Public Class frmValidator
End Sub End Sub
Public Sub onLookUpselectedValue_Control2Set(sender As Object, SelectedValues As List(Of String)) Public Sub onLookUpselectedValue_Control2Set(sender As Object, SelectedValues As List(Of String))
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
LOGGER.Debug("onLookUpselectedValue_Control2Set") LOGGER.Debug("onLookUpselectedValue_Control2Set")
@ -1444,7 +1430,7 @@ Public Class frmValidator
Dim oControlMeta = DirectCast(pControl.Tag, ClassControlCreator.ControlMetadata) Dim oControlMeta = DirectCast(pControl.Tag, ClassControlCreator.ControlMetadata)
Dim oControlID = oControlMeta.Guid Dim oControlID = oControlMeta.Guid
If _SetControlValue_in_action = True Then If _SetControlValue_In_Action = True Then
LOGGER.Debug("SetControlValue in action. Exiting.") LOGGER.Debug("SetControlValue in action. Exiting.")
Exit Sub Exit Sub
End If End If
@ -1464,19 +1450,18 @@ Public Class frmValidator
Dim oControlname2Set = oRow.Item("NAME") Dim oControlname2Set = oRow.Item("NAME")
LOGGER.Debug($"Workin on SetControLValue for {oControlname2Set} ...") LOGGER.Debug($"Workin on SetControLValue for {oControlname2Set} ...")
Dim oConnectionId = GenericEx.NotNull(oRow.Item("CONNECTION_ID"), -1) Dim oConnectionId = oRow.ItemEx("CONNECTION_ID", -1)
Dim oControlDataSql = GenericEx.NotNull(oRow.Item("SET_CONTROL_DATA"), String.Empty) Dim oControlDataSql = oRow.ItemEx("SET_CONTROL_DATA", String.Empty)
If oConnectionId = -1 Or oControlDataSql = String.Empty Then If oConnectionId = -1 Or oControlDataSql = String.Empty Then
LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!") LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!")
Exit Sub Exit Sub
End If End If
Dim oSqlCommand = GenericEx.NotNull(oRow.Item("SET_CONTROL_DATA"), String.Empty) oControlDataSql = clsPatterns.ReplaceAllValues(oControlDataSql, PanelValidatorControl, True)
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
'Dim oControlDataResult As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId, $"SetControlValues - CTRLID {oControlID}") 'Dim oControlDataResult As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId, $"SetControlValues - CTRLID {oControlID}")
Dim oControlDataResult As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With { Dim oControlDataResult As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oControlDataSql, DatabaseType.ECM) With {
.ConnectionId = oConnectionId .ConnectionId = oConnectionId
}) })
@ -1486,7 +1471,7 @@ Public Class frmValidator
For Each oResultRow As DataRow In oControlDataResult.Rows For Each oResultRow As DataRow In oControlDataResult.Rows
Try Try
_SetControlValue_in_action = True _SetControlValue_In_Action = True
Dim oControl2Set = oResultRow.ItemEx("Control2Set", String.Empty) Dim oControl2Set = oResultRow.ItemEx("Control2Set", String.Empty)
Dim oControlCaption = oResultRow.ItemEx("Caption", String.Empty) Dim oControlCaption = oResultRow.ItemEx("Caption", String.Empty)
@ -1495,34 +1480,11 @@ Public Class frmValidator
Dim oControlTextOption = oResultRow.ItemEx("TextOption", "Replace") Dim oControlTextOption = oResultRow.ItemEx("TextOption", "Replace")
If oControl2Set.ToString.ToUpper = "BTN_FINISH".ToUpper Then If oControl2Set.ToString.ToUpper = "BTN_FINISH".ToUpper Then
'Try
' Dim btntext = oResultRow.Item("Caption")
' btnSave.Text = btntext & " (F2)"
'Catch ex As Exception
' LOGGER.Error(ex)
'End Try
'Try
' Dim oColor1 = Color.FromName(oResultRow.Item("BackgroundColor"))
' btnSave.BackColor = oColor1
'Catch ex As Exception
' LOGGER.Error(ex)
' btnSave.BackColor = Color.Transparent
'End Try
'Try
' Dim oColor2 = Color.FromName(oResultRow.Item("FontColor"))
' btnSave.ForeColor = oColor2
'Catch ex As Exception
' LOGGER.Error(ex)
' btnSave.ForeColor = Color.Black
'End Try
btnSave.Text = oControlCaption & " (F2)" btnSave.Text = oControlCaption & " (F2)"
btnSave.BackColor = oControlBackColor btnSave.BackColor = oControlBackColor
btnSave.ForeColor = oControlFontColor btnSave.ForeColor = oControlFontColor
_SetControlValue_in_action = False _SetControlValue_In_Action = False
Continue For Continue For
End If End If
@ -1545,18 +1507,8 @@ Public Class frmValidator
Dim oControl As Control = oControlObject2Set Dim oControl As Control = oControlObject2Set
Dim oMeta As ClassControlCreator.ControlMetadata = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata) Dim oMeta As ClassControlCreator.ControlMetadata = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata)
'If oMeta.Guid = oControlId2Set Then
LOGGER.Debug($"Got the Control22Set: {oControlId2Set}..Setting the values..") LOGGER.Debug($"Got the Control22Set: {oControlId2Set}..Setting the values..")
'Dim oCaption As Object = oResultRow.Item("Caption")
'Dim oTextOption = Nothing
'Try
' oTextOption = oResultRow.Item("TextOption")
'Catch ex As Exception
' LOGGER.Debug("Column [TextOption] not found. Using Default of [Replace]")
' oTextOption = "Replace"
'End Try
Select Case oControl.GetType() Select Case oControl.GetType()
Case GetType(TextEdit) Case GetType(TextEdit)
@ -1569,24 +1521,6 @@ Public Class frmValidator
btnSave.BackColor = oControlBackColor btnSave.BackColor = oControlBackColor
btnSave.ForeColor = oControlFontColor btnSave.ForeColor = oControlFontColor
'Dim oBackColor
'Try
' oBackColor = Color.FromName(oResultRow.Item("BackgroundColor"))
' oControl.BackColor = oBackColor
'Catch ex As Exception
' LOGGER.Debug("Column [BackgroundColor] not found. Using Default of [White]")
' oControl.BackColor = Color.White
'End Try
'Dim oForeColor As Color
'Try
' oForeColor = Color.FromName(oResultRow.Item("FontColor"))
' oControl.ForeColor = oForeColor
'Catch ex As Exception
' LOGGER.Debug("Column [FontColor] not found. Using Default of [Black]")
' oControl.ForeColor = Color.Black
'End Try
Case GetType(LookupControl3) Case GetType(LookupControl3)
Dim oDependingLookup As LookupControl3 = oControl Dim oDependingLookup As LookupControl3 = oControl
If oDependingLookup.Properties.MultiSelect = True Then If oDependingLookup.Properties.MultiSelect = True Then
@ -1608,74 +1542,6 @@ Public Class frmValidator
'Exit For 'Exit For
End If End If
'End If
'For Each oControl As Control In PanelValidatorControl.Controls
' Dim oMeta As ClassControlCreator.ControlMetadata = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata)
' If oMeta.Guid = oControlId2Set Then
' LOGGER.Debug($"Got the Control22Set: {oControlId2Set}..Setting the values..")
' Dim oCaption As Object = oResultRow.Item("Caption")
' Dim oTextOption = Nothing
' Try
' oTextOption = oResultRow.Item("TextOption")
' Catch ex As Exception
' LOGGER.Debug("Column [TextOption] not found. Using Default of [Replace]")
' oTextOption = "Replace"
' End Try
' Select Case oControl.GetType()
' Case GetType(TextBox)
' If oTextOption = "Replace" Then
' oControl.Text = oCaption
' Else
' oControl.Text &= oCaption
' End If
' Dim oBackColor
' Try
' oBackColor = Color.FromName(oResultRow.Item("BackgroundColor"))
' oControl.BackColor = oBackColor
' Catch ex As Exception
' LOGGER.Debug("Column [BackgroundColor] not found. Using Default of [White]")
' oControl.BackColor = Color.White
' End Try
' Dim oForeColor As Color
' Try
' oForeColor = Color.FromName(oResultRow.Item("FontColor"))
' oControl.ForeColor = oForeColor
' Catch ex As Exception
' LOGGER.Debug("Column [FontColor] not found. Using Default of [Black]")
' oControl.ForeColor = Color.Black
' End Try
' Case GetType(LookupControl3)
' Dim oDependingLookup As LookupControl3 = oControl
' If oDependingLookup.Properties.MultiSelect = True Then
' If oTextOption = "Replace" Then
' oDependingLookup.Properties.SelectedValues = New List(Of String) From {oCaption}
' Else
' oDependingLookup.Properties.SelectedValues.Add(oCaption)
' End If
' Else
' oDependingLookup.Properties.SelectedValues = New List(Of String) From {oCaption}
' End If
' Case Else
' LOGGER.Warn("SetControlData used on unsupported control")
' End Select
' oFound = True
' Exit For
' End If
'Next
If oFound = False Then If oFound = False Then
LOGGER.Debug($"Could not find the Control2Set with ID {oControlGUID2Set} on panel!!!") LOGGER.Debug($"Could not find the Control2Set with ID {oControlGUID2Set} on panel!!!")
End If End If
@ -1683,7 +1549,7 @@ Public Class frmValidator
LOGGER.Error(ex) LOGGER.Error(ex)
LOGGER.Warn($"Error while Control2Set for [{oControlname2Set}]: " & ex.Message) LOGGER.Warn($"Error while Control2Set for [{oControlname2Set}]: " & ex.Message)
Finally Finally
_SetControlValue_in_action = False _SetControlValue_In_Action = False
End Try End Try
Next Next
End Sub End Sub
@ -1704,14 +1570,14 @@ Public Class frmValidator
Dim oDEPENDING_GUID = oRowDependingControl.Item("GUID") Dim oDEPENDING_GUID = oRowDependingControl.Item("GUID")
Dim oDEPENDING_CtrlName = oRowDependingControl.Item("NAME") Dim oDEPENDING_CtrlName = oRowDependingControl.Item("NAME")
LOGGER.Debug($"Control {oDEPENDING_CtrlName} is depending on lookUp {oLOOKUPName}..") LOGGER.Debug($"Control {oDEPENDING_CtrlName} is depending on lookUp {oLOOKUPName}..")
If _dependingControl_in_action = True Then If _DependingControl_In_Action = True Then
LOGGER.Debug($"..but _dependingControl_in_action = True ==> Exit Sub!") LOGGER.Debug($"..but _dependingControl_in_action = True ==> Exit Sub!")
Exit Sub Exit Sub
End If End If
If Not IsDBNull(oRowDependingControl.Item("CONNECTION_ID")) And Not IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")) Then If Not IsDBNull(oRowDependingControl.Item("CONNECTION_ID")) And Not IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")) Then
Dim oSqlCommand = IIf(IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")), "", oRowDependingControl.Item("SQL_UEBERPRUEFUNG")) Dim oSqlCommand = IIf(IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")), "", oRowDependingControl.Item("SQL_UEBERPRUEFUNG"))
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True) oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
_dependingControl_in_action = True _DependingControl_In_Action = True
'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oRowDependingControl.Item("CONNECTION_ID"), $"LookupControl_DependingControls - oControlID: {oControlID}") 'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oRowDependingControl.Item("CONNECTION_ID"), $"LookupControl_DependingControls - oControlID: {oControlID}")
Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With { Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With {
.ConnectionId = oRowDependingControl.Item("CONNECTION_ID") .ConnectionId = oRowDependingControl.Item("CONNECTION_ID")
@ -1727,7 +1593,7 @@ Public Class frmValidator
Case GetType(TextEdit).ToString Case GetType(TextEdit).ToString
Try Try
Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0) Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0)
oValue = GenericEx.NotNull(Of Object)(oValue, Nothing) oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing)
Try Try
'oControl.Text = oValue 'oControl.Text = oValue
DirectCast(oControl, TextEdit).EditValue = oValue DirectCast(oControl, TextEdit).EditValue = oValue
@ -1784,7 +1650,7 @@ Public Class frmValidator
End Select End Select
_dependingControl_in_action = False _DependingControl_In_Action = False
Exit For Exit For
End If End If
@ -1795,10 +1661,10 @@ Public Class frmValidator
End If End If
Catch ex As Exception Catch ex As Exception
LOGGER.Warn($"Error while setting depending control-value for [{oDEPENDING_CtrlName}]: " & ex.Message) LOGGER.Warn($"Error while setting depending control-value for [{oDEPENDING_CtrlName}]: " & ex.Message)
_dependingControl_in_action = False _DependingControl_In_Action = False
End Try End Try
SendKeys.Send("{TAB}") SendKeys.Send("{TAB}")
ControlHandleStarted = True _ControlHandleStarted = True
Else Else
LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!") LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!")
End If End If
@ -1826,14 +1692,14 @@ Public Class frmValidator
Dim oDEPENDING_GUID = oRowDependingControl.Item("GUID") Dim oDEPENDING_GUID = oRowDependingControl.Item("GUID")
Dim oDEPENDING_CtrlName = oRowDependingControl.Item("NAME") Dim oDEPENDING_CtrlName = oRowDependingControl.Item("NAME")
LOGGER.Debug($"Control {oDEPENDING_CtrlName} is depending on lookUp {oCheckboxname}..") LOGGER.Debug($"Control {oDEPENDING_CtrlName} is depending on lookUp {oCheckboxname}..")
If _dependingControl_in_action = True Then If _DependingControl_In_Action = True Then
LOGGER.Debug($"..but _dependingControl_in_action = True ==> Exit Sub!") LOGGER.Debug($"..but _dependingControl_in_action = True ==> Exit Sub!")
Exit Sub Exit Sub
End If End If
If Not IsDBNull(oRowDependingControl.Item("CONNECTION_ID")) And Not IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")) Then If Not IsDBNull(oRowDependingControl.Item("CONNECTION_ID")) And Not IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")) Then
Dim oSqlCommand = IIf(IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")), "", oRowDependingControl.Item("SQL_UEBERPRUEFUNG")) Dim oSqlCommand = IIf(IsDBNull(oRowDependingControl.Item("SQL_UEBERPRUEFUNG")), "", oRowDependingControl.Item("SQL_UEBERPRUEFUNG"))
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True) oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
_dependingControl_in_action = True _DependingControl_In_Action = True
'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oRowDependingControl.Item("CONNECTION_ID"), $"CheckBox_DependingControls - oControlID: {oControlID}") 'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oRowDependingControl.Item("CONNECTION_ID"), $"CheckBox_DependingControls - oControlID: {oControlID}")
Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With { Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With {
.ConnectionId = oRowDependingControl.Item("CONNECTION_ID") .ConnectionId = oRowDependingControl.Item("CONNECTION_ID")
@ -1850,7 +1716,7 @@ Public Class frmValidator
Case GetType(TextEdit).ToString Case GetType(TextEdit).ToString
Try Try
Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0) Dim oValue As Object = oDTDEPENDING_RESULT.Rows(0).Item(0)
oValue = GenericEx.NotNull(Of Object)(oValue, Nothing) oValue = ObjectEx.NotNull(Of Object)(oValue, Nothing)
Try Try
'oControl.Text = oValue 'oControl.Text = oValue
DirectCast(oControl, TextEdit).EditValue = oValue DirectCast(oControl, TextEdit).EditValue = oValue
@ -1906,7 +1772,7 @@ Public Class frmValidator
End Select End Select
_dependingControl_in_action = False _DependingControl_In_Action = False
Exit For Exit For
End If End If
@ -1916,10 +1782,10 @@ Public Class frmValidator
End If End If
Catch ex As Exception Catch ex As Exception
LOGGER.Warn($"Error while setting depending control-value for [{oDEPENDING_CtrlName}]: " & ex.Message) LOGGER.Warn($"Error while setting depending control-value for [{oDEPENDING_CtrlName}]: " & ex.Message)
_dependingControl_in_action = False _DependingControl_In_Action = False
End Try End Try
SendKeys.Send("{TAB}") SendKeys.Send("{TAB}")
ControlHandleStarted = True _ControlHandleStarted = True
Else Else
LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!") LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!")
End If End If
@ -1948,12 +1814,12 @@ Public Class frmValidator
Dim oDEPENDING_COLUMN = oRow.Item("SPALTENNAME") Dim oDEPENDING_COLUMN = oRow.Item("SPALTENNAME")
Dim oSqlCommand = oRow.Item("SQL_COMMAND") Dim oSqlCommand = oRow.Item("SQL_COMMAND")
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP") Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
If _dependingColumn_in_action = True Then If _DependingColumn_In_Action = True Then
Exit Sub Exit Sub
End If End If
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True) oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
_dependingColumn_in_action = True _DependingColumn_In_Action = True
Try Try
'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oCONNID, $"LookupControl_DependingColumn - oDEPENDING_CONTROL_ID: {oDEPENDING_CONTROL_ID}") 'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oCONNID, $"LookupControl_DependingColumn - oDEPENDING_CONTROL_ID: {oDEPENDING_CONTROL_ID}")
Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With { Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With {
@ -1967,7 +1833,7 @@ Public Class frmValidator
If oControlId = oDEPENDING_CONTROL_ID Then If oControlId = oDEPENDING_CONTROL_ID Then
ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup) ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
_dependingColumn_in_action = False _DependingColumn_In_Action = False
Exit For Exit For
End If End If
Next Next
@ -1975,7 +1841,7 @@ Public Class frmValidator
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
_dependingColumn_in_action = False _DependingColumn_In_Action = False
End Try End Try
Next Next
End If End If
@ -1992,13 +1858,13 @@ Public Class frmValidator
Dim oSqlCommand = oRow.Item("SQL_COMMAND") Dim oSqlCommand = oRow.Item("SQL_COMMAND")
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP") Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
If _dependingColumn_in_action = True Then If _DependingColumn_In_Action = True Then
Exit Sub Exit Sub
End If End If
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True) oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
_dependingColumn_in_action = True _DependingColumn_In_Action = True
Try Try
'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oCONNID, $"CheckBox_DependingColumn - oDEPENDING_CONTROL_ID: {oDEPENDING_CONTROL_ID}") 'Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oCONNID, $"CheckBox_DependingColumn - oDEPENDING_CONTROL_ID: {oDEPENDING_CONTROL_ID}")
Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With { Dim oDTDEPENDING_RESULT As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With {
@ -2011,7 +1877,7 @@ Public Class frmValidator
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CONTROL_ID Then If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CONTROL_ID Then
ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup) ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
_dependingColumn_in_action = False _DependingColumn_In_Action = False
Exit For Exit For
End If End If
Next Next
@ -2019,7 +1885,7 @@ Public Class frmValidator
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
_dependingColumn_in_action = False _DependingColumn_In_Action = False
End Try End Try
Next Next
End If End If
@ -2038,7 +1904,7 @@ Public Class frmValidator
.FilterExpression = String.Format("CONTROL_ACTIVE = 1 AND PROFIL_ID = {0} And SQL_UEBERPRUEFUNG Like '%{1}%'", CURRENT_ProfilGUID, oCombobox.Name) .FilterExpression = String.Format("CONTROL_ACTIVE = 1 AND PROFIL_ID = {0} And SQL_UEBERPRUEFUNG Like '%{1}%'", CURRENT_ProfilGUID, oCombobox.Name)
}) })
If Not IsNothing(DT) And DT.Rows.Count > 0 Then If Not IsNothing(DT) And DT.Rows.Count > 0 Then
If _dependingControl_in_action = True Then If _DependingControl_In_Action = True Then
Exit Sub Exit Sub
End If End If
Dim _Step = 0 Dim _Step = 0
@ -2053,11 +1919,11 @@ Public Class frmValidator
sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, PanelValidatorControl, True) sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, PanelValidatorControl, True)
_Step = 3 _Step = 3
_dependingControl_in_action = True _DependingControl_In_Action = True
_Step = 4 _Step = 4
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1)) Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
_Step = 5 _Step = 5
_dependingControl_in_action = False _DependingControl_In_Action = False
End If End If
Catch ex As Exception Catch ex As Exception
@ -2076,14 +1942,14 @@ Public Class frmValidator
LOGGER.Error(ex) LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result ComboBox - ERROR: " & ex.Message) LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result ComboBox - ERROR: " & ex.Message)
End Try End Try
ControlHandleStarted = True _ControlHandleStarted = True
End If End If
End If End If
End Sub End Sub
Private Sub Controls2beEnabled(pControlName As String) Private Sub Controls2beEnabled(pControlName As String)
Try Try
' 18.10.2021: ENABLE_SQL nicht beim Form Load verarbeiten ' 18.10.2021: ENABLE_SQL nicht beim Form Load verarbeiten
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
@ -2099,14 +1965,14 @@ Public Class frmValidator
Dim oENABLE_GUID = oRowEnablingControl.Item("GUID") Dim oENABLE_GUID = oRowEnablingControl.Item("GUID")
Dim oENABLE_CtrlName = oRowEnablingControl.Item("NAME") Dim oENABLE_CtrlName = oRowEnablingControl.Item("NAME")
LOGGER.Debug($"Control {oENABLE_CtrlName} is depending on Control: {pControlName}..") LOGGER.Debug($"Control {oENABLE_CtrlName} is depending on Control: {pControlName}..")
If _dependingControl_in_action = True Then If _DependingControl_In_Action = True Then
LOGGER.Debug($"..but _dependingControl_in_action = True ==> Exit Sub!") LOGGER.Debug($"..but _dependingControl_in_action = True ==> Exit Sub!")
Exit Sub Exit Sub
End If End If
If Not IsDBNull(oRowEnablingControl.Item("CONNECTION_ID")) And Not IsDBNull(oRowEnablingControl.Item("SQL_ENABLE")) Then If Not IsDBNull(oRowEnablingControl.Item("CONNECTION_ID")) And Not IsDBNull(oRowEnablingControl.Item("SQL_ENABLE")) Then
Dim oSqlCommand = IIf(IsDBNull(oRowEnablingControl.Item("SQL_ENABLE")), "", oRowEnablingControl.Item("SQL_ENABLE")) Dim oSqlCommand = IIf(IsDBNull(oRowEnablingControl.Item("SQL_ENABLE")), "", oRowEnablingControl.Item("SQL_ENABLE"))
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True) oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, PanelValidatorControl, True)
_dependingControl_in_action = True _DependingControl_In_Action = True
Dim oConnectionId As Integer = oRowEnablingControl.Item("CONNECTION_ID") Dim oConnectionId As Integer = oRowEnablingControl.Item("CONNECTION_ID")
@ -2122,7 +1988,7 @@ Public Class frmValidator
oFound = True oFound = True
LOGGER.Debug($"Got the depending control ID:{oENABLE_GUID}..Setting enabled/Disabled...") LOGGER.Debug($"Got the depending control ID:{oENABLE_GUID}..Setting enabled/Disabled...")
oControl.Enabled = oENABLERESULT oControl.Enabled = oENABLERESULT
_dependingControl_in_action = False _DependingControl_In_Action = False
Exit For Exit For
End If End If
@ -2133,7 +1999,7 @@ Public Class frmValidator
End If End If
Catch ex As Exception Catch ex As Exception
LOGGER.Warn($"Error while setting enabling control-value for [{oENABLE_CtrlName}]: " & ex.Message) LOGGER.Warn($"Error while setting enabling control-value for [{oENABLE_CtrlName}]: " & ex.Message)
_dependingControl_in_action = False _DependingControl_In_Action = False
End Try End Try
Else Else
LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!") LOGGER.Debug($"Error: Check CoNN ID and SQL on NULL VALUES!")
@ -2276,12 +2142,11 @@ Public Class frmValidator
Public Sub OnDTPValueChanged(sender As System.Object, e As System.EventArgs) Public Sub OnDTPValueChanged(sender As System.Object, e As System.EventArgs)
Dim dtp As DateTimePicker = sender Dim dtp As DateTimePicker = sender
If _Indexe_Loaded = True Then If _Indexe_Loaded = True Then
ValueDTP = dtp.Value
If dtp.Name = last_control.Name Then If dtp.Name = last_control.Name Then
' Abschluss() ' Abschluss()
Else Else
SendKeys.Send("{TAB}") SendKeys.Send("{TAB}")
ControlHandleStarted = True _ControlHandleStarted = True
End If End If
End If End If
End Sub End Sub
@ -2410,8 +2275,7 @@ Public Class frmValidator
Try Try
Dim oNormalizedPath = WINDREAM_MOD.GetNormalizedPath(oWMOwnPath, 1) Dim oNormalizedPath = WINDREAM_MOD.GetNormalizedPath(oWMOwnPath, 1)
CURRENT_WMFILE = WINDREAM_MOD.Session.GetWMObjectByPath(WMEntity.WMEntityDocument, oNormalizedPath) CURRENT_WMFILE = WINDREAM_MOD.Session.GetWMObjectByPath(WMEntity.WMEntityDocument, oNormalizedPath)
WMDocFileString = oNormalizedPath LOGGER.Debug("CURRENT_WMFILE: [{0}]", CURRENT_WMFILE)
LOGGER.Debug("WMDocFileString: " & WMDocFileString)
Return True Return True
Catch ex As Exception Catch ex As Exception
Dim _err1 As Boolean = False Dim _err1 As Boolean = False
@ -2421,7 +2285,6 @@ Public Class frmValidator
LOGGER.Info("Error Number: " & Err.Number.ToString) LOGGER.Info("Error Number: " & Err.Number.ToString)
errormessage = $"Could not create a WMObject(1) for [{oWMOwnPath}]!" errormessage = $"Could not create a WMObject(1) for [{oWMOwnPath}]!"
frmError.ShowDialog() frmError.ShowDialog()
WMDocFileString = ""
Return False Return False
End Try End Try
@ -2458,13 +2321,11 @@ Public Class frmValidator
End If End If
WMDocPathWindows = oResult WMDocPathWindows = oResult
OLD_Document_Path = WMDocPathWindows
CURRENT_DOC_PATH = WMDocPathWindows CURRENT_DOC_PATH = WMDocPathWindows
LOGGER.Info($"GetWMDocPathWindows CURRENT_DOC_PATH: {CURRENT_DOC_PATH}") LOGGER.Info($"GetWMDocPathWindows CURRENT_DOC_PATH: {CURRENT_DOC_PATH}")
Return True Return True
Catch ex As Exception Catch ex As Exception
WMDocPathWindows = "" WMDocPathWindows = ""
OLD_Document_Path = ""
CURRENT_DOC_PATH = "" CURRENT_DOC_PATH = ""
errormessage = $"Unexpected error in GetDocPathWindows: [{ex.Message}]!" errormessage = $"Unexpected error in GetDocPathWindows: [{ex.Message}]!"
frmError.ShowDialog() frmError.ShowDialog()
@ -2493,7 +2354,6 @@ Public Class frmValidator
activate_controls(False) activate_controls(False)
oErrMsgMissingInput = "" oErrMsgMissingInput = ""
WMDocPathWindows = "" WMDocPathWindows = ""
WMDocFileString = ""
'Me.lblerror.Visible = False 'Me.lblerror.Visible = False
@ -2505,7 +2365,6 @@ Public Class frmValidator
CURRENT_WMFILE = Nothing CURRENT_WMFILE = Nothing
Else Else
LOGGER.Debug("Following Document ") LOGGER.Debug("Following Document ")
docCounter += 1
End If End If
' Controls nicht beim ersten Laden leeren ' Controls nicht beim ersten Laden leeren
@ -3023,7 +2882,7 @@ Public Class frmValidator
Dim oSourceIndexName As String = oControlRow.Item("INDEX_NAME") Dim oSourceIndexName As String = oControlRow.Item("INDEX_NAME")
' Wenn kein defaultValue existiert, leeren String setzen ' Wenn kein defaultValue existiert, leeren String setzen
Dim oDefaultValue As String = GenericEx.NotNull(oControlRow.Item("DEFAULT_VALUE"), String.Empty) Dim oDefaultValue As String = ObjectEx.NotNull(oControlRow.Item("DEFAULT_VALUE"), String.Empty)
oIndexName = oSourceIndexName oIndexName = oSourceIndexName
oControName = oControl.Name oControName = oControl.Name
Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE") Dim oLoadIndex As Boolean = oControlRow.Item("LOAD_IDX_VALUE")
@ -3084,9 +2943,9 @@ Public Class frmValidator
'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 = GenericEx.NotNull(oFormattedValue, oDefaultValue) oTextBox.EditValue = ObjectEx.NotNull(oFormattedValue, oDefaultValue)
Else Else
oTextBox.EditValue = GenericEx.NotNull(oValueFromSource, oDefaultValue) oTextBox.EditValue = ObjectEx.NotNull(oValueFromSource, oDefaultValue)
End If End If
Try Try
@ -3568,13 +3427,11 @@ Public Class frmValidator
LOGGER.Debug("DATE konnte umgewandelt werden") LOGGER.Debug("DATE konnte umgewandelt werden")
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
ValueDTP = tempdate
LOGGER.Debug("DATE wurde auf heute gesetzt") LOGGER.Debug("DATE wurde auf heute gesetzt")
End Try End Try
DTP.Text = tempdate DTP.Text = tempdate
Else Else
LOGGER.Debug("DATE ist leer") LOGGER.Debug("DATE ist leer")
ValueDTP = tempdate
DTP.Text = tempdate DTP.Text = tempdate
End If End If
Catch ex As Exception Catch ex As Exception
@ -3742,8 +3599,8 @@ Public Class frmValidator
Load_Next_Document(True) Load_Next_Document(True)
Controls2B_EnDisabled_on_Load() Controls2B_EnDisabled_on_Load()
_dependingControl_in_action = False _DependingControl_In_Action = False
_dependingColumn_in_action = False _DependingColumn_In_Action = False
' 18.10.2021: Brauchen Sie das Überhaupt?? ' 18.10.2021: Brauchen Sie das Überhaupt??
'Controls2beDisabled() 'Controls2beDisabled()
@ -3753,7 +3610,7 @@ Public Class frmValidator
_frmValidatorSearch?.BringToFront() _frmValidatorSearch?.BringToFront()
End If End If
FormLoaded = True _FormLoaded = True
Try Try
If USER_GHOST_MODE_ACTIVE Then If USER_GHOST_MODE_ACTIVE Then
BbtnitmSave.Enabled = False BbtnitmSave.Enabled = False
@ -3944,7 +3801,7 @@ Public Class frmValidator
Sub Finish_WFStep(Optional includeFI As Boolean = True) Sub Finish_WFStep(Optional includeFI As Boolean = True)
btnSave.Enabled = False btnSave.Enabled = False
LOGGER.Debug("Abschluss für Dok: " & CURRENT_DOC_PATH & " gestartet") LOGGER.Debug("Abschluss für Dok: " & CURRENT_DOC_PATH & " gestartet")
ItemWorked = True _ItemWorked = True
Dim oErrorOcurred As Boolean = False Dim oErrorOcurred As Boolean = False
If OverrideAll = False Then If OverrideAll = False Then
'Eingaben auf Form überprüfen 'Eingaben auf Form überprüfen
@ -3987,7 +3844,7 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
End If End If
If Not IsNothing(oSQLCommand) Then If Not IsNothing(oSQLCommand) Then
Dim oResultfromSQL As Object = DatabaseFallback.GetScalarValueWithConnection(oSQLCommand, oConnectionID) Dim oResultfromSQL As Object = DatabaseFallback.GetScalarValueWithConnection(oSQLCommand, oConnectionID)
@ -3999,7 +3856,7 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
Else Else
LOGGER.Warn($"FinalIndexResult from SQL is DBNull - AttributeName [{oFinalIndexRow.Item("INDEXNAME")}] - oContinueOnIndifferentState = true, Continuing with next Attribute and Replacing with empty String") LOGGER.Warn($"FinalIndexResult from SQL is DBNull - AttributeName [{oFinalIndexRow.Item("INDEXNAME")}] - oContinueOnIndifferentState = true, Continuing with next Attribute and Replacing with empty String")
oResultfromSQL = "" oResultfromSQL = ""
@ -4013,7 +3870,7 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
Else Else
LOGGER.Warn($"FinalIndexResult from SQL is EmptyValue - AttributeName [{oFinalIndexRow.Item("INDEXNAME")}] - oContinueOnIndifferentState = true, So continuing with next Attribute") LOGGER.Warn($"FinalIndexResult from SQL is EmptyValue - AttributeName [{oFinalIndexRow.Item("INDEXNAME")}] - oContinueOnIndifferentState = true, So continuing with next Attribute")
Continue For Continue For
@ -4058,7 +3915,7 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
End If End If
Else Else
LOGGER.Debug("Now the final indexing...") LOGGER.Debug("Now the final indexing...")
@ -4090,12 +3947,12 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
End If End If
End If End If
If oErrorOcurred = True Then If oErrorOcurred = True Then
ItemWorked = False _ItemWorked = False
Exit For Exit For
End If End If
Next Next
@ -4251,7 +4108,7 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
End If End If
End If End If
@ -4265,7 +4122,7 @@ Public Class frmValidator
My.Settings.Save() My.Settings.Save()
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
LOGGER.Info("Unexpected error in Finish: " & ex.Message, True) LOGGER.Info("Unexpected error in Finish: " & ex.Message, True)
Exit Sub Exit Sub
End Try End Try
@ -4275,7 +4132,7 @@ Public Class frmValidator
errormessage = oErrMsgMissingInput errormessage = oErrMsgMissingInput
frmError.ShowDialog() frmError.ShowDialog()
oErrorOcurred = True oErrorOcurred = True
ItemWorked = False _ItemWorked = False
Exit Sub Exit Sub
End If End If
Else Else
@ -4288,7 +4145,7 @@ Public Class frmValidator
End If End If
If oErrorOcurred = True Then If oErrorOcurred = True Then
MsgBox("Unhandled error occured ... please check your log!", MsgBoxStyle.Exclamation, ADDITIONAL_TITLE) MsgBox("Unhandled error occured ... please check your log!", MsgBoxStyle.Exclamation, ADDITIONAL_TITLE)
ItemWorked = False _ItemWorked = False
Else Else
LOGGER.Debug("Validation of document ended successfully!") LOGGER.Debug("Validation of document ended successfully!")
Dim oPROCSQL = $"EXEC PRPM_CHECK_NEXT_WF {CURRENT_DOC_GUID}" Dim oPROCSQL = $"EXEC PRPM_CHECK_NEXT_WF {CURRENT_DOC_GUID}"
@ -4443,8 +4300,8 @@ Public Class frmValidator
End If End If
oControlId = oControlRow.Item("GUID") oControlId = oControlRow.Item("GUID")
Dim oRegexMatch As String = GenericEx.NotNull(oControlRow.Item("REGEX_MATCH"), String.Empty) Dim oRegexMatch As String = ObjectEx.NotNull(oControlRow.Item("REGEX_MATCH"), String.Empty)
Dim oRegexMessage As String = GenericEx.NotNull(oControlRow.Item("REGEX_MESSAGE_DE"), String.Empty) Dim oRegexMessage As String = ObjectEx.NotNull(oControlRow.Item("REGEX_MESSAGE_DE"), String.Empty)
oControlName = oControlRow.Item("CTRL_NAME") oControlName = oControlRow.Item("CTRL_NAME")
Dim oOVERWRITE_DATA = oControlRow.Item("OVERWRITE_DATA") Dim oOVERWRITE_DATA = oControlRow.Item("OVERWRITE_DATA")
@ -5265,7 +5122,7 @@ Public Class frmValidator
Dim oValueList As New List(Of String) Dim oValueList As New List(Of String)
For Each item As Object In oRow.ItemArray For Each item As Object In oRow.ItemArray
item = GenericEx.NotNull(item, String.Empty) item = ObjectEx.NotNull(item, String.Empty)
' Convert to string using InvariantCulture, so converting back from string does not screw up values ' Convert to string using InvariantCulture, so converting back from string does not screw up values
If TypeOf item IsNot String Then If TypeOf item IsNot String Then
item = String.Format(CultureInfo.InvariantCulture, "{0}", item) item = String.Format(CultureInfo.InvariantCulture, "{0}", item)
@ -5416,35 +5273,6 @@ Public Class frmValidator
Finish_WFStep() Finish_WFStep()
End Sub End Sub
Private Sub btnNavigatorfirst_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs)
If e.Button = Windows.Forms.MouseButtons.Left Then
navStep = "first"
End If
End Sub
Private Sub btnNavigatorprevious_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs)
If e.Button = Windows.Forms.MouseButtons.Left Then
navStep = "previous"
End If
End Sub
Private Sub btnNavigatornext_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs)
If e.Button = Windows.Forms.MouseButtons.Left Then
navStep = "next"
End If
End Sub
Private Sub btnNavigatorlast_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs)
If e.Button = Windows.Forms.MouseButtons.Left Then
navStep = "last"
End If
End Sub
Private Sub frmValidation_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left Then
navStep = Nothing
End If
End Sub
Sub Datei_ueberspringen() Sub Datei_ueberspringen()
Try Try
LOGGER.Debug("Skipping document....(Datei_ueberspringen)") LOGGER.Debug("Skipping document....(Datei_ueberspringen)")
@ -5606,7 +5434,7 @@ Public Class frmValidator
End Sub End Sub
Private Sub frmValidator_Resize(sender As Object, e As EventArgs) Handles Me.Resize Private Sub frmValidator_Resize(sender As Object, e As EventArgs) Handles Me.Resize
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
@ -5860,7 +5688,7 @@ Public Class frmValidator
Private Sub BarCheckItemLoadOnClick_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles Attmnt_bbtnitm_LoadonClick.CheckedChanged Private Sub BarCheckItemLoadOnClick_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles Attmnt_bbtnitm_LoadonClick.CheckedChanged
If FormLoaded = False Then If _FormLoaded = False Then
Exit Sub Exit Sub
End If End If
CONFIG.Config.ADDITIONAL_SEARCHES_LOAD_ONCLICK = Attmnt_bbtnitm_LoadonClick.Checked CONFIG.Config.ADDITIONAL_SEARCHES_LOAD_ONCLICK = Attmnt_bbtnitm_LoadonClick.Checked