3 Commits

Author SHA1 Message Date
Jonathan Jenne
3d95847c61 Version 2.4.4.2 2023-06-13 09:13:12 +02:00
Jonathan Jenne
12c36eeb92 WIP move grid functions to extra class 2023-06-13 09:12:45 +02:00
Jonathan Jenne
22691f30c4 clean up 2023-06-09 08:57:52 +02:00
7 changed files with 428 additions and 472 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

@@ -155,19 +155,6 @@ Public Class ClassControlCreator
' ----------------------- NEW CONTROLS -----------------------
'Public Function CreateNewTextBox(location As Point) As TextBox
' Dim control As New TextBox With {
' .Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}",
' .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
' .Location = location,
' .ReadOnly = True,
' .BackColor = Color.White,
' .Cursor = Cursors.Hand
' }
' Return control
'End Function
Public Function CreateNewTextBox(location As Point) As TextEdit
Dim control As New TextEdit With {
.Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}",
@@ -264,9 +251,9 @@ Public Class ClassControlCreator
.Name = $"{PREFIX_TABLE}_{clsTools.ShortGuid}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
.Cursor = Cursors.Hand,
.Location = location
.Location = location,
.UseEmbeddedNavigator = True
}
oControl.UseEmbeddedNavigator = True
oControl.ForceInitialize()
Dim oView As GridView = oControl.DefaultView
oView.OptionsView.ShowGroupPanel = False
@@ -302,37 +289,6 @@ Public Class ClassControlCreator
' ----------------------- EXISITING CONTROLS -----------------------
'Public Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As TextBox
' Try
' Dim control As TextBox = CreateBaseControl(New TextBox(), oControlRow, designMode)
' control.BackColor = Color.White
' If oControlRow.Item("HEIGHT") > 27 Then
' control.Multiline = True
' End If
' control.Height = oControlRow.Item("HEIGHT")
' control.Width = oControlRow.Item("WIDTH")
' If Not designMode Then
' control.AcceptsReturn = True
' control.ReadOnly = oControlRow.Item("READ_ONLY")
' control.TabStop = Not oControlRow.Item("READ_ONLY")
' control.BackColor = IIf(oControlRow.Item("READ_ONLY"), Color.LightGray, Color.White)
' control.ScrollBars = ScrollBars.Vertical
' Else
' control.ReadOnly = True
' End If
' Return control
' Catch ex As Exception
' Logger.Error(ex)
' End Try
'End Function
Public Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As BaseEdit
Try
Dim oHeight = oControlRow.ItemEx("HEIGHT", 0)
@@ -349,17 +305,11 @@ Public Class ClassControlCreator
oControl = CreateBaseControl(New TextEdit(), oControlRow, designMode)
End If
'Dim oControl As TextEdit = CreateBaseControl(New TextEdit(), oControlRow, designMode)
Dim oMeta As ControlMetadata = oControl.Tag
oControl.BackColor = Color.White
oMeta.BackColor = Color.White
' TODO: Add separate function for MultilineEdit
'If oControlRow.Item("HEIGHT") > 27 Then
' control.Multiline = True
'End If
oControl.Height = oHeight
oControl.Width = oWidth
@@ -380,10 +330,6 @@ Public Class ClassControlCreator
oControl.Properties.EditFormat.FormatType = FormatType.Custom
oControl.Properties.EditFormat.FormatString = ClassFormat.GetFormatString(oFormatString)
End If
'TODO: Find alternatives for TextEdit
'control.ScrollBars = ScrollBars.Vertical
'control.AcceptsReturn = True
Else
oControl.ReadOnly = True
End If
@@ -391,6 +337,7 @@ Public Class ClassControlCreator
Return oControl
Catch ex As Exception
Logger.Error(ex)
Return Nothing
End Try
End Function
@@ -407,6 +354,7 @@ Public Class ClassControlCreator
Return control
End Function
Public Function CreateExistingButton(row As DataRow, designMode As Boolean) As Button
Dim oControl As Button = CreateBaseControl(New Button(), row, designMode)
@@ -524,9 +472,9 @@ Public Class ClassControlCreator
End Function
Public Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean) As GridControl
Dim oGridControlCreator = New ControlCreator.GridControl(LogConfig, GridTables)
Dim oControl As GridControl = CreateBaseControl(New GridControl(), row, designMode)
Dim oControlId = DirectCast(oControl.Tag, ControlMetadata).Guid
Dim oDatatable As New DataTable
Dim oView As GridView
oControl.ForceInitialize()
@@ -593,64 +541,8 @@ Public Class ClassControlCreator
GridTables.Add(oControlId, New Dictionary(Of String, RepositoryItem)())
End If
For Each oRow As DataRow In DT_MY_COLUMNS.Rows
' Create Columns in Datatable
Dim oColumn = New DataColumn() With {
.ColumnName = oRow.Item("SPALTENNAME"),
.Caption = oRow.Item("SPALTEN_HEADER_LANG"),
.ReadOnly = False
}
Select Case oRow.Item("TYPE_COLUMN")
Case CONTROL_TYPE_TEXT
oColumn.DataType = GetType(String)
Case CONTROL_TYPE_INTEGER
oColumn.DataType = GetType(Integer)
Case CONTROL_TYPE_DOUBLE
oColumn.DataType = GetType(Double)
Case CONTROL_TYPE_CURRENCY
oColumn.DataType = GetType(Double)
Case CONTROL_TYPE_BOOLEAN
oColumn.DataType = GetType(Boolean)
Case Else
oColumn.DataType = GetType(String)
End Select
oDatatable.Columns.Add(oColumn)
' Fetch and cache Combobox results
Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
If oConnectionId > 0 And oSqlCommand <> "" Then
Try
Dim oComboboxDataTable As DataTable = Nothing
Dim oColumnName As String = oRow.Item("SPALTENNAME")
Logger.Debug("Working on SQL for Column[{0}]...", oColumnName)
If Not clsPatterns.HasComplexPatterns(oSqlCommand) Then
Logger.Debug("SQL has no complex patterns!")
'oComboboxDataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
oComboboxDataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With {
.ConnectionId = oConnectionId
})
Else
Logger.Debug("...has complex patterns!!")
End If
Dim oRepositoryItem = GridTables_GetRepositoryItemForColumn(oColumnName, oComboboxDataTable, oRow.Item("ADVANCED_LOOKUP"))
If GridTables.Item(oControlId).ContainsKey(oColumnName) Then
GridTables.Item(oControlId).Item(oColumnName) = oRepositoryItem
Else
GridTables.Item(oControlId).Add(oColumnName, oRepositoryItem)
End If
Catch ex As Exception
Logger.Warn("Could not load data for column {0} in control {1}", oRow.Item("SPALTENNAME"), oControl.Name)
Logger.Error(ex)
End Try
End If
Next
Dim oDataTable = oGridControlCreator.CreateGridColumns(DT_MY_COLUMNS)
GridTables = oGridControlCreator.FillGridTables(DT_MY_COLUMNS, oControlId, oControl.Name)
oView.PopulateColumns(oDatatable)
oControl.DataSource = oDatatable
oControl.RefreshDataSource()
@@ -679,79 +571,80 @@ Public Class ClassControlCreator
End Try
End If
oGridControlCreator.ConfigureViewColumns(DT_MY_COLUMNS, oView)
Dim oShouldDisplayFooter As Boolean = False
' Dim oShouldDisplayFooter As Boolean = False
'
'For Each oCol As GridColumn In oView.Columns
' Dim oColumnData As DataRow = DT_MY_COLUMNS.
' Select($"SPALTENNAME = '{oCol.FieldName}'").
' FirstOrDefault()
For Each oCol As GridColumn In oView.Columns
Dim oColumnData As DataRow = DT_MY_COLUMNS.
Select($"SPALTENNAME = '{oCol.FieldName}'").
FirstOrDefault()
' If oColumnData Is Nothing Then
' Continue For
' End If
If oColumnData Is Nothing Then
Continue For
End If
' Dim oSequence As Integer = oColumnData.Item("SEQUENCE")
' oCol.VisibleIndex = oSequence
Dim oSequence As Integer = oColumnData.Item("SEQUENCE")
oCol.VisibleIndex = oSequence
' Dim oColumnType As String = oColumnData.Item("TYPE_COLUMN")
Dim oColumnType As String = oColumnData.Item("TYPE_COLUMN")
' Select Case oColumnType
' Case "INTEGER"
' oCol.DisplayFormat.FormatType = FormatType.Custom
' oCol.DisplayFormat.FormatString = "N0"
Select Case oColumnType
Case "INTEGER"
oCol.DisplayFormat.FormatType = FormatType.Custom
oCol.DisplayFormat.FormatString = "N0"
' Case "DOUBLE"
' oCol.DisplayFormat.FormatType = FormatType.Custom
' oCol.DisplayFormat.FormatString = "N2"
Case "DOUBLE"
oCol.DisplayFormat.FormatType = FormatType.Custom
oCol.DisplayFormat.FormatString = "N2"
' Case "CURRENCY"
' oCol.DisplayFormat.FormatType = FormatType.Custom
' oCol.DisplayFormat.FormatString = "C2"
' End Select
Case "CURRENCY"
oCol.DisplayFormat.FormatType = FormatType.Custom
oCol.DisplayFormat.FormatString = "C2"
End Select
' Dim oSummaryFunction As String = oColumnData.Item("SUMMARY_FUNCTION")
Dim oSummaryFunction As String = oColumnData.Item("SUMMARY_FUNCTION")
' Select Case oSummaryFunction
' Case AGGREGATE_TOTAL_INTEGER
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
' oCol.SummaryItem.DisplayFormat = "SUM: {0:N0}"
' oShouldDisplayFooter = True
Select Case oSummaryFunction
Case AGGREGATE_TOTAL_INTEGER
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
oCol.SummaryItem.DisplayFormat = "SUM: {0:N0}"
oShouldDisplayFooter = True
' Case AGGREGATE_TOTAL_FLOAT
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
' oCol.SummaryItem.DisplayFormat = "SUM: {0:N2}"
' oShouldDisplayFooter = True
Case AGGREGATE_TOTAL_FLOAT
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
oCol.SummaryItem.DisplayFormat = "SUM: {0:N2}"
oShouldDisplayFooter = True
' Case AGGREGATE_TOTAL_CURRENCY
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
' oCol.SummaryItem.DisplayFormat = "SUM: {0:C2}"
' oShouldDisplayFooter = True
Case AGGREGATE_TOTAL_CURRENCY
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
oCol.SummaryItem.DisplayFormat = "SUM: {0:C2}"
oShouldDisplayFooter = True
' Case AGGREGATE_TOTAL_AVG
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Average
' oCol.SummaryItem.DisplayFormat = "AVG: {0}"
' oShouldDisplayFooter = True
Case AGGREGATE_TOTAL_AVG
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Average
oCol.SummaryItem.DisplayFormat = "AVG: {0}"
oShouldDisplayFooter = True
' Case AGGREGATE_TOTAL_MAX
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max
' oCol.SummaryItem.DisplayFormat = "MAX: {0}"
' oShouldDisplayFooter = True
Case AGGREGATE_TOTAL_MAX
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max
oCol.SummaryItem.DisplayFormat = "MAX: {0}"
oShouldDisplayFooter = True
' Case AGGREGATE_TOTAL_MIN
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Min
' oCol.SummaryItem.DisplayFormat = "MIN: {0}"
' oShouldDisplayFooter = True
Case AGGREGATE_TOTAL_MIN
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Min
oCol.SummaryItem.DisplayFormat = "MIN: {0}"
oShouldDisplayFooter = True
' Case AGGREGATE_TOTAL_COUNT
' oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count
' oCol.SummaryItem.DisplayFormat = "NUM: {0}"
' oShouldDisplayFooter = True
Case AGGREGATE_TOTAL_COUNT
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count
oCol.SummaryItem.DisplayFormat = "NUM: {0}"
oShouldDisplayFooter = True
End Select
Next
oView.OptionsView.ShowFooter = oShouldDisplayFooter
' End Select
'Next
'
' oView.OptionsView.ShowFooter = oShouldDisplayFooter
AddHandler oView.InitNewRow, Sub(sender As Object, e As InitNewRowEventArgs)
Try
@@ -817,18 +710,7 @@ Public Class ClassControlCreator
AddHandler oView.ShowingEditor, AddressOf View_ShowingEditor
AddHandler oView.ShownEditor, AddressOf View_ShownEditor
AddHandler oView.ValidateRow, AddressOf View_ValidateRow
AddHandler oControl.LostFocus, Sub(sender As GridControl, e As EventArgs)
Dim oView2 As GridView = sender.FocusedView
' 19.08.2022:
' Calling UpdateCurrentRow when newRowModified Is true
' leads to some weird jumping of focus in the current cell.
' This seems to fix it.
If newRowModified = False Then
oView2.UpdateCurrentRow()
End If
End Sub
AddHandler oControl.LostFocus, AddressOf Control_LostFocus
' 08.11.2021: Fix editor being empty on first open
oView.FocusInvalidRow()
@@ -838,6 +720,18 @@ Public Class ClassControlCreator
Private newRowModified As Boolean = False
Private Sub Control_LostFocus(sender As GridControl, e As EventArgs)
Dim oView2 As GridView = sender.FocusedView
' 19.08.2022:
' Calling UpdateCurrentRow when newRowModified Is true
' leads to some weird jumping of focus in the current cell.
' This seems to fix it.
If newRowModified = False Then
oView2.UpdateCurrentRow()
End If
End Sub
Private Sub View_ShowingEditor(sender As Object, e As CancelEventArgs)
Dim view As GridView = TryCast(sender, GridView)
Logger.Debug("Showing editor.")

