jj_26_01_16

This commit is contained in:
JenneJ 2016-01-26 13:38:52 +01:00
parent a7b5fcfd75
commit d90fcc9605
12 changed files with 121 additions and 46 deletions

View File

@ -485,7 +485,10 @@ Public Class ClassControlBuilder
Dim control As Label = New Label Dim control As Label = New Label
Dim defaultSize As Size = New Size(200, 27) Dim defaultSize As Size = New Size(200, 27)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
control.Tag = metadata
control.Name = name control.Name = name
control.Text = text control.Text = text
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
@ -552,6 +555,7 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
multiline As Boolean, multiline As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
format As String, format As String,
_new As Boolean, _new As Boolean,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
@ -560,7 +564,12 @@ Public Class ClassControlBuilder
Dim control As New TextBox Dim control As New TextBox
Dim defaultSize As Size = New Size(200, 27) Dim defaultSize As Size = New Size(200, 27)
control.Tag = id
Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
control.ForeColor = IntToColor(fontcolor) control.ForeColor = IntToColor(fontcolor)
@ -633,13 +642,18 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False) Optional _designMode As Boolean = False)
Try Try
Dim control As New CheckBox Dim control As New CheckBox
Dim defaultSize As Size = New Size(150, 27) Dim defaultSize As Size = New Size(150, 27)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Checked = Checked control.Checked = Checked
control.Name = name control.Name = name
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
@ -702,13 +716,18 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False) Optional _designMode As Boolean = False)
Try Try
Dim control As New RadioButton Dim control As New RadioButton
Dim defaultSize As Size = New Size(150, 27) Dim defaultSize As Size = New Size(150, 27)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
control.ForeColor = IntToColor(fontcolor) control.ForeColor = IntToColor(fontcolor)
@ -768,6 +787,7 @@ Public Class ClassControlBuilder
vformat As String, vformat As String,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
static_list As String, static_list As String,
sqlcommand As String, sqlcommand As String,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
@ -776,7 +796,11 @@ Public Class ClassControlBuilder
Dim control As New ComboBox Dim control As New ComboBox
Dim defaultSize As Size = New Size(120, 24) Dim defaultSize As Size = New Size(120, 24)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
control.ForeColor = IntToColor(fontcolor) control.ForeColor = IntToColor(fontcolor)
@ -890,6 +914,7 @@ Public Class ClassControlBuilder
vwidth As Integer, vwidth As Integer,
vheight As Integer, vheight As Integer,
read_only As Boolean, read_only As Boolean,
required As Boolean,
_new As Boolean, _new As Boolean,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False) Optional _designMode As Boolean = False)
@ -898,7 +923,11 @@ Public Class ClassControlBuilder
'Dim control As New DateTimePicker 'Dim control As New DateTimePicker
Dim defaultSize As Size = New Size(120, 24) Dim defaultSize As Size = New Size(120, 24)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
'control.Format = DateTimePickerFormat.Short 'control.Format = DateTimePickerFormat.Short
'control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) 'control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
@ -950,6 +979,7 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False) Optional _designMode As Boolean = False)
@ -957,7 +987,11 @@ Public Class ClassControlBuilder
Dim column As New DataGridViewTextBoxColumn Dim column As New DataGridViewTextBoxColumn
Dim defaultSize = New Size(130, 150) Dim defaultSize = New Size(130, 150)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.BackgroundColor = SystemColors.ControlDark control.BackgroundColor = SystemColors.ControlDark
control.AllowUserToAddRows = False control.AllowUserToAddRows = False
@ -1008,6 +1042,7 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
Optional _designMode As Boolean = False) Optional _designMode As Boolean = False)
@ -1033,7 +1068,11 @@ Public Class ClassControlBuilder
End If End If
ctx.Items.Add(itemSave) ctx.Items.Add(itemSave)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.Parent = _master_panel control.Parent = _master_panel
control.BorderStyle = BorderStyle.FixedSingle control.BorderStyle = BorderStyle.FixedSingle
@ -1087,7 +1126,10 @@ Public Class ClassControlBuilder
Dim control As New GroupBox Dim control As New GroupBox
Dim defaultSize = New Size(200, 100) Dim defaultSize = New Size(200, 100)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
control.Tag = metadata
control.Name = name control.Name = name
control.Parent = _master_panel control.Parent = _master_panel
control.Text = Caption control.Text = Caption
@ -1139,10 +1181,12 @@ Public Class ClassControlBuilder
Dim control As Button = New Button Dim control As Button = New Button
Dim defaultSize As Size = New Size(200, 27) Dim defaultSize As Size = New Size(200, 27)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
control.Tag = metadata
control.Name = name control.Name = name
control.Text = text control.Text = text
'control.Tag = "ADDAPPOINTMENT"
control.TabStop = False control.TabStop = False
control.Image = My.Resources.calendar_add control.Image = My.Resources.calendar_add
control.ImageAlign = ContentAlignment.MiddleRight control.ImageAlign = ContentAlignment.MiddleRight
@ -1195,10 +1239,12 @@ Public Class ClassControlBuilder
Dim control As Button = New Button Dim control As Button = New Button
Dim defaultSize As Size = New Size(30, 21) Dim defaultSize As Size = New Size(30, 21)
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
control.Tag = metadata
control.Name = name control.Name = name
control.Text = "" control.Text = ""
'control.Tag = "ADDFORMDATA"
control.TabStop = False control.TabStop = False
control.Image = My.Resources.add1 control.Image = My.Resources.add1
@ -1249,6 +1295,7 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
static_list As String, static_list As String,
sqlcommand As String, sqlcommand As String,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
@ -1259,7 +1306,11 @@ Public Class ClassControlBuilder
'control.CheckOnClick = True 'control.CheckOnClick = True
' control.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Style3 ' control.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Style3
control.Tag = id Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
control.ForeColor = IntToColor(fontcolor) control.ForeColor = IntToColor(fontcolor)
@ -1351,6 +1402,7 @@ Public Class ClassControlBuilder
vheight As Integer, vheight As Integer,
_new As Boolean, _new As Boolean,
read_only As Boolean, read_only As Boolean,
required As Boolean,
static_list As String, static_list As String,
sqlcommand As String, sqlcommand As String,
Optional parent As GroupBox = Nothing, Optional parent As GroupBox = Nothing,
@ -1361,7 +1413,12 @@ Public Class ClassControlBuilder
'control.CheckOnClick = True 'control.CheckOnClick = True
' control.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Style3 ' control.CheckStyle = DevExpress.XtraEditors.Controls.CheckStyles.Style3
control.Tag = id
Dim metadata As New ClassControlMetadata()
metadata.Id = id
metadata.Required = required
control.Tag = metadata
control.Name = name control.Name = name
control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle)) control.Font = New Font(fontfamily, fontsize, CType(fontstyle, FontStyle))
control.ForeColor = IntToColor(fontcolor) control.ForeColor = IntToColor(fontcolor)

