jj 19_01_16
This commit is contained in:
@@ -15,16 +15,17 @@
|
||||
|
||||
Public Class _ListControl : Inherits _BaseControl
|
||||
|
||||
Public Shared Function _GetDynamicValue(controlId As Integer, formId As Integer, recordId As Integer, parentRecordId As Integer) As DynamicValue
|
||||
Public Shared Function GetDynamicValue(controlId As Integer, formId As Integer, sqlCommand As String) As DynamicValue
|
||||
Dim returnValue As DynamicValue
|
||||
|
||||
returnValue.StaticList = CheckForStaticList(controlId, recordId)
|
||||
returnValue.DataTable = CheckForSqlCommand(controlId, formId, recordId, parentRecordId)
|
||||
returnValue.StaticList = CheckForStaticList(controlId)
|
||||
returnValue.DataTable = GetSqlList(controlId, formId, SQLCommand)
|
||||
'returnValue.DataTable = CheckForSqlCommand(controlId, formId)
|
||||
|
||||
Return returnValue
|
||||
End Function
|
||||
|
||||
Private Shared Function CheckForStaticList(controlId As Integer, recordId As Integer) As List(Of String)
|
||||
Private Shared Function CheckForStaticList(controlId As Integer) As List(Of String)
|
||||
Try
|
||||
' Der alte SQL Befehl hat nicht wirklich nach der StaticList geschaut o_O
|
||||
' Dim SQL As String = String.Format("SELECT VALUE FROM VWPMO_VALUES WHERE CONTROL_ID = {0} AND RECORD_ID = {1}", controlId, recordId)
|
||||
@@ -42,35 +43,96 @@
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Shared Function CheckForSqlCommand(controlId As Integer, formId As Integer, recordId As Integer, parentRecordId As Integer) As DataTable
|
||||
Private Shared Function GetSqlList(controlId As Integer, formId As Integer, sqlCommand As String)
|
||||
Try
|
||||
Dim SQL As String = String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", controlId)
|
||||
Dim SqlCommand As String = ClassDatabase.Execute_Scalar(SQL)
|
||||
|
||||
If SqlCommand Is Nothing Or SqlCommand = String.Empty Then
|
||||
If sqlCommand Is Nothing Or sqlCommand = String.Empty Then
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
If SqlCommand.Contains("@") Then
|
||||
SqlCommand = ReplaceSqlCommandPlaceholders(SqlCommand, recordId, parentRecordId)
|
||||
End If
|
||||
'Dim cached As DataTable = ClassControlValueCache.LoadFromCache(formId, controlId)
|
||||
Dim cached As DataTable = ClassControlValueCache.LoadFromCache(sqlCommand)
|
||||
Dim final As DataTable
|
||||
|
||||
Dim CachedDataTable As DataTable = ClassControlValueCache.LoadFromCache(formId, controlId)
|
||||
Dim FinalDataTable As DataTable
|
||||
If CachedDataTable Is Nothing Then
|
||||
FinalDataTable = ClassDatabase.Return_Datatable(SqlCommand)
|
||||
ClassControlValueCache.SaveToCache(formId, controlId, FinalDataTable)
|
||||
If cached Is Nothing Then
|
||||
final = ClassDatabase.Return_Datatable(sqlCommand)
|
||||
'ClassControlValueCache.SaveToCache(formId, controlId, final)
|
||||
ClassControlValueCache.SaveToCache(sqlCommand, final)
|
||||
Else
|
||||
FinalDataTable = CachedDataTable
|
||||
final = cached
|
||||
End If
|
||||
|
||||
Return FinalDataTable
|
||||
Return final
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in CheckForSqlCommand: " & vbNewLine & ex.Message)
|
||||
MsgBox("Error in GetSqlList: " & vbNewLine & ex.Message)
|
||||
Return Nothing
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As Windows.Forms.ComboBox, dt As DataTable)
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
End Sub
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.CheckedListBoxControl, dt As DataTable)
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
End Sub
|
||||
|
||||
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.ListBoxControl, dt As DataTable)
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -85,7 +147,7 @@
|
||||
Dim AutoValue As String = String.Empty
|
||||
Dim ControlId As Integer = control.Tag
|
||||
Dim SQL As String = ClassDatabase.Execute_Scalar(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
|
||||
SQL = ReplaceSqlCommandPlaceholders(SQL, RecordId, ParentRecordId)
|
||||
SQL = ClassControlValues.ReplaceSqlCommandPlaceholders(SQL, RecordId, ParentRecordId)
|
||||
|
||||
If SQL = "" Or IsDBNull(SQL) Then
|
||||
Return control.Text
|
||||
@@ -161,53 +223,17 @@
|
||||
control.Text = value
|
||||
End Sub
|
||||
|
||||
Public Shared Sub LoadList(control As Windows.Forms.ComboBox, formId As Integer, recordId As Integer, parentRecordId As Integer)
|
||||
Public Shared Sub LoadList(control As Windows.Forms.ComboBox, formId As Integer, SQLCommand As String)
|
||||
Try
|
||||
Dim dynamic As DynamicValue = _GetDynamicValue(control.Tag, formId, recordId, parentRecordId)
|
||||
Dim dynamic As DynamicValue = GetDynamicValue(control.Tag, formId, SQLCommand)
|
||||
|
||||
If dynamic.StaticList IsNot Nothing Then
|
||||
control.DataSource = dynamic.StaticList
|
||||
End If
|
||||
|
||||
If dynamic.DataTable IsNot Nothing AndAlso dynamic.DataTable.Rows.Count > 0 Then
|
||||
Dim dt As DataTable = dynamic.DataTable
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
Dim sw2 = Stopwatch.StartNew()
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
|
||||
' Die alte Methode:
|
||||
'control.DataSource = dt
|
||||
'If dt.Columns.Count = 1 Then
|
||||
' control.DisplayMember = dt.Columns(0).ColumnName
|
||||
' control.ValueMember = dt.Columns(0).ColumnName
|
||||
'ElseIf dt.Columns.Count = 2 Then
|
||||
' control.DisplayMember = dt.Columns(1).ColumnName
|
||||
' control.ValueMember = dt.Columns(0).ColumnName
|
||||
'End If
|
||||
|
||||
sw2.Stop()
|
||||
Console.WriteLine("Assingning the DataSource took {0}ms", sw2.ElapsedMilliseconds)
|
||||
|
||||
|
||||
CalculateDropdownWidth(control, dt)
|
||||
SetDataSource(control, dynamic.DataTable)
|
||||
CalculateDropdownWidth(control, dynamic.DataTable)
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in Combobox.LoadList:" & vbNewLine & ex.Message)
|
||||
@@ -252,35 +278,16 @@
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Public Shared Sub LoadList(control As DevExpress.XtraEditors.CheckedListBoxControl, formId As Integer, recordId As Integer, parentRecordId As Integer)
|
||||
Public Shared Sub LoadList(control As DevExpress.XtraEditors.CheckedListBoxControl, formId As Integer, SQLCommand As String)
|
||||
Try
|
||||
Dim dynamic As DynamicValue = _GetDynamicValue(control.Tag, formId, recordId, parentRecordId)
|
||||
Dim dynamic As DynamicValue = GetDynamicValue(control.Tag, formId, SQLCommand)
|
||||
|
||||
If dynamic.StaticList IsNot Nothing Then
|
||||
control.DataSource = dynamic.StaticList
|
||||
End If
|
||||
|
||||
If dynamic.DataTable IsNot Nothing AndAlso dynamic.DataTable.Rows.Count > 0 Then
|
||||
Dim dt As DataTable = dynamic.DataTable
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
SetDataSource(control, dynamic.DataTable)
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
@@ -300,34 +307,15 @@
|
||||
control.SelectedIndex = control.FindStringExact(value)
|
||||
End Sub
|
||||
|
||||
Public Shared Sub LoadList(control As DevExpress.XtraEditors.ListBoxControl, formId As Integer, recordId As Integer, parentRecordId As Integer)
|
||||
Dim dynamic As DynamicValue = _GetDynamicValue(control.Tag, formId, recordId, parentRecordId)
|
||||
Public Shared Sub LoadList(control As DevExpress.XtraEditors.ListBoxControl, formId As Integer, SQLCommand As String)
|
||||
Dim dynamic As DynamicValue = GetDynamicValue(control.Tag, formId, SQLCommand)
|
||||
|
||||
If dynamic.StaticList IsNot Nothing Then
|
||||
control.DataSource = dynamic.StaticList
|
||||
End If
|
||||
|
||||
If dynamic.DataTable IsNot Nothing AndAlso dynamic.DataTable.Rows.Count > 0 Then
|
||||
Dim dt As DataTable = dynamic.DataTable
|
||||
Dim columnCount As Integer = dt.Columns.Count
|
||||
|
||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
||||
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||
control.DataSource = Nothing
|
||||
control.SelectedIndex = -1
|
||||
|
||||
' Es ist wichtig, dass DisplayMember und ValueMember VOR der DataSource festgelegt werden,
|
||||
' Dadurch ist das Laden der Datasource um einiges SCHNELLER
|
||||
If columnCount = 1 Then
|
||||
control.DisplayMember = dt.Columns(0).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
ElseIf columnCount = 2 Then
|
||||
control.DisplayMember = dt.Columns(1).ColumnName
|
||||
control.ValueMember = dt.Columns(0).ColumnName
|
||||
End If
|
||||
|
||||
' Als letztes setzen wir die DataSource
|
||||
control.DataSource = dt
|
||||
SetDataSource(control, dynamic.DataTable)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -1,68 +1,31 @@
|
||||
Public Class ClassControlValueCache
|
||||
Private Shared Property Cache As New Dictionary(Of String, DataTable)
|
||||
|
||||
Private Shared Property Cache As New Dictionary(Of String, Dictionary(Of String, DataTable))
|
||||
' ClassControlValueCache
|
||||
' Ordnet SQL Queries den daraus resultierenden DataTables zu.
|
||||
'
|
||||
' Somit kann eine Query in der Laufzeit des Programms von mehreren Forms genutzt werden,
|
||||
' muss aber nur einmal vom Server abgefragt werden.
|
||||
Public Shared Function LoadFromCache(sqlCommand As String) As DataTable
|
||||
' Mit ToUpper wird das Command case-insensitive,
|
||||
' es ist also egal, ob die query GROSS oder klein geschrieben wird
|
||||
Dim UpperCaseCommand = sqlCommand.ToUpper()
|
||||
|
||||
Public Shared Function LoadFromCache(formId As Integer, controlId As Integer) As DataTable
|
||||
|
||||
Dim dict As Dictionary(Of String, DataTable) = GetCachedFormDict(formId.ToString())
|
||||
|
||||
If IsNothing(dict) Then
|
||||
Return Nothing
|
||||
Else
|
||||
|
||||
Dim dt As DataTable = GetCachedControlDict(dict, controlId.ToString())
|
||||
|
||||
If IsNothing(dt) Then
|
||||
Return Nothing
|
||||
Else
|
||||
Return dt
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Public Shared Function SaveToCache(formId As Integer, controlId As Integer, dt As DataTable) As DataTable
|
||||
|
||||
Dim dict As Dictionary(Of String, DataTable) = GetCachedFormDict(formId.ToString())
|
||||
|
||||
If IsNothing(dict) Then
|
||||
dict = SetCachedFormDict(formId.ToString(), New Dictionary(Of String, DataTable))
|
||||
End If
|
||||
|
||||
SetCachedControlDict(dict, controlId.ToString(), dt)
|
||||
Return dt
|
||||
End Function
|
||||
|
||||
|
||||
Private Shared Function GetCachedFormDict(formId As Integer) As Dictionary(Of String, DataTable)
|
||||
|
||||
If Cache.ContainsKey(formId.ToString()) Then
|
||||
Return Cache.Item(formId.ToString())
|
||||
If Cache.ContainsKey(UpperCaseCommand) Then
|
||||
Return Cache.Item(UpperCaseCommand)
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Private Shared Function SetCachedFormDict(formId As Integer, dict As Dictionary(Of String, DataTable)) As Dictionary(Of String, DataTable)
|
||||
Cache.Item(formId.ToString()) = dict
|
||||
Return dict
|
||||
End Function
|
||||
Public Shared Sub SaveToCache(sqlCommand As String, dt As DataTable)
|
||||
Dim UpperCaseCommand = sqlCommand.ToUpper()
|
||||
Cache.Item(UpperCaseCommand) = dt
|
||||
End Sub
|
||||
|
||||
Private Shared Function GetCachedControlDict(dict As Dictionary(Of String, DataTable), controlId As Integer) As DataTable
|
||||
|
||||
If dict.ContainsKey(controlId.ToString()) Then
|
||||
Return dict.Item(controlId.ToString())
|
||||
Else
|
||||
Return Nothing
|
||||
End If
|
||||
|
||||
End Function
|
||||
|
||||
Private Shared Function SetCachedControlDict(dict As Dictionary(Of String, DataTable), controlId As Integer, dt As DataTable) As DataTable
|
||||
dict.Item(controlId.ToString()) = dt
|
||||
Return dt
|
||||
End Function
|
||||
Public Shared Sub ClearCache()
|
||||
Cache.Clear()
|
||||
End Sub
|
||||
|
||||
End Class
|
||||
|
||||
@@ -1,139 +1,9 @@
|
||||
Imports DevExpress.XtraEditors.Controls
|
||||
|
||||
Public Class ClassControlValues
|
||||
'Private Shared Function LoadControlAutoValue(ControlID As Integer, RecordID As Integer, control As Control) As String
|
||||
|
||||
|
||||
' If TypeOf control Is Label Then
|
||||
' Dim SQL = "SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = " & ControlID
|
||||
' Dim autoValue
|
||||
' Dim result = ClassDatabase.Execute_Scalar(SQL)
|
||||
' result = result.Replace("@FORM_ID", CURRENT_FORM_ID)
|
||||
' result = result.Replace("@RECORD_ID", CURRENT_RECORD_ID)
|
||||
' result = result.Replace("@RECORDID", CURRENT_RECORD_ID)
|
||||
' result = result.Replace("@PARENTRECORD_ID", CURRENT_PARENTID)
|
||||
' ' Wenn das SQL Command leer ist, hat dieses Control kein SQL Command
|
||||
' ' Gib den ursprünlichen Text zurück
|
||||
' If result = "" Then
|
||||
' Return control.Text
|
||||
' Else
|
||||
' autoValue = ClassDatabase.Execute_Scalar(result)
|
||||
|
||||
' ' Wenn das SQL Command DBNull zurück gibt,
|
||||
' ' Überschreibe den alten Wert mit " " (Leerzeichen)
|
||||
' If IsDBNull(autoValue) Then
|
||||
' SQL = "SELECT CONTROL_TEXT FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = " & ControlID
|
||||
' Dim value = ClassDatabase.Execute_Scalar(SQL)
|
||||
' Return value
|
||||
' Else
|
||||
' Return autoValue
|
||||
' End If
|
||||
' End If
|
||||
' 'End If
|
||||
|
||||
' 'Return Nothing
|
||||
' Else
|
||||
' Return Nothing
|
||||
' End If
|
||||
|
||||
'End Function
|
||||
|
||||
'Public Shared Sub LoadControlValue(RecordID As Integer, ControlID As Integer, control As Control)
|
||||
' Try
|
||||
' ' Dim DT1 As DataTable = ClassDatabase.Return_Datatable()
|
||||
' Dim DT As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM VWPMO_VALUES WHERE RECORD_ID = " & RecordID & " and CONTROL_ID = " & ControlID, "LaodControlValue: ReturnValues")
|
||||
' If DT.Rows.Count = 0 Then
|
||||
' Dim autoValue = LoadControlAutoValue(ControlID, RecordID, control)
|
||||
|
||||
' If Not String.IsNullOrEmpty(autoValue) Then
|
||||
' control.Text = autoValue
|
||||
' End If
|
||||
|
||||
' Exit Sub
|
||||
' End If
|
||||
|
||||
' Dim result = DT.Rows(0).Item("VALUE")
|
||||
' '22.06.2015
|
||||
' If Not IsDBNull(result) Then
|
||||
' Select Case DT.Rows(0).Item("CONTROL_TYPE_ID")
|
||||
' Case 1 'Label
|
||||
' Dim label As Label = DirectCast(control, Label)
|
||||
' Dim autoValue As String = LoadControlAutoValue(ControlID, RecordID, control)
|
||||
' If Not IsNothing(autoValue) Then
|
||||
' label.Text = autoValue
|
||||
' End If
|
||||
' Case 2 ' TextBox
|
||||
' Dim textbox As TextBox = DirectCast(control, TextBox)
|
||||
' textbox.Text = result
|
||||
' Case 10 ' CheckBox
|
||||
' Dim checkbox As CheckBox = DirectCast(control, CheckBox)
|
||||
' checkbox.Checked = CBool(result)
|
||||
' Case 11 'RadioButton
|
||||
' Dim radio As RadioButton = DirectCast(control, RadioButton)
|
||||
' radio.Checked = CBool(result)
|
||||
' Case 3 ' ComboBox
|
||||
' Dim cmbbox As ComboBox = DirectCast(control, System.Windows.Forms.ComboBox)
|
||||
' cmbbox.Text = result
|
||||
' 'If LogErrorsOnly = False Then ClassLogger.Add(">> control ComboBox", False)
|
||||
' 'Dim cmbSql As String = "SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = " & ControlID
|
||||
' 'cmbSql = ClassDatabase.Execute_Scalar(cmbSql)
|
||||
' 'If Not (cmbSql Is Nothing Or cmbSql = String.Empty) Then
|
||||
' ' If cmbSql.ToString.Contains("@") Then
|
||||
' ' cmbSql = cmbSql.ToString.Replace("@RECORDID", CURRENT_RECORD_ID)
|
||||
' ' cmbSql = cmbSql.ToString.Replace("@RECORD_ID", CURRENT_RECORD_ID)
|
||||
' ' cmbSql = cmbSql.ToString.Replace("@PARENTRECORD_ID", CURRENT_PARENTID)
|
||||
' ' If LogErrorsOnly = False Then ClassLogger.Add(">> SQL Combobox: " & cmbSql, False)
|
||||
' ' End If
|
||||
' ' If LogErrorsOnly = False Then ClassLogger.Add(">> SQL Combobox: " & cmbSql, False)
|
||||
|
||||
' ' 'SQL-Command vorhanden also Ausführen des SQL
|
||||
' ' Dim DT_ComboBox As DataTable = ClassDatabase.Return_Datatable(cmbSql, "LoadControlValues: Combobox")
|
||||
' ' If DT_ComboBox Is Nothing = False Then
|
||||
' ' cmbbox.DataSource = DT_ComboBox
|
||||
' ' Select Case DT_ComboBox.Columns.Count
|
||||
' ' Case 2
|
||||
' ' cmbbox.DisplayMember = DT_ComboBox.Columns(1).ColumnName
|
||||
' ' cmbbox.ValueMember = DT_ComboBox.Columns(0).ColumnName
|
||||
' ' Case 1
|
||||
' ' cmbbox.DisplayMember = DT_ComboBox.Columns(0).ColumnName
|
||||
' ' cmbbox.ValueMember = DT_ComboBox.Columns(0).ColumnName
|
||||
' ' End Select
|
||||
|
||||
' ' End If
|
||||
' 'End If
|
||||
' ''combobox.DataSource = Nothing
|
||||
' 'If cmbbox.SelectedIndex = -1 Then
|
||||
' ' cmbbox.DataSource = Nothing
|
||||
' ' cmbbox.Text = result
|
||||
' 'Else
|
||||
' ' cmbbox.SelectedIndex = cmbbox.FindStringExact(result)
|
||||
' 'End If
|
||||
' Case 4 'DateTimePicker
|
||||
' Dim datepicker As DevExpress.XtraEditors.DateEdit = DirectCast(control, DevExpress.XtraEditors.DateEdit)
|
||||
|
||||
' If result = "" Or result = "00:00:00" Then
|
||||
' datepicker.DateTime = DateTime.MinValue
|
||||
' Else
|
||||
' datepicker.DateTime = Date.Parse(result)
|
||||
' End If
|
||||
' Case 13 ' Listbox
|
||||
' Dim listbox As DevExpress.XtraEditors.ListBoxControl = DirectCast(control, DevExpress.XtraEditors.ListBoxControl)
|
||||
' listbox.SelectedIndex = listbox.FindStringExact(result)
|
||||
' Case Else
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(">> Sub LoadControlValue - Control-Type nicht berücksichtigt: " & DT.Rows(0).Item("CONTROL_TYPE_ID"), False)
|
||||
' 'MsgBox(DT.Rows(0).Item("CONTROL_TYPE_ID"))
|
||||
' End Select
|
||||
' Else
|
||||
' ClassLogger.Add(" >> Achtung, der Value für Control-ID: " & ControlID & " ist DBNull", False)
|
||||
' End If
|
||||
|
||||
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Error in LoadControlValue:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
' End Try
|
||||
'End Sub
|
||||
|
||||
#Region "#### ClassControlValues REWRITE ####"
|
||||
Public Shared Sub LoadControlValuesNeu(RecordId As Integer, ParentRecordId As Integer, FormId As Integer, controls As Control.ControlCollection)
|
||||
Public Shared Sub LoadControlValues(RecordId As Integer, ParentRecordId As Integer, FormId As Integer, controls As Control.ControlCollection)
|
||||
Try
|
||||
'Dim SQL As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE VALUE <> '' AND RECORD_ID = {0}", RecordId)
|
||||
Dim SQL As String = String.Format("SELECT * FROM VWPMO_VALUES WHERE RECORD_ID = {0}", RecordId)
|
||||
@@ -156,7 +26,7 @@ Public Class ClassControlValues
|
||||
|
||||
If TypeOf control Is GroupBox Then
|
||||
Dim groupbox As GroupBox = DirectCast(control, GroupBox)
|
||||
LoadControlValuesNeu(RecordId, ParentRecordId, FormId, groupbox.Controls)
|
||||
LoadControlValues(RecordId, ParentRecordId, FormId, groupbox.Controls)
|
||||
Else
|
||||
LoadControlValueNeu(RecordId, ParentRecordId, ControlId, control, value)
|
||||
End If
|
||||
@@ -216,29 +86,47 @@ Public Class ClassControlValues
|
||||
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
|
||||
Public Shared Sub LoadControlValuesList(RecordID As Integer, ParentRecordId As Integer, FormID As Integer, controls As Control.ControlCollection)
|
||||
Public Shared Sub LoadControlValuesList(FormID As Integer, controls As Control.ControlCollection)
|
||||
Try
|
||||
If controls.Count = 0 Then
|
||||
MsgBox("Control.ControlCollection is unexpected empty!", MsgBoxStyle.Exclamation)
|
||||
'MsgBox("LoadControlValuesList: Control.ControlCollection is unexpected empty!", MsgBoxStyle.Exclamation)
|
||||
ClassLogger.Add("LoadControlValuesList: Control.ControlCollection is unexpected empty!")
|
||||
Exit Sub
|
||||
End If
|
||||
Dim SW As Stopwatch = Stopwatch.StartNew()
|
||||
|
||||
' Zuerst alle SQL Commands für FormID finden
|
||||
' CONTROL_SQLCOMMAND_1 wird als SQL gealiast
|
||||
Dim SQL As String = String.Format("SELECT CONTROL_ID, CONTROL_SQLCOMMAND_1 AS SQL FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = {0} AND CONTROL_SQLCOMMAND_1 <> '' AND CONTROL_SQLCOMMAND_1 NOT LIKE '%@%'", FormID)
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
|
||||
If dt.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each Ctrl As Control In controls
|
||||
Dim controlTagId = CInt(Ctrl.Tag)
|
||||
'Datatable nach row mit CONTROL_ID wie Ctrl suchen
|
||||
Dim row As DataRow = dt.Select(String.Format("CONTROL_ID={0}", controlTagId)).FirstOrDefault()
|
||||
|
||||
If IsNothing(row) Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim sqlcommand As String = row.Item("SQL")
|
||||
|
||||
Select Case Ctrl.GetType()
|
||||
Case GetType(ComboBox)
|
||||
Dim combobox = DirectCast(Ctrl, ComboBox)
|
||||
ControlLoader.Combobox.LoadList(combobox, FormID, RecordID, ParentRecordId)
|
||||
ControlLoader.Combobox.LoadList(combobox, FormID, sqlcommand)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.ListBoxControl)
|
||||
Dim listbox = DirectCast(Ctrl, DevExpress.XtraEditors.ListBoxControl)
|
||||
ControlLoader.ListBox.LoadList(listbox, FormID, RecordID, ParentRecordId)
|
||||
ControlLoader.ListBox.LoadList(listbox, FormID, sqlcommand)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
Dim chlistbox = DirectCast(Ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadList(chlistbox, FormID, RecordID, ParentRecordId)
|
||||
ControlLoader.CheckedListBox.LoadList(chlistbox, FormID, sqlcommand)
|
||||
|
||||
End Select
|
||||
Next
|
||||
@@ -253,6 +141,66 @@ Public Class ClassControlValues
|
||||
|
||||
End Sub
|
||||
|
||||
Public Shared Sub LoadControlValuesListWithPlaceholders(FormId As Integer, RecordId As Integer, ParentRecordId As Integer, controls As Control.ControlCollection)
|
||||
Try
|
||||
If controls.Count = 0 Then
|
||||
'MsgBox("LoadControlValuesListWithPlaceholders: Control.ControlCollection is unexpected empty!", MsgBoxStyle.Exclamation)
|
||||
ClassLogger.Add("LoadControlValuesListWithPlaceholders: Control.ControlCollection is unexpected empty!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim SQL As String = String.Format("SELECT CONTROL_ID, CONTROL_SQLCOMMAND_1 AS SQL FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = {0} AND CONTROL_SQLCOMMAND_1 <> '' AND CONTROL_SQLCOMMAND_1 LIKE '%@%'", FormId)
|
||||
Dim SW As Stopwatch = Stopwatch.StartNew()
|
||||
Dim commands As New List(Of String)
|
||||
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||
|
||||
If dt.Rows.Count = 0 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each Ctrl As Control In controls
|
||||
Dim controlTagId = CInt(Ctrl.Tag)
|
||||
Dim row As DataRow = dt.Select(String.Format("CONTROL_ID={0}", controlTagId)).FirstOrDefault()
|
||||
|
||||
If IsNothing(row) Then
|
||||
Continue For
|
||||
End If
|
||||
|
||||
Dim sqlcommand As String = row.Item("SQL")
|
||||
sqlcommand = ReplaceSqlCommandPlaceholders(sqlcommand, RecordId, ParentRecordId)
|
||||
|
||||
Select Case Ctrl.GetType()
|
||||
Case GetType(ComboBox)
|
||||
Dim combobox = DirectCast(Ctrl, ComboBox)
|
||||
ControlLoader.Combobox.LoadList(combobox, FormId, sqlcommand)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.ListBoxControl)
|
||||
Dim listbox = DirectCast(Ctrl, DevExpress.XtraEditors.ListBoxControl)
|
||||
ControlLoader.ListBox.LoadList(listbox, FormId, sqlcommand)
|
||||
|
||||
Case GetType(DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
Dim chlistbox = DirectCast(Ctrl, DevExpress.XtraEditors.CheckedListBoxControl)
|
||||
ControlLoader.CheckedListBox.LoadList(chlistbox, FormId, sqlcommand)
|
||||
|
||||
End Select
|
||||
Next
|
||||
|
||||
SW.Stop()
|
||||
Console.WriteLine("LoadControlValuesListWithPlaceholders took {0} milliseconds to load", SW.ElapsedMilliseconds)
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in LoadControlValuesListWithPlaceholders:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Public Shared Function ReplaceSqlCommandPlaceholders(sqlCommand As String, recordId As Integer, parentRecordId As Integer)
|
||||
sqlCommand = sqlCommand.Replace("@RECORD_ID", recordId)
|
||||
sqlCommand = sqlCommand.Replace("@RECORDID", recordId)
|
||||
sqlCommand = sqlCommand.Replace("@PARENTRECORD_ID", parentRecordId)
|
||||
sqlCommand = sqlCommand.Replace("@PARENTRECORDID", parentRecordId)
|
||||
|
||||
Return sqlCommand
|
||||
End Function
|
||||
|
||||
Public Shared Sub UnloadControlValuesList(RecordID As Integer, FormID As Integer, controls As Control.ControlCollection)
|
||||
For Each C As Control In controls
|
||||
If TypeOf C Is ComboBox Then
|
||||
|
||||
@@ -1119,8 +1119,8 @@ Public Class frmForm_Constructor
|
||||
Load_Entity_Data_Only()
|
||||
Search_RowHandle(CURRENT_RECORD_ID)
|
||||
'Die Daten auf dem Panel laden
|
||||
ClassControlValues.LoadControlValuesNeu(CURRENT_RECORD_ID, CURRENT_PARENTID,CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(CURRENT_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(CURRENT_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
pnlDetails.Enabled = True
|
||||
End If
|
||||
Catch ex As Exception
|
||||
@@ -1151,7 +1151,7 @@ Public Class frmForm_Constructor
|
||||
Dim CURRENT_WORKFILE = Str.Substring(Str.LastIndexOf("@") + 1)
|
||||
TBPMO_FILES_USERTableAdapter.cmdInsert(CURRENT_WORKFILE, Environment.UserName, DropType)
|
||||
End If
|
||||
|
||||
|
||||
Next
|
||||
TBPMO_FILES_USERTableAdapter.Fill(DD_DMSDataSet.TBPMO_FILES_USER, Environment.UserName)
|
||||
For Each Filerow As DataRow In DD_DMSDataSet.TBPMO_FILES_USER.Rows
|
||||
@@ -1575,7 +1575,7 @@ Public Class frmForm_Constructor
|
||||
grvwSelection.ClearSelection()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub Check_Record_Changed()
|
||||
If EDIT_STATE <> "none" Then
|
||||
tslblStatusMain_show(False, "")
|
||||
@@ -1645,8 +1645,8 @@ Public Class frmForm_Constructor
|
||||
If EDIT_STATE = "none" Then
|
||||
'TabPageDetails.Text = "Detaileingabe zu '" & ACT_EBENE_STRING & "' - Record(" & SelectedRecordID & ")"
|
||||
'Die Daten auf dem Panel laden
|
||||
ClassControlValues.LoadControlValuesNeu(SelectedRecordID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(SelectedRecordID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(SelectedRecordID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
'Load_Control_Values(CtrlBuilder.AllControls)
|
||||
'Refresh_Treeview_SelectedData()
|
||||
RECORD_CHANGED = False
|
||||
@@ -2007,8 +2007,8 @@ Public Class frmForm_Constructor
|
||||
Load_Record_Data()
|
||||
End If
|
||||
End If
|
||||
'Überprüfen ob es für diese Entität Wiedervorlagen gibt?
|
||||
Check_FOLLOWUP_IsConfigured(CURRENT_FORM_ID)
|
||||
'Überprüfen ob es für diese Entität Wiedervorlagen gibt?
|
||||
Check_FOLLOWUP_IsConfigured(CURRENT_FORM_ID)
|
||||
End Select
|
||||
|
||||
Load_Templates()
|
||||
@@ -2157,7 +2157,7 @@ Public Class frmForm_Constructor
|
||||
MsgBox("Bitte wählen Sie zuerst einen Datensatz aus.", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
|
||||
|
||||
|
||||
End Sub
|
||||
Private Sub grvwSelection_Layout(sender As Object, e As EventArgs) Handles grvwSelection.Layout
|
||||
If dataloaded = True Then
|
||||
@@ -2259,7 +2259,7 @@ Public Class frmForm_Constructor
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in ShowDocView:" & vbNewLine & ex.Message, MsgBoxStyle.Exclamation)
|
||||
End Try
|
||||
|
||||
|
||||
End Sub
|
||||
Sub CloseWDDocview()
|
||||
Try
|
||||
@@ -2341,7 +2341,7 @@ Public Class frmForm_Constructor
|
||||
Private Sub ZeigeRecordLogsToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ZeigeRecordLogsToolStripMenuItem.Click
|
||||
frmRecord_Changes.ShowDialog()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GridControlSelection_MouseEnter(sender As Object, e As EventArgs) Handles GridControlSelection.MouseEnter
|
||||
GridControlSelection.Select()
|
||||
@@ -2361,8 +2361,8 @@ Public Class frmForm_Constructor
|
||||
Select Case TCDetails.SelectedTabPageIndex
|
||||
Case 0
|
||||
If RECORD_NEEDS_REFRESH = True Then
|
||||
ClassControlValues.LoadControlValuesNeu(SelectedRecordID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(SelectedRecordID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(SelectedRecordID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
UpdRECORD_NEEDS_REFRESH(False)
|
||||
End If
|
||||
|
||||
|
||||
@@ -822,7 +822,7 @@ Public Class frmForm_Constructor_Main
|
||||
Load_Entity_Data_Only()
|
||||
Get_Grid_Row_Handle(CURRENT_RECORD_ID)
|
||||
'Die Daten auf dem Panel laden
|
||||
ClassControlValues.LoadControlValuesNeu(CURRENT_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(CURRENT_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
pnlDetails.Enabled = True
|
||||
End If
|
||||
|
||||
@@ -859,7 +859,7 @@ Public Class frmForm_Constructor_Main
|
||||
Me.tsButtonEditMode.Text = "Bearbeiten beenden"
|
||||
'Funktion zum Vollständigen load der Inhalte
|
||||
|
||||
ClassControlValues.LoadControlValuesList(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesList(CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
Else
|
||||
RECORD_ENABLED = False
|
||||
Me.pnlDetails.Enabled = False
|
||||
@@ -1115,7 +1115,7 @@ Public Class frmForm_Constructor_Main
|
||||
Load_Grid_Layout()
|
||||
|
||||
|
||||
|
||||
|
||||
'Zurücksetzen
|
||||
ENTITY_LOADED = True
|
||||
Catch ex As Exception
|
||||
@@ -1307,7 +1307,7 @@ Public Class frmForm_Constructor_Main
|
||||
'grvwGrid.Columns("Record-ID").OptionsColumn.AllowShowHide = False
|
||||
|
||||
End If
|
||||
|
||||
|
||||
|
||||
HideColumns()
|
||||
Dim selnode As TreeNode = TreeViewMain.SelectedNode
|
||||
@@ -1521,7 +1521,7 @@ Public Class frmForm_Constructor_Main
|
||||
If EDIT_STATE = EditState.None Then
|
||||
'TabPageDetails.Text = "Detaileingabe zu '" & ACT_EBENE_STRING & "' - Record(" & SelectedRecordID & ")"
|
||||
'Die Daten auf dem Panel laden
|
||||
ClassControlValues.LoadControlValuesNeu(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
'Load_Control_Values(CtrlBuilder.AllControls)
|
||||
'Refresh_Treeview_SelectedData()
|
||||
RECORD_CHANGED = False
|
||||
|
||||
@@ -212,7 +212,7 @@ Partial Class frmForm_Constructor_Main_2
|
||||
Me.GridControlMain.Location = New System.Drawing.Point(0, 0)
|
||||
Me.GridControlMain.MainView = Me.grvwTiles
|
||||
Me.GridControlMain.Name = "GridControlMain"
|
||||
Me.GridControlMain.Size = New System.Drawing.Size(788, 270)
|
||||
Me.GridControlMain.Size = New System.Drawing.Size(795, 270)
|
||||
Me.GridControlMain.TabIndex = 0
|
||||
Me.GridControlMain.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.grvwCarousel, Me.grvwTiles, Me.grvwGrid})
|
||||
'
|
||||
@@ -467,7 +467,7 @@ Partial Class frmForm_Constructor_Main_2
|
||||
Me.SplitContainerBottom.Panel1.Text = "Panel1"
|
||||
Me.SplitContainerBottom.Panel2.Controls.Add(Me.Panel2)
|
||||
Me.SplitContainerBottom.Panel2.Text = "Panel2"
|
||||
Me.SplitContainerBottom.Size = New System.Drawing.Size(1083, 365)
|
||||
Me.SplitContainerBottom.Size = New System.Drawing.Size(1083, 372)
|
||||
Me.SplitContainerBottom.SplitterPosition = 576
|
||||
Me.SplitContainerBottom.TabIndex = 0
|
||||
Me.SplitContainerBottom.Text = "SplitContainerControl1"
|
||||
@@ -483,7 +483,7 @@ Partial Class frmForm_Constructor_Main_2
|
||||
Me.TCDetails.Location = New System.Drawing.Point(0, 25)
|
||||
Me.TCDetails.Name = "TCDetails"
|
||||
Me.TCDetails.SelectedTabPage = Me.TabDetails
|
||||
Me.TCDetails.Size = New System.Drawing.Size(1071, 340)
|
||||
Me.TCDetails.Size = New System.Drawing.Size(1078, 347)
|
||||
Me.TCDetails.TabIndex = 1
|
||||
Me.TCDetails.TabPages.AddRange(New DevExpress.XtraTab.XtraTabPage() {Me.TabDetails, Me.TabWindream, Me.TabFollowUp, Me.TabPos})
|
||||
'
|
||||
@@ -492,7 +492,7 @@ Partial Class frmForm_Constructor_Main_2
|
||||
Me.TabDetails.Controls.Add(Me.pnlDetails)
|
||||
Me.TabDetails.Image = Global.DD_Record_Organiser.My.Resources.Resources.grid_Data_16xMD
|
||||
Me.TabDetails.Name = "TabDetails"
|
||||
Me.TabDetails.Size = New System.Drawing.Size(1069, 312)
|
||||
Me.TabDetails.Size = New System.Drawing.Size(1072, 316)
|
||||
Me.TabDetails.Text = "Detailansicht"
|
||||
'
|
||||
'pnlDetails
|
||||
@@ -501,7 +501,7 @@ Partial Class frmForm_Constructor_Main_2
|
||||
Me.pnlDetails.Dock = System.Windows.Forms.DockStyle.Fill
|
||||
Me.pnlDetails.Location = New System.Drawing.Point(0, 0)
|
||||
Me.pnlDetails.Name = "pnlDetails"
|
||||
Me.pnlDetails.Size = New System.Drawing.Size(1069, 312)
|
||||
Me.pnlDetails.Size = New System.Drawing.Size(1072, 316)
|
||||
Me.pnlDetails.TabIndex = 0
|
||||
'
|
||||
'TabWindream
|
||||
@@ -884,7 +884,7 @@ Partial Class frmForm_Constructor_Main_2
|
||||
Me.ToolStripEdit.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsButtonAdd, Me.tsButtonSave, Me.tsButtonDelete, Me.tsButtonEditMode, Me.ToolStripDropDownButton1, Me.tsButtonShowTaskOverview, Me.tsButtonShowWorkflowTasks})
|
||||
Me.ToolStripEdit.Location = New System.Drawing.Point(0, 0)
|
||||
Me.ToolStripEdit.Name = "ToolStripEdit"
|
||||
Me.ToolStripEdit.Size = New System.Drawing.Size(1071, 25)
|
||||
Me.ToolStripEdit.Size = New System.Drawing.Size(1078, 25)
|
||||
Me.ToolStripEdit.TabIndex = 0
|
||||
Me.ToolStripEdit.Text = "ToolStrip1"
|
||||
'
|
||||
|
||||
@@ -1005,8 +1005,6 @@ Public Class frmForm_Constructor_Main_2
|
||||
Lock_RecordControls(False)
|
||||
tsButtonShowWorkflowTasks.Enabled = True
|
||||
ClassControlValues.LoadDefaultValues(CURRENT_FORM_ID, SELECTED_RECORD_ID, pnlDetails.Controls)
|
||||
'ClassControlValues.LoadControlValuesList(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
|
||||
' Im gegensatz zu EnableEditMode muss hier nur der save button enabled werden
|
||||
tsButtonSave.Enabled = True
|
||||
EDIT_STATE = EditState.Insert
|
||||
@@ -1162,29 +1160,6 @@ Public Class frmForm_Constructor_Main_2
|
||||
|
||||
Private Sub tsButtonEditMode_Click(sender As Object, e As EventArgs) Handles tsButtonEditMode.Click
|
||||
ToggleEditMode()
|
||||
|
||||
'If RECORD_ENABLED = False Then
|
||||
' RECORD_ENABLED = True
|
||||
' Me.pnlDetails.Enabled = True
|
||||
' Me.tsButtonDelete.Enabled = True
|
||||
' Me.tsButtonAdd.Enabled = True
|
||||
' Me.tsButtonSave.Enabled = True
|
||||
' Me.tsButtonEditMode.Text = "Bearbeiten beenden"
|
||||
' 'Funktion zum Vollständigen load der Inhalte
|
||||
|
||||
' ClassControlValues.LoadControlValuesList(SELECTED_RECORD_ID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
'Else
|
||||
' RECORD_ENABLED = False
|
||||
' Me.pnlDetails.Enabled = False
|
||||
' Me.tsButtonDelete.Enabled = False
|
||||
' Me.tsButtonAdd.Enabled = False
|
||||
' Me.tsButtonSave.Enabled = False
|
||||
' Me.tsButtonEditMode.Text = "Bearbeiten"
|
||||
' 'Funktion nur zum load der Inhalte
|
||||
|
||||
' ClassControlValues.UnloadControlValuesList(SELECTED_RECORD_ID, CURRENT_RECORD_ID, CtrlBuilder.AllControls)
|
||||
|
||||
'End If
|
||||
End Sub
|
||||
|
||||
Sub ToggleEditMode()
|
||||
@@ -1202,8 +1177,10 @@ Public Class frmForm_Constructor_Main_2
|
||||
Me.tsButtonAdd.Enabled = True
|
||||
Me.tsButtonSave.Enabled = True
|
||||
Me.tsButtonEditMode.Text = "Bearbeiten beenden"
|
||||
'Funktion zum Vollständigen load der Inhalte
|
||||
'ClassControlValues.LoadControlValuesList(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
|
||||
' Abhängige Listen laden
|
||||
ClassControlValues.LoadControlValuesListWithPlaceholders(CURRENT_FORM_ID, SELECTED_RECORD_ID, CURRENT_PARENTID, CtrlBuilder.AllControls)
|
||||
|
||||
RECORD_ENABLED = True
|
||||
pnlDetails.Focus()
|
||||
'If RECORD_ENABLED = False Then
|
||||
@@ -1531,11 +1508,13 @@ Public Class frmForm_Constructor_Main_2
|
||||
'Next
|
||||
|
||||
' Wenn rows existieren, erste row laden und recordid auslesen
|
||||
Dim firstRow As System.Data.DataRowView = GridControlMain.MainView.GetRow(0)
|
||||
If Not IsNothing(firstRow) Then
|
||||
Dim firstRecordId As Integer = firstRow.Row.Item("Record-ID")
|
||||
ClassControlValues.LoadControlValuesList(firstRecordId, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.MasterPanel.Controls)
|
||||
End If
|
||||
'Dim firstRow As System.Data.DataRowView = GridControlMain.MainView.GetRow(0)
|
||||
'If Not IsNothing(firstRow) Then
|
||||
' Dim firstRecordId As Integer = firstRow.Row.Item("Record-ID")
|
||||
' ClassControlValues.LoadControlValuesList(firstRecordId, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.MasterPanel.Controls)
|
||||
'End If
|
||||
' Hinfällig, da hier die Record-ID nicht gebraucht wird
|
||||
ClassControlValues.LoadControlValuesList(CURRENT_FORM_ID, CtrlBuilder.MasterPanel.Controls)
|
||||
|
||||
'Zurücksetzen
|
||||
ENTITY_LOADED = True
|
||||
@@ -1565,7 +1544,7 @@ Public Class frmForm_Constructor_Main_2
|
||||
CURRENT_RECORD_ID = Grid_RecordID
|
||||
'Daten zu Record in jedem Fall laden
|
||||
'ClassControlValues.LoadControlValues(SELECTED_RECORD_ID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesNeu(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
' Laden der Daten bedeutet nicht dass Daten vom Benutzer geändert wurden!
|
||||
RECORD_CHANGED = False
|
||||
Update_Record_Label(Grid_RecordID)
|
||||
@@ -1609,7 +1588,7 @@ Public Class frmForm_Constructor_Main_2
|
||||
' Datatable laden
|
||||
GridControlMain.DataSource = DT
|
||||
|
||||
|
||||
|
||||
|
||||
grvwTiles.TileTemplate.Clear()
|
||||
|
||||
@@ -2075,7 +2054,7 @@ Public Class frmForm_Constructor_Main_2
|
||||
If TCDetails.SelectedTabPage.Text.StartsWith("Detail") Or TCDetails.SelectedTabPage.Text.StartsWith("Kopf") Then
|
||||
'Daten zu Record in jedem Fall laden
|
||||
'ClassControlValues.LoadControlValues(SELECTED_RECORD_ID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValuesNeu(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
ClassControlValues.LoadControlValues(SELECTED_RECORD_ID, CURRENT_PARENTID, CURRENT_FORM_ID, CtrlBuilder.AllControls)
|
||||
End If
|
||||
If TCDetails.SelectedTabPage.Text.ToLower.StartsWith("wieder") Then
|
||||
tsButtonEditMode.Enabled = False
|
||||
|
||||
@@ -409,7 +409,7 @@ Public Class frmFormInput
|
||||
' SelectedFormID = RowView.Item(1)
|
||||
RefreshRecordByID(SelectedRecordID)
|
||||
|
||||
ClassControlValues.LoadControlValuesNeu(SelectedRecordID, CURRENT_PARENTID, thisformid, pnlView.Controls)
|
||||
ClassControlValues.LoadControlValues(SelectedRecordID, CURRENT_PARENTID, thisformid, pnlView.Controls)
|
||||
End If
|
||||
load_Documents()
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user