View File

@@ -0,0 +1,21 @@
Namespace ControlCreator
Public Class Constants
Public Const CONTROL_TYPE_TEXT = "TEXT"
Public Const CONTROL_TYPE_INTEGER = "INTEGER"
Public Const CONTROL_TYPE_BOOLEAN = "BOOLEAN"
Public Const CONTROL_TYPE_DOUBLE = "DOUBLE"
Public Const CONTROL_TYPE_CURRENCY = "CURRENCY"
Public Const CONTROL_TYPE_DATE = "DATE"
Public Const CONTROL_TYPE_DATETIME = "DATETIME"
Public Const AGGREGATE_NONE = "NONE"
Public Const AGGREGATE_TOTAL_INTEGER = "TOTAL_INTEGER"
Public Const AGGREGATE_TOTAL_FLOAT = "TOTAL_FLOAT"
Public Const AGGREGATE_TOTAL_CURRENCY = "TOTAL_CURRENCY"
Public Const AGGREGATE_TOTAL_MIN = "TOTAL_MIN"
Public Const AGGREGATE_TOTAL_MAX = "TOTAL_MAX"
Public Const AGGREGATE_TOTAL_AVG = "TOTAL_AVG"
Public Const AGGREGATE_TOTAL_COUNT = "TOTAL_COUNT"
End Class
End Namespace

