jj_01_02_16
This commit is contained in:
@@ -25,274 +25,484 @@
|
||||
|
||||
Public Sub LoadControlPropertiesNeu(ctrl As Control)
|
||||
Try
|
||||
'TODO: LoadControlProperties Neuschreiben!!!
|
||||
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.Return_Datatable(sql)
|
||||
Dim props As Object = Nothing
|
||||
Dim row As DataRow = Nothing
|
||||
Dim r As DataRow = Nothing
|
||||
Dim type As String = Nothing
|
||||
|
||||
If dt.Rows.Count <> 1 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
row = dt.Rows(0)
|
||||
r = dt.Rows(0)
|
||||
type = r.Item("CTRLTYPE_NAME")
|
||||
|
||||
'Props Object initialisieren
|
||||
Select Case type
|
||||
Case "Label" : props = New LabelProperties()
|
||||
Case "Textbox" : props = New TextBoxProperties()
|
||||
Case "Combobox" : props = New ComboBoxProperties()
|
||||
Case "Checkbox" : props = New CheckBoxProperties()
|
||||
Case "RadioButton" : props = New RadioButtonProperties()
|
||||
Case "Datepicker" : props = New DateTimePickerProperties()
|
||||
Case "Datagridview" : props = New DataGridViewProperties()
|
||||
Case "Groupbox" : props = New GroupBoxProperties()
|
||||
Case "Picturebox" : props = New PictureBoxProperties()
|
||||
Case "ListBox" : props = New ComboBoxProperties()
|
||||
Case "CheckedListBox" : props = New ComboBoxProperties()
|
||||
Case "F_AddAppointment" : props = New FunctionAddAppointment()
|
||||
Case "F_AddFormData" : props = New FunctionAddFormData()
|
||||
End Select
|
||||
|
||||
'Generische Properties laden
|
||||
props.ID = r.Item("CONTROL_ID")
|
||||
props.Name = r.Item("CONTROL_NAME")
|
||||
props.Size = New Size(r.Item("CTRLSCR_WIDTH"), r.Item("CTRLSCR_HEIGHT"))
|
||||
props.Location = New Point(r.Item("CTRLSCR_X_LOC"), r.Item("CTRLSCR_Y_LOC"))
|
||||
|
||||
'Control-spezifische Properties laden
|
||||
Select Case type
|
||||
Case "Label"
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
props.ColumnTitle = r.Item("CONTROL_COL_NAME")
|
||||
props.Caption = r.Item("CTRLSCR_CAPTION")
|
||||
props.SQLCommand = New SQLValue(NotNull(r.Item("CONTROL_SQLCOMMAND_1"), ""))
|
||||
|
||||
Case "Textbox"
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
props.ColumnTitle = r.Item("CONTROL_COL_NAME")
|
||||
props.DefaultValue = ClassConverter.ToStringOrDefault(r.Item("CONTROL_DEF_VALUE"))
|
||||
props.Format = NotNull([Enum].Parse(GetType(EnumFormatOptions), r.Item("CONTROL_FORMAT_TYPE")), EnumFormatOptions.String)
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
props.TabStop = r.Item("CTRLSCR_TAB_STOP")
|
||||
props.TabIndex = r.Item("CTRLSCR_TAB_INDEX")
|
||||
props.ShowColumn = NotNull(r.Item("CONTROL_SHOW_COLUMN"), True)
|
||||
props.Multiline = r.Item("CONTROL_MULTILINE")
|
||||
props.SQLCommand = New SQLValue(NotNull(r.Item("CONTROL_SQLCOMMAND_1"), ""))
|
||||
|
||||
Case "Combobox"
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
props.ColumnTitle = r.Item("CONTROL_COL_NAME")
|
||||
props.DefaultValue = ClassConverter.ToStringOrDefault(r.Item("CONTROL_DEF_VALUE"))
|
||||
props.MasterDataId = r.Item("CTRLSCR_MASTER_DATA_ID")
|
||||
props.Format = NotNull([Enum].Parse(GetType(EnumFormatOptions), r.Item("CONTROL_FORMAT_TYPE")), EnumFormatOptions.String)
|
||||
props.StaticList = NotNull(r.Item("CONTROL_STATIC_LIST"), "")
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
props.TabStop = r.Item("CTRLSCR_TAB_STOP")
|
||||
props.TabIndex = r.Item("CTRLSCR_TAB_INDEX")
|
||||
props.ShowColumn = NotNull(r.Item("CONTROL_SHOW_COLUMN"), True)
|
||||
props.SQLCommand = New SQLValue(NotNull(r.Item("CONTROL_SQLCOMMAND_1"), ""))
|
||||
|
||||
Case "Checkbox"
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
props.ColumnTitle = r.Item("CONTROL_COL_NAME")
|
||||
props.Caption = r.Item("CTRLSCR_CAPTION")
|
||||
props.DefaultValue = ClassConverter.ToBooleanOrDefault(r.Item("CONTROL_DEF_VALUE"))
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
props.ShowColumn = NotNull(r.Item("CONTROL_SHOW_COLUMN"), True)
|
||||
props.TabStop = r.Item("CTRLSCR_TAB_STOP")
|
||||
props.TabIndex = r.Item("CTRLSCR_TAB_INDEX")
|
||||
|
||||
Case "RadioButton"
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
|
||||
Case "Datepicker"
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
props.ColumnTitle = r.Item("CONTROL_COL_NAME")
|
||||
|
||||
props.DefaultValue = NotNull(r.Item("CONTROL_DEF_VALUE"), EnumDateTimePickerDefaultValueOptions.Empty)
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
props.ShowColumn = NotNull(r.Item("CONTROL_SHOW_COLUMN"), True)
|
||||
props.TabStop = r.Item("CTRLSCR_TAB_STOP")
|
||||
props.TabIndex = r.Item("CTRLSCR_TAB_INDEX")
|
||||
|
||||
Case "Datagridview"
|
||||
' Keine zusätzliche Properties
|
||||
|
||||
Case "Groupbox"
|
||||
props.Caption = r.Item("CTRLSCR_CAPTION")
|
||||
props.BackColor = IntToColor(r.Item("CTRLSCR_BACK_COLOR"))
|
||||
|
||||
Case "Picturebox"
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
|
||||
Case "ListBox"
|
||||
props.StaticList = ClassConverter.ToStringOrDefault(r.Item("CONTROL_STATIC_LIST"))
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
|
||||
Case "CheckedListBox"
|
||||
props.StaticList = ClassConverter.ToStringOrDefault(r.Item("CONTROL_STATIC_LIST"))
|
||||
props.IsRequired = r.Item("CONTROL_REQUIRED")
|
||||
props.IsReadOnly = r.Item("CONTROL_READ_ONLY")
|
||||
props.FontColor = IntToColor(r.Item("CTRLSCR_FONT_COLOR"))
|
||||
props.Font = New Font(r.Item("CTRLSCR_FONT_FAMILY").ToString(),
|
||||
CType(r.Item("CTRLSCR_FONT_SIZE"), Single),
|
||||
CType(r.Item("CTRLSCR_FONT_STYLE"), FontStyle))
|
||||
|
||||
Case "F_AddAppointment"
|
||||
props.Caption() = r.Item("CTRLSCR_CAPTION")
|
||||
|
||||
Dim controlId = DirectCast(ctrl.Tag, ClassControlMetadata).Id
|
||||
Dim f = ClassFunctionCommands.LoadFunction(controlId)
|
||||
Dim FromDateId, ToDateId, SubjectString, Subject2String, PlaceString, DescString
|
||||
|
||||
FromDateId = f.Item("INTEGER1")
|
||||
If IsDBNull(FromDateId) OrElse FromDateId = 0 Then
|
||||
props.FromDate = ""
|
||||
Else
|
||||
props.FromDate = Get_Name_for_ControlID(FromDateId, CURRENT_FORM_ID)
|
||||
End If
|
||||
|
||||
ToDateId = f.Item("INTEGER2")
|
||||
If IsDBNull(ToDateId) OrElse ToDateId = 0 Then
|
||||
props.ToDate = ""
|
||||
Else
|
||||
props.ToDate = Get_Name_for_ControlID(ToDateId, CURRENT_FORM_ID)
|
||||
End If
|
||||
|
||||
SubjectString = f.Item("STRING1")
|
||||
If IsDBNull(SubjectString) OrElse String.IsNullOrEmpty(SubjectString) Then
|
||||
props.Subject = ""
|
||||
Else
|
||||
props.Subject = SubjectString
|
||||
End If
|
||||
|
||||
Subject2String = f.Item("STRING2")
|
||||
If IsDBNull(Subject2String) OrElse String.IsNullOrEmpty(Subject2String) Then
|
||||
props.Subject2 = ""
|
||||
Else
|
||||
props.Subject2 = Subject2String
|
||||
End If
|
||||
|
||||
PlaceString = f.Item("STRING3")
|
||||
If IsDBNull(PlaceString) OrElse String.IsNullOrEmpty(PlaceString) Then
|
||||
props.Place = ""
|
||||
Else
|
||||
props.Place = PlaceString
|
||||
End If
|
||||
|
||||
DescString = f.Item("STRING4")
|
||||
If IsDBNull(DescString) OrElse String.IsNullOrEmpty(DescString) Then
|
||||
props.Description = ""
|
||||
Else
|
||||
props.Description = DescString
|
||||
End If
|
||||
|
||||
|
||||
Case "F_AddFormData"
|
||||
props.Caption = r.Item("CTRLSCR_CAPTION")
|
||||
|
||||
Dim controlId = DirectCast(ctrl.Tag, ClassControlMetadata).Id
|
||||
Dim f = ClassFunctionCommands.LoadFunction(controlId)
|
||||
|
||||
Dim FormId = f.Item("INTEGER1")
|
||||
If IsDBNull(FormId) OrElse FormId = 0 Then
|
||||
props.FormID = 0
|
||||
Else
|
||||
props.FormID = FormId
|
||||
End If
|
||||
|
||||
Dim ScreenId = f.Item("INTEGER2")
|
||||
If IsDBNull(ScreenId) OrElse ScreenId = 0 Then
|
||||
props.ScreenID = 0
|
||||
Else
|
||||
props.ScreenID = ScreenId
|
||||
End If
|
||||
|
||||
End Select
|
||||
|
||||
CURRENT_CONTROL_ID = r.Item("CONTROL_ID")
|
||||
' Aktuelle Control Eigenschaften anzeigen
|
||||
Me.pgControlProperties.SelectedObject = props
|
||||
' Fenster Titel aktualisieren
|
||||
Me.Text = String.Format("Eigenschaften von {0}({1})", type, props.ID.ToString())
|
||||
' Control Name akutalisieren
|
||||
Me.tslControlName.Text = r.Item("CONTROL_NAME")
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in loadcontrolproperties" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
MsgBox("Error in LoadControlProperties" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
' ADDED 25.11
|
||||
' Lade Control Eigenschaften und zeige diese an
|
||||
' Wird von frmLevelDesigner aufgerufen
|
||||
Public Sub LoadControlProperties(ctrl As Control)
|
||||
Try
|
||||
Dim sql As String = "SELECT CTRLSCR_ID FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_NAME = '" & ctrl.Name & "' AND FORM_ID = " & CURRENT_FORM_ID & " and SCREEN_ID = " & CURRENT_SCREEN_ID
|
||||
Dim CTRLSCR_ID = ClassDatabase.Execute_Scalar(sql)
|
||||
If CTRLSCR_ID > 0 Then
|
||||
Dim DT As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM VWPMO_CONTROL_SCREEN WHERE CTRLSCR_ID = " & CTRLSCR_ID)
|
||||
If DT.Rows.Count = 1 Then
|
||||
Dim row As DataRow = DT.Rows(0)
|
||||
Dim type As String = row.Item("CTRLTYPE_NAME")
|
||||
Dim props As Object = Nothing
|
||||
Dim fontcolor As Color
|
||||
Dim fontfamily As String
|
||||
Dim fontstyle As FontStyle
|
||||
Dim fontsize As Single
|
||||
Dim isreadonly As Boolean
|
||||
Dim isrequired As Boolean
|
||||
Dim columntitle As String
|
||||
Dim DefaultValue As String
|
||||
'Public Sub LoadControlProperties(ctrl As Control)
|
||||
' Try
|
||||
' Dim sql As String = "SELECT CTRLSCR_ID FROM VWPMO_CONTROL_SCREEN WHERE CONTROL_NAME = '" & ctrl.Name & "' AND FORM_ID = " & CURRENT_FORM_ID & " and SCREEN_ID = " & CURRENT_SCREEN_ID
|
||||
' Dim CTRLSCR_ID = ClassDatabase.Execute_Scalar(sql)
|
||||
' If CTRLSCR_ID > 0 Then
|
||||
' Dim DT As DataTable = ClassDatabase.Return_Datatable("SELECT * FROM VWPMO_CONTROL_SCREEN WHERE CTRLSCR_ID = " & CTRLSCR_ID)
|
||||
' If DT.Rows.Count = 1 Then
|
||||
' Dim row As DataRow = DT.Rows(0)
|
||||
' Dim type As String = row.Item("CTRLTYPE_NAME")
|
||||
' Dim props As Object = Nothing
|
||||
' Dim fontcolor As Color
|
||||
' Dim fontfamily As String
|
||||
' Dim fontstyle As FontStyle
|
||||
' Dim fontsize As Single
|
||||
' Dim isreadonly As Boolean
|
||||
' Dim isrequired As Boolean
|
||||
' Dim columntitle As String
|
||||
' Dim DefaultValue As String
|
||||
|
||||
|
||||
Select Case type
|
||||
Case "Label"
|
||||
props = New LabelProperties()
|
||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
Case "Textbox"
|
||||
props = New TextBoxProperties()
|
||||
props.DefaultValue = ClassConverter.ToStringOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
' Select Case type
|
||||
' Case "Label"
|
||||
' props = New LabelProperties()
|
||||
' props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
' Case "Textbox"
|
||||
' props = New TextBoxProperties()
|
||||
' props.DefaultValue = ClassConverter.ToStringOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
|
||||
If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
||||
props.Format = DirectCast([Enum].Parse(GetType(EnumFormatOptions), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
||||
Else
|
||||
props.Format = "String"
|
||||
End If
|
||||
Case "Combobox"
|
||||
props = New ComboBoxProperties()
|
||||
props.MasterDataId = row.Item("CTRLSCR_MASTER_DATA_ID")
|
||||
props.DefaultValue = ClassConverter.ToStringOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
' If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
||||
' props.Format = DirectCast([Enum].Parse(GetType(EnumFormatOptions), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
||||
' Else
|
||||
' props.Format = "String"
|
||||
' End If
|
||||
' Case "Combobox"
|
||||
' props = New ComboBoxProperties()
|
||||
' props.MasterDataId = row.Item("CTRLSCR_MASTER_DATA_ID")
|
||||
' props.DefaultValue = ClassConverter.ToStringOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
|
||||
If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
||||
props.Format = DirectCast([Enum].Parse(GetType(EnumFormatOptions), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
||||
Else
|
||||
props.Format = "String"
|
||||
End If
|
||||
' If Not IsDBNull(row.Item("CONTROL_FORMAT_TYPE")) Then
|
||||
' props.Format = DirectCast([Enum].Parse(GetType(EnumFormatOptions), row.Item("CONTROL_FORMAT_TYPE")), Integer)
|
||||
' Else
|
||||
' props.Format = "String"
|
||||
' End If
|
||||
|
||||
props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||
Case "Checkbox"
|
||||
props = New CheckBoxProperties()
|
||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
props.DefaultValue = ClassConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
Case "Datepicker"
|
||||
props = New DateTimePickerProperties()
|
||||
props.DefaultValue = NotNull(row.Item("CONTROL_DEF_VALUE"), EnumDateTimePickerDefaultValueOptions.Empty)
|
||||
'props.DefaultValue = ClassConverter.ToDateTimePickerOptionsOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
Case "Datagridview"
|
||||
props = New DataGridViewProperties()
|
||||
Case "Groupbox"
|
||||
props = New GroupBoxProperties()
|
||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
props.BackColor = IntToColor(row.Item("CTRLSCR_BACK_COLOR"))
|
||||
Case "Picturebox"
|
||||
props = New PictureBoxProperties()
|
||||
Case "RadioButton"
|
||||
props = New RadioButtonProperties()
|
||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
props.DefaultValue = ClassConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
props.IsRequired = row.Item("CONTROL_REQUIRED")
|
||||
Case "F_AddAppointment"
|
||||
props = New FunctionAddAppointment()
|
||||
Case "F_AddFormData"
|
||||
props = New FunctionAddFormData()
|
||||
Case "CheckedListBox"
|
||||
props = New ComboBoxProperties()
|
||||
props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||
Case "ListBox"
|
||||
props = New ComboBoxProperties()
|
||||
props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||
Case Else
|
||||
MsgBox("Unknown control type " & type, MsgBoxStyle.Exclamation, "Error in LoadControlProperties:")
|
||||
End Select
|
||||
' props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||
' Case "Checkbox"
|
||||
' props = New CheckBoxProperties()
|
||||
' props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
' props.DefaultValue = ClassConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
' Case "Datepicker"
|
||||
' props = New DateTimePickerProperties()
|
||||
' props.DefaultValue = NotNull(row.Item("CONTROL_DEF_VALUE"), EnumDateTimePickerDefaultValueOptions.Empty)
|
||||
' 'props.DefaultValue = ClassConverter.ToDateTimePickerOptionsOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
' Case "Datagridview"
|
||||
' props = New DataGridViewProperties()
|
||||
' Case "Groupbox"
|
||||
' props = New GroupBoxProperties()
|
||||
' props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
' props.BackColor = IntToColor(row.Item("CTRLSCR_BACK_COLOR"))
|
||||
' Case "Picturebox"
|
||||
' props = New PictureBoxProperties()
|
||||
' Case "RadioButton"
|
||||
' props = New RadioButtonProperties()
|
||||
' props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
' props.DefaultValue = ClassConverter.ToBooleanOrDefault(row.Item("CONTROL_DEF_VALUE"))
|
||||
' props.IsRequired = row.Item("CONTROL_REQUIRED")
|
||||
' Case "F_AddAppointment"
|
||||
' props = New FunctionAddAppointment()
|
||||
' Case "F_AddFormData"
|
||||
' props = New FunctionAddFormData()
|
||||
' Case "CheckedListBox"
|
||||
' props = New ComboBoxProperties()
|
||||
' props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||
' Case "ListBox"
|
||||
' props = New ComboBoxProperties()
|
||||
' props.StaticList = ClassConverter.ToStringOrDefault(row.Item("CONTROL_STATIC_LIST"))
|
||||
' Case Else
|
||||
' MsgBox("Unknown control type " & type, MsgBoxStyle.Exclamation, "Error in LoadControlProperties:")
|
||||
' End Select
|
||||
|
||||
' Generic Properties
|
||||
props.ID = row.Item("CONTROL_ID")
|
||||
props.Name = row.Item("CONTROL_NAME")
|
||||
props.Size = New Size(row.Item("CTRLSCR_WIDTH"), row.Item("CTRLSCR_HEIGHT"))
|
||||
' ' Generic Properties
|
||||
' props.ID = row.Item("CONTROL_ID")
|
||||
' props.Name = row.Item("CONTROL_NAME")
|
||||
' props.Size = New Size(row.Item("CTRLSCR_WIDTH"), row.Item("CTRLSCR_HEIGHT"))
|
||||
|
||||
'TODO: calc location
|
||||
'If row.Item("CONTROL_PARENT_ID") <> 0 Then
|
||||
' Dim parentSQL = "SELECT CTRLSCR_X_LOC, CTRLSCR_Y_LOC FROM VWPMO_VALUES WHERE = CONTROL_ID = " & row.Item("CONTROL_PARENT_ID")
|
||||
'End If
|
||||
' 'TODO: calc location
|
||||
' 'If row.Item("CONTROL_PARENT_ID") <> 0 Then
|
||||
' ' Dim parentSQL = "SELECT CTRLSCR_X_LOC, CTRLSCR_Y_LOC FROM VWPMO_VALUES WHERE = CONTROL_ID = " & row.Item("CONTROL_PARENT_ID")
|
||||
' 'End If
|
||||
|
||||
|
||||
props.Location = New Point(row.Item("CTRLSCR_X_LOC"), row.Item("CTRLSCR_Y_LOC"))
|
||||
' props.Location = New Point(row.Item("CTRLSCR_X_LOC"), row.Item("CTRLSCR_Y_LOC"))
|
||||
|
||||
Me.Text = "Eigenschaften Control-ID: " & props.ID
|
||||
' Me.Text = "Eigenschaften Control-ID: " & props.ID
|
||||
|
||||
If type = "F_AddAppointment" Then
|
||||
Dim ControlId = GetControlID_for_Name(ctrl.Name, CURRENT_FORM_ID)
|
||||
Dim dr = ClassFunctionCommands.LoadFunction(ControlId)
|
||||
' If type = "F_AddAppointment" Then
|
||||
' Dim ControlId = GetControlID_for_Name(ctrl.Name, CURRENT_FORM_ID)
|
||||
' Dim dr = ClassFunctionCommands.LoadFunction(ControlId)
|
||||
|
||||
Dim FromDateId, ToDateId, SubjectString, Subject2String, PlaceString, DescString
|
||||
' Dim FromDateId, ToDateId, SubjectString, Subject2String, PlaceString, DescString
|
||||
|
||||
FromDateId = dr.Item("INTEGER1")
|
||||
ToDateId = dr.Item("INTEGER2")
|
||||
SubjectString = dr.Item("STRING1")
|
||||
Subject2String = dr.Item("STRING2")
|
||||
PlaceString = dr.Item("STRING3")
|
||||
DescString = dr.Item("STRING4")
|
||||
' FromDateId = dr.Item("INTEGER1")
|
||||
' ToDateId = dr.Item("INTEGER2")
|
||||
' SubjectString = dr.Item("STRING1")
|
||||
' Subject2String = dr.Item("STRING2")
|
||||
' PlaceString = dr.Item("STRING3")
|
||||
' DescString = dr.Item("STRING4")
|
||||
|
||||
|
||||
If IsDBNull(FromDateId) OrElse FromDateId = 0 Then
|
||||
props.FromDate = ""
|
||||
Else
|
||||
props.FromDate = GetName_for_ControlID(FromDateId, CURRENT_FORM_ID)
|
||||
End If
|
||||
' If IsDBNull(FromDateId) OrElse FromDateId = 0 Then
|
||||
' props.FromDate = ""
|
||||
' Else
|
||||
' props.FromDate = Get_Name_for_ControlID(FromDateId, CURRENT_FORM_ID)
|
||||
' End If
|
||||
|
||||
If IsDBNull(ToDateId) OrElse ToDateId = 0 Then
|
||||
props.ToDate = ""
|
||||
Else
|
||||
props.ToDate = GetName_for_ControlID(ToDateId, CURRENT_FORM_ID)
|
||||
End If
|
||||
' If IsDBNull(ToDateId) OrElse ToDateId = 0 Then
|
||||
' props.ToDate = ""
|
||||
' Else
|
||||
' props.ToDate = Get_Name_for_ControlID(ToDateId, CURRENT_FORM_ID)
|
||||
' End If
|
||||
|
||||
|
||||
|
||||
If IsDBNull(SubjectString) OrElse String.IsNullOrEmpty(SubjectString) Then
|
||||
props.Subject = ""
|
||||
Else
|
||||
props.Subject = SubjectString
|
||||
End If
|
||||
' If IsDBNull(SubjectString) OrElse String.IsNullOrEmpty(SubjectString) Then
|
||||
' props.Subject = ""
|
||||
' Else
|
||||
' props.Subject = SubjectString
|
||||
' End If
|
||||
|
||||
If IsDBNull(Subject2String) OrElse String.IsNullOrEmpty(Subject2String) Then
|
||||
props.Subject2 = ""
|
||||
Else
|
||||
props.Subject2 = Subject2String
|
||||
End If
|
||||
' If IsDBNull(Subject2String) OrElse String.IsNullOrEmpty(Subject2String) Then
|
||||
' props.Subject2 = ""
|
||||
' Else
|
||||
' props.Subject2 = Subject2String
|
||||
' End If
|
||||
|
||||
If IsDBNull(PlaceString) OrElse String.IsNullOrEmpty(PlaceString) Then
|
||||
props.Place = ""
|
||||
Else
|
||||
props.Place = PlaceString
|
||||
End If
|
||||
' If IsDBNull(PlaceString) OrElse String.IsNullOrEmpty(PlaceString) Then
|
||||
' props.Place = ""
|
||||
' Else
|
||||
' props.Place = PlaceString
|
||||
' End If
|
||||
|
||||
If IsDBNull(DescString) OrElse String.IsNullOrEmpty(DescString) Then
|
||||
props.Description = ""
|
||||
Else
|
||||
props.Description = DescString
|
||||
End If
|
||||
' If IsDBNull(DescString) OrElse String.IsNullOrEmpty(DescString) Then
|
||||
' props.Description = ""
|
||||
' Else
|
||||
' props.Description = DescString
|
||||
' End If
|
||||
|
||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
ElseIf type = "F_AddFormData" Then
|
||||
' TODO
|
||||
Dim ControlId = GetControlID_for_Name(ctrl.Name, CURRENT_FORM_ID)
|
||||
Dim dr = ClassFunctionCommands.LoadFunction(ControlId)
|
||||
' props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
' ElseIf type = "F_AddFormData" Then
|
||||
' ' TODO
|
||||
' Dim ControlId = GetControlID_for_Name(ctrl.Name, CURRENT_FORM_ID)
|
||||
' Dim dr = ClassFunctionCommands.LoadFunction(ControlId)
|
||||
|
||||
Dim FormId, ScreenId
|
||||
' Dim FormId, ScreenId
|
||||
|
||||
FormId = dr.Item("INTEGER1")
|
||||
ScreenId = dr.Item("INTEGER2")
|
||||
' FormId = dr.Item("INTEGER1")
|
||||
' ScreenId = dr.Item("INTEGER2")
|
||||
|
||||
If IsDBNull(FormId) OrElse FormId = 0 Then
|
||||
props.FormID = 0
|
||||
Else
|
||||
props.FormID = FormId
|
||||
End If
|
||||
' If IsDBNull(FormId) OrElse FormId = 0 Then
|
||||
' props.FormID = 0
|
||||
' Else
|
||||
' props.FormID = FormId
|
||||
' End If
|
||||
|
||||
If IsDBNull(ScreenId) OrElse ScreenId = 0 Then
|
||||
props.ScreenID = 0
|
||||
Else
|
||||
props.ScreenID = ScreenId
|
||||
End If
|
||||
' If IsDBNull(ScreenId) OrElse ScreenId = 0 Then
|
||||
' props.ScreenID = 0
|
||||
' Else
|
||||
' props.ScreenID = ScreenId
|
||||
' End If
|
||||
|
||||
props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
End If
|
||||
' props.Caption = row.Item("CTRLSCR_CAPTION")
|
||||
' End If
|
||||
|
||||
' Control Properties
|
||||
If Not type.Contains("F_") Then
|
||||
' PreSave and Convert Properties
|
||||
fontcolor = IntToColor(row.Item("CTRLSCR_FONT_COLOR"))
|
||||
fontfamily = row.Item("CTRLSCR_FONT_FAMILY")
|
||||
fontstyle = CType(row.Item("CTRLSCR_FONT_STYLE"), FontStyle)
|
||||
fontsize = CType(row.Item("CTRLSCR_FONT_SIZE"), Single)
|
||||
isreadonly = row.Item("CONTROL_READ_ONLY")
|
||||
isrequired = row.Item("CONTROL_REQUIRED")
|
||||
columntitle = row.Item("CONTROL_COL_NAME")
|
||||
' ' Control Properties
|
||||
' If Not type.Contains("F_") Then
|
||||
' ' PreSave and Convert Properties
|
||||
' fontcolor = IntToColor(row.Item("CTRLSCR_FONT_COLOR"))
|
||||
' fontfamily = row.Item("CTRLSCR_FONT_FAMILY")
|
||||
' fontstyle = CType(row.Item("CTRLSCR_FONT_STYLE"), FontStyle)
|
||||
' fontsize = CType(row.Item("CTRLSCR_FONT_SIZE"), Single)
|
||||
' isreadonly = row.Item("CONTROL_READ_ONLY")
|
||||
' isrequired = row.Item("CONTROL_REQUIRED")
|
||||
' columntitle = row.Item("CONTROL_COL_NAME")
|
||||
|
||||
' Assign Properties to Class
|
||||
props.FontColor = fontcolor
|
||||
props.Font = New Font(fontfamily, fontsize, fontstyle)
|
||||
props.ColumnTitle = columntitle
|
||||
' ' Assign Properties to Class
|
||||
' props.FontColor = fontcolor
|
||||
' props.Font = New Font(fontfamily, fontsize, fontstyle)
|
||||
' props.ColumnTitle = columntitle
|
||||
|
||||
'ReadOnly
|
||||
If type = "Textbox" Or type = "Datepicker" Or type = "Combobox" Or type = "Picturebox" Or type = "RadioButton" Or type = "Checkbox" Or type = "CheckedListBox" _
|
||||
Or type = "ListBox" Then
|
||||
props.IsReadOnly = row.Item("CONTROL_READ_ONLY")
|
||||
End If
|
||||
' 'ReadOnly
|
||||
' If type = "Textbox" Or type = "Datepicker" Or type = "Combobox" Or type = "Picturebox" Or type = "RadioButton" Or type = "Checkbox" Or type = "CheckedListBox" _
|
||||
' Or type = "ListBox" Then
|
||||
' props.IsReadOnly = row.Item("CONTROL_READ_ONLY")
|
||||
' End If
|
||||
|
||||
' Nicht verfügbar für label
|
||||
If type = "Textbox" Or type = "Combobox" Or type = "Datepicker" Or type = "Checkbox" Or type = "RadioButton" Or type = "CheckedListBox" _
|
||||
Or type = "ListBox" Then
|
||||
props.TabStop = row.Item("CTRLSCR_TAB_STOP")
|
||||
props.TabIndex = row.Item("CTRLSCR_TAB_INDEX")
|
||||
' ' Nicht verfügbar für label
|
||||
' If type = "Textbox" Or type = "Combobox" Or type = "Datepicker" Or type = "Checkbox" Or type = "RadioButton" Or type = "CheckedListBox" _
|
||||
' Or type = "ListBox" Then
|
||||
' props.TabStop = row.Item("CTRLSCR_TAB_STOP")
|
||||
' props.TabIndex = row.Item("CTRLSCR_TAB_INDEX")
|
||||
|
||||
If Not IsDBNull(row.Item("CONTROL_SHOW_COLUMN")) Then
|
||||
props.ShowColumn = row.Item("CONTROL_SHOW_COLUMN")
|
||||
Else
|
||||
props.ShowColumn = True
|
||||
End If
|
||||
End If
|
||||
' If Not IsDBNull(row.Item("CONTROL_SHOW_COLUMN")) Then
|
||||
' props.ShowColumn = row.Item("CONTROL_SHOW_COLUMN")
|
||||
' Else
|
||||
' props.ShowColumn = True
|
||||
' End If
|
||||
' End If
|
||||
|
||||
If type = "Textbox" Then
|
||||
props.Multiline = row.Item("CONTROL_MULTILINE")
|
||||
End If
|
||||
' If type = "Textbox" Then
|
||||
' props.Multiline = row.Item("CONTROL_MULTILINE")
|
||||
' End If
|
||||
|
||||
If type = "Combobox" Or type = "CheckedListBox" Or type = "ListBox" Or type = "Textbox" Then
|
||||
If row.Item("CONTROL_SQLCOMMAND_1").ToString.Length > 1 Then
|
||||
Dim value As New SQLValue(row.Item("CONTROL_SQLCOMMAND_1").ToString)
|
||||
props.SQLCommand = value
|
||||
'props.SQLCommand = row.Item("CONTROL_SQLCOMMAND_1").ToString
|
||||
End If
|
||||
' If type = "Combobox" Or type = "CheckedListBox" Or type = "ListBox" Or type = "Textbox" Then
|
||||
' If row.Item("CONTROL_SQLCOMMAND_1").ToString.Length > 1 Then
|
||||
' Dim value As New SQLValue(row.Item("CONTROL_SQLCOMMAND_1").ToString)
|
||||
' props.SQLCommand = value
|
||||
' 'props.SQLCommand = row.Item("CONTROL_SQLCOMMAND_1").ToString
|
||||
' End If
|
||||
|
||||
'props.ParentFormID = row.Item("PARENT_FORM_ID")
|
||||
props.IsRequired = isrequired
|
||||
props.IsReadOnly = isreadonly
|
||||
End If
|
||||
' 'props.ParentFormID = row.Item("PARENT_FORM_ID")
|
||||
' props.IsRequired = isrequired
|
||||
' props.IsReadOnly = isreadonly
|
||||
' End If
|
||||
|
||||
If type = "Label" Then
|
||||
If row.Item("CONTROL_SQLCOMMAND_1").ToString.Length > 1 Then
|
||||
Dim value As New SQLValue(row.Item("CONTROL_SQLCOMMAND_1").ToString)
|
||||
props.SQLCommand = value
|
||||
'props.SQLCommand = row.Item("CONTROL_SQLCOMMAND_1").ToString
|
||||
End If
|
||||
End If
|
||||
' If type = "Label" Then
|
||||
' If row.Item("CONTROL_SQLCOMMAND_1").ToString.Length > 1 Then
|
||||
' Dim value As New SQLValue(row.Item("CONTROL_SQLCOMMAND_1").ToString)
|
||||
' props.SQLCommand = value
|
||||
' 'props.SQLCommand = row.Item("CONTROL_SQLCOMMAND_1").ToString
|
||||
' End If
|
||||
' End If
|
||||
|
||||
|
||||
End If
|
||||
' End If
|
||||
|
||||
' Globale Variable setzen
|
||||
CURRENT_CONTROL_ID = row.Item("CONTROL_ID")
|
||||
Me.pgControlProperties.SelectedObject = props
|
||||
End If
|
||||
End If
|
||||
' ' Globale Variable setzen
|
||||
' CURRENT_CONTROL_ID = row.Item("CONTROL_ID")
|
||||
' Me.pgControlProperties.SelectedObject = props
|
||||
' End If
|
||||
' End If
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Error in loadcontrolproperties" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
End Try
|
||||
' Catch ex As Exception
|
||||
' MsgBox("Error in loadcontrolproperties" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
' End Try
|
||||
|
||||
|
||||
End Sub
|
||||
'End Sub
|
||||
|
||||
' Aktualisiert die Position des akutellen Controls und speichert diese in der Klasse
|
||||
Public Sub UpdateControlLocation(ctrl As Control)
|
||||
@@ -307,7 +517,7 @@
|
||||
|
||||
Public Function SaveControlProperties(ctrl As Control, properties As Object) As Boolean
|
||||
If ClassControlCommands.UpdateControl(ctrl, properties) Then
|
||||
LoadControlProperties(ctrl)
|
||||
LoadControlPropertiesNeu(ctrl)
|
||||
Return True
|
||||
Else
|
||||
MsgBox("Fehler beim Speichern der Elementeigenschaften.", MsgBoxStyle.Critical)
|
||||
|
||||
Reference in New Issue
Block a user