jj__25_01_16
This commit is contained in:
@@ -45,6 +45,7 @@ Public Class ClassControlBuilder
|
|||||||
Dim onRecordChangedHandler As EventHandler = CType(Me.Events(_onRecordChangedName), EventHandler)
|
Dim onRecordChangedHandler As EventHandler = CType(Me.Events(_onRecordChangedName), EventHandler)
|
||||||
|
|
||||||
If (onRecordChangedHandler IsNot Nothing) Then
|
If (onRecordChangedHandler IsNot Nothing) Then
|
||||||
|
Console.WriteLine("RecordChanged")
|
||||||
onRecordChangedHandler.Invoke(sender, e)
|
onRecordChangedHandler.Invoke(sender, e)
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
@@ -806,37 +807,6 @@ Public Class ClassControlBuilder
|
|||||||
control.Size = New Size(vwidth, vheight)
|
control.Size = New Size(vwidth, vheight)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'SQL-Command vorhanden also Ausführen des SQL
|
|
||||||
|
|
||||||
' TODO: ERST LADEN WENN EDIT MODE ENABLEDs
|
|
||||||
'If sqlcommand.Length > 1 Then
|
|
||||||
' Dim DT_Combobox As DataTable = ClassDatabase.Return_Datatable(sqlcommand)
|
|
||||||
' If DT_Combobox Is Nothing = False Then
|
|
||||||
' If DT_Combobox.Rows.Count > 0 Then
|
|
||||||
' control.DataSource = DT_Combobox
|
|
||||||
' control.DisplayMember = DT_Combobox.Columns(1).ColumnName
|
|
||||||
' control.ValueMember = DT_Combobox.Columns(0).ColumnName
|
|
||||||
' control.AutoCompleteMode = AutoCompleteMode.SuggestAppend
|
|
||||||
' control.AutoCompleteSource = AutoCompleteSource.ListItems
|
|
||||||
' End If
|
|
||||||
' Dim iWidestWidth As Integer = 300
|
|
||||||
' For Each row As DataRow In DT_Combobox.Rows
|
|
||||||
' 'Die BReite der DropDown-Lsit anpassen
|
|
||||||
' Using g As Graphics = control.CreateGraphics
|
|
||||||
' If g.MeasureString(row.Item(1).ToString, control.Font).Width + 30 > iWidestWidth Then
|
|
||||||
' iWidestWidth = g.MeasureString(row.Item(1).ToString, control.Font).Width + 30
|
|
||||||
' End If
|
|
||||||
' g.Dispose()
|
|
||||||
' End Using
|
|
||||||
' ' control.Items.Add(row.Item(0).ToString)
|
|
||||||
' Next
|
|
||||||
' If iWidestWidth > 300 Then
|
|
||||||
' control.DropDownWidth = Math.Max(iWidestWidth, control.Width)
|
|
||||||
' End If
|
|
||||||
|
|
||||||
' End If
|
|
||||||
'End If
|
|
||||||
|
|
||||||
' Wenn statische liste vorhanden, werte splitten und einfügen
|
' Wenn statische liste vorhanden, werte splitten und einfügen
|
||||||
If static_list.Length > 0 Then
|
If static_list.Length > 0 Then
|
||||||
Dim items() As String = static_list.Split(";")
|
Dim items() As String = static_list.Split(";")
|
||||||
@@ -845,7 +815,6 @@ Public Class ClassControlBuilder
|
|||||||
Next
|
Next
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
|
||||||
Me.SetEventHandlers(control)
|
Me.SetEventHandlers(control)
|
||||||
Me.CurrentControl = DirectCast(control, ComboBox)
|
Me.CurrentControl = DirectCast(control, ComboBox)
|
||||||
If Not IsNothing(parent) Then
|
If Not IsNothing(parent) Then
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ Public Class ClassControlCommandsUI
|
|||||||
Dim SQL As String = "SELECT * FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = " & FormId & " and SCREEN_ID = 1"
|
Dim SQL As String = "SELECT * FROM VWPMO_CONTROL_SCREEN WHERE FORM_ID = " & FormId & " and SCREEN_ID = 1"
|
||||||
Dim DT As DataTable = ClassDatabase.Return_Datatable(SQL)
|
Dim DT As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||||
|
|
||||||
|
_CtrlBuilder.MasterPanel.SuspendLayout()
|
||||||
|
|
||||||
For Each dr As DataRow In DT.Rows
|
For Each dr As DataRow In DT.Rows
|
||||||
|
|
||||||
@@ -249,6 +249,9 @@ Public Class ClassControlCommandsUI
|
|||||||
dr.Item("CONTROL_SQLCOMMAND_1"),
|
dr.Item("CONTROL_SQLCOMMAND_1"),
|
||||||
parent)
|
parent)
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
_CtrlBuilder.MasterPanel.ResumeLayout()
|
||||||
|
|
||||||
' ContextMenuStrip zuweisen
|
' ContextMenuStrip zuweisen
|
||||||
' MasterDataID im ContextMenuStrip Speichern
|
' MasterDataID im ContextMenuStrip Speichern
|
||||||
If dr.Item("CTRLSCR_MASTER_DATA_ID") <> 0 Then
|
If dr.Item("CTRLSCR_MASTER_DATA_ID") <> 0 Then
|
||||||
|
|||||||
@@ -19,8 +19,7 @@
|
|||||||
Dim returnValue As DynamicValue
|
Dim returnValue As DynamicValue
|
||||||
|
|
||||||
returnValue.StaticList = CheckForStaticList(controlId)
|
returnValue.StaticList = CheckForStaticList(controlId)
|
||||||
returnValue.DataTable = GetSqlList(controlId, formId, SQLCommand)
|
returnValue.DataTable = GetSqlList(controlId, formId, sqlCommand)
|
||||||
'returnValue.DataTable = CheckForSqlCommand(controlId, formId)
|
|
||||||
|
|
||||||
Return returnValue
|
Return returnValue
|
||||||
End Function
|
End Function
|
||||||
@@ -49,16 +48,16 @@
|
|||||||
Return Nothing
|
Return Nothing
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Dim cached As DataTable = ClassControlValueCache.LoadFromCache(formId, controlId)
|
|
||||||
Dim cached As DataTable = ClassControlValueCache.LoadFromCache(sqlCommand)
|
Dim cached As DataTable = ClassControlValueCache.LoadFromCache(sqlCommand)
|
||||||
Dim final As DataTable
|
Dim final As DataTable
|
||||||
|
|
||||||
If cached Is Nothing Then
|
If cached Is Nothing Then
|
||||||
final = ClassDatabase.Return_Datatable(sqlCommand)
|
final = ClassDatabase.Return_Datatable(sqlCommand)
|
||||||
'ClassControlValueCache.SaveToCache(formId, controlId, final)
|
|
||||||
ClassControlValueCache.SaveToCache(sqlCommand, final)
|
ClassControlValueCache.SaveToCache(sqlCommand, final)
|
||||||
|
Console.WriteLine("CACHE MISS")
|
||||||
Else
|
Else
|
||||||
final = cached
|
final = cached
|
||||||
|
Console.WriteLine("CACHE HIT")
|
||||||
End If
|
End If
|
||||||
|
|
||||||
Return final
|
Return final
|
||||||
@@ -69,8 +68,11 @@
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Overloads Shared Sub SetDataSource(control As Windows.Forms.ComboBox, dt As DataTable)
|
Overloads Shared Sub SetDataSource(control As Windows.Forms.ComboBox, dt As DataTable)
|
||||||
|
Dim sw As Stopwatch = Stopwatch.StartNew()
|
||||||
Dim columnCount As Integer = dt.Columns.Count
|
Dim columnCount As Integer = dt.Columns.Count
|
||||||
|
|
||||||
|
control.BeginUpdate()
|
||||||
|
|
||||||
' Damit beim Setzen von DisplayMember und ValueMember kein Fehler auftritt,
|
' 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.
|
' muss die Datasource zunächst geleert werden und der selected index auf -1 gesetzt werden.
|
||||||
control.DataSource = Nothing
|
control.DataSource = Nothing
|
||||||
@@ -88,6 +90,11 @@
|
|||||||
|
|
||||||
' Als letztes setzen wir die DataSource
|
' Als letztes setzen wir die DataSource
|
||||||
control.DataSource = dt
|
control.DataSource = dt
|
||||||
|
|
||||||
|
control.EndUpdate()
|
||||||
|
|
||||||
|
sw.Stop()
|
||||||
|
Console.WriteLine("SetDataSource for {0} took {1}ms", control.Name, sw.ElapsedMilliseconds)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.CheckedListBoxControl, dt As DataTable)
|
Overloads Shared Sub SetDataSource(control As DevExpress.XtraEditors.CheckedListBoxControl, dt As DataTable)
|
||||||
|
|||||||
@@ -97,17 +97,25 @@ Public Class ClassControlValues
|
|||||||
End If
|
End If
|
||||||
Dim SW As Stopwatch = Stopwatch.StartNew()
|
Dim SW As Stopwatch = Stopwatch.StartNew()
|
||||||
|
|
||||||
|
|
||||||
|
Dim swsql As Stopwatch = Stopwatch.StartNew()
|
||||||
|
|
||||||
' Zuerst alle SQL Commands für FormID finden
|
' Zuerst alle SQL Commands für FormID finden
|
||||||
' CONTROL_SQLCOMMAND_1 wird als SQL gealiast
|
' 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 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)
|
Dim dt As DataTable = ClassDatabase.Return_Datatable(SQL)
|
||||||
|
|
||||||
|
swsql.Stop()
|
||||||
|
Console.WriteLine("LoadControlValuesList - Database took {0} milliseconds to load", swsql.ElapsedMilliseconds)
|
||||||
|
|
||||||
If dt.Rows.Count = 0 Then
|
If dt.Rows.Count = 0 Then
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
For Each Ctrl As Control In controls
|
For Each Ctrl As Control In controls
|
||||||
|
|
||||||
|
Dim swcontrol As Stopwatch = Stopwatch.StartNew()
|
||||||
|
|
||||||
Dim controlTagId = CInt(Ctrl.Tag)
|
Dim controlTagId = CInt(Ctrl.Tag)
|
||||||
'If controlTagId = 474 Then
|
'If controlTagId = 474 Then
|
||||||
' MsgBox("Thats it")
|
' MsgBox("Thats it")
|
||||||
@@ -135,6 +143,9 @@ Public Class ClassControlValues
|
|||||||
ControlLoader.CheckedListBox.LoadList(chlistbox, FormID, sqlcommand)
|
ControlLoader.CheckedListBox.LoadList(chlistbox, FormID, sqlcommand)
|
||||||
|
|
||||||
End Select
|
End Select
|
||||||
|
|
||||||
|
swcontrol.Stop()
|
||||||
|
Console.WriteLine("LoadControlValuesList Loading {0} took {1} milliseconds to load", Ctrl.Name, swcontrol.ElapsedMilliseconds)
|
||||||
Next
|
Next
|
||||||
|
|
||||||
SW.Stop()
|
SW.Stop()
|
||||||
|
|||||||
Reference in New Issue
Block a user