Clean up, fix missing TextEdit

This commit is contained in:
Jonathan Jenne 2023-06-02 10:47:24 +02:00
parent 8dade7c299
commit e44a42faea
8 changed files with 177 additions and 303 deletions

View File

@ -64,13 +64,14 @@ Public Class ClassControlCreator
Public Const CONTROL_TYPE_DATETIME = "DATETIME" Public Const CONTROL_TYPE_DATETIME = "DATETIME"
Public Shared Property Logger As Logger Public ReadOnly Property Logger As Logger
Public ReadOnly Property LogConfig As LogConfig
''' <summary> ''' <summary>
''' Saves the column data for each grid and each column in that grid ''' Saves the column data for each grid and each column in that grid
''' </summary> ''' </summary>
Public Shared Property GridTables As New Dictionary(Of Integer, Dictionary(Of String, RepositoryItem)) Public Property GridTables As New Dictionary(Of Integer, Dictionary(Of String, RepositoryItem))
Public Shared Property GridColumns As New Dictionary(Of Integer, DataTable) Public Property GridColumns As New Dictionary(Of Integer, DataTable)
''' <summary> ''' <summary>
''' Standard Eigenschaften für alle Controls ''' Standard Eigenschaften für alle Controls
@ -91,7 +92,12 @@ Public Class ClassControlCreator
Public BackColor As Color = Color.White Public BackColor As Color = Color.White
End Class End Class
Private Shared Function TransformDataRow(row As DataRow) As ControlDBProps Public Sub New(pLogConfig As LogConfig)
LogConfig = pLogConfig
Logger = pLogConfig.GetLogger()
End Sub
Private Function TransformDataRow(row As DataRow) As ControlDBProps
Dim x As Integer = row.Item("X_LOC") Dim x As Integer = row.Item("X_LOC")
Dim y As Integer = row.Item("Y_LOC") Dim y As Integer = row.Item("Y_LOC")
Dim style As FontStyle = NotNull(row.Item("FONT_STYLE"), DEFAULT_FONT_STYLE) Dim style As FontStyle = NotNull(row.Item("FONT_STYLE"), DEFAULT_FONT_STYLE)
@ -116,7 +122,7 @@ Public Class ClassControlCreator
} }
End Function End Function
Public Shared Function CreateBaseControl(ctrl As Control, OControlRow As DataRow, designMode As Boolean) As Control Public Function CreateBaseControl(ctrl As Control, OControlRow As DataRow, designMode As Boolean) As Control
Try Try
Dim props As ControlDBProps = TransformDataRow(OControlRow) Dim props As ControlDBProps = TransformDataRow(OControlRow)
@ -149,7 +155,7 @@ Public Class ClassControlCreator
' ----------------------- NEW CONTROLS ----------------------- ' ----------------------- NEW CONTROLS -----------------------
'Public Shared Function CreateNewTextBox(location As Point) As TextBox 'Public Function CreateNewTextBox(location As Point) As TextBox
' Dim control As New TextBox With { ' Dim control As New TextBox With {
' .Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}", ' .Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}",
' .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT), ' .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
@ -162,7 +168,7 @@ Public Class ClassControlCreator
' Return control ' Return control
'End Function 'End Function
Public Shared Function CreateNewTextBox(location As Point) As TextEdit Public Function CreateNewTextBox(location As Point) As TextEdit
Dim control As New TextEdit With { Dim control As New TextEdit With {
.Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}", .Name = $"{PREFIX_TEXTBOX}_{clsTools.ShortGuid()}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT), .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
@ -175,7 +181,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewLabel(location As Point) As Label Public Function CreateNewLabel(location As Point) As Label
Dim control As New Label With { Dim control As New Label With {
.Name = $"{PREFIX_LABEL}_{clsTools.ShortGuid}", .Name = $"{PREFIX_LABEL}_{clsTools.ShortGuid}",
.Text = DEFAULT_TEXT, .Text = DEFAULT_TEXT,
@ -187,7 +193,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewCheckbox(location As Point) As CheckBox Public Function CreateNewCheckbox(location As Point) As CheckBox
Dim control As New CheckBox With { Dim control As New CheckBox With {
.Name = $"{PREFIX_CHECKBOX}_{clsTools.ShortGuid}", .Name = $"{PREFIX_CHECKBOX}_{clsTools.ShortGuid}",
.AutoSize = True, .AutoSize = True,
@ -200,8 +206,8 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewCombobox(location As Point) As ComboBox Public Function CreateNewCombobox(location As Point) As Windows.Forms.ComboBox
Dim control As New ComboBox With { Dim control As New Windows.Forms.ComboBox With {
.Name = $"{PREFIX_COMBOBOX}_{clsTools.ShortGuid}", .Name = $"{PREFIX_COMBOBOX}_{clsTools.ShortGuid}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT), .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
.Cursor = Cursors.Hand, .Cursor = Cursors.Hand,
@ -211,7 +217,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewDatetimepicker(location As Point) As DateTimePicker Public Function CreateNewDatetimepicker(location As Point) As DateTimePicker
Dim control As New DateTimePicker With { Dim control As New DateTimePicker With {
.Name = $"{PREFIX_DATETIMEPICKER}_{clsTools.ShortGuid}", .Name = $"{PREFIX_DATETIMEPICKER}_{clsTools.ShortGuid}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT), .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
@ -223,7 +229,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewDatagridview(location As Point) As DataGridView Public Function CreateNewDatagridview(location As Point) As DataGridView
Dim control As New DataGridView With { Dim control As New DataGridView With {
.Name = $"{PREFIX_DATAGRIDVIEW}_{clsTools.ShortGuid}", .Name = $"{PREFIX_DATAGRIDVIEW}_{clsTools.ShortGuid}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE), .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
@ -243,7 +249,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Friend Shared Function CreateNewLookupControl(location As Point) As LookupControl3 Friend Function CreateNewLookupControl(location As Point) As LookupControl3
Dim control As New LookupControl3 With { Dim control As New LookupControl3 With {
.Name = $"{PREFIX_LOOKUP}_{clsTools.ShortGuid}", .Name = $"{PREFIX_LOOKUP}_{clsTools.ShortGuid}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT), .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT),
@ -253,7 +259,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewTable(location As Point) As GridControl Public Function CreateNewTable(location As Point) As GridControl
Dim oControl As New GridControl With { Dim oControl As New GridControl With {
.Name = $"{PREFIX_TABLE}_{clsTools.ShortGuid}", .Name = $"{PREFIX_TABLE}_{clsTools.ShortGuid}",
.Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE), .Size = New Size(DEFAULT_WIDTH, DEFAULT_HEIGHT_TABLE),
@ -273,7 +279,7 @@ Public Class ClassControlCreator
Return oControl Return oControl
End Function End Function
Public Shared Function CreateNewLine(location As Point) As LineLabel Public Function CreateNewLine(location As Point) As LineLabel
Dim control As New LineLabel With { Dim control As New LineLabel With {
.Name = $"{PREFIX_LINE}_{clsTools.ShortGuid}", .Name = $"{PREFIX_LINE}_{clsTools.ShortGuid}",
.Text = "---------------------------------", .Text = "---------------------------------",
@ -283,7 +289,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateNewButton(location As Point) As Button Public Function CreateNewButton(location As Point) As Button
Dim control As New Button With { Dim control As New Button With {
.Name = $"{PREFIX_BUTTON}_{clsTools.ShortGuid}", .Name = $"{PREFIX_BUTTON}_{clsTools.ShortGuid}",
.Size = New Size(108, 28), .Size = New Size(108, 28),
@ -296,7 +302,7 @@ Public Class ClassControlCreator
' ----------------------- EXISITING CONTROLS ----------------------- ' ----------------------- EXISITING CONTROLS -----------------------
'Public Shared Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As TextBox 'Public Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As TextBox
' Try ' Try
' Dim control As TextBox = CreateBaseControl(New TextBox(), oControlRow, designMode) ' Dim control As TextBox = CreateBaseControl(New TextBox(), oControlRow, designMode)
@ -327,7 +333,7 @@ Public Class ClassControlCreator
'End Function 'End Function
Public Shared Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As BaseEdit Public Function CreateExistingTextbox(oControlRow As DataRow, designMode As Boolean) As BaseEdit
Try Try
Dim oHeight = oControlRow.ItemEx("HEIGHT", 0) Dim oHeight = oControlRow.ItemEx("HEIGHT", 0)
Dim oWidth = oControlRow.ItemEx("WIDTH", 0) Dim oWidth = oControlRow.ItemEx("WIDTH", 0)
@ -388,7 +394,7 @@ Public Class ClassControlCreator
End Try End Try
End Function End Function
Public Shared Function CreateExistingLabel(row As DataRow, designMode As Boolean) As Label Public Function CreateExistingLabel(row As DataRow, designMode As Boolean) As Label
Dim control As Label = CreateBaseControl(New Label(), row, designMode) Dim control As Label = CreateBaseControl(New Label(), row, designMode)
Try Try
control.Text = row.Item("CTRL_CAPTION_LANG") control.Text = row.Item("CTRL_CAPTION_LANG")
@ -401,7 +407,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateExistingButton(row As DataRow, designMode As Boolean) As Button Public Function CreateExistingButton(row As DataRow, designMode As Boolean) As Button
Dim oControl As Button = CreateBaseControl(New Button(), row, designMode) Dim oControl As Button = CreateBaseControl(New Button(), row, designMode)
Dim ctrl_image As Bitmap = Nothing Dim ctrl_image As Bitmap = Nothing
@ -430,7 +436,7 @@ Public Class ClassControlCreator
Return oControl Return oControl
End Function End Function
Public Shared Function CreateExistingCombobox(row As DataRow, designMode As Boolean) As Windows.Forms.ComboBox Public Function CreateExistingCombobox(row As DataRow, designMode As Boolean) As Windows.Forms.ComboBox
Dim control As Windows.Forms.ComboBox = CreateBaseControl(New Windows.Forms.ComboBox(), row, designMode) Dim control As Windows.Forms.ComboBox = CreateBaseControl(New Windows.Forms.ComboBox(), row, designMode)
control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT"))
@ -447,7 +453,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateExistingDatepicker(row As DataRow, designMode As Boolean) As DateTimePicker Public Function CreateExistingDatepicker(row As DataRow, designMode As Boolean) As DateTimePicker
Dim control As DateTimePicker = CreateBaseControl(New DateTimePicker(), row, designMode) Dim control As DateTimePicker = CreateBaseControl(New DateTimePicker(), row, designMode)
control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT"))
@ -461,7 +467,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateExisingCheckbox(row As DataRow, designMode As Boolean) As CheckBox Public Function CreateExisingCheckbox(row As DataRow, designMode As Boolean) As CheckBox
Dim oCheckBox As CheckBox = CreateBaseControl(New CheckBox(), row, designMode) Dim oCheckBox As CheckBox = CreateBaseControl(New CheckBox(), row, designMode)
oCheckBox.AutoSize = True oCheckBox.AutoSize = True
@ -480,7 +486,7 @@ Public Class ClassControlCreator
Return oCheckBox Return oCheckBox
End Function End Function
Public Shared Function CreateExistingDataGridView(row As DataRow, designMode As Boolean) As DataGridView Public Function CreateExistingDataGridView(row As DataRow, designMode As Boolean) As DataGridView
Dim control As DataGridView = CreateBaseControl(New DataGridView(), row, designMode) Dim control As DataGridView = CreateBaseControl(New DataGridView(), row, designMode)
control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT")) control.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT"))
@ -504,7 +510,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateExistingLookupControl(row As DataRow, designMode As Boolean) As LookupControl3 Public Function CreateExistingLookupControl(row As DataRow, designMode As Boolean) As LookupControl3
Dim control As LookupControl3 = CreateBaseControl(New LookupControl3(), row, designMode) Dim control As LookupControl3 = CreateBaseControl(New LookupControl3(), row, designMode)
control.Properties.Name = control.Name control.Properties.Name = control.Name
control.Width = row.Item("WIDTH") control.Width = row.Item("WIDTH")
@ -517,7 +523,7 @@ Public Class ClassControlCreator
Return control Return control
End Function End Function
Public Shared Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean) As GridControl Public Function CreateExistingGridControl(row As DataRow, DT_MY_COLUMNS As DataTable, designMode As Boolean) As GridControl
Dim oControl As GridControl = CreateBaseControl(New GridControl(), row, designMode) Dim oControl As GridControl = CreateBaseControl(New GridControl(), row, designMode)
Dim oControlId = DirectCast(oControl.Tag, ControlMetadata).Guid Dim oControlId = DirectCast(oControl.Tag, ControlMetadata).Guid
Dim oDatatable As New DataTable Dim oDatatable As New DataTable
@ -830,9 +836,9 @@ Public Class ClassControlCreator
Return oControl Return oControl
End Function End Function
Private Shared newRowModified As Boolean = False Private newRowModified As Boolean = False
Private Shared Sub View_ShowingEditor(sender As Object, e As CancelEventArgs) Private Sub View_ShowingEditor(sender As Object, e As CancelEventArgs)
Dim view As GridView = TryCast(sender, GridView) Dim view As GridView = TryCast(sender, GridView)
Logger.Debug("Showing editor.") Logger.Debug("Showing editor.")
If view.IsNewItemRow(view.FocusedRowHandle) AndAlso Not newRowModified Then If view.IsNewItemRow(view.FocusedRowHandle) AndAlso Not newRowModified Then
@ -841,7 +847,7 @@ Public Class ClassControlCreator
End If End If
End Sub End Sub
Private Shared Sub View_ShownEditor(sender As Object, e As EventArgs) Private Sub View_ShownEditor(sender As Object, e As EventArgs)
Dim view As GridView = TryCast(sender, GridView) Dim view As GridView = TryCast(sender, GridView)
If view.IsNewItemRow(view.FocusedRowHandle) Then If view.IsNewItemRow(view.FocusedRowHandle) Then
Logger.Debug("Attaching Modified Handler.") Logger.Debug("Attaching Modified Handler.")
@ -852,7 +858,7 @@ Public Class ClassControlCreator
End If End If
End Sub End Sub
Private Shared Sub View_ValidateRow(sender As Object, e As ValidateRowEventArgs) Private Sub View_ValidateRow(sender As Object, e As ValidateRowEventArgs)
Dim view As GridView = TryCast(sender, GridView) Dim view As GridView = TryCast(sender, GridView)
If view.IsNewItemRow(e.RowHandle) AndAlso Not newRowModified Then If view.IsNewItemRow(e.RowHandle) AndAlso Not newRowModified Then
Logger.Debug("Deleting unused row") Logger.Debug("Deleting unused row")
@ -863,7 +869,7 @@ Public Class ClassControlCreator
newRowModified = False newRowModified = False
End Sub End Sub
Private Shared Sub View_ValidatingEditor(sender As Object, e As BaseContainerValidateEditorEventArgs) Private Sub View_ValidatingEditor(sender As Object, e As BaseContainerValidateEditorEventArgs)
Dim oValue As String = NotNull(e.Value, "") Dim oValue As String = NotNull(e.Value, "")
If oValue.Contains(" | ") Then If oValue.Contains(" | ") Then
@ -872,11 +878,11 @@ Public Class ClassControlCreator
End If End If
End Sub End Sub
Private Shared Sub View_InvalidRowException(sender As Object, e As InvalidRowExceptionEventArgs) Private Sub View_InvalidRowException(sender As Object, e As InvalidRowExceptionEventArgs)
e.ExceptionMode = ExceptionMode.NoAction e.ExceptionMode = ExceptionMode.NoAction
End Sub End Sub
Public Shared Function CreateExistingLine(row As DataRow, designMode As Boolean) As LineLabel Public Function CreateExistingLine(row As DataRow, designMode As Boolean) As LineLabel
Dim control As LineLabel = CreateBaseControl(New LineLabel(), row, designMode) Dim control As LineLabel = CreateBaseControl(New LineLabel(), row, designMode)
control.Text = "------------------------------" control.Text = "------------------------------"
control.BorderStyle = BorderStyle.None control.BorderStyle = BorderStyle.None
@ -904,7 +910,7 @@ Public Class ClassControlCreator
End Sub End Sub
End Class End Class
Public Shared Function GET_CONTROL_PROPERTIES(DT_CONTROL As DataTable, ControlName As String) Public Function GET_CONTROL_PROPERTIES(DT_CONTROL As DataTable, ControlName As String)
Try Try
CURRENT_CONTROL_ID = 0 CURRENT_CONTROL_ID = 0
CURR_CON_ID = 0 CURR_CON_ID = 0
@ -938,7 +944,7 @@ Public Class ClassControlCreator
End Try End Try
End Function End Function
Public Shared Function GET_CONTROL_PROPERTY(DT_CONTROL As DataTable, ControlGUID As Integer, ColNAME As String) Public Function GET_CONTROL_PROPERTY(DT_CONTROL As DataTable, ControlGUID As Integer, ColNAME As String)
Try Try
CURRENT_CONTROL_ID = 0 CURRENT_CONTROL_ID = 0
CURR_CON_ID = 0 CURR_CON_ID = 0
@ -965,7 +971,8 @@ Public Class ClassControlCreator
End Try End Try
End Function End Function
Public Shared Function GET_DEPENDING_CONTROLS(DT_CONTROLS As DataTable, ControlName As String)
Public Function GetDependingControls(DT_CONTROLS As DataTable, ControlName As String) As Boolean
Try Try
Dim dt As New DataTable Dim dt As New DataTable
dt = DT_CONTROLS dt = DT_CONTROLS
@ -981,13 +988,12 @@ Public Class ClassControlCreator
Catch ex As Exception Catch ex As Exception
Logger.Error(ex) Logger.Error(ex)
Logger.Info("Unexpected Error in GET_DEPENDING_CONTROLS (" & ControlName & "):" & ex.Message) Logger.Info("Unexpected Error in GET_DEPENDING_CONTROLS (" & ControlName & "):" & ex.Message)
Return 0 Return False
End Try End Try
End Function End Function
Public Shared Function GET_CONNECTION_INFO(CON_ID As Integer) Public Function GET_CONNECTION_INFO(CON_ID As Integer) As DataRow()
Try Try
Dim dt As New DataTable Dim dt As New DataTable
dt = BASEDATA_DT_TBDD_CONNECTION dt = BASEDATA_DT_TBDD_CONNECTION
' Define the filter ' Define the filter
@ -1004,10 +1010,9 @@ Public Class ClassControlCreator
Logger.Info("Unexpected Error in GET_CONNECTION_INFO (" & CON_ID.ToString & "):" & ex.Message) Logger.Info("Unexpected Error in GET_CONNECTION_INFO (" & CON_ID.ToString & "):" & ex.Message)
Return Nothing Return Nothing
End Try End Try
End Function End Function
Public Shared Sub GridTables_CacheDatatableForColumn(pControlId As Object, pColumnName As Object, pSqlStatement As Object, pConnectionId As Integer, pAdvancedLookup As Boolean) Public Sub GridTables_CacheDatatableForColumn(pControlId As Object, pColumnName As Object, pSqlStatement As Object, pConnectionId As Integer, pAdvancedLookup As Boolean)
Try Try
'Dim oTable As DataTable = ClassDatabase.Return_Datatable_ConId(pSqlStatement, pConnectionId) 'Dim oTable As DataTable = ClassDatabase.Return_Datatable_ConId(pSqlStatement, pConnectionId)
Dim oTable As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(pSqlStatement, DatabaseType.ECM) With { Dim oTable As DataTable = DatabaseFallback.GetDatatable(New GetDatatableOptions(pSqlStatement, DatabaseType.ECM) With {
@ -1032,7 +1037,7 @@ Public Class ClassControlCreator
End Try End Try
End Sub End Sub
Public Shared Function GridTables_GetRepositoryItemForColumn(pColumnName As String, pDataTable As DataTable, pIsAdvancedLookup As Boolean) As RepositoryItem Public Function GridTables_GetRepositoryItemForColumn(pColumnName As String, pDataTable As DataTable, pIsAdvancedLookup As Boolean) As RepositoryItem
If pIsAdvancedLookup Then If pIsAdvancedLookup Then
Dim oEditor = New RepositoryItemLookupControl3 Dim oEditor = New RepositoryItemLookupControl3
@ -1075,7 +1080,7 @@ Public Class ClassControlCreator
End If End If
End Function End Function
Public Shared Sub GridTables_HandleControlValueChange(pControlPanel As XtraScrollableControl, pColumnsWithSqlAndControlPlaceholders As DataTable) Public Sub GridTables_HandleControlValueChange(pControlPanel As XtraScrollableControl, pColumnsWithSqlAndControlPlaceholders As DataTable)
If Not IsNothing(pColumnsWithSqlAndControlPlaceholders) AndAlso pColumnsWithSqlAndControlPlaceholders.Rows.Count > 0 Then If Not IsNothing(pColumnsWithSqlAndControlPlaceholders) AndAlso pColumnsWithSqlAndControlPlaceholders.Rows.Count > 0 Then
For Each oRow As DataRow In pColumnsWithSqlAndControlPlaceholders.Rows For Each oRow As DataRow In pColumnsWithSqlAndControlPlaceholders.Rows
Try Try
@ -1117,7 +1122,7 @@ Public Class ClassControlCreator
End If End If
End Sub End Sub
Private Shared Function GridTables_TestEditorExistsByControlAndColumn(oControlId As Integer, pColumn As String) As Boolean Private Function GridTables_TestEditorExistsByControlAndColumn(oControlId As Integer, pColumn As String) As Boolean
If GridTables.ContainsKey(oControlId) Then If GridTables.ContainsKey(oControlId) Then
Dim oContainsKey = GridTables.Item(oControlId).ContainsKey(pColumn) Dim oContainsKey = GridTables.Item(oControlId).ContainsKey(pColumn)
If oContainsKey AndAlso GridTables.Item(oControlId).Item(pColumn) IsNot Nothing Then If oContainsKey AndAlso GridTables.Item(oControlId).Item(pColumn) IsNot Nothing Then
@ -1130,7 +1135,7 @@ Public Class ClassControlCreator
End If End If
End Function End Function
Private Shared Function GridTables_ValidateColumn(pView As GridView, pColumnDefinition As DataTable, ColumnName As String, pValue As Object, ByRef pIsValid As Boolean, ByRef pErrorText As String) As Boolean Private Function GridTables_ValidateColumn(pView As GridView, pColumnDefinition As DataTable, ColumnName As String, pValue As Object, ByRef pIsValid As Boolean, ByRef pErrorText As String) As Boolean
Dim oColumn As DataRow = (From r As DataRow In pColumnDefinition.Rows Dim oColumn As DataRow = (From r As DataRow In pColumnDefinition.Rows
Where r.Item("SPALTENNAME") = ColumnName Where r.Item("SPALTENNAME") = ColumnName
Select r).FirstOrDefault() Select r).FirstOrDefault()

View File

@ -29,84 +29,6 @@ Public Class ClassFormat
End Select End Select
End Function End Function
Public Shared Function GetFormattedValue(pControlName As String, pValueObject As Object, pFormatString As String) As String
Try
If pFormatString <> String.Empty Then
' https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tostring?view=net-7.0#system-datetime-tostring(system-string)
Select Case pFormatString
Case ClassControlCreator.CONTROL_TYPE_CURRENCY ' 16,325.63
If TypeOf pValueObject Is Double Then
Dim oFormattedValue As Double = pValueObject
Return oFormattedValue.ToString(CURRENCY_FORMAT)
ElseIf TypeOf pValueObject Is String Then
Dim oFormattedValue As Double
Double.TryParse(pValueObject, oFormattedValue)
Return oFormattedValue.ToString(CURRENCY_FORMAT)
Else
Return Nothing
End If
Case ClassControlCreator.CONTROL_TYPE_DOUBLE ' 16325,63
If TypeOf pValueObject Is Double Then
Dim oFormattedValue As Double = pValueObject
Return oFormattedValue.ToString(DECIMAL_FORMAT)
ElseIf TypeOf pValueObject Is String Then
Dim oFormattedValue As Double
Double.TryParse(pValueObject, oFormattedValue)
Return oFormattedValue.ToString(DECIMAL_FORMAT)
Else
Return Nothing
End If
Case ClassControlCreator.CONTROL_TYPE_DATE ' 15.06.2008
Dim oFormattedValue As DateTime
If TypeOf pValueObject Is DateTime Then
oFormattedValue = pValueObject
Return oFormattedValue.ToString(DATE_FORMAT)
ElseIf TypeOf pValueObject Is String Then
DateTime.TryParse(pValueObject, oFormattedValue)
Return oFormattedValue.ToString(DATE_FORMAT)
Else
Return Nothing
End If
Case ClassControlCreator.CONTROL_TYPE_DATETIME ' 15.06.2008 9:15:07
Dim oFormattedValue As DateTime
If TypeOf pValueObject Is DateTime Then
oFormattedValue = pValueObject
Return oFormattedValue.ToString(DATETIME_FORMAT)
ElseIf TypeOf pValueObject Is String Then
DateTime.TryParse(pValueObject, oFormattedValue)
Return oFormattedValue.ToString(DATETIME_FORMAT)
Else
Return Nothing
End If
Case Else ' Unknown Format String
LOGGER.Warn("Format String [{0}] for Control [{1}] is not valid!", pFormatString, pControlName)
Return Nothing
End Select
Else
Return Nothing
End If
Catch ex As Exception
LOGGER.Warn($"Unexpected error while formatting Value for Control [{0}]", pControlName)
LOGGER.Error(ex)
Return Nothing
End Try
End Function
''' <summary> ''' <summary>
''' Converts a string according to the type information, using the invariant culture ''' Converts a string according to the type information, using the invariant culture
''' </summary> ''' </summary>

View File

@ -133,7 +133,6 @@
End Function End Function
Public Function Delete_Term_Object_From_Metadata(oAttributeName As String, oTerm2Delete As String) As Object Public Function Delete_Term_Object_From_Metadata(oAttributeName As String, oTerm2Delete As String) As Object
Try Try
Dim oAttributeValue
Dim oID_IS_FOREIGN As Integer Dim oID_IS_FOREIGN As Integer
oID_IS_FOREIGN = 0 oID_IS_FOREIGN = 0
If IDB_USES_WMFILESTORE Then If IDB_USES_WMFILESTORE Then

View File

@ -4,6 +4,8 @@ Imports DigitalData.Controls.LookupGrid
Imports DevExpress.XtraGrid Imports DevExpress.XtraGrid
Imports DevExpress.XtraGrid.Views.Grid Imports DevExpress.XtraGrid.Views.Grid
Imports DevExpress.XtraGrid.Columns Imports DevExpress.XtraGrid.Columns
Imports DevExpress.XtraEditors
Imports DigitalData.Modules.Language
''' <summary> ''' <summary>
''' Defines common Functions for Checking for and replacing placeholders. ''' Defines common Functions for Checking for and replacing placeholders.
''' This Class also includes a child class `Pattern` for passing around Patterns. ''' This Class also includes a child class `Pattern` for passing around Patterns.
@ -209,6 +211,9 @@ Public Class clsPatterns
Case GetType(TextBox) Case GetType(TextBox)
oReplaceValue = oControl.Text oReplaceValue = oControl.Text
Case GetType(TextEdit)
oReplaceValue = Utils.NotNull(DirectCast(oControl, TextEdit).EditValue, String.Empty)
Case GetType(LookupControl3) Case GetType(LookupControl3)
Dim oLookupControl3 As LookupControl3 = oControl Dim oLookupControl3 As LookupControl3 = oControl
If oLookupControl3.Properties.SelectedValues.Count = 1 Then If oLookupControl3.Properties.SelectedValues.Count = 1 Then
@ -217,7 +222,7 @@ Public Class clsPatterns
oReplaceValue = ERROR_REPLACE_VALUE oReplaceValue = ERROR_REPLACE_VALUE
End If End If
Case GetType(ComboBox) Case GetType(Windows.Forms.ComboBox)
oReplaceValue = oControl.Text oReplaceValue = oControl.Text
Case GetType(CheckBox) Case GetType(CheckBox)

View File

@ -197,7 +197,7 @@ Public Class frmAdministration
If tabctrl_Profilkonfig.SelectedIndex = 1 Then If tabctrl_Profilkonfig.SelectedIndex = 1 Then
CURRENT_OBJECTTYPE = cmbObjekttypen.Text CURRENT_OBJECTTYPE = cmbObjekttypen.Text
If TabControl2.SelectedIndex = 1 Then If TabControl2.SelectedIndex = 1 Then
Refresh_Final_indexe() Refresh_Final_Indexes()
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
@ -406,7 +406,7 @@ Public Class frmAdministration
EditMode_Profile("Unlock") EditMode_Profile("Unlock")
End Sub End Sub
Private Sub Refresh_Final_indexe() Private Sub Refresh_Final_Indexes()
_Logger.Debug("Loading Final Index Data") _Logger.Debug("Loading Final Index Data")
Try Try
@ -434,7 +434,7 @@ Public Class frmAdministration
RibbonPageGroup4.Enabled = False RibbonPageGroup4.Enabled = False
Case 1 Case 1
CURRENT_OBJECTTYPE = cmbObjekttypen.Text CURRENT_OBJECTTYPE = cmbObjekttypen.Text
Refresh_Final_indexe() Refresh_Final_Indexes()
CancelFinalIndexInsert() CancelFinalIndexInsert()
End Select End Select
@ -628,7 +628,7 @@ Public Class frmAdministration
Save_Profile() Save_Profile()
End If End If
If UNSAVED_CHANGES_FI Then If UNSAVED_CHANGES_FI Then
Save_FI() Save_Final_Indexes()
End If End If
e.Cancel = True e.Cancel = True
Else Else
@ -721,7 +721,7 @@ Public Class frmAdministration
pgFinalIndexes.Refresh() pgFinalIndexes.Refresh()
If oShouldRefreshGrid Then If oShouldRefreshGrid Then
Refresh_Final_indexe() Refresh_Final_Indexes()
End If End If
Catch ex As Exception Catch ex As Exception
_Logger.Error(ex) _Logger.Error(ex)
@ -1016,7 +1016,7 @@ Public Class frmAdministration
End Sub End Sub
Private Sub BarButtonItem15_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem15.ItemClick Private Sub BarButtonItem15_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem15.ItemClick
Refresh_Final_indexe() Refresh_Final_Indexes()
End Sub End Sub
Private Sub BarButtonItem16_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem16.ItemClick Private Sub BarButtonItem16_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem16.ItemClick
@ -1033,7 +1033,7 @@ Public Class frmAdministration
If Not IsNothing(row) Then If Not IsNothing(row) Then
If MsgBox("Wollen Sie den Index wirklich löschen?", MsgBoxStyle.YesNo Or MsgBoxStyle.Question) = MsgBoxResult.Yes Then If MsgBox("Wollen Sie den Index wirklich löschen?", MsgBoxStyle.YesNo Or MsgBoxStyle.Question) = MsgBoxResult.Yes Then
TBPM_PROFILE_FINAL_INDEXINGTableAdapter.DeleteFinalIndex(row.Item("GUID")) TBPM_PROFILE_FINAL_INDEXINGTableAdapter.DeleteFinalIndex(row.Item("GUID"))
Refresh_Final_indexe() Refresh_Final_Indexes()
MsgBox("Index erfolgreich gelöscht!", MsgBoxStyle.Information, "Hinweis:") MsgBox("Index erfolgreich gelöscht!", MsgBoxStyle.Information, "Hinweis:")
End If End If
@ -1041,11 +1041,10 @@ Public Class frmAdministration
End Sub End Sub
Private Sub BarButtonItem18_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem18.ItemClick Private Sub BarButtonItem18_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem18.ItemClick
Save_FI() Save_Final_Indexes()
Refresh_Final_Indexes()
Refresh_Final_indexe()
End Sub End Sub
Private Sub Save_FI() Private Sub Save_Final_Indexes()
Try Try
'Dim obj As FinalIndexProperties = PropertyGrid1.SelectedObject 'Dim obj As FinalIndexProperties = PropertyGrid1.SelectedObject
Dim obj As FinalIndexProperties = pgFinalIndexes.SelectedObject Dim obj As FinalIndexProperties = pgFinalIndexes.SelectedObject
@ -1248,7 +1247,7 @@ Public Class frmAdministration
End If End If
If UNSAVED_CHANGES_FI Then If UNSAVED_CHANGES_FI Then
Save_FI() Save_Final_Indexes()
End If End If
Return True Return True
@ -1302,7 +1301,7 @@ Public Class frmAdministration
tsbStaticInfo.Caption = "" tsbStaticInfo.Caption = ""
Indexe_eintragen() Indexe_eintragen()
If tabctrl_Profilkonfig.SelectedIndex = 1 And TBPM_PROFILEBindingSource.Position <> -1 Then If tabctrl_Profilkonfig.SelectedIndex = 1 And TBPM_PROFILEBindingSource.Position <> -1 Then
Refresh_Final_indexe() Refresh_Final_Indexes()
End If End If
End Sub End Sub
Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter Private Sub GroupBox2_Enter(sender As Object, e As EventArgs) Handles GroupBox2.Enter
@ -1341,7 +1340,6 @@ Public Class frmAdministration
End Function End Function
Private Sub BarButtonItem22_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem22.ItemClick Private Sub BarButtonItem22_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem22.ItemClick
Dim oUpdate As String
Dim oCtrlSeriesSQL As Button Dim oCtrlSeriesSQL As Button
Dim oCtrlSeriesType As ComboBox Dim oCtrlSeriesType As ComboBox
Dim oCtrlSeriesArgument As TextBox Dim oCtrlSeriesArgument As TextBox

View File

@ -21,7 +21,9 @@ Public Class frmFormDesigner
' Control Variables ' Control Variables
Private CurrentControl As Control = Nothing Private CurrentControl As Control = Nothing
Private _Logger = LOGCONFIG.GetLogger() Private _Logger = LOGCONFIG.GetLogger()
Private ControlCreator As ClassControlCreator
' Movement Variables ' Movement Variables
Private Mouse_IsPressed As Boolean Private Mouse_IsPressed As Boolean
@ -56,8 +58,7 @@ Public Class frmFormDesigner
Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load Private Sub frmFormDesigner_Load(sender As Object, e As EventArgs) Handles Me.Load
Try Try
ControlCreator = New ClassControlCreator(LOGCONFIG)
ClassControlCreator.Logger = LOGCONFIG.GetLoggerFor("ControlCreator")
BarButtonItem3.Caption = "Designer locked" BarButtonItem3.Caption = "Designer locked"
BarButtonItem3.ItemAppearance.Normal.BackColor = Color.Red BarButtonItem3.ItemAppearance.Normal.BackColor = Color.Red
Designer_Locked = True Designer_Locked = True
@ -258,33 +259,33 @@ Public Class frmFormDesigner
' Jetzt die Control spezifischen Eigenschaften zuweisen ' Jetzt die Control spezifischen Eigenschaften zuweisen
Select Case row.Item("CTRL_TYPE") Select Case row.Item("CTRL_TYPE")
Case ClassControlCreator.PREFIX_TEXTBOX Case ClassControlCreator.PREFIX_TEXTBOX
Dim txt = ClassControlCreator.CreateExistingTextbox(row, True) Dim txt = ControlCreator.CreateExistingTextbox(row, True)
pnldesigner.Controls.Add(txt) pnldesigner.Controls.Add(txt)
SetMovementHandlers(txt) SetMovementHandlers(txt)
Case ClassControlCreator.PREFIX_LABEL Case ClassControlCreator.PREFIX_LABEL
Dim lbl = ClassControlCreator.CreateExistingLabel(row, True) Dim lbl = ControlCreator.CreateExistingLabel(row, True)
pnldesigner.Controls.Add(lbl) pnldesigner.Controls.Add(lbl)
SetMovementHandlers(lbl) SetMovementHandlers(lbl)
Case "CMB" Case "CMB"
Dim cmb = ClassControlCreator.CreateExistingCombobox(row, True) Dim cmb = ControlCreator.CreateExistingCombobox(row, True)
pnldesigner.Controls.Add(cmb) pnldesigner.Controls.Add(cmb)
SetMovementHandlers(cmb) SetMovementHandlers(cmb)
Case "DTP" Case "DTP"
Dim dtp = ClassControlCreator.CreateExistingDatepicker(row, True) Dim dtp = ControlCreator.CreateExistingDatepicker(row, True)
pnldesigner.Controls.Add(dtp) pnldesigner.Controls.Add(dtp)
SetMovementHandlers(dtp) SetMovementHandlers(dtp)
Case "CHK" Case "CHK"
Dim chk = ClassControlCreator.CreateExisingCheckbox(row, True) Dim chk = ControlCreator.CreateExisingCheckbox(row, True)
pnldesigner.Controls.Add(chk) pnldesigner.Controls.Add(chk)
SetMovementHandlers(chk) SetMovementHandlers(chk)
Case "DGV" Case "DGV"
Dim dgv = ClassControlCreator.CreateExistingDataGridView(row, True) Dim dgv = ControlCreator.CreateExistingDataGridView(row, True)
pnldesigner.Controls.Add(dgv) pnldesigner.Controls.Add(dgv)
SetMovementHandlers(dgv) SetMovementHandlers(dgv)
@ -296,7 +297,7 @@ Public Class frmFormDesigner
Dim oDTColumnsPerDevExGrid As DataTable = DatabaseFallback.GetDatatableECM(oSQL) ', "FDesignLaodControls") Dim oDTColumnsPerDevExGrid As DataTable = DatabaseFallback.GetDatatableECM(oSQL) ', "FDesignLaodControls")
Dim table = ClassControlCreator.CreateExistingGridControl(row, oDTColumnsPerDevExGrid, True) Dim table = ControlCreator.CreateExistingGridControl(row, oDTColumnsPerDevExGrid, True)
AddHandler table.MouseClick, AddressOf gridControl_MouseClick AddHandler table.MouseClick, AddressOf gridControl_MouseClick
' AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick ' AddHandler table.ColumnHeaderMouseClick, AddressOf table_ColumnHeaderMouseClick
@ -305,16 +306,16 @@ Public Class frmFormDesigner
SetMovementHandlers(table) SetMovementHandlers(table)
Case "LOOKUP" Case "LOOKUP"
Dim lookup = ClassControlCreator.CreateExistingLookupControl(row, True) Dim lookup = ControlCreator.CreateExistingLookupControl(row, True)
pnldesigner.Controls.Add(lookup) pnldesigner.Controls.Add(lookup)
SetMovementHandlers(lookup) SetMovementHandlers(lookup)
Case "LINE" Case "LINE"
Dim line = ClassControlCreator.CreateExistingLine(row, True) Dim line = ControlCreator.CreateExistingLine(row, True)
pnldesigner.Controls.Add(line) pnldesigner.Controls.Add(line)
SetMovementHandlers(line) SetMovementHandlers(line)
Case "BUTTON" Case "BUTTON"
Dim oButton = ClassControlCreator.CreateExistingButton(row, True) Dim oButton = ControlCreator.CreateExistingButton(row, True)
pnldesigner.Controls.Add(oButton) pnldesigner.Controls.Add(oButton)
SetMovementHandlers(oButton) SetMovementHandlers(oButton)
End Select End Select
@ -1104,7 +1105,7 @@ Public Class frmFormDesigner
Try Try
Select Case ControlSelected Select Case ControlSelected
Case ClassControlCreator.PREFIX_LABEL Case ClassControlCreator.PREFIX_LABEL
Dim label = ClassControlCreator.CreateNewLabel(cursorPosition) Dim label = ControlCreator.CreateNewLabel(cursorPosition)
SetMovementHandlers(label) SetMovementHandlers(label)
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, label.Name, "LBL", label.Text, label.Location.X, label.Location.Y, USER_USERNAME, label.Size.Height, label.Size.Width) TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, label.Name, "LBL", label.Text, label.Location.X, label.Location.Y, USER_USERNAME, label.Size.Height, label.Size.Width)
@ -1119,7 +1120,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(label) pnldesigner.Controls.Add(label)
Case ClassControlCreator.PREFIX_TEXTBOX Case ClassControlCreator.PREFIX_TEXTBOX
Dim txt = ClassControlCreator.CreateNewTextBox(cursorPosition) Dim txt = ControlCreator.CreateNewTextBox(cursorPosition)
SetMovementHandlers(txt) SetMovementHandlers(txt)
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, txt.Name, "TXT", txt.Name, txt.Location.X, txt.Location.Y, USER_USERNAME, txt.Size.Height, txt.Size.Width) TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, txt.Name, "TXT", txt.Name, txt.Location.X, txt.Location.Y, USER_USERNAME, txt.Size.Height, txt.Size.Width)
@ -1133,7 +1134,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(txt) pnldesigner.Controls.Add(txt)
Case ClassControlCreator.PREFIX_COMBOBOX Case ClassControlCreator.PREFIX_COMBOBOX
Dim cmb = ClassControlCreator.CreateNewCombobox(cursorPosition) Dim cmb = ControlCreator.CreateNewCombobox(cursorPosition)
SetMovementHandlers(cmb) SetMovementHandlers(cmb)
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, cmb.Name, "CMB", cmb.Name, cmb.Location.X, cmb.Location.Y, USER_USERNAME, cmb.Size.Height, cmb.Size.Width) TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, cmb.Name, "CMB", cmb.Name, cmb.Location.X, cmb.Location.Y, USER_USERNAME, cmb.Size.Height, cmb.Size.Width)
@ -1147,7 +1148,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(cmb) pnldesigner.Controls.Add(cmb)
Case ClassControlCreator.PREFIX_DATETIMEPICKER Case ClassControlCreator.PREFIX_DATETIMEPICKER
Dim dtp = ClassControlCreator.CreateNewDatetimepicker(cursorPosition) Dim dtp = ControlCreator.CreateNewDatetimepicker(cursorPosition)
SetMovementHandlers(dtp) SetMovementHandlers(dtp)
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dtp.Name, "DTP", dtp.Name, dtp.Location.X, dtp.Location.Y, USER_USERNAME, dtp.Size.Height, dtp.Size.Width) TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, dtp.Name, "DTP", dtp.Name, dtp.Location.X, dtp.Location.Y, USER_USERNAME, dtp.Size.Height, dtp.Size.Width)
@ -1161,7 +1162,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(dtp) pnldesigner.Controls.Add(dtp)
Case ClassControlCreator.PREFIX_CHECKBOX Case ClassControlCreator.PREFIX_CHECKBOX
Dim chk = ClassControlCreator.CreateNewCheckbox(cursorPosition) Dim chk = ControlCreator.CreateNewCheckbox(cursorPosition)
SetMovementHandlers(chk) SetMovementHandlers(chk)
TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, chk.Name, "CHK", chk.Text, chk.Location.X, chk.Location.Y, USER_USERNAME, chk.Size.Height, chk.Size.Width) TBPM_PROFILE_CONTROLSTableAdapter.cmdInsertAnlage(ProfileId, chk.Name, "CHK", chk.Text, chk.Location.X, chk.Location.Y, USER_USERNAME, chk.Size.Height, chk.Size.Width)
@ -1175,7 +1176,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(chk) pnldesigner.Controls.Add(chk)
Case ClassControlCreator.PREFIX_LOOKUP Case ClassControlCreator.PREFIX_LOOKUP
Dim lc As LookupControl3 = ClassControlCreator.CreateNewLookupControl(cursorPosition) Dim lc As LookupControl3 = ControlCreator.CreateNewLookupControl(cursorPosition)
SetMovementHandlers(lc) SetMovementHandlers(lc)
@ -1190,7 +1191,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(lc) pnldesigner.Controls.Add(lc)
Case ClassControlCreator.PREFIX_TABLE Case ClassControlCreator.PREFIX_TABLE
Dim tb = ClassControlCreator.CreateNewTable(cursorPosition) Dim tb = ControlCreator.CreateNewTable(cursorPosition)
SetMovementHandlers(tb) SetMovementHandlers(tb)
AddHandler tb.MouseClick, AddressOf gridControl_MouseClick AddHandler tb.MouseClick, AddressOf gridControl_MouseClick
@ -1210,7 +1211,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(tb) pnldesigner.Controls.Add(tb)
Case ClassControlCreator.PREFIX_LINE Case ClassControlCreator.PREFIX_LINE
Dim line = ClassControlCreator.CreateNewLine(cursorPosition) Dim line = ControlCreator.CreateNewLine(cursorPosition)
SetMovementHandlers(line) SetMovementHandlers(line)
@ -1225,7 +1226,7 @@ Public Class frmFormDesigner
pnldesigner.Controls.Add(line) pnldesigner.Controls.Add(line)
Case ClassControlCreator.PREFIX_BUTTON Case ClassControlCreator.PREFIX_BUTTON
Dim oButton = ClassControlCreator.CreateNewButton(cursorPosition) Dim oButton = ControlCreator.CreateNewButton(cursorPosition)
SetMovementHandlers(oButton) SetMovementHandlers(oButton)

View File

@ -25,6 +25,7 @@ Public Class frmMassValidator
Private CTRLS_Loaded As Boolean = False Private CTRLS_Loaded As Boolean = False
Private FORM_Shown As Boolean = False Private FORM_Shown As Boolean = False
Private _dependingControl_in_action As Boolean = False Private _dependingControl_in_action As Boolean = False
Private ControlCreator As ClassControlCreator
Private oErrorMessage As String Private oErrorMessage As String
Private _windream As New ClassWindream_allgemein Private _windream As New ClassWindream_allgemein
@ -43,6 +44,7 @@ Public Class frmMassValidator
'_windreamPM = New ClassPMWindream() '_windreamPM = New ClassPMWindream()
'_windreamPM.Create_Session() '_windreamPM.Create_Session()
ControlCreator = New ClassControlCreator(LOGCONFIG)
LOGGER.Debug("windream initialized frmMassValidator") LOGGER.Debug("windream initialized frmMassValidator")
@ -146,7 +148,7 @@ Public Class frmMassValidator
Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper Select Case oControlRow.Item("CTRL_TYPE").ToString.ToUpper
Case ClassControlCreator.PREFIX_TEXTBOX Case ClassControlCreator.PREFIX_TEXTBOX
LOGGER.Debug("Versuch TXT zu laden") LOGGER.Debug("Versuch TXT zu laden")
Dim txt As TextEdit = ClassControlCreator.CreateExistingTextbox(oControlRow, False) Dim txt As TextEdit = ControlCreator.CreateExistingTextbox(oControlRow, False)
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
@ -155,19 +157,19 @@ Public Class frmMassValidator
oControl = txt oControl = txt
Case "LBL" Case "LBL"
LOGGER.Debug("Versuch LBL zu laden") LOGGER.Debug("Versuch LBL zu laden")
oControl = ClassControlCreator.CreateExistingLabel(oControlRow, False) oControl = ControlCreator.CreateExistingLabel(oControlRow, False)
Case "CMB" Case "CMB"
LOGGER.Debug("Versuch CMB zu laden") LOGGER.Debug("Versuch CMB zu laden")
If oControlRow.Item("READ_ONLY") Then If oControlRow.Item("READ_ONLY") Then
Dim cmbReadonly = ClassControlCreator.CreateExistingTextbox(oControlRow, False) Dim cmbReadonly = ControlCreator.CreateExistingTextbox(oControlRow, False)
oControl = cmbReadonly oControl = cmbReadonly
Else Else
Dim cmb = ClassControlCreator.CreateExistingCombobox(oControlRow, False) Dim cmb = ControlCreator.CreateExistingCombobox(oControlRow, False)
AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex AddHandler cmb.SelectedValueChanged, AddressOf OnCmbselectedIndex
#Region "CONTROL LIST" #Region "CONTROL LIST"
If ClassControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, cmb.Name) = 0 Then If ControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, cmb.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting control-properties (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
@ -179,7 +181,7 @@ Public Class frmMassValidator
LOGGER.Debug("ConID > 0 And commandsql <> ''") LOGGER.Debug("ConID > 0 And commandsql <> ''")
Dim connectionString As String Dim connectionString As String
Dim ConRow As DataRow() = ClassControlCreator.GET_CONNECTION_INFO(CURR_CON_ID) Dim ConRow As DataRow() = ControlCreator.GET_CONNECTION_INFO(CURR_CON_ID)
If ConRow Is Nothing Then If ConRow Is Nothing Then
MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting Coninfo (CMB load) - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
@ -277,26 +279,7 @@ Public Class frmMassValidator
End If End If
#End Region #End Region
'Dim oMaxWidth As Integer = cmb.Width
'Using oGraphics As Graphics = cmb.CreateGraphics()
' Dim oStringLength = oGraphics.MeasureString(Text, cmb.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 cmb.Items 'Für alle Einträge...
' Dim g1 As Graphics = cmb.CreateGraphics
' If g1.MeasureString(Text, cmb.Font).Width + 30 > oMaxWidth Then
' oMaxWidth = g1.MeasureString(Text, cmb.Font).Width + 30
' End If
' g1.Dispose()
' Next oItem
'End Using
'cmb.DropDownWidth = oMaxWidth
@ -311,10 +294,10 @@ Public Class frmMassValidator
Case "DTP" Case "DTP"
LOGGER.Debug("Versuch DTP zu laden") LOGGER.Debug("Versuch DTP zu laden")
oControl = ClassControlCreator.CreateExistingDatepicker(oControlRow, False) oControl = ControlCreator.CreateExistingDatepicker(oControlRow, False)
Case "DGV" Case "DGV"
LOGGER.Debug("Versuch DGV zu laden") LOGGER.Debug("Versuch DGV zu laden")
Dim dgv = ClassControlCreator.CreateExistingDataGridView(oControlRow, False) Dim dgv = ControlCreator.CreateExistingDataGridView(oControlRow, False)
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
@ -322,20 +305,20 @@ Public Class frmMassValidator
Case "CHK" Case "CHK"
LOGGER.Debug("Versuch Checkbox zu laden") LOGGER.Debug("Versuch Checkbox zu laden")
oControl = ClassControlCreator.CreateExisingCheckbox(oControlRow, False) oControl = ControlCreator.CreateExisingCheckbox(oControlRow, False)
Case "LINE" Case "LINE"
LOGGER.Debug("Versuch Linie zu laden") LOGGER.Debug("Versuch Linie zu laden")
oControl = ClassControlCreator.CreateExistingLine(oControlRow, False) oControl = ControlCreator.CreateExistingLine(oControlRow, False)
Case "LOOKUP" Case "LOOKUP"
Dim oMultiselect = oControlRow.Item("MULTISELECT") Dim oMultiselect = oControlRow.Item("MULTISELECT")
Dim oReadonly = oControlRow.Item("READ_ONLY") Dim oReadonly = oControlRow.Item("READ_ONLY")
If oMultiselect = False And oReadonly = True Then If oMultiselect = False And oReadonly = True Then
Dim lookupReadonly = ClassControlCreator.CreateExistingTextbox(oControlRow, False) Dim lookupReadonly = ControlCreator.CreateExistingTextbox(oControlRow, False)
oControl = lookupReadonly oControl = lookupReadonly
Else Else
Dim lookup As LookupControl3 = ClassControlCreator.CreateExistingLookupControl(oControlRow, False) Dim lookup As LookupControl3 = ControlCreator.CreateExistingLookupControl(oControlRow, False)
lookup.Properties.PreventDuplicates = oControlRow.Item("VKT_PREVENT_MULTIPLE_VALUES") lookup.Properties.PreventDuplicates = oControlRow.Item("VKT_PREVENT_MULTIPLE_VALUES")
lookup.Properties.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM") lookup.Properties.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM")
@ -373,7 +356,7 @@ Public Class frmMassValidator
LOGGER.Debug("Versuch Tabelle zu laden") LOGGER.Debug("Versuch Tabelle zu laden")
Dim oDTMyColumns As DataTable = DatabaseFallback.GetDatatableECM($"SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = {oControlRow.Item("GUID")} ORDER BY SEQUENCE") ', "MV_LoadControls1") Dim oDTMyColumns As DataTable = DatabaseFallback.GetDatatableECM($"SELECT * FROM TBPM_CONTROL_TABLE WHERE CONTROL_ID = {oControlRow.Item("GUID")} ORDER BY SEQUENCE") ', "MV_LoadControls1")
oControl = ClassControlCreator.CreateExistingGridControl(oControlRow, oDTMyColumns, False) oControl = ControlCreator.CreateExistingGridControl(oControlRow, oDTMyColumns, False)
End Select End Select
If oControl IsNot Nothing AndAlso TypeOf oControl IsNot Label Then If oControl IsNot Nothing AndAlso TypeOf oControl IsNot Label Then
@ -451,7 +434,6 @@ Public Class frmMassValidator
Sub FillIndexValues() Sub FillIndexValues()
Dim controltype As String Dim controltype As String
Dim indexname As String Dim indexname As String
Dim resultvalue
Try Try
For Each oControl As Control In Me.pnldesigner.Controls For Each oControl As Control In Me.pnldesigner.Controls
@ -849,12 +831,12 @@ Public Class frmMassValidator
If (e.KeyCode = Keys.Return) Or (e.KeyCode = Keys.Tab) Or (e.KeyCode = Keys.Enter) Then If (e.KeyCode = Keys.Return) Or (e.KeyCode = Keys.Tab) Or (e.KeyCode = Keys.Enter) Then
Try Try
If ClassControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, box.Name) = 0 Then If ControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, box.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting control-properties - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
If ClassControlCreator.GET_DEPENDING_CONTROLS(DTCONTROLS, box.Name) = False Then If ControlCreator.GetDependingControls(DTCONTROLS, box.Name) = False Then
MsgBox("Unexpected Error in getting dependent controls - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting dependent controls - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
@ -953,15 +935,15 @@ Public Class frmMassValidator
End Try End Try
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 Windows.Forms.ComboBox = sender
If cmb.SelectedIndex <> -1 And CTRLS_Loaded = True And FORM_Shown = True Then If cmb.SelectedIndex <> -1 And CTRLS_Loaded = True And FORM_Shown = True Then
' Try ' Try
If ClassControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, cmb.Name) = 0 Then If ControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, cmb.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties CMB - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting control-properties CMB - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
If ClassControlCreator.GET_DEPENDING_CONTROLS(DTCONTROLS, cmb.Name) = False Then If ControlCreator.GetDependingControls(DTCONTROLS, cmb.Name) = False Then
MsgBox("Unexpected Error in getting dependent controls CMB- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting dependent controls CMB- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
@ -999,12 +981,12 @@ Public Class frmMassValidator
Public Sub onDGVRowValidating(ByVal sender As Object, ByVal e As DataGridViewCellCancelEventArgs) Public Sub onDGVRowValidating(ByVal sender As Object, ByVal e As DataGridViewCellCancelEventArgs)
Dim dgv As DataGridView = sender Dim dgv As DataGridView = sender
Try Try
If ClassControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, dgv.Name) = 0 Then If ControlCreator.GET_CONTROL_PROPERTIES(DTCONTROLS, dgv.Name) = 0 Then
MsgBox("Unexpected Error in getting control-properties DGV - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting control-properties DGV - Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
If ClassControlCreator.GET_DEPENDING_CONTROLS(DTCONTROLS, dgv.Name) = False Then If ControlCreator.GetDependingControls(DTCONTROLS, dgv.Name) = False Then
MsgBox("Unexpected Error in getting dependent controls DGV- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical) MsgBox("Unexpected Error in getting dependent controls DGV- Check the log and inform Your sysadmin!", MsgBoxStyle.Critical)
Exit Sub Exit Sub
End If End If
@ -1228,7 +1210,7 @@ Public Class frmMassValidator
End Try End Try
Case GetType(System.Windows.Forms.ComboBox) Case GetType(System.Windows.Forms.ComboBox)
Dim cmb As ComboBox = oControl Dim cmb As Windows.Forms.ComboBox = oControl
Try Try
value_from_control = cmb.Text value_from_control = cmb.Text
Catch ex As Exception Catch ex As Exception

View File

@ -83,19 +83,8 @@ Public Class frmValidator
Private Property _dependingColumn_in_action As Boolean = False Private Property _dependingColumn_in_action As Boolean = False
Private Property _SetControlValue_in_action As Boolean = False Private Property _SetControlValue_in_action As Boolean = False
Private Property DTConversations As DataTable
Private Property DTDYNAMIC_RIGHTS As DataTable
Private Property DT_AdditionalSearches_Resultset_Docs As DataTable Private Property DT_AdditionalSearches_Resultset_Docs As DataTable
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 Public Property FormLoaded As Boolean = False
Private Property ItemWorked As Boolean = False Private Property ItemWorked As Boolean = False
Private Property Override As Boolean = False Private Property Override As Boolean = False
@ -104,7 +93,10 @@ Public Class frmValidator
Private Property listChangedLookup As New List(Of String) Private Property listChangedLookup As New List(Of String)
Private Property ControlHandleStarted As Boolean = False Private Property ControlHandleStarted As Boolean = False
Private Documentloader As Loader Private Documentloader As Loader
Private ControlCreator As ClassControlCreator
Private Property OperationMode As OperationMode Private Property OperationMode As OperationMode
Private ReadOnly Environment As Environment Private ReadOnly Environment As Environment
Private AdditionalDocResultsExist As Boolean = False Private AdditionalDocResultsExist As Boolean = False
@ -159,7 +151,7 @@ Public Class frmValidator
OperationMode = GetOperationMode() OperationMode = GetOperationMode()
Documentloader = New Loader(LOGCONFIG, OperationMode, Environment.Service.Client, Environment.User) Documentloader = New Loader(LOGCONFIG, OperationMode, Environment.Service.Client, Environment.User)
ControlCreator = New ClassControlCreator(LOGCONFIG)
PMDelimiter = "~" PMDelimiter = "~"
Override = False Override = False
@ -169,8 +161,7 @@ Public Class frmValidator
OLD_Document_Path = "" OLD_Document_Path = ""
first_control = Nothing first_control = Nothing
me_closing = False me_closing = False
'pdfxchange = False
'sumatra = False
FormLoaded = False FormLoaded = False
Attmt_bbtnitmShow.Visibility = BarItemVisibility.Never Attmt_bbtnitmShow.Visibility = BarItemVisibility.Never
Attmnt_bbtnitm_LoadonClick.Visibility = BarItemVisibility.Never Attmnt_bbtnitm_LoadonClick.Visibility = BarItemVisibility.Never
@ -617,7 +608,21 @@ Public Class frmValidator
End If End If
Dim oValue Dim oValue
If TypeOf control Is TextEdit Then ' Because LookupControl is a subtype of TextEdit,
' we need to check for LookupControl first!
If TypeOf control Is LookupControl3 Then
Try
Dim lookup As LookupControl3 = control
lookup.Properties.DataSource = oDTContent
lookup.Properties.ValueMember = oDTContent.Columns.Item(0).ColumnName
lookup.Properties.DisplayMember = oDTContent.Columns.Item(0).ColumnName
Catch ex As Exception
LOGGER.Warn("Error in LookUpLoadSQLData: " & ex.Message)
End Try
ElseIf TypeOf control Is TextEdit Then
Try Try
Dim firstRow As DataRow = oDTContent.Rows(0) Dim firstRow As DataRow = oDTContent.Rows(0)
@ -629,7 +634,7 @@ Public Class frmValidator
LOGGER.Warn("Error in TextBoxLoadSQLData: " & ex.Message) LOGGER.Warn("Error in TextBoxLoadSQLData: " & ex.Message)
End Try End Try
ElseIf TypeOf control Is ComboBox Then ElseIf TypeOf control Is Windows.Forms.ComboBox Then
Try Try
Dim oMyComboBox As Windows.Forms.ComboBox = control Dim oMyComboBox As Windows.Forms.ComboBox = control
Dim oselectedIndex = oMyComboBox.SelectedIndex Dim oselectedIndex = oMyComboBox.SelectedIndex
@ -646,17 +651,7 @@ Public Class frmValidator
Catch ex As Exception Catch ex As Exception
LOGGER.Warn("Error in ComboBoxLoadSQLData: " & ex.Message) LOGGER.Warn("Error in ComboBoxLoadSQLData: " & ex.Message)
End Try End Try
ElseIf TypeOf control Is LookupControl3 Then
Try
Dim lookup As LookupControl3 = control
lookup.Properties.DataSource = oDTContent
lookup.Properties.ValueMember = oDTContent.Columns.Item(0).ColumnName
lookup.Properties.DisplayMember = oDTContent.Columns.Item(0).ColumnName
Catch ex As Exception
LOGGER.Warn("Error in LookUpLoadSQLData: " & ex.Message)
End Try
ElseIf TypeOf control Is GridControl Then ElseIf TypeOf control Is GridControl Then
Try Try
Dim dataGridView As GridControl = control Dim dataGridView As GridControl = control
@ -761,8 +756,6 @@ Public Class frmValidator
Dim oTabIndexCounter As Integer = 0 Dim oTabIndexCounter As Integer = 0
ClassControlCreator.Logger = LOGCONFIG.GetLoggerFor("ControlCreator")
For Each oControlRow As DataRow In DT_CONTROLS.Rows For Each oControlRow As DataRow In DT_CONTROLS.Rows
Dim oMyControl As Control Dim oMyControl As Control
Dim oControlID = oControlRow.Item("GUID") Dim oControlID = oControlRow.Item("GUID")
@ -774,7 +767,7 @@ Public Class frmValidator
oControlInfo = ClassControlCreator.PREFIX_TEXTBOX & "#" & oControlInfo oControlInfo = ClassControlCreator.PREFIX_TEXTBOX & "#" & oControlInfo
LOGGER.Debug($"[{oControlInfo}] - TXT Try to create control...") LOGGER.Debug($"[{oControlInfo}] - TXT Try to create control...")
Dim txt As TextEdit = ClassControlCreator.CreateExistingTextbox(oControlRow, False) Dim txt As TextEdit = ControlCreator.CreateExistingTextbox(oControlRow, False)
AddHandler txt.GotFocus, AddressOf OnTextBoxFocus AddHandler txt.GotFocus, AddressOf OnTextBoxFocus
AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus AddHandler txt.LostFocus, AddressOf OnTextBoxLostFocus
AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp AddHandler txt.KeyUp, AddressOf OnTextBoxKeyUp
@ -786,15 +779,15 @@ Public Class frmValidator
End Try End Try
Case "LBL" Case "LBL"
oControlInfo = "LBL#" & oControlInfo oControlInfo = "LBL#" & oControlInfo
oMyControl = ClassControlCreator.CreateExistingLabel(oControlRow, False) oMyControl = ControlCreator.CreateExistingLabel(oControlRow, False)
Case "CMB" Case "CMB"
oControlInfo = "CMB#" & oControlInfo oControlInfo = "CMB#" & oControlInfo
LOGGER.Debug($"[{oControlInfo}] - CMB Try to create control...") LOGGER.Debug($"[{oControlInfo}] - CMB Try to create control...")
If oControlRow.Item("READ_ONLY") Then If oControlRow.Item("READ_ONLY") Then
Dim cmbReadonly = ClassControlCreator.CreateExistingTextbox(oControlRow, False) Dim cmbReadonly = ControlCreator.CreateExistingTextbox(oControlRow, False)
oMyControl = cmbReadonly oMyControl = cmbReadonly
Else Else
Dim oComboBox = ClassControlCreator.CreateExistingCombobox(oControlRow, False) Dim oComboBox = ControlCreator.CreateExistingCombobox(oControlRow, False)
AddHandler oComboBox.SelectedValueChanged, AddressOf OnCmbselectedIndex AddHandler oComboBox.SelectedValueChanged, AddressOf OnCmbselectedIndex
AddHandler oComboBox.GotFocus, Sub(sender As Control, e As EventArgs) AddHandler oComboBox.GotFocus, Sub(sender As Control, e As EventArgs)
@ -878,10 +871,10 @@ Public Class frmValidator
Case "DTP" Case "DTP"
oControlInfo = "DTP#" & oControlInfo oControlInfo = "DTP#" & oControlInfo
oMyControl = ClassControlCreator.CreateExistingDatepicker(oControlRow, False) oMyControl = ControlCreator.CreateExistingDatepicker(oControlRow, False)
Case "DGV" Case "DGV"
Dim dgv = ClassControlCreator.CreateExistingDataGridView(oControlRow, False) Dim dgv = ControlCreator.CreateExistingDataGridView(oControlRow, False)
AddHandler dgv.RowValidating, AddressOf onDGVRowValidating AddHandler dgv.RowValidating, AddressOf onDGVRowValidating
@ -893,10 +886,10 @@ Public Class frmValidator
Dim oReadonly = oControlRow.Item("READ_ONLY") Dim oReadonly = oControlRow.Item("READ_ONLY")
If oMultiselect = False And oReadonly = True Then If oMultiselect = False And oReadonly = True Then
Dim lookupReadonly = ClassControlCreator.CreateExistingTextbox(oControlRow, False) Dim lookupReadonly = ControlCreator.CreateExistingTextbox(oControlRow, False)
oMyControl = lookupReadonly oMyControl = lookupReadonly
Else Else
Dim lookup As LookupControl3 = ClassControlCreator.CreateExistingLookupControl(oControlRow, False) Dim lookup As LookupControl3 = ControlCreator.CreateExistingLookupControl(oControlRow, False)
lookup.Properties.PreventDuplicates = oControlRow.Item("VKT_PREVENT_MULTIPLE_VALUES") lookup.Properties.PreventDuplicates = oControlRow.Item("VKT_PREVENT_MULTIPLE_VALUES")
lookup.Properties.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM") lookup.Properties.AllowAddNewValues = oControlRow.Item("VKT_ADD_ITEM")
@ -958,7 +951,7 @@ Public Class frmValidator
Case "CHK" Case "CHK"
oControlInfo = "CHK#" & oControlInfo oControlInfo = "CHK#" & oControlInfo
oMyControl = ClassControlCreator.CreateExisingCheckbox(oControlRow, False) oMyControl = ControlCreator.CreateExisingCheckbox(oControlRow, False)
Dim mycheckbox As CheckBox = oMyControl Dim mycheckbox As CheckBox = oMyControl
AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange AddHandler mycheckbox.CheckedChanged, AddressOf onCheckBox_CheckedChange
@ -977,7 +970,7 @@ Public Class frmValidator
Continue For Continue For
End If End If
Dim oGrid = ClassControlCreator.CreateExistingGridControl(oControlRow, oFilteredDatatable, False) Dim oGrid = ControlCreator.CreateExistingGridControl(oControlRow, oFilteredDatatable, False)
AddHandler oGrid.ProcessGridKey, Sub(ByVal _sender As Object, ByVal e As KeyEventArgs) AddHandler oGrid.ProcessGridKey, Sub(ByVal _sender As Object, ByVal e As KeyEventArgs)
If e.KeyCode = Keys.Tab Then If e.KeyCode = Keys.Tab Then
@ -1001,9 +994,9 @@ Public Class frmValidator
oMyControl = oGrid oMyControl = oGrid
Case "LINE" Case "LINE"
oMyControl = ClassControlCreator.CreateExistingLine(oControlRow, False) oMyControl = ControlCreator.CreateExistingLine(oControlRow, False)
Case "BUTTON" Case "BUTTON"
Dim obutton = ClassControlCreator.CreateExistingButton(oControlRow, False) Dim obutton = ControlCreator.CreateExistingButton(oControlRow, False)
AddHandler obutton.Click, AddressOf onCustomButtonClick AddHandler obutton.Click, AddressOf onCustomButtonClick
oMyControl = obutton oMyControl = obutton
@ -1056,7 +1049,7 @@ Public Class frmValidator
Case GetType(DevExpress.XtraEditors.TextEdit) Case GetType(DevExpress.XtraEditors.TextEdit)
inctrl.Text = "" inctrl.Text = ""
Case GetType(System.Windows.Forms.ComboBox) Case GetType(System.Windows.Forms.ComboBox)
Dim cmb As ComboBox = inctrl Dim cmb As Windows.Forms.ComboBox = inctrl
cmb.SelectedIndex = -1 cmb.SelectedIndex = -1
Case GetType(System.Windows.Forms.DataGridView) Case GetType(System.Windows.Forms.DataGridView)
Dim dgv As DataGridView = inctrl Dim dgv As DataGridView = inctrl
@ -1097,7 +1090,7 @@ Public Class frmValidator
SetControlValues_FromControl(oTextbox) SetControlValues_FromControl(oTextbox)
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
End Sub End Sub
Private Function GetControlID(ByVal PROFILEID As Integer, Controlname As String) Private Function GetControlID(ByVal PROFILEID As Integer, Controlname As String)
@ -1148,7 +1141,7 @@ Public Class frmValidator
End If End If
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
@ -1165,7 +1158,7 @@ Public Class frmValidator
Private Sub onCustomButtonClick(sender As System.Object, e As System.EventArgs) Private Sub onCustomButtonClick(sender As System.Object, e As System.EventArgs)
Dim oButton As Button = sender Dim oButton As Button = sender
Dim oControlID = DirectCast(oButton.Tag, ClassControlCreator.ControlMetadata).Guid Dim oControlID = DirectCast(oButton.Tag, ClassControlCreator.ControlMetadata).Guid
Dim oSQL = ClassControlCreator.GET_CONTROL_PROPERTY(DT_CONTROLS, oControlID, "SQL_UEBERPRUEFUNG") Dim oSQL = ControlCreator.GET_CONTROL_PROPERTY(DT_CONTROLS, oControlID, "SQL_UEBERPRUEFUNG")
If IsNothing(oSQL) Then If IsNothing(oSQL) Then
LOGGER.Warn("onCustomButtonClick - SQL_UEBERPRUEFUNG IS NOTHING") LOGGER.Warn("onCustomButtonClick - SQL_UEBERPRUEFUNG IS NOTHING")
Exit Sub Exit Sub
@ -1175,7 +1168,7 @@ Public Class frmValidator
LOGGER.Warn("onCustomButtonClick - Check_UpdateIndexe = False >> Exit Click") LOGGER.Warn("onCustomButtonClick - Check_UpdateIndexe = False >> Exit Click")
Exit Sub Exit Sub
End If End If
Override_SQLCommand = ClassControlCreator.GET_CONTROL_PROPERTY(DT_CONTROLS, oControlID, "SQL2") Override_SQLCommand = ControlCreator.GET_CONTROL_PROPERTY(DT_CONTROLS, oControlID, "SQL2")
If IsNothing(Override_SQLCommand) Then If IsNothing(Override_SQLCommand) Then
Override_SQLCommand = "" Override_SQLCommand = ""
End If End If
@ -1395,7 +1388,7 @@ Public Class frmValidator
Dim oLookup As RepositoryItemLookupControl3 = sender Dim oLookup As RepositoryItemLookupControl3 = sender
listChangedLookup.Add(oLookup.Name) listChangedLookup.Add(oLookup.Name)
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
End Try End Try
@ -1413,7 +1406,7 @@ Public Class frmValidator
Checkbox_EnablingControls(oCheckbox) Checkbox_EnablingControls(oCheckbox)
CheckBox_DependingColumn(oCheckbox) CheckBox_DependingColumn(oCheckbox)
SetControlValues_FromControl(oCheckbox) SetControlValues_FromControl(oCheckbox)
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
Catch ex As Exception Catch ex As Exception
LOGGER.Error(ex) LOGGER.Error(ex)
End Try End Try
@ -1959,7 +1952,7 @@ Public Class frmValidator
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If oControlId = oDEPENDING_CONTROL_ID Then If oControlId = oDEPENDING_CONTROL_ID Then
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup) ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
_dependingColumn_in_action = False _dependingColumn_in_action = False
Exit For Exit For
End If End If
@ -2003,7 +1996,7 @@ Public Class frmValidator
For Each oControl As Control In PanelValidatorControl.Controls For Each oControl As Control In PanelValidatorControl.Controls
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CONTROL_ID Then If DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid = oDEPENDING_CONTROL_ID Then
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup) ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
_dependingColumn_in_action = False _dependingColumn_in_action = False
Exit For Exit For
End If End If
@ -2019,7 +2012,7 @@ Public Class frmValidator
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 oCombobox As ComboBox = sender Dim oCombobox As Windows.Forms.ComboBox = sender
If oCombobox.SelectedIndex <> -1 And _Indexe_Loaded = True Then If oCombobox.SelectedIndex <> -1 And _Indexe_Loaded = True Then
If oCombobox.Name = last_control.Name Then If oCombobox.Name = last_control.Name Then
'Abschluss() 'Abschluss()
@ -2060,7 +2053,7 @@ Public Class frmValidator
Next Next
End If End If
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
Controls2beEnabled(oCombobox.Name) Controls2beEnabled(oCombobox.Name)
@ -2990,12 +2983,12 @@ Public Class frmValidator
If DTVWCONTROL_INDEX.Rows.Count > 0 Then If DTVWCONTROL_INDEX.Rows.Count > 0 Then
Dim oCount As Integer = 0 Dim oCount As Integer = 0
For Each oControl As Control In Me.PanelValidatorControl.Controls For Each oControl As Control In Me.PanelValidatorControl.Controls
If SingleAttribute <> "" Then 'If SingleAttribute <> "" Then
oIDBOverride = True ' oIDBOverride = True
If SingleAttribute <> oControl.Name Then ' If SingleAttribute <> oControl.Name Then
Continue For ' Continue For
End If ' End If
End If 'End If
Dim oValueFromSource Dim oValueFromSource
Dim oFormattedValue As String = "" Dim oFormattedValue As String = ""
@ -3104,7 +3097,7 @@ Public Class frmValidator
End Try End Try
ClassControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER) ControlCreator.GridTables_HandleControlValueChange(PanelValidatorControl, DT_COLUMNS_GRID_WITH_SQL_WITH_CTRL_PLACEHOLDER)
Catch ex As Exception Catch ex As Exception
@ -3285,25 +3278,6 @@ Public Class frmValidator
oDataSource.Rows.Add(oRowData.ToArray()) oDataSource.Rows.Add(oRowData.ToArray())
'Select Case oColValuesfromSource.Length
' Case 1
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0)})
' Case 2
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1)})
' Case 3
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2)})
' Case 4
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3)})
' Case 5
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4)})
' Case 6
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4), oColValuesfromSource(5)})
' Case 7
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4), oColValuesfromSource(5), oColValuesfromSource(6)})
' Case 8
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4), oColValuesfromSource(5), oColValuesfromSource(6), oColValuesfromSource(7)})
'End Select
ElseIf oValueType = "System.Data.DataTable" Then ElseIf oValueType = "System.Data.DataTable" Then
Dim oMyDatatable As DataTable = oValueFromSource Dim oMyDatatable As DataTable = oValueFromSource
@ -3327,25 +3301,6 @@ Public Class frmValidator
oDataSource.Rows.Add(oRowData.ToArray()) oDataSource.Rows.Add(oRowData.ToArray())
'Select Case oColValuesfromSource.Length
' Case 1
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0)})
' Case 2
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1)})
' Case 3
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2)})
' Case 4
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3)})
' Case 5
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4)})
' Case 6
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4), oColValuesfromSource(5)})
' Case 7
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4), oColValuesfromSource(5), oColValuesfromSource(6)})
' Case 8
' oDataSource.Rows.Add(New String() {oColValuesfromSource(0), oColValuesfromSource(1), oColValuesfromSource(2), oColValuesfromSource(3), oColValuesfromSource(4), oColValuesfromSource(5), oColValuesfromSource(6), oColValuesfromSource(7)})
'End Select
Next Next
End If End If
@ -3634,7 +3589,7 @@ Public Class frmValidator
For Each oControl As Control In PanelValidatorControl.Controls For Each oControl As Control In PanelValidatorControl.Controls
Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid Dim oControlId = DirectCast(oControl.Tag, ClassControlCreator.ControlMetadata).Guid
If oControlId = oDEPENDING_CTRL_ID Then If oControlId = oDEPENDING_CTRL_ID Then
ClassControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup) ControlCreator.GridTables_CacheDatatableForColumn(oControlId, oDEPENDING_COLUMN, oSqlCommand, oCONNID, oAdvancedLookup)
Exit For Exit For
End If End If
Next Next
@ -4181,7 +4136,7 @@ Public Class frmValidator
End Try End Try
Case GetType(System.Windows.Forms.ComboBox) Case GetType(System.Windows.Forms.ComboBox)
Dim cmb As ComboBox = oControl Dim cmb As Windows.Forms.ComboBox = oControl
Try Try
value_from_control = cmb.Text value_from_control = cmb.Text
Catch ex As Exception Catch ex As Exception
@ -4328,17 +4283,24 @@ Public Class frmValidator
btnSave.Enabled = True btnSave.Enabled = True
End Sub End Sub
Function Check_Missing(control As Control, typ As String) As Boolean
Function Check_Missing_Control_Value(control As Control, typ As String) As Boolean
Select Case typ Select Case typ
Case "txt" Case "txt"
Dim oTextBox As TextEdit = control Dim oTextBox As TextEdit = control
If oTextBox.Text = String.Empty Then
If IsNothing(oTextBox.EditValue) Then
Return True
End If
If oTextBox.EditValue.ToString = String.Empty Then
Return True Return True
End If End If
End Select End Select
Return False Return False
End Function End Function
Function Return_PM_VEKTOR(input As String, VKTBezeichner As String) Function Return_PM_VEKTOR(input As String, VKTBezeichner As String)
Dim PM_String As String Dim PM_String As String
Try Try
@ -4673,7 +4635,7 @@ Public Class frmValidator
End If End If
'as erstes überprüfen ob überhaupt etwas eingetragen worden ist 'as erstes überprüfen ob überhaupt etwas eingetragen worden ist
If Check_Missing(oControl, "txt") = True And oIsRequired = True Then 'NICHTS EINGETRAGEN If Check_Missing_Control_Value(oControl, "txt") = True And oIsRequired = True Then 'NICHTS EINGETRAGEN
oMissing = True oMissing = True
oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'" oErrMsgMissingInput = oWrongInputMessage & " textbox '" & oControl.Name & "'"
LOGGER.Warn(oErrMsgMissingInput) LOGGER.Warn(oErrMsgMissingInput)