jj
This commit is contained in:
parent
8283312ae7
commit
b655ec7f00
@ -35,6 +35,7 @@ Public Class ClassControlCreator
|
|||||||
Public Const PREFIX_LINE = "LINE"
|
Public Const PREFIX_LINE = "LINE"
|
||||||
Public Const PREFIX_BUTTON = "BTN"
|
Public Const PREFIX_BUTTON = "BTN"
|
||||||
|
|
||||||
|
Public Shared GridTables As New Dictionary(Of String, DataTable)
|
||||||
|
|
||||||
''' <summary>
|
''' <summary>
|
||||||
''' Standard Eigenschaften für alle Controls
|
''' Standard Eigenschaften für alle Controls
|
||||||
@ -425,7 +426,7 @@ Public Class ClassControlCreator
|
|||||||
|
|
||||||
End With
|
End With
|
||||||
|
|
||||||
Dim oTables As New Dictionary(Of String, DataTable)
|
GridTables.Clear()
|
||||||
|
|
||||||
For Each oRow As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In columns
|
For Each oRow As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In columns
|
||||||
' Create Columns in Datatable
|
' Create Columns in Datatable
|
||||||
@ -443,15 +444,19 @@ Public Class ClassControlCreator
|
|||||||
Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
|
Dim oConnectionId As Integer = NotNull(oRow.Item("CONNECTION_ID"), 0)
|
||||||
Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
|
Dim oSqlCommand As String = NotNull(oRow.Item("SQL_COMMAND"), "")
|
||||||
|
|
||||||
|
If Not clsPatterns.HasComplexPatterns(oSqlCommand) Then
|
||||||
If oConnectionId > 0 And oSqlCommand <> "" Then
|
If oConnectionId > 0 And oSqlCommand <> "" Then
|
||||||
Try
|
Try
|
||||||
Dim oComboboxDataTable As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
|
Dim oComboboxDataTable As DataTable = ClassDatabase.Return_Datatable_ConId(oSqlCommand, oConnectionId)
|
||||||
oTables.Add(oRow.SPALTENNAME, oComboboxDataTable)
|
GridTables.Add(oRow.SPALTENNAME, oComboboxDataTable)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Warn("Could not load data for column {0} in control {1}", oRow.SPALTENNAME, oControl.Name)
|
LOGGER.Warn("Could not load data for column {0} in control {1}", oRow.SPALTENNAME, oControl.Name)
|
||||||
LOGGER.Error(ex)
|
LOGGER.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
Next
|
Next
|
||||||
|
|
||||||
oControl.DataSource = oDatatable
|
oControl.DataSource = oDatatable
|
||||||
@ -463,8 +468,8 @@ Public Class ClassControlCreator
|
|||||||
For Each oRow As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In columns
|
For Each oRow As DD_DMSLiteDataSet.TBPM_CONTROL_TABLERow In columns
|
||||||
If oRow.SPALTENNAME = e.Column.FieldName Then
|
If oRow.SPALTENNAME = e.Column.FieldName Then
|
||||||
|
|
||||||
If oTables.ContainsKey(e.Column.FieldName) Then
|
If GridTables.ContainsKey(e.Column.FieldName) Then
|
||||||
Dim oComboboxDataTable As DataTable = oTables.Item(e.Column.FieldName)
|
Dim oComboboxDataTable As DataTable = GridTables.Item(e.Column.FieldName)
|
||||||
Dim oEditor As New RepositoryItemComboBox()
|
Dim oEditor As New RepositoryItemComboBox()
|
||||||
Dim oItems As New List(Of String)
|
Dim oItems As New List(Of String)
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
DevExpress.XtraBars.BarManager, DevExpress.XtraBars.v19.2, Version=19.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a
|
||||||
@ -53,6 +53,7 @@ Public Class frmValidator
|
|||||||
Private _frmValidatorSearch As frmValidatorSearch 'You need a reference to Form1
|
Private _frmValidatorSearch As frmValidatorSearch 'You need a reference to Form1
|
||||||
Private _dependingControl_in_action As Boolean = False
|
Private _dependingControl_in_action As Boolean = False
|
||||||
Private DTCONTROLS As DataTable
|
Private DTCONTROLS As DataTable
|
||||||
|
Private DTGRID_COLUMNS As DataTable
|
||||||
Private DTVWCONTROL_INDEX As DataTable
|
Private DTVWCONTROL_INDEX As DataTable
|
||||||
Private FormLoaded As Boolean = False
|
Private FormLoaded As Boolean = False
|
||||||
Private ItemWorked As Boolean = False
|
Private ItemWorked As Boolean = False
|
||||||
@ -557,6 +558,8 @@ Public Class frmValidator
|
|||||||
Dim oSQL = $"SELECT * FROM TBPM_PROFILE_CONTROLS WHERE PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY Y_LOC, X_LOC"
|
Dim oSQL = $"SELECT * FROM TBPM_PROFILE_CONTROLS WHERE PROFIL_ID = {CURRENT_ProfilGUID} ORDER BY Y_LOC, X_LOC"
|
||||||
DTCONTROLS = ClassDatabase.Return_Datatable(oSQL)
|
DTCONTROLS = ClassDatabase.Return_Datatable(oSQL)
|
||||||
|
|
||||||
|
oSQL = $"SELECT T1.GUID As CONTROL_ID, T1.PROFIL_ID, T.SQL_COMMAND, T.SPALTENNAME from TBPM_CONTROL_TABLE T, TBPM_PROFILE_CONTROLS T1 WHERE T.CONTROL_ID = T1.GUID AND T1.PROFIL_ID = {CURRENT_ProfilGUID} AND LEN(T.SQL_COMMAND) > 0"
|
||||||
|
DTGRID_COLUMNS = ClassDatabase.Return_Datatable(oSQL)
|
||||||
Dim oCount As Integer = 0
|
Dim oCount As Integer = 0
|
||||||
|
|
||||||
For Each oControlRow As DataRow In DTCONTROLS.Rows
|
For Each oControlRow As DataRow In DTCONTROLS.Rows
|
||||||
@ -1142,10 +1145,20 @@ Public Class frmValidator
|
|||||||
Try
|
Try
|
||||||
If Not IsNothing(SelectedValues) Then
|
If Not IsNothing(SelectedValues) Then
|
||||||
If SelectedValues.Count = 1 Then
|
If SelectedValues.Count = 1 Then
|
||||||
Dim oLOOKUPValue = SelectedValues.Item(0)
|
LookupControl_DependingControls(oLookup, SelectedValues)
|
||||||
Dim oLOOKUPName = oLookup.Name
|
LookupControl_DependingColumn(oLookup, SelectedValues)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
LOGGER.Error(ex)
|
||||||
|
End Try
|
||||||
|
End Sub
|
||||||
|
|
||||||
Dim oControlID = DirectCast(oLookup.Tag, ClassControlCreator.ControlMetadata).Guid
|
Private Sub LookupControl_DependingControls(LookupControl As LookupControl2, SelectedValues As List(Of String))
|
||||||
|
Dim oLOOKUPValue = SelectedValues.Item(0)
|
||||||
|
Dim oLOOKUPName = LookupControl.Name
|
||||||
|
|
||||||
|
Dim oControlID = DirectCast(LookupControl.Tag, ClassControlCreator.ControlMetadata).Guid
|
||||||
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
|
Dim oFilteredDatatable As DataTable = DTCONTROLS.Clone()
|
||||||
Dim oExpression = $"SQL_UEBERPRUEFUNG like '%#CTRL#{oLOOKUPName}%'"
|
Dim oExpression = $"SQL_UEBERPRUEFUNG like '%#CTRL#{oLOOKUPName}%'"
|
||||||
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
|
DTCONTROLS.Select(oExpression).CopyToDataTable(oFilteredDatatable, LoadOption.PreserveChanges)
|
||||||
@ -1166,12 +1179,16 @@ Public Class frmValidator
|
|||||||
For Each oControl As Control In pnldesigner.Controls
|
For Each oControl As Control In pnldesigner.Controls
|
||||||
|
|
||||||
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then
|
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then
|
||||||
If oControl.GetType.ToString = "System.Windows.Forms.TextBox" Then
|
Select Case oControl.GetType.ToString
|
||||||
|
Case GetType(TextBox).ToString
|
||||||
oControl.Text = oDTDEPENDING_RESULT.Rows(0).Item(0)
|
oControl.Text = oDTDEPENDING_RESULT.Rows(0).Item(0)
|
||||||
Else
|
Case GetType(LookupControl2).ToString
|
||||||
Dim oDependingLookup As LookupControl2 = oControl
|
Dim oDependingLookup As LookupControl2 = oControl
|
||||||
oDependingLookup.DataSource = oDTDEPENDING_RESULT
|
oDependingLookup.DataSource = oDTDEPENDING_RESULT
|
||||||
End If
|
Case GetType(GridControl).ToString
|
||||||
|
'ClassControlCreator.GridTables
|
||||||
|
|
||||||
|
End Select
|
||||||
_dependingControl_in_action = False
|
_dependingControl_in_action = False
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
@ -1187,12 +1204,40 @@ Public Class frmValidator
|
|||||||
ControlHandleStarted = True
|
ControlHandleStarted = True
|
||||||
End If
|
End If
|
||||||
End If
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub LookupControl_DependingColumn(LookupControl As LookupControl2, SelectedValues As List(Of String))
|
||||||
|
Dim oSQLColumnDatatable As DataTable = DTGRID_COLUMNS.Clone()
|
||||||
|
Dim oExpression = $"SQL_COMMAND like '%#CTRL#{LookupControl.Name}%'"
|
||||||
|
DTGRID_COLUMNS.Select(oExpression).CopyToDataTable(oSQLColumnDatatable, LoadOption.PreserveChanges)
|
||||||
|
If oSQLColumnDatatable.Rows.Count > 0 Then
|
||||||
|
For Each oRow As DataRow In oSQLColumnDatatable.Rows
|
||||||
|
Dim oDEPENDING_GUID = DTGRID_COLUMNS.Rows(0).Item("CONTROL_ID")
|
||||||
|
Dim oDEPENDING_COLUMN = DTGRID_COLUMNS.Rows(0).Item("SPALTENNAME")
|
||||||
|
Dim oSqlCommand = DTGRID_COLUMNS.Rows(0).Item("SQL_COMMAND")
|
||||||
|
If _dependingControl_in_action = True Then
|
||||||
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
oSqlCommand = clsPatterns.ReplaceAllValues(oSqlCommand, pnldesigner, CURRENT_WMFILE, USER_PRENAME, USER_SURNAME, USER_SHORTNAME, USER_EMAIL, USER_ID, CURRENT_CLICKED_PROFILE_ID)
|
||||||
|
LOGGER.Debug(">>> sql after ReplaceAllValues: " & oSqlCommand)
|
||||||
|
_dependingControl_in_action = True
|
||||||
|
Try
|
||||||
|
Dim oDTDEPENDING_RESULT As DataTable = ClassDatabase.Return_Datatable(oSqlCommand)
|
||||||
|
For Each oControl As Control In pnldesigner.Controls
|
||||||
|
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_GUID Then
|
||||||
|
ClassControlCreator.GridTables.Add(oDEPENDING_COLUMN, oDTDEPENDING_RESULT)
|
||||||
|
_dependingControl_in_action = False
|
||||||
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
Next
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
LOGGER.Error(ex)
|
LOGGER.Error(ex)
|
||||||
|
_dependingControl_in_action = False
|
||||||
End Try
|
End Try
|
||||||
|
Next
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
|
||||||
Public Sub OnCmbselectedIndex(sender As System.Object, e As System.EventArgs)
|
Public Sub OnCmbselectedIndex(sender As System.Object, e As System.EventArgs)
|
||||||
Dim cmb As ComboBox = sender
|
Dim cmb As ComboBox = sender
|
||||||
If cmb.SelectedIndex <> -1 And _Indexe_Loaded = True Then
|
If cmb.SelectedIndex <> -1 And _Indexe_Loaded = True Then
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user