View File

@ -36,11 +36,6 @@
ElseIf control.Name.Contains("f_addformdata") Then ElseIf control.Name.Contains("f_addformdata") Then
Return 9 Return 9
End If End If
'If control.Tag = "ADDAPPOINTMENT" Then
' Return 8
'ElseIf control.Tag = "ADDFORMDATA" Then
' Return 9
'End If
Case CurrentType.Contains("CheckedListBoxControl".ToUpper) Case CurrentType.Contains("CheckedListBoxControl".ToUpper)
Return 12 Return 12
Case CurrentType.Contains("ListBoxControl".ToUpper) Case CurrentType.Contains("ListBoxControl".ToUpper)

View File

@ -70,6 +70,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
dr.Item("CONTROL_MULTILINE"), dr.Item("CONTROL_MULTILINE"),
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_FORMAT_TYPE"), dr.Item("CONTROL_FORMAT_TYPE"),
False, False,
parent) parent)
@ -89,6 +90,7 @@ Public Class ClassControlCommandsUI
dr.Item("CONTROL_FORMAT_TYPE"), dr.Item("CONTROL_FORMAT_TYPE"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_STATIC_LIST"), dr.Item("CONTROL_STATIC_LIST"),
dr.Item("CONTROL_SQLCOMMAND_1"), dr.Item("CONTROL_SQLCOMMAND_1"),
parent) parent)
@ -105,6 +107,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_WIDTH"), dr.Item("CTRLSCR_WIDTH"),
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
False, False,
parent) parent)
Case 5 ' GroupBox Case 5 ' GroupBox
@ -131,6 +134,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent) parent)
Case 7 ' DataGridView Case 7 ' DataGridView
_CtrlBuilder.AddDataGridView(dr.Item("CONTROL_ID"), _CtrlBuilder.AddDataGridView(dr.Item("CONTROL_ID"),
@ -141,6 +145,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent) parent)
Case 10 ' Checkbox Case 10 ' Checkbox
Dim Checked As Boolean = False Dim Checked As Boolean = False
@ -165,6 +170,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent) parent)
Case 8 ' Function AddAppointment Case 8 ' Function AddAppointment
_CtrlBuilder.FunctionAddAppointment(dr.Item("CONTROL_ID"), _CtrlBuilder.FunctionAddAppointment(dr.Item("CONTROL_ID"),
@ -211,6 +217,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent) parent)
Case 12 'CheckedListBox Case 12 'CheckedListBox
CtrlBuilder.AddCheckedListBox(dr.Item("CONTROL_ID"), CtrlBuilder.AddCheckedListBox(dr.Item("CONTROL_ID"),
@ -227,6 +234,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_STATIC_LIST"), dr.Item("CONTROL_STATIC_LIST"),
dr.Item("CONTROL_SQLCOMMAND_1"), dr.Item("CONTROL_SQLCOMMAND_1"),
parent) parent)
@ -245,6 +253,7 @@ Public Class ClassControlCommandsUI
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_STATIC_LIST"), dr.Item("CONTROL_STATIC_LIST"),
dr.Item("CONTROL_SQLCOMMAND_1"), dr.Item("CONTROL_SQLCOMMAND_1"),
parent) parent)
@ -327,7 +336,7 @@ Public Class ClassControlCommandsUI
Private Sub InsertAllControls(FormID As Integer, RecordID As Integer, controls As Control.ControlCollection) Private Sub InsertAllControls(FormID As Integer, RecordID As Integer, controls As Control.ControlCollection)
For Each ctrl As Control In controls For Each ctrl As Control In controls
Dim CONTROL_ID As Integer = ctrl.Tag 'GetControlID_for_Name(ctrl.Name, FormID) Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id 'GetControlID_for_Name(ctrl.Name, FormID)
Dim CONTROL_VALUE As String = Nothing Dim CONTROL_VALUE As String = Nothing
If TypeOf ctrl Is PictureBox Then If TypeOf ctrl Is PictureBox Then
@ -468,12 +477,12 @@ Public Class ClassControlCommandsUI
Private Sub UpdateAllControls(FormID As Integer, RecordID As Integer, controls As Control.ControlCollection) Private Sub UpdateAllControls(FormID As Integer, RecordID As Integer, controls As Control.ControlCollection)
Try Try
For Each ctrl As Control In controls For Each ctrl As Control In controls
Dim CONTROL_ID As Integer = ctrl.Tag 'GetControlID_for_RecordID(ctrl.Name, RecordID) Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id 'GetControlID_for_RecordID(ctrl.Name, RecordID)
If LogErrorsOnly = False Then ClassLogger.Add(">> CONTROL_ID: " & CONTROL_ID, False) If LogErrorsOnly = False Then ClassLogger.Add(">> CONTROL_ID: " & CONTROL_ID, False)
Dim CONTROL_VALUE As String = GetControlValue(ctrl) Dim CONTROL_VALUE As String = GetControlValue(ctrl)
If TypeOf ctrl Is PictureBox Then If TypeOf ctrl Is PictureBox Then
Dim id As Integer = ctrl.Tag 'GetControlID_for_Name(ctrl.Name, FormID) Dim id As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id 'GetControlID_for_Name(ctrl.Name, FormID)
UpsertImage(id, RecordID, ctrl.BackgroundImage) UpsertImage(id, RecordID, ctrl.BackgroundImage)
Continue For Continue For
End If End If
@ -502,7 +511,7 @@ Public Class ClassControlCommandsUI
Function GetControlValue(ctrl As Control) As String Function GetControlValue(ctrl As Control) As String
Dim type = ctrl.GetType().Name Dim type = ctrl.GetType().Name
Dim CONTROL_ID As Integer = ctrl.Tag ' GetControlID_for_RecordID(ctrl.Name, CURRENT_RECORD_ID) Dim CONTROL_ID As Integer = DirectCast(ctrl.Tag, ClassControlMetadata).Id ' GetControlID_for_RecordID(ctrl.Name, CURRENT_RECORD_ID)
If LogErrorsOnly = False Then ClassLogger.Add(">> GetControlValue CONTROL_ID: " & CONTROL_ID, False) If LogErrorsOnly = False Then ClassLogger.Add(">> GetControlValue CONTROL_ID: " & CONTROL_ID, False)
Dim CONTROL_VALUE As String = Nothing Dim CONTROL_VALUE As String = Nothing
If LogErrorsOnly = False Then ClassLogger.Add(">> type = " & type.ToString, False) If LogErrorsOnly = False Then ClassLogger.Add(">> type = " & type.ToString, False)