View File

@@ -0,0 +1,215 @@
Imports DevExpress.Utils
Imports DevExpress.XtraEditors
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraGrid.Views.Grid
Imports DigitalData.Controls.LookupGrid
Imports DigitalData.Modules.EDMI.API.Constants
Imports DigitalData.Modules.EDMI.API.DatabaseWithFallback
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Base
Imports System.ComponentModel
Namespace ControlCreator
Public Class GridControl
Private ReadOnly _LogConfig As LogConfig
Private ReadOnly _GridTables As Dictionary(Of Integer, Dictionary(Of String, RepositoryItem))
Public Sub New(pLogConfig As LogConfig, pGridTables As Dictionary(Of Integer, Dictionary(Of String, RepositoryItem)))
_LogConfig = pLogConfig
_GridTables = pGridTables
End Sub
Public Function CreateGridColumns(pColumnTable As DataTable) As DataTable
Dim oDataTable As New DataTable
For Each oRow As DataRow In pColumnTable.Rows
' Create Columns in Datatable
Dim oColumn = New DataColumn() With {
.ColumnName = oRow.Item("SPALTENNAME"),
.Caption = oRow.Item("SPALTEN_HEADER_LANG"),
.ReadOnly = False
}
Select Case oRow.Item("TYPE_COLUMN")
Case Constants.CONTROL_TYPE_TEXT
oColumn.DataType = GetType(String)
Case Constants.CONTROL_TYPE_INTEGER
oColumn.DataType = GetType(Integer)
Case Constants.CONTROL_TYPE_DOUBLE
oColumn.DataType = GetType(Double)
Case Constants.CONTROL_TYPE_CURRENCY
oColumn.DataType = GetType(Double)
Case Constants.CONTROL_TYPE_BOOLEAN
oColumn.DataType = GetType(Boolean)
Case Else
oColumn.DataType = GetType(String)
End Select
oDataTable.Columns.Add(oColumn)
Next
Return oDataTable
End Function
Public Function FillGridTables(pColumnTable As DataTable, pControlId As Integer, pControlName As String) As Dictionary(Of Integer, Dictionary(Of String, RepositoryItem))
For Each oRow As DataRow In pColumnTable.Rows
' Fetch and cache Combobox results
Dim oConnectionId As Integer = oRow.ItemEx("CONNECTION_ID", 0)
Dim oSqlCommand As String = oRow.ItemEx("SQL_COMMAND", "")
If oConnectionId > 0 And oSqlCommand <> "" Then
Try
Dim oComboboxDataTable As DataTable = Nothing
Dim oColumnName As String = oRow.Item("SPALTENNAME")
LOGGER.Debug("Working on SQL for Column[{0}]...", oColumnName)
If Not clsPatterns.HasComplexPatterns(oSqlCommand) Then
LOGGER.Debug("SQL has no complex patterns!")
'oComboboxDataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
oComboboxDataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(oSqlCommand, DatabaseType.ECM) With {
.ConnectionId = oConnectionId
})
Else
LOGGER.Debug("...has complex patterns!!")
End If
Dim oRepositoryItem = GridTables_GetRepositoryItemForColumn(oColumnName, oComboboxDataTable, oRow.Item("ADVANCED_LOOKUP"))
If _GridTables.Item(pControlId).ContainsKey(oColumnName) Then
_GridTables.Item(pControlId).Item(oColumnName) = oRepositoryItem
Else
_GridTables.Item(pControlId).Add(oColumnName, oRepositoryItem)
End If
Catch ex As Exception
LOGGER.Warn("Could not load data for column {0} in control {1}", oRow.Item("SPALTENNAME"), pControlName)
LOGGER.Error(ex)
End Try
End If
Next
Return _GridTables
End Function
Private Function GridTables_GetRepositoryItemForColumn(pColumnName As String, pDataTable As DataTable, pIsAdvancedLookup As Boolean) As RepositoryItem
If pIsAdvancedLookup Then
Dim oEditor = New RepositoryItemLookupControl3
If pDataTable IsNot Nothing Then
oEditor.DisplayMember = pDataTable.Columns.Item(0).ColumnName
oEditor.ValueMember = pDataTable.Columns.Item(0).ColumnName
oEditor.DataSource = pDataTable
End If
Return oEditor
Else
Dim oEditor = New RepositoryItemComboBox()
Dim oItems As New List(Of String)
AddHandler oEditor.Validating, Sub(_sender As ComboBoxEdit, _e As CancelEventArgs)
If oItems.Contains(_sender.EditValue) Then
_e.Cancel = False
Else
_e.Cancel = True
End If
End Sub
If pDataTable IsNot Nothing Then
For Each oRow2 As DataRow In pDataTable.Rows
Dim oValue = oRow2.Item(0)
Try
If oRow2.ItemArray.Length > 1 Then
oValue &= $" | {oRow2.Item(1)}"
End If
Catch ex As Exception
End Try
oEditor.Items.Add(oValue)
oItems.Add(oValue)
Next
End If
Return oEditor
End If
End Function
Public Sub ConfigureViewColumns(pColumnTable As DataTable, pGridView As GridView)
Dim oShouldDisplayFooter As Boolean = False
For Each oCol As GridColumn In pGridView.Columns
Dim oColumnData As DataRow = pColumnTable.
Select($"SPALTENNAME = '{oCol.FieldName}'").
FirstOrDefault()
If oColumnData Is Nothing Then
Continue For
End If
Dim oSequence As Integer = oColumnData.Item("SEQUENCE")
oCol.VisibleIndex = oSequence
Dim oColumnType As String = oColumnData.Item("TYPE_COLUMN")
Select Case oColumnType
Case "INTEGER"
oCol.DisplayFormat.FormatType = FormatType.Custom
oCol.DisplayFormat.FormatString = "N0"
Case "DOUBLE"
oCol.DisplayFormat.FormatType = FormatType.Custom
oCol.DisplayFormat.FormatString = "N2"
Case "CURRENCY"
oCol.DisplayFormat.FormatType = FormatType.Custom
oCol.DisplayFormat.FormatString = "C2"
End Select
Dim oSummaryFunction As String = oColumnData.Item("SUMMARY_FUNCTION")
Select Case oSummaryFunction
Case Constants.AGGREGATE_TOTAL_INTEGER
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
oCol.SummaryItem.DisplayFormat = "SUM: {0:N0}"
oShouldDisplayFooter = True
Case Constants.AGGREGATE_TOTAL_FLOAT
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
oCol.SummaryItem.DisplayFormat = "SUM: {0:N2}"
oShouldDisplayFooter = True
Case Constants.AGGREGATE_TOTAL_CURRENCY
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Sum
oCol.SummaryItem.DisplayFormat = "SUM: {0:C2}"
oShouldDisplayFooter = True
Case Constants.AGGREGATE_TOTAL_AVG
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Average
oCol.SummaryItem.DisplayFormat = "AVG: {0}"
oShouldDisplayFooter = True
Case Constants.AGGREGATE_TOTAL_MAX
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max
oCol.SummaryItem.DisplayFormat = "MAX: {0}"
oShouldDisplayFooter = True
Case Constants.AGGREGATE_TOTAL_MIN
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Min
oCol.SummaryItem.DisplayFormat = "MIN: {0}"
oShouldDisplayFooter = True
Case Constants.AGGREGATE_TOTAL_COUNT
oCol.SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Count
oCol.SummaryItem.DisplayFormat = "NUM: {0}"
oShouldDisplayFooter = True
End Select
Next
pGridView.OptionsView.ShowFooter = oShouldDisplayFooter
End Sub
End Class
End Namespace

