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.Info("Error in Insert_LogEntry: " & ex.Message)
End Try
End Function
Public Function ExecuteonMSSQL(ByVal sqlcommand As String, ConString As String)
Try
' die nötigen Variablen definieren

View File

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