View File

@ -13,7 +13,7 @@
Public Shared Function LoadAutoValue(control As Windows.Forms.Control, RecordId As Integer, ParentRecordId As Integer) Public Shared Function LoadAutoValue(control As Windows.Forms.Control, RecordId As Integer, ParentRecordId As Integer)
Dim AutoValue As String = String.Empty Dim AutoValue As String = String.Empty
Dim ControlId As Integer = control.Tag Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
Dim SQL As String = ClassDatabase.Execute_Scalar(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId)) Dim SQL As String = ClassDatabase.Execute_Scalar(String.Format("SELECT SQL_COMMAND_1 FROM TBPMO_CONTROL WHERE GUID = {0}", ControlId))
SQL = ClassControlValues.ReplaceSqlCommandPlaceholders(SQL, RecordId, ParentRecordId) SQL = ClassControlValues.ReplaceSqlCommandPlaceholders(SQL, RecordId, ParentRecordId)
@ -174,7 +174,7 @@
Dim autoValue = LoadAutoValue(control, recordId, parentRecordId) Dim autoValue = LoadAutoValue(control, recordId, parentRecordId)
If IsNothing(autoValue) Then If IsNothing(autoValue) Then
Dim ControlId As Integer = control.Tag Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
Dim SQL = String.Format("SELECT CONTROL_TEXT FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0}", ControlId) Dim SQL = String.Format("SELECT CONTROL_TEXT FROM TBPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0}", ControlId)
Dim labelText As String = ClassDatabase.Execute_Scalar(SQL) Dim labelText As String = ClassDatabase.Execute_Scalar(SQL)
control.Text = labelText control.Text = labelText
@ -239,7 +239,7 @@
Public Shared Sub LoadList(control As Windows.Forms.ComboBox, formId As Integer, SQLCommand As String) Public Shared Sub LoadList(control As Windows.Forms.ComboBox, formId As Integer, SQLCommand As String)
Try Try
Dim dynamic As DynamicValue = GetDynamicValue(control.Tag, formId, SQLCommand) Dim dynamic As DynamicValue = GetDynamicValue(DirectCast(control.Tag, ClassControlMetadata).Id, formId, SQLCommand)
If dynamic.StaticList IsNot Nothing Then If dynamic.StaticList IsNot Nothing Then
control.DataSource = dynamic.StaticList control.DataSource = dynamic.StaticList
@ -294,7 +294,7 @@
Public Shared Sub LoadList(control As DevExpress.XtraEditors.CheckedListBoxControl, formId As Integer, SQLCommand As String) Public Shared Sub LoadList(control As DevExpress.XtraEditors.CheckedListBoxControl, formId As Integer, SQLCommand As String)
Try Try
Dim dynamic As DynamicValue = GetDynamicValue(control.Tag, formId, SQLCommand) Dim dynamic As DynamicValue = GetDynamicValue(DirectCast(control.Tag, ClassControlMetadata).Id, formId, SQLCommand)
If dynamic.StaticList IsNot Nothing Then If dynamic.StaticList IsNot Nothing Then
control.DataSource = dynamic.StaticList control.DataSource = dynamic.StaticList
@ -322,7 +322,7 @@
End Sub End Sub
Public Shared Sub LoadList(control As DevExpress.XtraEditors.ListBoxControl, formId As Integer, SQLCommand As String) Public Shared Sub LoadList(control As DevExpress.XtraEditors.ListBoxControl, formId As Integer, SQLCommand As String)
Dim dynamic As DynamicValue = GetDynamicValue(control.Tag, formId, SQLCommand) Dim dynamic As DynamicValue = GetDynamicValue(DirectCast(control.Tag, ClassControlMetadata).Id, formId, SQLCommand)
If dynamic.StaticList IsNot Nothing Then If dynamic.StaticList IsNot Nothing Then
control.DataSource = dynamic.StaticList control.DataSource = dynamic.StaticList

