SQL Connection cleanup

This commit is contained in:
Jonathan Jenne
2022-08-09 15:18:47 +02:00
parent 8c76b53273
commit 7c9160a270
14 changed files with 144 additions and 140 deletions

View File

@@ -84,10 +84,12 @@ Public Module ModuleControlProperties
Private _index_type As String
Private _sql_command As String
Friend _sql_connection As Integer = 0
Private _Override_SQL As String
Private _Enable_SQL As String
Private _Enable_SQL_ONLOAD As String
Private _default_value
Friend _set_control_data As String
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property Active() As Boolean
@@ -122,10 +124,23 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_DATA)>
Public Property SQLCommand() As SQLValue
Get
Return New SQLValue(NotNull(_sql_command, ""))
Return New SQLValue(NotNull(_sql_command, ""), _sql_connection)
End Get
Set(ByVal value As SQLValue)
_sql_command = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
<DisplayName("SQL Connection")>
<Category(ClassConstants.CAT_INFORMATION)>
<[ReadOnly](True)>
Public Property SQLConnection() As Integer
Get
Return _sql_connection
End Get
Set(value As Integer)
_sql_connection = value
End Set
End Property
@@ -133,10 +148,11 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_VALIDATION)>
Public Property Override_SQL() As SQLValue
Get
Return New SQLValue(NotNull(_Override_SQL, ""))
Return New SQLValue(NotNull(_Override_SQL, ""), _sql_connection)
End Get
Set(ByVal value As SQLValue)
_Override_SQL = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
@@ -144,10 +160,11 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property Enable_SQL() As SQLValue
Get
Return New SQLValue(NotNull(_Enable_SQL, ""))
Return New SQLValue(NotNull(_Enable_SQL, ""), _sql_connection)
End Get
Set(ByVal value As SQLValue)
_Enable_SQL = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
@@ -155,10 +172,11 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property Enable_SQL_OnLoad() As SQLValue
Get
Return New SQLValue(NotNull(_Enable_SQL_ONLOAD, ""))
Return New SQLValue(NotNull(_Enable_SQL_ONLOAD, ""), _sql_connection)
End Get
Set(ByVal value As SQLValue)
_Enable_SQL_ONLOAD = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
@@ -174,12 +192,24 @@ Public Module ModuleControlProperties
End Property
End Class
Public Class TextboxProperties
Public Class InputPropertiesWithControlData
Inherits InputProperties
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
Get
Return New SQLValue(_set_control_data, _sql_connection)
End Get
Set(value As SQLValue)
_set_control_data = value.Value
SQLConnection = value.ConnectionId
End Set
End Property
End Class
Public Class TextboxProperties
Inherits InputPropertiesWithControlData
<DisplayName("Regex Pattern")>
<Category(ClassConstants.CAT_VALIDATION)>
@@ -200,26 +230,19 @@ Public Module ModuleControlProperties
End Class
Public Class CheckboxProperties
Inherits InputProperties
Inherits InputPropertiesWithControlData
<Category(ClassConstants.CAT_DISPLAY)>
Public Property Text() As String
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
End Class
Public Class ComboboxProperties
Inherits InputProperties
Inherits InputPropertiesWithControlData
<Category(ClassConstants.CAT_DISPLAY)>
Public Property Text() As String
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
<Browsable(False)>
Public Property ChoiceLists() As List(Of String)
@@ -270,6 +293,7 @@ Public Module ModuleControlProperties
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property AllowAddNewValues As Boolean
End Class
Public Class ButtonProperties
Inherits InputProperties
@@ -290,8 +314,9 @@ Public Module ModuleControlProperties
End Set
End Property
End Class
Public Class LookupControlProperties
Inherits InputProperties
Inherits InputPropertiesWithControlData
<DisplayName("Multi Select")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
@@ -312,11 +337,6 @@ Public Module ModuleControlProperties
<DisplayName("Display As Combobox Control")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property DisplayAsComboBox As Boolean
<DisplayName("Set Control Data SQL")>
<Category(ClassConstants.CAT_BEHAVIOUR)>
Public Property SetControlData As SQLValue
End Class
Public Class LineLabelProperties