WIP lookup grid with depending controls

This commit is contained in:
Jonathan Jenne 2021-09-30 16:35:43 +02:00
parent 33ddd7a28b
commit 9d123727d4
9 changed files with 533 additions and 346 deletions

View File

@ -37,7 +37,10 @@ Public Class ClassControlCreator
Public Const PREFIX_LINE = "LINE"
Public Const PREFIX_BUTTON = "BTN"
Public Shared GridTables As New Dictionary(Of String, Dictionary(Of String, DataTable))
''' <summary>
''' Saves the column data for each grid and each column in that grid
''' </summary>
Public Shared Property GridTables As New Dictionary(Of Integer, Dictionary(Of String, RepositoryItem))
''' <summary>
''' Standard Eigenschaften für alle Controls
@ -406,8 +409,9 @@ Public Class ClassControlCreator
Return control
End Function
Public Shared Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean) As GridControl
Public Shared Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean, pPanel As Panel) As GridControl
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
@ -420,6 +424,8 @@ Public Class ClassControlCreator
If Not designMode Then
oView.OptionsBehavior.Editable = Not row.Item("READ_ONLY")
oView.OptionsBehavior.ReadOnly = row.Item("READ_ONLY")
'oView.OptionsBehavior.EditorShowMode = EditorShowMode.Click
oControl.UseEmbeddedNavigator = Not row.Item("READ_ONLY")
If row.Item("VKT_ADD_ITEM") = True Then
@ -450,10 +456,10 @@ Public Class ClassControlCreator
End With
If GridTables.ContainsKey(oControl.Name) Then
GridTables.Item(oControl.Name).Clear()
If GridTables.ContainsKey(oControlId) Then
GridTables.Item(oControlId).Clear()
Else
GridTables.Add(oControl.Name, New Dictionary(Of String, DataTable)())
GridTables.Add(oControlId, New Dictionary(Of String, RepositoryItem)())
End If
For Each oRow As DataRow In DT_MY_COLUMNS.Rows
@ -472,25 +478,27 @@ Public Class ClassControlCreator
Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
If Not clsPatterns.HasComplexPatterns(oSqlCommand) Then
If oConnectionId > 0 And oSqlCommand <> "" Then
Try
Dim oComboboxDataTable As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
If oConnectionId > 0 And oSqlCommand <> "" Then
Try
Dim oComboboxDataTable As DataTable = Nothing
Dim oColumnName As String = oRow.Item("SPALTENNAME")
If oComboboxDataTable Is Nothing Then
LOGGER.Warn("DataTable for SQL [{0}] is nothing. Possible error on SQL Query.")
End If
If Not clsPatterns.HasComplexPatterns(oSqlCommand) Then
oComboboxDataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
End If
GridTables.Item(oControl.Name).Add(oRow.Item("SPALTENNAME"), oComboboxDataTable)
'GridTables.Add(oRow.Item("SPALTENNAME"), oComboboxDataTable)
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
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
oView.PopulateColumns(oDatatable)
@ -509,55 +517,132 @@ Public Class ClassControlCreator
AddHandler oView.CustomRowCellEdit, Sub(sender As Object, e As CustomRowCellEditEventArgs)
Try
For Each oRow As DataRow In DT_MY_COLUMNS.Rows
If oRow.Item("SPALTENNAME") = e.Column.FieldName Then
If GridTables.Item(oControl.Name).ContainsKey(e.Column.FieldName) Then
Dim oComboboxDataTable As DataTable = GridTables.Item(oControl.Name).Item(e.Column.FieldName)
If oComboboxDataTable Is Nothing Then
Throw New ApplicationException($"ComboboxTable for Column {e.Column.FieldName} is empty.")
End If
If oRow.Item("ADVANCED_LOOKUP") And oComboboxDataTable IsNot Nothing Then
Dim oEditor = New RepositoryItemLookupControl3 With {
.DataSource = oComboboxDataTable,
.DisplayMember = oComboboxDataTable.Columns.Item(0).ColumnName,
.ValueMember = oComboboxDataTable.Columns.Item(0).ColumnName
}
'AddHandler oEditor.SelectedValuesChanged, Sub(_sender As Object, _e As List(Of String))
' oView.PostEditor()
' End Sub
e.RepositoryItem = 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
For Each oRow2 As DataRow In oComboboxDataTable.Rows
Dim oValue = oRow2.Item(0)
Try
oValue &= $" | {oRow2.Item(1)}"
Catch ex As Exception
End Try
oEditor.Items.Add(oValue)
oItems.Add(oValue)
Next
e.RepositoryItem = oEditor
End If
End If
If oRow.Item("SPALTENNAME") <> e.Column.FieldName Then
Continue For
End If
If Not GridTables.Item(oControlId).ContainsKey(e.Column.FieldName) Then
Continue For
End If
Dim oEditor = GridTables.Item(oControlId).Item(e.Column.FieldName)
e.RepositoryItem = oEditor
#Region "Old Stuff"
'Dim oComboboxDataTable As DataTable = GridTables.Item(oControlId).Item(e.Column.FieldName)
'If oComboboxDataTable Is Nothing Then
' Throw New ApplicationException($"ComboboxTable for Column {e.Column.FieldName} is empty.")
'End If
'If oRow.Item("ADVANCED_LOOKUP") Then
' Dim oEditor = New RepositoryItemLookupControl3
' If oComboboxDataTable IsNot Nothing Then
' oEditor.DisplayMember = oComboboxDataTable.Columns.Item(0).ColumnName
' oEditor.ValueMember = oComboboxDataTable.Columns.Item(0).ColumnName
' oEditor.DataSource = oComboboxDataTable
' End If
' 'AddHandler oEditor.SelectedValuesChanged, Sub(_sender As Object, _e As List(Of String))
' ' oView.PostEditor()
' ' End Sub
' 'AddHandler oEditor.BeforePopup, Sub(_sender As Object, _e As EventArgs)
' ' MsgBox("oEditor.BeforePopup")
' ' Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
' ' Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
' ' oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, pPanel, True)
' ' Dim oTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
' ' oEditor.DataSource = oTable
' ' oEditor.DisplayMember = oComboboxDataTable.Columns.Item(0).ColumnName
' ' oEditor.ValueMember = oComboboxDataTable.Columns.Item(0).ColumnName
' ' End Sub
' 'AddHandler oEditor.QueryPopUp, Sub()
' ' MsgBox("oEditor.QueryPopUp")
' ' End Sub
' 'AddHandler oEditor.Popup, Sub()
' ' MsgBox("oEditor.Popup")
' ' End Sub
' 'AddHandler oEditor.ButtonClick, Sub()
' ' MsgBox("oEditor.ButtonClick")
' ' End Sub
' AddHandler oEditor.ButtonPressed, Sub(_sender As Object, _e As EventArgs)
' Dim oEditor2 = DirectCast(_sender, LookupControl3)
' 'MsgBox("oEditor.ButtonPressed")
' Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
' Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
' oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, pPanel, True)
' Dim oTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
' If oTable IsNot Nothing Then
' oEditor2.Properties.ValueMember = oTable.Columns.Item(0).ColumnName
' oEditor2.Properties.DisplayMember = oTable.Columns.Item(0).ColumnName
' oEditor2.Properties.DataSource = oTable
' oEditor2.DoValidate(PopupCloseMode.Normal)
' End If
' End Sub
' e.RepositoryItem = oEditor
'Else
' If oComboboxDataTable Is Nothing Then
' Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
' Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
' oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, pPanel, True)
' oComboboxDataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
' End If
' If oComboboxDataTable Is Nothing Then
' Continue For
' End If
' 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
' For Each oRow2 As DataRow In oComboboxDataTable.Rows
' Dim oValue = oRow2.Item(0)
' Try
' oValue &= $" | {oRow2.Item(1)}"
' Catch ex As Exception
' End Try
' oEditor.Items.Add(oValue)
' oItems.Add(oValue)
' Next
' e.RepositoryItem = oEditor
'End If
#End Region
Next
Catch ex As Exception
LOGGER.Warn("Error in CustomRowCellEdit for [{0}]", e.CellValue)
@ -565,10 +650,6 @@ Public Class ClassControlCreator
End Try
End Sub
'AddHandler oView.CellValueChanged, Sub(sender As Object, e As CellValueChangedEventArgs)
' Console.WriteLine("")
' End Sub
AddHandler oView.ValidateRow, Sub(sender As Object, e As ValidateRowEventArgs)
Dim oRow As DataRowView = oView.GetRow(oView.FocusedRowHandle)
@ -599,12 +680,18 @@ Public Class ClassControlCreator
AddHandler oView.ValidatingEditor, Sub(sender As Object, e As BaseContainerValidateEditorEventArgs)
Dim oValue As String = NotNull(e.Value, "")
'MsgBox(oValue)
If oValue.Contains(" | ") Then
oValue = oValue.Split(" | ").ToList().First()
e.Value = oValue
End If
End Sub
'oView.FocusInvalidRow()
Return oControl
End Function
@ -738,4 +825,70 @@ Public Class ClassControlCreator
End Try
End Function
Public Shared Sub GridTables_CacheDatatableForColumn(pControlId As Object, pColumnName As Object, pSqlStatement As Object, pConnectionId As Integer, pAdvancedLookup As Boolean)
Try
Dim oTable As DataTable = ClassDatabase.Return_Datatable_ConId(pSqlStatement, pConnectionId)
' If no columns for this control have been added, create an empty dict now
If Not GridTables.ContainsKey(pControlId) Then
GridTables.Add(pControlId, New Dictionary(Of String, RepositoryItem))
End If
Dim oRepositoryItem = GridTables_GetRepositoryItemForColumn(pColumnName, oTable, pAdvancedLookup)
Dim oColumnDictionary = GridTables.Item(pControlId)
If oColumnDictionary.ContainsKey(pColumnName) Then
oColumnDictionary.Item(pColumnName) = oRepositoryItem
Else
oColumnDictionary.Add(pColumnName, oRepositoryItem)
End If
Catch ex As Exception
LOGGER.Error(ex)
End Try
End Sub
Public Shared Function GridTables_GetRepositoryItemForColumn(pColumnName As String, pDataTable As DataTable, pIsAdvancedLookup As Boolean) As RepositoryItem
If pDataTable Is Nothing Then
Return Nothing
End If
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
For Each oRow2 As DataRow In pDataTable.Rows
Dim oValue = oRow2.Item(0)
Try
oValue &= $" | {oRow2.Item(1)}"
Catch ex As Exception
End Try
oEditor.Items.Add(oValue)
oItems.Add(oValue)
Next
Return oEditor
End If
End Function
End Class

View File

@ -104,8 +104,8 @@ Module ModuleRuntimeVariables
Public CURRENT_SQL_COMAMND As String
Public CURRENT_DT_SQL_CONFIG_TABLE As DataTable
Public CURRENT_CLICKED_PROFILE_ID As Integer = 0
Public CURRENT_CLICKED_PROFILE_TITLE As String
Public Property CURRENT_CLICKED_PROFILE_ID As Integer = 0
Public Property CURRENT_CLICKED_PROFILE_TITLE As String
Public DT_CLIENT_USER As DataTable
Public CLIENT_SELECTED As Integer = 0
@ -114,7 +114,7 @@ Module ModuleRuntimeVariables
Public CURR_SELECT_CONTROL As String
Public CURR_CHOICE_LIST As String
Public CURR_DT_DEPENDING_CONTROLS As DataTable 'enthält zur Laufzeit die abhängigen Controls
Public Property CURR_DT_DEPENDING_CONTROLS As DataTable 'enthält zur Laufzeit die abhängigen Controls
Public CURRENT_DT_MASS_CHANGE_DOCS As DataTable

View File

@ -73,6 +73,7 @@ Public Class clsPatterns
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Error in ReplaceAllValues:" & ex.Message)
Return input
End Try
End Function

View File

@ -267,7 +267,7 @@ Public Class frmFormDesigner
Dim oDTColumnsPerDevExGrid As DataTable = Database_ECM.GetDatatable($"SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = {guid} ORDER BY [SEQUENCE]") ', "FDesignLaodControls")
Dim table = ClassControlCreator.CreateExistingGridControl(row, oDTColumnsPerDevExGrid, True)
Dim table = ClassControlCreator.CreateExistingGridControl(row, oDTColumnsPerDevExGrid, True, pnldesigner)
AddHandler table.MouseClick, AddressOf gridControl_MouseClick
' AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick

View File

@ -710,7 +710,9 @@ Public Class frmMain
If IsNumeric(_tag) Then
If CURRENT_CLICKED_PROFILE_ID <> _tag Then
OverviewOrDEtail = "DETAIL"
CURRENT_CLICKED_PROFILE_ID = _tag
LOGGER.Debug("CURRENT_CLICKED_PROFILE_ID set to [{0}]", CURRENT_CLICKED_PROFILE_ID)
CURRENT_CLICKED_PROFILE_TITLE = e.Link.Item.Caption
GRID_LOAD_TYPE = "PROFILE#" & CURRENT_CLICKED_PROFILE_ID.ToString
TimerRefresh.Stop()
@ -1112,7 +1114,6 @@ Public Class frmMain
' Catch ex As Exception
' LOGGER.Warn($"Unexpected Error in freefileforUser [{oUpdate}] - {ex.Message}")
' End Try
'End If
If bwSync.IsBusy Then
@ -1120,16 +1121,14 @@ Public Class frmMain
TimerRefresh_running = False
End If
Try
' SaveGridLayout()
'bwSync.ReportProgress(10)
LoadNavBar()
'bwSync.ReportProgress(60)
Dim oStopWatch As New RefreshHelper.SW("Decide_Load")
Await Decide_Load(False)
oStopWatch.Done()
'bwSync.ReportProgress(95)
If GridControl_Docs.Visible = True And FormOpenClose = False Then RefreshHelper.LoadViewInfo()
If GridControl_Docs.Visible = True And FormOpenClose = False Then
RefreshHelper.LoadViewInfo()
End If
Handling_DEBUG_USER()
Catch ex As Exception
@ -1137,13 +1136,9 @@ Public Class frmMain
End Try
Catch ex As Exception
LOGGER.Error(ex)
Finally
TimerRefresh_running = False
End Try
TimerRefresh_running = False
'BarEditItem1.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
'' call this method to start your asynchronous Task.
'bwSync.RunWorkerAsync()
End Sub
Private Sub NotifyIcon1_Click(sender As System.Object, e As EventArgs) Handles NotifyIcon1.Click
@ -1464,6 +1459,7 @@ Public Class frmMain
If Len(oHitProfilID) > 0 Then
If oHitProfilID > 0 Then
CURRENT_CLICKED_PROFILE_ID = oHitProfilID
LOGGER.Debug("CURRENT_CLICKED_PROFILE_ID set to [{0}]", CURRENT_CLICKED_PROFILE_ID)
End If
End If
@ -2121,9 +2117,11 @@ Public Class frmMain
DXMouseEventArgs.GetMouseArgs(e).Handled = True
GridViewItem_Clicked = "GROUP"
CURRENT_CLICKED_PROFILE_ID = GridView_Docs.GetRowCellValue(GridView_Docs.GetDataRowHandleByGroupRowHandle(hi.RowHandle), GridView_Docs.Columns("PROFILE_ID"))
LOGGER.Debug("CURRENT_CLICKED_PROFILE_ID set to [{0}]", CURRENT_CLICKED_PROFILE_ID)
ElseIf hi.InDataRow Then
GridViewItem_Clicked = "ROW"
CURRENT_CLICKED_PROFILE_ID = GridView_Docs.GetRowCellValue(GridView_Docs.GetDataRowHandleByGroupRowHandle(hi.RowHandle), GridView_Docs.Columns("PROFILE_ID"))
LOGGER.Debug("CURRENT_CLICKED_PROFILE_ID set to [{0}]", CURRENT_CLICKED_PROFILE_ID)
Else
GridViewItem_Clicked = Nothing
End If

View File

@ -369,7 +369,7 @@ Public Class frmMassValidator
LOGGER.Debug("Versuch Tabelle zu laden")
Dim oDTMyColumns As DataTable = Database_ECM.GetDatatable($"SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = {oControlRow.Item("GUID")} ORDER BY SEQUENCE") ', "MV_LoadControls1")
oControl = ClassControlCreator.CreateExistingGridControl(oControlRow, oDTMyColumns, False)
oControl = ClassControlCreator.CreateExistingGridControl(oControlRow, oDTMyColumns, False, pnldesigner)
End Select
If oControl IsNot Nothing AndAlso TypeOf oControl IsNot Label Then

View File

@ -110,6 +110,7 @@ Partial Class frmValidator
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog()
Me.BarButtonItem6 = New DevExpress.XtraBars.BarButtonItem()
CType(Me.SplitContainer2_DV_Chat, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SplitContainer2_DV_Chat.SuspendLayout()
CType(Me.SplitContainer1, System.ComponentModel.ISupportInitialize).BeginInit()
@ -452,9 +453,9 @@ Partial Class frmValidator
'RibbonControl1
'
Me.RibbonControl1.ExpandCollapseItem.Id = 0
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.bsiError, Me.bsiInformation, Me.bsiDocID, Me.BarButtonItemFileView, Me.BarButtonItem3, Me.BarButtonItem4, Me.bbtniRefresh, Me.bbtniRefreshSearches, Me.bbtniNext, Me.bbtniDelete, Me.bbtniAnnotation, Me.bsiInfo1, Me.bsiInfo2, Me.BbtnitmSave, Me.BarButtonItem2, Me.BarLinkContainerItem1, Me.btnitemConversationEnd, Me.bbtnitem_ConversationNew, Me.BarLinkContainerItem2, Me.BarEditItem1, Me.BarEditItem2, Me.BarEditItem3, Me.btnitemConversation_reload, Me.BarButtonItem5, Me.BarButtonItemAttmt, Me.barbtnitmExport})
Me.RibbonControl1.Items.AddRange(New DevExpress.XtraBars.BarItem() {Me.RibbonControl1.ExpandCollapseItem, Me.RibbonControl1.SearchEditItem, Me.bsiError, Me.bsiInformation, Me.bsiDocID, Me.BarButtonItemFileView, Me.BarButtonItem3, Me.BarButtonItem4, Me.bbtniRefresh, Me.bbtniRefreshSearches, Me.bbtniNext, Me.bbtniDelete, Me.bbtniAnnotation, Me.bsiInfo1, Me.bsiInfo2, Me.BbtnitmSave, Me.BarButtonItem2, Me.BarLinkContainerItem1, Me.btnitemConversationEnd, Me.bbtnitem_ConversationNew, Me.BarLinkContainerItem2, Me.BarEditItem1, Me.BarEditItem2, Me.BarEditItem3, Me.btnitemConversation_reload, Me.BarButtonItem5, Me.BarButtonItemAttmt, Me.barbtnitmExport, Me.BarButtonItem6})
resources.ApplyResources(Me.RibbonControl1, "RibbonControl1")
Me.RibbonControl1.MaxItemId = 29
Me.RibbonControl1.MaxItemId = 30
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.PageCategories.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageCategory() {Me.RibbonPageConversations})
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
@ -738,6 +739,7 @@ Partial Class frmValidator
Me.RibbonPageGroup3.ItemLinks.Add(Me.bbtniNext)
Me.RibbonPageGroup3.ItemLinks.Add(Me.bbtniDelete)
Me.RibbonPageGroup3.ItemLinks.Add(Me.bbtniAnnotation)
Me.RibbonPageGroup3.ItemLinks.Add(Me.BarButtonItem6)
Me.RibbonPageGroup3.Name = "RibbonPageGroup3"
resources.ApplyResources(Me.RibbonPageGroup3, "RibbonPageGroup3")
'
@ -774,6 +776,12 @@ Partial Class frmValidator
Me.RibbonPage2.Name = "RibbonPage2"
resources.ApplyResources(Me.RibbonPage2, "RibbonPage2")
'
'BarButtonItem6
'
resources.ApplyResources(Me.BarButtonItem6, "BarButtonItem6")
Me.BarButtonItem6.Id = 29
Me.BarButtonItem6.Name = "BarButtonItem6"
'
'frmValidator
'
Me.Appearance.Options.UseFont = True
@ -899,4 +907,5 @@ Partial Class frmValidator
Friend WithEvents RibbonPageCust As DevExpress.XtraBars.Ribbon.RibbonPageGroup
Friend WithEvents barbtnitmExport As DevExpress.XtraBars.BarButtonItem
Friend WithEvents FolderBrowserDialog1 As FolderBrowserDialog
Friend WithEvents BarButtonItem6 As DevExpress.XtraBars.BarButtonItem
End Class

View File

@ -1063,6 +1063,9 @@
cmVlbiIgLz4NCiAgPC9nPg0KPC9zdmc+Cw==
</value>
</data>
<data name="BarButtonItem6.Caption" xml:space="preserve">
<value>Set Grid Focus (DEBUG)</value>
</data>
<data name="RibbonControl1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 0</value>
</data>
@ -1787,6 +1790,12 @@
<data name="&gt;&gt;FolderBrowserDialog1.Type" xml:space="preserve">
<value>System.Windows.Forms.FolderBrowserDialog, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;BarButtonItem6.Name" xml:space="preserve">
<value>BarButtonItem6</value>
</data>
<data name="&gt;&gt;BarButtonItem6.Type" xml:space="preserve">
<value>DevExpress.XtraBars.BarButtonItem, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>frmValidator</value>
</data>

View File

@ -1,89 +1,97 @@
Imports WINDREAMLib
Imports System.Threading
Imports System.Runtime.InteropServices
Imports Oracle.ManagedDataAccess.Client
Imports Independentsoft
Imports System.IO
Imports System.Text.RegularExpressions
Imports System.ComponentModel
Imports DigitalData.Controls.LookupGrid
Imports DevExpress.XtraGrid
Imports System.Reflection
Imports DigitalData.Controls.ChatControl
Imports DevExpress.XtraEditors.Repository
Imports DigitalData.Modules.EDMI.API
Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraEditors.Controls
Public Class frmValidator
Dim strFileList()
Dim PROFIL_sortbynewest As Boolean
Dim PROFIL_VEKTORINDEX
Dim PROFIL_FINISH_SQL
Dim PROFIL_LOGINDEX
''' <summary>
''' Contains all controls for the current profile
''' </summary>
Private Property DT_CONTROLS As DataTable
Dim oErrMsgMissingInput
''' <summary>
''' Contains all grid columns for the current profile
''' </summary>
Private Property DT_COLUMNS_GRID As DataTable
Private PMDelimiter As String
''' <summary>
''' Contains all grid columns for the current profile which have an sql but don't have a reference to a control
''' </summary>
Private Property DT_COLUMNS_GRID_WITH_SQL As DataTable
Dim WD_Search As String
Dim finalProfile As Boolean
Dim Move2Folder As String
Private DataASorDB As ClassDataASorDB
Private allgFunk As New ClassAllgemeineFunktionen
''' <summary>
''' Contains all grid columns for the current profile which have an sql and have a reference to a control
''' </summary>
Private Property DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER As DataTable
Private Property PROFIL_sortbynewest As Boolean
Private Property PROFIL_VEKTORINDEX
Private Property PROFIL_FINISH_SQL
Private Property PROFIL_LOGINDEX
Private Property oErrMsgMissingInput
Private Property 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 navStep As String = Nothing
Private Property navStep As String = Nothing
Public Shared WMDocPathWindows As String
Public WMDocFileString As String
Private DocPathWindows As String
Dim OLD_Document_Path As String = ""
Dim ValueDTP As Date
Dim AnzDoks As Integer
Dim docCounter As Integer = 1
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
Dim Amount_Docs2Validate As Integer
'Anzahl der validierten Dokumente
Dim Anzahl_validierte_Dok As Integer = 0
Dim me_closing As Boolean = False
Dim first_control As Control
Dim last_control As Control
Dim _Indexe_Loaded As Boolean = False
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 idxerr_message As String = ""
Public Shared Property idxerr_message As String = ""
Private _CURRENT_INDEX_ARRAY(100, 250) As String
Private _frmValidatorSearch As frmValidatorSearch 'You need a reference to Form1
Private _dependingControl_in_action As Boolean = False
Private _dependingColumn_in_action As Boolean = False
Private _SetControlValue_in_action As Boolean = False
Private DTCONTROLS As DataTable
Private DTGRID_COLUMNS_WITH_SQL As DataTable
Private DTGRID_COLUMNS As DataTable
Private DTGRID_SQL_DEFINITION As DataTable
Private DTConversations As DataTable
Private DTDYNAMIC_RIGHTS As DataTable
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 DT_AdditionalSearches_Resultset_Docs As DataTable
Private Right_Conversation_Add As Boolean = False
Private Right_Conversation_Stop As Boolean = False
Private Right_Conversation_Message As Boolean = False
Private Conversation_User_Active As Boolean = False
Private ConversationQUDT_Delete As DataTable
Private Conversation_initialized As Boolean = False
Private Property DTConversations As DataTable
Private Property DTDYNAMIC_RIGHTS As DataTable
Public FormLoaded As Boolean = False
Private ItemWorked As Boolean = False
Private Override As Boolean = False
Private OverrideAll As Boolean = False
Private Override_SQLCommand As String = ""
Private listChangedLookup As New List(Of String)
Private Property DT_AdditionalSearches_Resultset_Docs As DataTable
Private ControlHandleStarted As Boolean = False
Private Property Right_Conversation_Add As Boolean = False
Private Property Right_Conversation_Stop As Boolean = False
Private Property Right_Conversation_Message As Boolean = False
Private Property Conversation_User_Active As Boolean = False
Private Property ConversationQUDT_Delete As DataTable
Private Property Conversation_initialized As Boolean = False
Public Property FormLoaded 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
Public Sub New()
'MyBase.New
@ -706,19 +714,40 @@ Public Class frmValidator
Try
pnldesigner.Controls.Clear()
Dim oSQL = $"SELECT [dbo].[FNPM_LANGUAGE_CONTROL_TEXT] (NAME,'{USER_LANGUAGE}',CTRL_TYPE,CTRL_TEXT) CTRL_CAPTION_LANG, * FROM TBPM_PROFILE_CONTROLS WHERE CONTROL_ACTIVE = 1 AND PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY Y_LOC, X_LOC"
DTCONTROLS = DataASorDB.GetDatatable("DD_ECM", oSQL, "TBPM_PROFILE_CONTROLS_LANGUAGE", $"LANGUAGE = '{USER_LANGUAGE}' AND PROFIL_ID = {CURRENT_ProfilGUID}", "Y_LOC, X_LOC")
oSQL = $"SELECT T1.GUID As CONTROL_ID, T1.PROFIL_ID, T.CONNECTION_ID, T.SQL_COMMAND, T.SPALTENNAME,T.FORMATTYPE,T.FORMATSTRING from TBPM_CONTROL_TABLE T, TBPM_PROFILE_CONTROLS T1 WHERE CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = {CURRENT_ProfilGUID} AND LEN(T.SQL_COMMAND) > 0 AND T.LOAD_AFT_LOAD_CONTROL = 0 ORDER BY T.SEQUENCE"
DTGRID_COLUMNS_WITH_SQL = DataASorDB.GetDatatable("DD_ECM", oSQL, "DTGRID_COLUMNS_WITH_SQL", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
DT_CONTROLS = DataASorDB.GetDatatable("DD_ECM", oSQL, "TBPM_PROFILE_CONTROLS_LANGUAGE", $"LANGUAGE = '{USER_LANGUAGE}' AND PROFIL_ID = {CURRENT_ProfilGUID}", "Y_LOC, X_LOC")
oSQL = $"SELECT T.* from TBPM_CONTROL_TABLE T, TBPM_PROFILE_CONTROLS T1 WHERE T1.CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY T.SEQUENCE"
DTGRID_COLUMNS = DataASorDB.GetDatatable("DD_ECM", oSQL, "TBPM_CONTROL_TABLE", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
DT_COLUMNS_GRID = DataASorDB.GetDatatable("DD_ECM", oSQL, "TBPM_CONTROL_TABLE", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
oSQL = $"SELECT T1.GUID As CONTROL_ID, T1.PROFIL_ID, T.CONNECTION_ID, T.SQL_COMMAND, T.SPALTENNAME,T.FORMATTYPE,T.FORMATSTRING from TBPM_CONTROL_TABLE T, TBPM_PROFILE_CONTROLS T1 WHERE T1.CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = {CURRENT_ProfilGUID} AND LEN(T.SQL_COMMAND) > 0 AND T.LOAD_AFT_LOAD_CONTROL = 1 ORDER BY T.SEQUENCE"
DTGRID_SQL_DEFINITION = DataASorDB.GetDatatable("DD_ECM", oSQL, "DTGRID_SQL_DEFINITION", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
Dim oCount As Integer = 0
oSQL = "SELECT T1.GUID As CONTROL_ID, T1.PROFIL_ID, T.CONNECTION_ID, T.SQL_COMMAND, T.SPALTENNAME,T.FORMATTYPE,T.FORMATSTRING from TBPM_CONTROL_TABLE T, TBPM_PROFILE_CONTROLS T1 WHERE T1.CONTROL_ACTIVE = 1 AND T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = " & CURRENT_ProfilGUID & " AND LEN(T.SQL_COMMAND) > 0 ORDER BY T.SEQUENCE"
DT_COLUMNS_GRID_WITH_SQL = DataASorDB.GetDatatable("DD_ECM", oSQL, "DTGRID_SQL_DEFINITION", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
For Each oControlRow As DataRow In DTCONTROLS.Rows
oSQL = "
SELECT
T1.GUID As CONTROL_ID,
T1.PROFIL_ID,
T.CONNECTION_ID,
T.SQL_COMMAND,
T.SPALTENNAME,
T.FORMATTYPE,
T.FORMATSTRING,
T.ADVANCED_LOOKUP
FROM
TBPM_CONTROL_TABLE T,
TBPM_PROFILE_CONTROLS T1
WHERE
T1.CONTROL_ACTIVE = 1 AND
T.CONTROL_ID = T1.GUID AND
T1.PROFIL_ID = " & CURRENT_ProfilGUID & " AND
LEN(T.SQL_COMMAND) > 0 AND
T.SQL_COMMAND LIKE '%{#CTRL%'
ORDER BY T.SEQUENCE"
DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER = DataASorDB.GetDatatable("DD_ECM", oSQL, "DTGRID_SQL_DEFINITION", $"PROFIL_ID = {CURRENT_ProfilGUID}", "SEQUENCE")
Dim oTabIndexCounter As Integer = 0
For Each oControlRow As DataRow In DT_CONTROLS.Rows
Dim oMyControl As Control
Dim oControlID = oControlRow.Item("GUID")
oControlInfo = $"CtrlID: {oControlID} - CtrlName: {oControlRow.Item("NAME")} - CtrlIndex: {oControlRow.Item("INDEX_NAME")}"
@ -761,7 +790,7 @@ Public Class frmValidator
oComboBox.BackColor = Color.White
End If
End Sub
#Region "CONTROL LIST"
LOGGER.Debug("In add_ComboBox - GUID: " & oControlID)
Dim oCONID As Integer
Try
@ -822,29 +851,6 @@ Public Class frmValidator
End If
End If
#End Region
'Dim oMaxWidth As Integer = oComboBox.Width
'Using oGraphics As Graphics = oComboBox.CreateGraphics()
' Dim oStringLength = oGraphics.MeasureString(Text, oComboBox.Font).Width
' If oStringLength + 30 > oMaxWidth Then
' oMaxWidth = oStringLength + 30
' End If
'End Using
'Using g As Graphics = Me.CreateGraphics
' For Each oItem As Object In oComboBox.Items 'Für alle Einträge...
' Dim g1 As Graphics = oComboBox.CreateGraphics
' If g1.MeasureString(Text, oComboBox.Font).Width + 30 > oMaxWidth Then
' oMaxWidth = g1.MeasureString(Text, oComboBox.Font).Width + 30
' End If
' g1.Dispose()
' Next oItem
'End Using
'oComboBox.DropDownWidth = oMaxWidth
oMyControl = oComboBox
End If
@ -884,9 +890,9 @@ Public Class frmValidator
AddHandler lookup.Properties.SelectedValuesChanged, AddressOf LookupListChanged
'Wenn Multiselect false dann prüfen ob abhängiges Control
If CBool(oControlRow.Item("MULTISELECT")) = False Then
Dim oFilteredData As DataTable = DTCONTROLS.Clone()
Dim oFilteredData As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"SQL_UEBERPRUEFUNG like '%#CTRL#{oMyControl.Name}%'"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredData, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredData, LoadOption.PreserveChanges)
If oFilteredData.Rows.Count >= 1 Then
LOGGER.Debug($"createControlsLU - Found {oFilteredData.Rows.Count} Controls which are depending on {oMyControl.Name}")
'AddHandler lookup.EditValueChanged, AddressOf onLookUp1
@ -894,7 +900,7 @@ Public Class frmValidator
End If
oExpression = $"SQL_ENABLE like '%#CTRL#{oMyControl.Name}%'"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredData, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredData, LoadOption.PreserveChanges)
If oFilteredData.Rows.Count >= 1 Then
LOGGER.Debug($"createControlsLU - Found {oFilteredData.Rows.Count} Controls which' enable state is depending on {oMyControl.Name}")
'AddHandler lookup.EditValueChanged, AddressOf onLookUp1
@ -902,14 +908,14 @@ Public Class frmValidator
End If
oFilteredData = DTCONTROLS.Clone()
oFilteredData = DT_CONTROLS.Clone()
oExpression = $"GUID = {oControlRow.Item("GUID")} and Len(SET_CONTROL_DATA) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredData, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredData, LoadOption.PreserveChanges)
If oFilteredData.Rows.Count = 1 Then
'AddHandler lookup.EditValueChanged, AddressOf onLookUp1
AddHandler lookup.Properties.SelectedValuesChanged, AddressOf onLookUpselectedValue_Control2Set
End If
oFilteredData = DTCONTROLS.Clone()
oFilteredData = DT_CONTROLS.Clone()
End If
@ -937,61 +943,29 @@ Public Class frmValidator
Dim mycheckbox As CheckBox = oMyControl
AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange
'prüfen ob abhängiges Control
'Dim filteredData As DataTable = DTCONTROLS.Clone()
'Dim oExpression = $"SQL_UEBERPRUEFUNG like '%#CTRL#{oMyControl.Name}%'"
'DTCONTROLS.Select(oExpression).CopyToDataTable(filteredData, LoadOption.PreserveChanges)
'If filteredData.Rows.Count = 1 Then
' AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange
'End If
'oExpression = $"SQL_ENABLE like '%#CTRL#{oMyControl.Name}%'"
'DTCONTROLS.Select(oExpression).CopyToDataTable(filteredData, LoadOption.PreserveChanges)
'If filteredData.Rows.Count >= 1 Then
' 'AddHandler lookup.EditValueChanged, AddressOf onLookUp1
' AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange
'End If
'filteredData = DTCONTROLS.Clone()
'oExpression = $"GUID = {oControlRow.Item("GUID")} and Len(SET_CONTROL_DATA) > 0"
'DTCONTROLS.Select(oExpression).CopyToDataTable(filteredData, LoadOption.PreserveChanges)
'If filteredData.Rows.Count >= 1 Then
' AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange
'End If
'Dim oCONTROL_ID = DirectCast(oControlRow.Item("GUID"), ClassControlCreator.ControlMetadata).Guid
'Dim ofilteredData As DataTable = DTCONTROLS.Clone()
'oExpression = $"GUID = {oCONTROL_ID} and Len(SET_CONTROL_DATA) > 0"
'DTCONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
'If ofilteredData.Rows.Count = 1 Then
' AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange
'End If
Case "TABLE"
oControlInfo = "TABLE#" & oControlInfo
'Dim columns As List(Of DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow) = (From r As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In DD_DMSLiteDataSet.TBPM_CONTROL_TABLE
' Where r.CONTROL_ID = oControlRow.Item("GUID")
' Select r).ToList()
Dim oFilteredDatatable As DataTable = DTGRID_COLUMNS.Clone()
Dim oFilteredDatatable As DataTable = DT_COLUMNS_GRID.Clone()
Dim oExpression = $"CONTROL_ID = {oControlRow.Item("GUID")}"
DTGRID_COLUMNS.Select(oExpression, "SEQUENCE").CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_COLUMNS_GRID.Select(oExpression, "SEQUENCE").CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count >= 1 Then
LOGGER.Debug($"We got a definition for DTGRID_COLUMNS!!")
LOGGER.Debug("We got a DTGRID_COLUMNS definition for [{0}] ", oControlInfo)
Else
LOGGER.Debug("DTGRID_COLUMNS definition for control [{0}] does not contain any rows!", oControlInfo)
Continue For
End If
Dim oGrid = ClassControlCreator.CreateExistingGridControl(oControlRow, oFilteredDatatable, False)
Dim oGrid = ClassControlCreator.CreateExistingGridControl(oControlRow, oFilteredDatatable, False, pnldesigner)
AddHandler oGrid.ProcessGridKey, Sub(ByVal _sender As Object, ByVal e As KeyEventArgs)
If e.KeyCode = Keys.Tab Then
Dim gridControl = TryCast(_sender, GridControl)
Dim view = TryCast(gridControl.FocusedView, Views.Base.ColumnView)
If (e.Modifiers = Keys.None And view.IsNewItemRow(view.FocusedRowHandle) And view.FocusedColumn.VisibleIndex = view.VisibleColumns.Count - 1) Then
If (e.Modifiers = Keys.None And view.IsNewItemRow(view.FocusedRowHandle) _
And view.FocusedColumn.VisibleIndex = view.VisibleColumns.Count - 1) Then
If view.IsEditing Then
view.CloseEditor()
Me.SelectNextControl(gridControl, e.Modifiers = Keys.None, True, True, True)
@ -1021,12 +995,12 @@ Public Class frmValidator
End If
last_control = oMyControl
oMyControl.TabIndex = oCount
oMyControl.TabIndex = oTabIndexCounter
End If
' oMyControl.Tag = CInt(oControlRow.Item("GUID"))
pnldesigner.Controls.Add(oMyControl)
oCount += 1
oTabIndexCounter += 1
Catch ex As Exception
Dim st As New StackTrace(True)
st = New StackTrace(ex, True)
@ -1104,9 +1078,9 @@ Public Class frmValidator
oTextbox.BackColor = Color.White
End If
Dim oCONTROL_ID = DirectCast(oTextbox.Tag, ClassControlCreator.ControlMetadata).Guid
Dim ofilteredData As DataTable = DTCONTROLS.Clone()
Dim ofilteredData As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"GUID = {oCONTROL_ID} and Len(SET_CONTROL_DATA) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
If ofilteredData.Rows.Count = 1 Then
Dynamic_SetControlData(oTextbox, ofilteredData.Rows(0))
End If
@ -1123,46 +1097,71 @@ Public Class frmValidator
ControlHandleStarted = False
Exit Sub
End If
Dim box As TextBox = sender
If box.Text <> String.Empty And me_closing = False And _Indexe_Loaded = True And box.Height < 25 Then
Dim oTextBox As TextBox = sender
If oTextBox.Text <> String.Empty And me_closing = 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
Dim CONTROL_ID = DirectCast(box.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oSql = String.Format("select NAME,CONNECTION_ID,SQL_UEBERPRUEFUNG FROM TBPM_PROFILE_CONTROLS WHERE CONTROL_ACTIVE = 1 AND PROFIL_ID = {0} AND SQL_UEBERPRUEFUNG LIKE '%{1}%'", CURRENT_ProfilGUID, box.Name)
Dim CONTROL_ID = DirectCast(oTextBox.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oSql = String.Format("SELECT NAME, CONNECTION_ID, SQL_UEBERPRUEFUNG FROM TBPM_PROFILE_CONTROLS WHERE CONTROL_ACTIVE = 1 AND PROFIL_ID = {0} AND SQL_UEBERPRUEFUNG LIKE '%{1}%'", CURRENT_ProfilGUID, oTextBox.Name)
Dim DTCONTROLS_UEBP As DataTable
DTCONTROLS_UEBP = DataASorDB.GetDatatable("DD_ECM", oSql, "TBPM_PROFILE_CONTROLS_SQL_UEP", $"PROFIL_ID = {CURRENT_ProfilGUID} AND SQL_UEBERPRUEFUNG LIKE '%{box.Name}%'")
DTCONTROLS_UEBP = DataASorDB.GetDatatable("DD_ECM", oSql, "TBPM_PROFILE_CONTROLS_SQL_UEP", $"PROFIL_ID = {CURRENT_ProfilGUID} AND SQL_UEBERPRUEFUNG LIKE '%{oTextBox.Name}%'")
If Not IsNothing(DTCONTROLS_UEBP) And DTCONTROLS_UEBP.Rows.Count > 0 Then
For Each ROW As DataRow In DTCONTROLS_UEBP.Rows
If Not IsNothing(DTCONTROLS_UEBP) AndAlso DTCONTROLS_UEBP.Rows.Count > 0 Then
For Each oRow As DataRow In DTCONTROLS_UEBP.Rows
Try
Dim displayboxname = ROW.Item(0).ToString
If Not IsDBNull(ROW.Item(1)) And Not IsDBNull(ROW.Item(2)) Then
Dim sql_Statement = ROW.Item(2)
sql_Statement = clsPatterns.ReplaceAllValues(sql_Statement, pnldesigner, True)
Dim oControlName = oRow.Item("NAME").ToString
Dim oSqlStatement = oRow.Item("SQL_UEBERPRUEFUNG")
Dim oConnectionId = oRow.Item("CONNECTION_ID")
If Not IsDBNull(oSqlStatement) And Not IsDBNull(oConnectionId) Then
oSqlStatement = clsPatterns.ReplaceAllValues(oSqlStatement, pnldesigner, True)
_dependingControl_in_action = True
Depending_Control_Set_Result(displayboxname, sql_Statement, ROW.Item(1))
Depending_Control_Set_Result(oControlName, oSqlStatement, oConnectionId)
_dependingControl_in_action = False
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Display SQL result for control: " & ROW.Item(0).ToString & " - ERROR: " & ex.Message)
LOGGER.Info("Unexpected Error in Display SQL result for control: " & oRow.Item("NAME") & " - ERROR: " & ex.Message)
End Try
Next
End If
If Not IsNothing(DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) AndAlso DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER.Rows.Count > 0 Then
For Each oRow As DataRow In DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER.Rows
Try
Dim oControlId = oRow.Item("CONTROL_ID")
Dim oSqlStatement = oRow.Item("SQL_COMMAND")
Dim oConnectionId = oRow.Item("CONNECTION_ID")
Dim oColumnName = oRow.Item("SPALTENNAME")
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
If Not IsDBNull(oSqlStatement) And Not IsDBNull(oSqlStatement) Then
oSqlStatement = clsPatterns.ReplaceAllValues(oSqlStatement, pnldesigner, True)
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oColumnName, oSqlStatement, oConnectionId, oAdvancedLookup)
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Display SQL result for grid column: " & oRow.Item("CONTROL_ID") & " - ERROR: " & ex.Message)
End Try
Next
End If
Catch ex As Exception
LOGGER.Error(ex)
LOGGER.Info("Unexpected Error in Eventhandler Variable SQL Result - ERROR: " & ex.Message)
End Try
If box.Name = last_control.Name Then
If oTextBox.Name = last_control.Name Then
' Abschluss()
Else
SendKeys.Send("{TAB}")
@ -1175,7 +1174,7 @@ Public Class frmValidator
Private Sub onCustomButtonClick(sender As System.Object, e As System.EventArgs)
Dim oButton As Button = sender
Dim oControlID = DirectCast(oButton.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oSQL = ClassControlCreator.GET_CONTROL_PROPERTY(DTCONTROLS, oControlID, "SQL_UEBERPRUEFUNG")
Dim oSQL = ClassControlCreator.GET_CONTROL_PROPERTY(DT_CONTROLS, oControlID, "SQL_UEBERPRUEFUNG")
If IsNothing(oSQL) Then
LOGGER.Warn("onCustomButtonClick - SQL_UEBERPRUEFUNG IS NOTHING")
Exit Sub
@ -1185,7 +1184,7 @@ Public Class frmValidator
LOGGER.Warn("onCustomButtonClick - Check_UpdateIndexe = False >> Exit Click")
Exit Sub
End If
Override_SQLCommand = ClassControlCreator.GET_CONTROL_PROPERTY(DTCONTROLS, oControlID, "SQL2")
Override_SQLCommand = ClassControlCreator.GET_CONTROL_PROPERTY(DT_CONTROLS, oControlID, "SQL2")
If IsNothing(Override_SQLCommand) Then
Override_SQLCommand = ""
End If
@ -1415,9 +1414,9 @@ Public Class frmValidator
Checkbox_EnablingControls(oCheckbox)
CheckBox_DependingColumn(oCheckbox)
Dim oCONTROL_ID = DirectCast(oCheckbox.Tag, ClassControlCreator.ControlMetadata).Guid
Dim ofilteredData As DataTable = DTCONTROLS.Clone()
Dim ofilteredData As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"GUID = {oCONTROL_ID} and Len(SET_CONTROL_DATA) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
If ofilteredData.Rows.Count = 1 Then
Dynamic_SetControlData(oCheckbox, ofilteredData.Rows(0))
End If
@ -1573,9 +1572,9 @@ Public Class frmValidator
Dim oLOOKUPName = LookupControl.Name
LOGGER.Debug($"oLOOKUPValue is [{oLOOKUPValue}]!")
Dim oControlID = DirectCast(LookupControl.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"GUID = {oControlID} and LEN(SET_CONTROL_DATA) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count = 1 Then
LOGGER.Debug($"We got a definition for SetControlValues!!")
Else
@ -1700,9 +1699,9 @@ Public Class frmValidator
Dim oLOOKUPName = LookupControl.Name
LOGGER.Debug($"oLOOKUPValue is [{oLOOKUPValue}]!")
Dim oControlID = DirectCast(LookupControl.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"SQL_UEBERPRUEFUNG like '%#CTRL#{oLOOKUPName}%'"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count > 0 Then
LOGGER.Debug($"We got {oFilteredDatatable.Rows.Count} depending controls!!")
Else
@ -1821,9 +1820,9 @@ Public Class frmValidator
Dim oCheckboxname = pCheckbox.Name
LOGGER.Debug($"pCheckStateTrue [{pCheckbox.Checked}]!")
Dim oControlID = DirectCast(pCheckbox.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"SQL_UEBERPRUEFUNG like '%#CTRL#{oCheckboxname}%'"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count > 0 Then
LOGGER.Debug($"We got {oFilteredDatatable.Rows.Count} depending controls!!")
Else
@ -1942,15 +1941,16 @@ Public Class frmValidator
End Sub
Private Sub LookupControl_DependingColumn(LookupControl As LookupControl3, SelectedValues As List(Of String))
Dim oSQLColumnDatatable As DataTable = DTGRID_COLUMNS_WITH_SQL.Clone()
Dim oSQLColumnDatatable As DataTable = DT_COLUMNS_GRID_WITH_SQL.Clone()
Dim oExpression = $"SQL_COMMAND like '%#CTRL#{LookupControl.Name}%'"
DTGRID_COLUMNS_WITH_SQL.Select(oExpression).CopyToDataTable(oSQLColumnDatatable, LoadOption.PreserveChanges)
DT_COLUMNS_GRID_WITH_SQL.Select(oExpression).CopyToDataTable(oSQLColumnDatatable, LoadOption.PreserveChanges)
If oSQLColumnDatatable.Rows.Count > 0 Then
For Each oRow As DataRow In oSQLColumnDatatable.Rows
Dim oDEPENDING_CONTROL_ID = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("CONTROL_ID")
Dim oCONNID = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("CONNECTION_ID")
Dim oDEPENDING_COLUMN = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("SPALTENNAME")
Dim oSqlCommand = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("SQL_COMMAND")
Dim oDEPENDING_CONTROL_ID = oRow.Item("CONTROL_ID")
Dim oCONNID = oRow.Item("CONNECTION_ID")
Dim oDEPENDING_COLUMN = oRow.Item("SPALTENNAME")
Dim oSqlCommand = oRow.Item("SQL_COMMAND")
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
If _dependingColumn_in_action = True Then
Exit Sub
End If
@ -1959,12 +1959,16 @@ Public Class frmValidator
_dependingColumn_in_action = True
Try
Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oCONNID, $"LookupControl_DependingColumn - oDEPENDING_CONTROL_ID: {oDEPENDING_CONTROL_ID}")
If Not IsNothing(oDTDEPENDING_RESULT) Then
LOGGER.Debug($"Trying to fill the DropDown (DC) for ControlID [{oDEPENDING_CONTROL_ID}]..RowCount: [{oDTDEPENDING_RESULT.Rows.Count}] ")
For Each oControl As Control In pnldesigner.Controls
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CONTROL_ID Then
ClassControlCreator.GridTables.Item(oControl.Name).Add(oDEPENDING_COLUMN, oDTDEPENDING_RESULT)
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If oControlId = oDEPENDING_CONTROL_ID Then
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
_dependingColumn_in_action = False
Exit For
End If
@ -1979,29 +1983,32 @@ Public Class frmValidator
End If
End Sub
Private Sub CheckBox_DependingColumn(pCheckbox As CheckBox)
Dim oSQLColumnDatatable As DataTable = DTGRID_COLUMNS_WITH_SQL.Clone()
Dim oSQLColumnDatatable As DataTable = DT_COLUMNS_GRID_WITH_SQL.Clone()
Dim oExpression = $"SQL_COMMAND like '%#CTRL#{pCheckbox.Name}%'"
DTGRID_COLUMNS_WITH_SQL.Select(oExpression).CopyToDataTable(oSQLColumnDatatable, LoadOption.PreserveChanges)
DT_COLUMNS_GRID_WITH_SQL.Select(oExpression).CopyToDataTable(oSQLColumnDatatable, LoadOption.PreserveChanges)
If oSQLColumnDatatable.Rows.Count > 0 Then
For Each oRow As DataRow In oSQLColumnDatatable.Rows
Dim oDEPENDING_CONTROL_ID = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("CONTROL_ID")
Dim oCONNID = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("CONNECTION_ID")
Dim oDEPENDING_COLUMN = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("SPALTENNAME")
Dim oSqlCommand = DTGRID_COLUMNS_WITH_SQL.Rows(0).Item("SQL_COMMAND")
Dim oDEPENDING_CONTROL_ID = oRow.Item("CONTROL_ID")
Dim oCONNID = oRow.Item("CONNECTION_ID")
Dim oDEPENDING_COLUMN = oRow.Item("SPALTENNAME")
Dim oSqlCommand = oRow.Item("SQL_COMMAND")
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
If _dependingColumn_in_action = True Then
Exit Sub
End If
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, pnldesigner, 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}")
If Not IsNothing(oDTDEPENDING_RESULT) Then
LOGGER.Debug($"Trying to fill the DropDown (DC) for ControlID [{oDEPENDING_CONTROL_ID}]..RowCount: [{oDTDEPENDING_RESULT.Rows.Count}] ")
For Each oControl As Control In pnldesigner.Controls
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CONTROL_ID Then
ClassControlCreator.GridTables.Item(oControl.Name).Add(oDEPENDING_COLUMN, oDTDEPENDING_RESULT)
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
_dependingColumn_in_action = False
Exit For
End If
@ -2056,9 +2063,9 @@ Public Class frmValidator
Next
End If
Controls2beEnabled(oCombobox.Name)
Dim ofilteredData As DataTable = DTCONTROLS.Clone()
Dim ofilteredData As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"GUID = {CONTROL_ID} and Len(SET_CONTROL_DATA) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(ofilteredData, LoadOption.PreserveChanges)
If ofilteredData.Rows.Count = 1 Then
Dynamic_SetControlData(oCombobox, ofilteredData.Rows(0))
End If
@ -2072,9 +2079,9 @@ Public Class frmValidator
End Sub
Private Sub Controls2beEnabled(pControlName As String)
Try
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"SQL_ENABLE like '%#CTRL#{pControlName}%'"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count > 0 Then
LOGGER.Debug($"We got {oFilteredDatatable.Rows.Count} controls which got enable definitions!!")
Else
@ -2127,9 +2134,9 @@ Public Class frmValidator
End Sub
Private Sub Controls2beDisabled()
Try
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"LEN(SQL_ENABLE) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count > 0 Then
LOGGER.Debug($"We got {oFilteredDatatable.Rows.Count} controls which need to be disabled!!")
End If
@ -2149,9 +2156,9 @@ Public Class frmValidator
End Sub
Private Sub Controls2B_EnDisabled_on_Load()
Try
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
Dim oFilteredDatatable As DataTable = DT_CONTROLS.Clone()
Dim oExpression = $"LEN(SQL_ENABLE_ON_LOAD) > 0"
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
DT_CONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
If oFilteredDatatable.Rows.Count > 0 Then
LOGGER.Debug($"We got {oFilteredDatatable.Rows.Count} controls which need to be checked dis/enable on load!")
End If
@ -3115,7 +3122,7 @@ Public Class frmValidator
Case "DevExpress.XtraGrid.GridControl"
oControlType = "DevExpress.XtraGrid.GridControl"
Dim oMyGridControl As GridControl = oControl
Dim oDTColumnsPerDevExGrid As DataTable = DTGRID_COLUMNS.Clone()
Dim oDTColumnsPerDevExGrid As DataTable = DT_COLUMNS_GRID.Clone()
If oSourceIndexName = "" Then
MsgBox("Attention wrong configuration:" & vbNewLine & "for control " & oControl.Name & " no INDEX configured!" & vbNewLine & "Bitte prüfen Sie den Formulardesigner!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
Exit For
@ -3138,7 +3145,7 @@ Public Class frmValidator
'Tabellendarstellung
Case "TABLE"
Dim oExpression = $"CONTROL_ID = {oControlId}"
DTGRID_COLUMNS.Select(oExpression, "SEQUENCE").CopyToDataTable(oDTColumnsPerDevExGrid, LoadOption.PreserveChanges)
DT_COLUMNS_GRID.Select(oExpression, "SEQUENCE").CopyToDataTable(oDTColumnsPerDevExGrid, LoadOption.PreserveChanges)
Dim oColValuesfromSource As String()
LOGGER.Debug($"DevExpressGrid: {oDTColumnsPerDevExGrid.Rows.Count} Columns configured for control {oControlId}.")
@ -3505,12 +3512,16 @@ Public Class frmValidator
' set_foreground()
If first_control Is Nothing = False Then first_control.Focus()
Try
For Each oRow As DataRow In DTGRID_SQL_DEFINITION.Rows
Dim oDataTable As DataTable = DT_COLUMNS_GRID_WITH_SQL.Clone()
DT_COLUMNS_GRID_WITH_SQL.Select($"SQL_COMMAND not like '%#CTRL#%'").CopyToDataTable(oDataTable, LoadOption.PreserveChanges)
For Each oRow As DataRow In oDataTable.Rows
Dim oDEPENDING_CTRL_ID = oRow.Item("CONTROL_ID")
Dim oDEPENDING_COLUMN = oRow.Item("SPALTENNAME")
Dim oSqlCommand = oRow.Item("SQL_COMMAND")
Dim oCONNID = oRow.Item("CONNECTION_ID")
Dim oAdvancedLookup = oRow.Item("ADVANCED_LOOKUP")
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, pnldesigner, True)
Try
@ -3518,8 +3529,9 @@ Public Class frmValidator
If Not IsNothing(oDTRESULT_FOR_COLUMN) Then
LOGGER.Debug($"Trying to create a DropDown(FIV) for CONTROL-ID [{oDEPENDING_CTRL_ID}] - RowCount: [{oDTRESULT_FOR_COLUMN.Rows.Count}] ")
For Each oControl As Control In pnldesigner.Controls
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CTRL_ID Then
ClassControlCreator.GridTables.Item(oControl.Name).Add(oDEPENDING_COLUMN, oDTRESULT_FOR_COLUMN)
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If oControlId = oDEPENDING_CTRL_ID Then
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
Exit For
End If
Next
@ -3899,61 +3911,61 @@ Public Class frmValidator
oResult(0) = oValue
LOGGER.Debug($"oIndexType {oIndexType.ToString}")
If oIndexType > 4000 And oIndexType <5000 Then
If oIndexType > 4000 And oIndexType < 5000 Then
'If dr.Item("INDEXNAME").ToString.StartsWith("[%VKT") Then
' Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME"))
'Hier muss nun separat as Vektorfeld indexiert werden
If WMIndexVectofield(oValue, oFinalIndexRow.Item("INDEXNAME"), oFinalIndexRow.Item("PREVENT_DUPLICATES"), oFinalIndexRow.Item("ALLOW_NEW_VALUES")) = False Then
LOGGER.Debug("Final Vektorindex '" & oFinalIndexRow.Item("INDEXNAME").ToString & "' has beens et suxxessfully!")
Else
errormessage = "Error in final indexing:" & vbNewLine & idxerr_message
My.Settings.Save()
frmError.ShowDialog()
oErrorOcurred = True
ItemWorked = False
End If
Else
LOGGER.Debug("Now the final indexing...")
If oValue.ToUpper = "SQL-Command".ToUpper Then
MsgBox("Something went wrong while final-indexing. Check Your log and inform the admin-team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
LOGGER.Warn("Something went wrong while final-indexing")
Exit For
End If
Dim oFIResult As Boolean = False
If IDB_ACTIVE = False Then
If Indexiere_File(CURRENT_WMFILE, oFinalIndexRow.Item("INDEXNAME"), oResult) = True Then
oFIResult = True
LOGGER.Debug("FINALER INDEX '" & oFinalIndexRow.Item("INDEXNAME") & "' WURDE ERFOLGREICH GESETZT")
' Dim PM_String = Return_PM_VEKTOR(value, dr.Item("INDEXNAME"))
'Hier muss nun separat as Vektorfeld indexiert werden
If WMIndexVectofield(oValue, oFinalIndexRow.Item("INDEXNAME"), oFinalIndexRow.Item("PREVENT_DUPLICATES"), oFinalIndexRow.Item("ALLOW_NEW_VALUES")) = False Then
LOGGER.Debug("Final Vektorindex '" & oFinalIndexRow.Item("INDEXNAME").ToString & "' has beens et suxxessfully!")
Else
errormessage = "Error in final indexing:" & vbNewLine & idxerr_message
My.Settings.Save()
frmError.ShowDialog()
oErrorOcurred = True
ItemWorked = False
End If
Else
LOGGER.Debug("Now the final indexing...")
If oValue.ToUpper = "SQL-Command".ToUpper Then
MsgBox("Something went wrong while final-indexing. Check Your log and inform the admin-team!", MsgBoxStyle.Critical, ADDITIONAL_TITLE)
LOGGER.Warn("Something went wrong while final-indexing")
Exit For
End If
Dim oFIResult As Boolean = False
If IDB_ACTIVE = False Then
If Indexiere_File(CURRENT_WMFILE, oFinalIndexRow.Item("INDEXNAME"), oResult) = True Then
oFIResult = True
LOGGER.Debug("FINALER INDEX '" & oFinalIndexRow.Item("INDEXNAME") & "' WURDE ERFOLGREICH GESETZT")
'Nun das Logging
If PROFIL_LOGINDEX <> "" Then
Dim logstr = Return_LOGString(oValue, "DDFINALINDEX", oFinalIndexRow.Item("INDEXNAME"))
WMIndexVectofield(logstr, PROFIL_LOGINDEX)
End If
End If
Else
If IDBData.SetVariableValue(oFinalIndexRow.Item("INDEXNAME"), oValue) = True Then
oFIResult = True
LOGGER.Debug($"Final index IDB '{oFinalIndexRow.Item("INDEXNAME")}' was updated with [{oValue.ToString}]")
End If
End If
If oFIResult = False Then
errormessage = "Error in final indexing:" & vbNewLine & idxerr_message
My.Settings.Save()
frmError.ShowDialog()
oErrorOcurred = True
ItemWorked = False
End If
'Nun das Logging
If PROFIL_LOGINDEX <> "" Then
Dim logstr = Return_LOGString(oValue, "DDFINALINDEX", oFinalIndexRow.Item("INDEXNAME"))
WMIndexVectofield(logstr, PROFIL_LOGINDEX)
End If
End If
Else
If IDBData.SetVariableValue(oFinalIndexRow.Item("INDEXNAME"), oValue) = True Then
oFIResult = True
LOGGER.Debug($"Final index IDB '{oFinalIndexRow.Item("INDEXNAME")}' was updated with [{oValue.ToString}]")
End If
End If
If oFIResult = False Then
errormessage = "Error in final indexing:" & vbNewLine & idxerr_message
My.Settings.Save()
frmError.ShowDialog()
oErrorOcurred = True
ItemWorked = False
End If
End If
If oErrorOcurred = True Then
ItemWorked = False
Exit For
End If
Next
End If
Catch ex As Exception
LOGGER.Warn($"Error in finalIndexing: {ex.Message}")
End If
If oErrorOcurred = True Then
ItemWorked = False
Exit For
End If
Next
End If
Catch ex As Exception
LOGGER.Warn($"Error in finalIndexing: {ex.Message}")
oErrorOcurred = True
End Try
End If
@ -4145,11 +4157,6 @@ Public Class frmValidator
MsgBox("Unhandled error occured ... please check your log!", MsgBoxStyle.Exclamation, ADDITIONAL_TITLE)
ItemWorked = False
Else
'Das Dokument freigeben und as editiert markieren
'Dim sql = String.Format("UPDATE TBPM_PROFILE_FILES SET IN_WORK = 0, IN_WORK_WHEN = NULL, WORK_USER = '{0}', EDIT = 1 WHERE GUID = {1}", USER_USERNAME, CURRENT_DOC_GUID)
'Database_ECM.ExecuteNonQuery(sql)
Anzahl_validierte_Dok += 1
'tstrlbl_Info.Text = "Anzahl Dateien: " & TBPM_PROFILE_FILESTableAdapter.cmdGet_Anzahl(PROFIL_ID)
LOGGER.Debug("Validation of document ended successfully!")
Dim oPROCSQL = $"EXEC PRPM_CHECK_NEXT_WF {CURRENT_DOC_GUID}"
Database_ECM.ExecuteNonQuery(oPROCSQL)
@ -5675,4 +5682,14 @@ Public Class frmValidator
End If
End Sub
Private Sub BarButtonItem6_ItemClick_2(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem6.ItemClick
For Each oControl In pnldesigner.Controls
If TypeOf oControl Is GridControl Then
Dim oGrid = DirectCast(oControl, GridControl)
Dim oView = DirectCast(oGrid.FocusedView, GridView)
oView.FocusInvalidRow()
End If
Next
End Sub
End Class