View File

@ -0,0 +1,4 @@
Public Structure ClassControlMetadata
Public Property Id As Integer
Public Property Required As Boolean
End Structure

View File

@ -17,7 +17,7 @@ Public Class ClassControlValues
ClearControlValues(controls) ClearControlValues(controls)
For Each control As Control In controls For Each control As Control In controls
Dim ControlId As Integer = CInt(control.Tag) Dim ControlId As Integer = DirectCast(control.Tag, ClassControlMetadata).Id
' Wert per LINQ aus DT_ControlValues suchen der zur aktuellen controlId passt ' Wert per LINQ aus DT_ControlValues suchen der zur aktuellen controlId passt
Dim value = (From row In DT_ControlValues.AsEnumerable() Dim value = (From row In DT_ControlValues.AsEnumerable()
@ -116,7 +116,7 @@ Public Class ClassControlValues
Dim swcontrol As Stopwatch = Stopwatch.StartNew() Dim swcontrol As Stopwatch = Stopwatch.StartNew()
Dim controlTagId = CInt(Ctrl.Tag) Dim controlTagId = DirectCast(Ctrl.Tag, ClassControlMetadata).Id
'If controlTagId = 474 Then 'If controlTagId = 474 Then
' MsgBox("Thats it") ' MsgBox("Thats it")
'End If 'End If
@ -177,7 +177,7 @@ Public Class ClassControlValues
End If End If
For Each Ctrl As Control In controls For Each Ctrl As Control In controls
Dim controlTagId = CInt(Ctrl.Tag) Dim controlTagId = DirectCast(Ctrl.Tag, ClassControlMetadata).Id
Dim row As DataRow = dt.Select(String.Format("CONTROL_ID={0}", controlTagId)).FirstOrDefault() Dim row As DataRow = dt.Select(String.Format("CONTROL_ID={0}", controlTagId)).FirstOrDefault()
If IsNothing(row) Then If IsNothing(row) Then
@ -298,7 +298,7 @@ Public Class ClassControlValues
Dim i = 0 Dim i = 0
For Each control As Control In controls For Each control As Control In controls
Dim CONTROL_ID = control.Tag ' GetControlID_for_Name(control.Name, FormID) Dim CONTROL_ID = DirectCast(control.Tag, ClassControlMetadata).Id ' GetControlID_for_Name(control.Name, FormID)
If Not (TypeOf control Is Label) Then If Not (TypeOf control Is Label) Then
i += 1 i += 1
End If End If

View File

@ -43,7 +43,7 @@ Public Class ClassOfficeTemplate
For Each cc In doc.ContentControls For Each cc In doc.ContentControls
If LogErrorsOnly = False Then ClassLogger.Add(">> Office-Pattern: " & cc.Tag, False) If LogErrorsOnly = False Then ClassLogger.Add(">> Office-Pattern: " & cc.Tag, False)
For Each patternrow As System.Data.DataRow In DT_PATTERNS.Rows For Each patternrow As System.Data.DataRow In DT_PATTERNS.Rows
If patternrow.Item("NAME_PATTERN").ToString.ToUpper = cc.tag.ToString.ToUpper Then If patternrow.Item("NAME_PATTERN").ToString.ToUpper = cc.Tag.ToString.ToUpper Then
If Not IsDBNull(patternrow.Item("FIXED_VALUE")) Then If Not IsDBNull(patternrow.Item("FIXED_VALUE")) Then
'Fixed Value ist gefüllt 'Fixed Value ist gefüllt
Dim fvalue As String = patternrow.Item("FIXED_VALUE").ToString.ToUpper Dim fvalue As String = patternrow.Item("FIXED_VALUE").ToString.ToUpper

View File

@ -247,6 +247,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="ClassControlLoader.vb" /> <Compile Include="ClassControlLoader.vb" />
<Compile Include="ClassControlMetadata.vb" />
<Compile Include="ClassControlValueCache.vb" /> <Compile Include="ClassControlValueCache.vb" />
<Compile Include="ClassConverter.vb" /> <Compile Include="ClassConverter.vb" />
<Compile Include="ClassFolderWatcher.vb" /> <Compile Include="ClassFolderWatcher.vb" />

View File

@ -530,7 +530,7 @@ Public Class frmFormInput
Dim MenuItem = DirectCast(sender, ToolStripMenuItem) Dim MenuItem = DirectCast(sender, ToolStripMenuItem)
Dim ContextMenu As ContextMenuStrip = MenuItem.Owner Dim ContextMenu As ContextMenuStrip = MenuItem.Owner
Dim SourceControl As Control = ContextMenu.SourceControl Dim SourceControl As Control = ContextMenu.SourceControl
Dim MasterDataId As Integer = SourceControl.Tag Dim MasterDataId As Integer = DirectCast(SourceControl.Tag, ClassControlMetadata).Id
frmQuickInput.ShowDialog() frmQuickInput.ShowDialog()
End Sub End Sub

View File

@ -117,31 +117,31 @@
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "txt" Case "txt"
CtrlBuilder.AddTextBox(0, "txt" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, False, False, "String", True, Parent) CtrlBuilder.AddTextBox(0, "txt" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, False, False, False, "String", True, Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "cmb" Case "cmb"
CtrlBuilder.AddComboBox(0, "cmb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, "String", True, False, "", "", Parent) CtrlBuilder.AddComboBox(0, "cmb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, "String", True, False, False, "", "", Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "dtp" Case "dtp"
CtrlBuilder.AddDateTimePicker(0, "dtp" & random, 0, 0, def_font_family, def_font_size, def_font_style, 0, False, 0, 0, False, True, Parent) CtrlBuilder.AddDateTimePicker(0, "dtp" & random, 0, 0, def_font_family, def_font_size, def_font_style, 0, False, 0, 0, False, False, True, Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "dgv" Case "dgv"
CtrlBuilder.AddDataGridView(0, "dgv" & random, 0, 0, 0, 0, True, False, Parent) CtrlBuilder.AddDataGridView(0, "dgv" & random, 0, 0, 0, 0, True, False, False, Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "chk" Case "chk"
CtrlBuilder.AddCheckBox(0, "chk" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, Parent) CtrlBuilder.AddCheckBox(0, "chk" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, False, Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "rb" Case "rb"
CtrlBuilder.AddRadioButton(0, "rb" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, Parent) CtrlBuilder.AddRadioButton(0, "rb" & random, "Bezeichn. defnieren", False, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, False, 0, 0, True, False, False, Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "pb" Case "pb"
CtrlBuilder.AddPictureBox(0, "pb" & random, 0, 0, 0, 0, True, False, Parent) CtrlBuilder.AddPictureBox(0, "pb" & random, 0, 0, 0, 0, True, False, False, Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "gb" Case "gb"
@ -163,11 +163,11 @@
ClassFunctionCommands.InsertFunction(ControlId, "ADDFORMDATA") ClassFunctionCommands.InsertFunction(ControlId, "ADDFORMDATA")
End If End If
Case "lstbxcheck" Case "lstbxcheck"
CtrlBuilder.AddCheckedListBox(0, "chlb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, "", "", Parent) CtrlBuilder.AddCheckedListBox(0, "chlb" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, False, "", "", Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case "lstbx" Case "lstbx"
CtrlBuilder.AddListBox(0, "lbx" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, "", "", Parent) CtrlBuilder.AddListBox(0, "lbx" & random, 0, 0, def_font_family, def_font_color, def_font_size, def_font_style, 0, True, 0, 0, True, False, False, "", "", Parent)
' Aktuelles Control in die Datenbank speichern ' Aktuelles Control in die Datenbank speichern
ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl) ClassControlCommands.InsertControl(CtrlBuilder.CurrentControl)
Case Else Case Else
@ -306,6 +306,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
dr.Item("CONTROL_MULTILINE"), dr.Item("CONTROL_MULTILINE"),
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_FORMAT_TYPE"), dr.Item("CONTROL_FORMAT_TYPE"),
False, False,
parent, parent,
@ -326,6 +327,7 @@
dr.Item("CONTROL_FORMAT_TYPE"), dr.Item("CONTROL_FORMAT_TYPE"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_STATIC_LIST"), dr.Item("CONTROL_STATIC_LIST"),
dr.Item("CONTROL_SQLCOMMAND_1"), dr.Item("CONTROL_SQLCOMMAND_1"),
parent, parent,
@ -343,6 +345,7 @@
dr.Item("CTRLSCR_WIDTH"), dr.Item("CTRLSCR_WIDTH"),
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
False, False,
parent, parent,
True) True)
@ -371,6 +374,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent, parent,
True) True)
Case 7 ' DataGridView Case 7 ' DataGridView
@ -382,6 +386,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent, parent,
True) True)
Case 10 ' Checkbox Case 10 ' Checkbox
@ -407,6 +412,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent, parent,
True) True)
Case 8 'AddAppointment Button Case 8 'AddAppointment Button
@ -455,6 +461,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
parent, parent,
True) True)
Case 12 'CheckedListBox Case 12 'CheckedListBox
@ -472,6 +479,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_STATIC_LIST"), dr.Item("CONTROL_STATIC_LIST"),
dr.Item("CONTROL_SQLCOMMAND_1"), dr.Item("CONTROL_SQLCOMMAND_1"),
parent, parent,
@ -491,6 +499,7 @@
dr.Item("CTRLSCR_HEIGHT"), dr.Item("CTRLSCR_HEIGHT"),
False, False,
dr.Item("CONTROL_READ_ONLY"), dr.Item("CONTROL_READ_ONLY"),
dr.Item("CONTROL_REQUIRED"),
dr.Item("CONTROL_STATIC_LIST"), dr.Item("CONTROL_STATIC_LIST"),
dr.Item("CONTROL_SQLCOMMAND_1"), dr.Item("CONTROL_SQLCOMMAND_1"),
parent, parent,