View File

@@ -13,7 +13,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyCompany("Digital Data")>
<Assembly: AssemblyProduct("TaskFlow")>
<Assembly: AssemblyCopyright("Copyright © Digital Data 2023")>
<Assembly: AssemblyTrademark("2.4.4.1")>
<Assembly: AssemblyTrademark("2.4.4.2")>
<Assembly: ComVisible(False)>
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("2.4.4.1")>
<Assembly: AssemblyVersion("2.4.4.2")>
<Assembly: AssemblyFileVersion("1.0.0.0")>

View File

@@ -282,6 +282,8 @@
<Compile Include="ClassWorkDoc.vb" />
<Compile Include="clsPatterns.vb" />
<Compile Include="clsWMDocGrid.vb" />
<Compile Include="ControlCreator\Constants.vb" />
<Compile Include="ControlCreator\GridControl.vb" />
<Compile Include="FinalIndexDataSet.Designer.vb">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>

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
@@ -2586,9 +2445,6 @@ Public Class frmValidator
End If
End If
FillIndexValues(first)
For Each oControl As Control In PanelValidatorControl.Controls
@@ -3023,7 +2879,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 +2940,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 +3424,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 +3596,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 +3607,7 @@ Public Class frmValidator
_frmValidatorSearch?.BringToFront()
End If
FormLoaded = True
_FormLoaded = True
Try
If USER_GHOST_MODE_ACTIVE Then
BbtnitmSave.Enabled = False
@@ -3944,7 +3798,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 +3841,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 +3853,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 +3867,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 +3912,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 +3944,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 +4105,7 @@ Public Class frmValidator
My.Settings.Save()
frmError.ShowDialog()
oErrorOcurred = True
ItemWorked = False
_ItemWorked = False
End If
End If
@@ -4265,7 +4119,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 +4129,7 @@ Public Class frmValidator
errormessage = oErrMsgMissingInput
frmError.ShowDialog()
oErrorOcurred = True
ItemWorked = False
_ItemWorked = False
Exit Sub
End If
Else
@@ -4288,7 +4142,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 +4297,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 +5119,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 +5270,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 +5431,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 +5685,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