MS_1705
This commit is contained in:
@@ -144,9 +144,17 @@ Public Class ClassControlValues
|
||||
|
||||
Public Shared Sub LoadControlValues(RecordId As Integer, ParentRecordId As Integer, FormId As Integer, controls As Control.ControlCollection, Entity_ID As Integer)
|
||||
Try
|
||||
Dim sw As New Stopwatch
|
||||
sw.Start()
|
||||
|
||||
'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)
|
||||
Dim DT_ControlValues As DataTable = ClassDatabase.Return_Datatable(SQL, "LoadControlValues")
|
||||
CURRENT_CONTROL_VALUES = DT_ControlValues
|
||||
Dim elapsed As Double
|
||||
elapsed = sw.Elapsed.TotalSeconds
|
||||
sw.Stop()
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(String.Format(" >> Load VWPMO_VALUES via SQL took {0} to load", Format(elapsed, "0.000000000") & " seconds"), False)
|
||||
|
||||
If controls.Count = 0 Then
|
||||
ClassLogger.Add("the control-Collection in LoadControlValuesNeu is empty!", True)
|
||||
@@ -157,26 +165,38 @@ Public Class ClassControlValues
|
||||
|
||||
' Zuerst alle Controls leeren
|
||||
ClearControlValues(controls)
|
||||
|
||||
sw.Start()
|
||||
' Load all Hints for controls
|
||||
LoadControlHints(controls)
|
||||
|
||||
Dim SQLHint = "SELECT * FROM VWPMO_CONTROL_HINT WHERE FORM_ID = " & FormId
|
||||
Dim DT_Hints As DataTable = ClassDatabase.Return_Datatable(SQLHint, "LoadControlHints")
|
||||
' ' Hint in DT_Hints suchen der zur aktuellen controlId passt
|
||||
For Each row As DataRow In DT_Hints.Rows
|
||||
ClassControlValueCache.SaveHint(row.Item(1), row.Item(2))
|
||||
Next
|
||||
' LoadControlHints(controls)
|
||||
elapsed = sw.Elapsed.TotalSeconds
|
||||
sw.Stop()
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(String.Format(" >> LoadControlHints took {0} to load", Format(elapsed, "0.000000000") & " seconds"), False)
|
||||
sw.Start()
|
||||
Dim result As Double = 0
|
||||
For Each control As Control In controls
|
||||
Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
|
||||
|
||||
' Wert per LINQ aus DT_ControlValues suchen der zur aktuellen controlId passt
|
||||
Dim values As List(Of Object) = (From row In DT_ControlValues.AsEnumerable()
|
||||
Where row.Item("CONTROL_ID") = ControlId
|
||||
Select row.Item("VALUE")).ToList()
|
||||
|
||||
|
||||
If TypeOf control Is GroupBox Then
|
||||
Dim groupbox As GroupBox = DirectCast(control, GroupBox)
|
||||
LoadControlValues(RecordId, ParentRecordId, FormId, groupbox.Controls, Entity_ID)
|
||||
Else
|
||||
LoadControlValue(RecordId, ParentRecordId, ControlId, control, values, Entity_ID)
|
||||
End If
|
||||
|
||||
Next
|
||||
Console.WriteLine("Secons Sum: " & result)
|
||||
elapsed = sw.Elapsed.TotalSeconds
|
||||
sw.Stop()
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(String.Format(" >> Loop LoadControlValue took {0} to load", Format(elapsed, "0.000000000") & " seconds"), False)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in LoadControlValuesNeu: " & ex.Message, True)
|
||||
MsgBox("Error in LoadControlValuesNeu:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
@@ -398,7 +418,7 @@ Public Class ClassControlValues
|
||||
Dim elapsed As Double
|
||||
elapsed = SW.Elapsed.TotalSeconds
|
||||
SW.Stop()
|
||||
Console.WriteLine("LoadControlValuesListWithPlaceholders took {0} to load", Format(elapsed, "0.000000000") & " seconds")
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(String.Format(" >> LoadControlValuesListWithPlaceholders took {0} to load", Format(elapsed, "0.000000000") & " seconds"), False)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in LoadControlValuesListWithPlaceholders: " & ex.Message, True)
|
||||
MsgBox("Unexpected Error in LoadControlValuesListWithPlaceholders:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
@@ -466,7 +486,7 @@ Public Class ClassControlValues
|
||||
Dim elapsed As Double
|
||||
elapsed = SW.Elapsed.TotalSeconds
|
||||
SW.Stop()
|
||||
Console.WriteLine("Enable_Depending_Controls took {0} to load", Format(elapsed, "0.000000000") & " seconds")
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(String.Format(" >> Enable_Depending_Controls took {0} to load", Format(elapsed, "0.000000000") & " seconds"), False)
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Enable_Depending_Controls: " & ex.Message, True)
|
||||
MsgBox("Unexpected Error in Enable_Depending_Controls:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
|
||||
Reference in New Issue
Block a user