View File

@ -554,7 +554,7 @@ Public Class frmQuickEdit
Dim MenuItem = DirectCast(sender, ToolStripMenuItem) Dim MenuItem = DirectCast(sender, ToolStripMenuItem)
Dim ContextMenu As ContextMenuStrip = MenuItem.Owner Dim ContextMenu As ContextMenuStrip = MenuItem.Owner
Dim SourceControl As Control = ContextMenu.SourceControl Dim SourceControl As Control = ContextMenu.SourceControl
Dim MasterDataId As Integer = SourceControl.Tag Dim MasterDataId As Integer = DirectCast(SourceControl.Tag, ClassControlMetadata).Id
frmQuickInput.ShowDialog() frmQuickInput.ShowDialog()
End Sub End Sub
End Class End Class

View File

@ -26,7 +26,7 @@
Public Sub LoadControlPropertiesNeu(ctrl As Control) Public Sub LoadControlPropertiesNeu(ctrl As Control)
Try Try
'TODO: LoadControlProperties Neuschreiben!!! 'TODO: LoadControlProperties Neuschreiben!!!
Dim sql As String = String.Format("SELECT * FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0}", ctrl.Tag) Dim sql As String = String.Format("SELECT * FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_ID = {0}", DirectCast(ctrl.Tag, ClassControlMetadata).Id)
Dim dt As DataTable = ClassDatabase.Execute_Scalar(sql) Dim dt As DataTable = ClassDatabase.Execute_Scalar(sql)
Dim props As Object = Nothing Dim props As Object = Nothing
Dim row As DataRow = Nothing Dim row As DataRow = Nothing