This commit is contained in:
2020-09-07 16:13:56 +02:00
parent b34c66c93f
commit 618d5dac07
24 changed files with 2819 additions and 424 deletions

View File

@@ -55,8 +55,10 @@ Public Class ClassControlCreator
Public Class ControlMetadata
Public Guid As Integer
Public AttrID As Integer
Public DependingAttrID As Integer
Public AttrTitle As String
Public AttrType As String
Public SourceSQL As String
Public DTSource As DataTable
Public MinValue As String
Public MaxValue As String
@@ -92,21 +94,33 @@ Public Class ClassControlCreator
oSourceSQL = oSourceSQL.Replace("@USER_LANGUAGE", My.Application.User.Language)
oSourceSQL = oSourceSQL.Replace("@pUSER_ID", My.Application.User.UserId)
oSourceSQL = oSourceSQL.Replace("@RESULT_TITLE", pAttributeRow.Item("ATTRIBUTE_TITLE").ToString)
Dim oDTSource As DataTable = My.Database_IDB.GetDatatable(oSourceSQL)
Dim oDTSource As DataTable
If pAttributeRow.Item("DEPENDING_ATTRIBUTE1") = 0 Then
oDTSource = My.Database_IDB.GetDatatable(oSourceSQL)
End If
Dim oMinValue As String = ""
Dim oMaxValue As String = ""
If Not IsNothing(oDTSource) Then
oMinValue = oDTSource.Rows(0).Item(0)
oMaxValue = oDTSource.Rows(oDTSource.Rows.Count - 1).Item(0)
End If
ctrl.Tag = New ControlMetadata() With {
'ctrl.Tag = New ControlMetadata() With {
Dim omyclass = New ControlMetadata() With {
.Guid = CType(pAttributeRow.Item("GUID"), Integer),
.AttrID = CType(pAttributeRow.Item("ATTRIBUTE_ID"), Integer),
.DependingAttrID = CType(pAttributeRow.Item("DEPENDING_ATTRIBUTE1"), Integer),
.AttrTitle = CType(pAttributeRow.Item("ATTRIBUTE_TITLE"), String),
.DTSource = CType(oDTSource, DataTable),
.SourceSQL = oSourceSQL,
.MinValue = oMinValue,
.MaxValue = oMaxValue
}
If CInt(pAttributeRow.Item("DEPENDING_ATTRIBUTE1")) <> 0 Then
omyclass.DTSource = Nothing
Else
omyclass.DTSource = CType(oDTSource, DataTable)
End If
ctrl.Tag = omyclass
ctrl.Name = props.Name
ctrl.Location = props.Location
ctrl.Font = props.Font
@@ -171,7 +185,7 @@ Public Class ClassControlCreator
oView = CType(oMyNewGridControl.MainView, GridView)
oView.OptionsView.ShowGroupPanel = False
oMyNewGridControl.ContextMenu = Nothing
oView.Appearance.EvenRow.BackColor = Color.LightBlue
oView.Appearance.EvenRow.BackColor = Color.PaleTurquoise
oView.OptionsBehavior.Editable = False
oView.OptionsBehavior.ReadOnly = True
@@ -451,7 +465,7 @@ Public Class ClassControlCreator
End Sub
Public Sub OncmbSIndexChanged(sender As System.Object, e As System.EventArgs)
If Form.FormShown = False Then
If Form.DataLoaded = False Then
Exit Sub
End If