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

@@ -12,22 +12,27 @@ Public Class ClassSQLEditor
End Function
Public Overrides Function EditValue(context As ITypeDescriptorContext, provider As IServiceProvider, value As Object) As Object
Dim svc As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
Dim SQLSTring As String = DirectCast(value, SQLValue).Value
Dim oService As IWindowsFormsEditorService = TryCast(provider.GetService(GetType(IWindowsFormsEditorService)), IWindowsFormsEditorService)
If svc IsNot Nothing AndAlso SQLSTring IsNot Nothing Then
Dim oValueObject = DirectCast(value, SQLValue)
Dim oSQLString As String = oValueObject.Value
Dim oSQLConnection As Integer = oValueObject.ConnectionId
If oService IsNot Nothing AndAlso oSQLString IsNot Nothing Then
'CURRENT_DESIGN_TYPE = "INPUT_INDEX"
Using oForm As New frmSQLEditor(LOGCONFIG, DatabaseECM)
oForm.SQLCommand = SQLSTring
oForm.SQLCommand = oSQLString
oForm.SQLConnection = oSQLConnection
oForm.PlaceholdersManualPrefix = "CTRL"
oForm.PlaceholdersManualTitle = "Controls"
oForm.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.ToDictionary(Function(name) name, Function(name) name)
oForm.PlaceholdersManual = CURRENT_CONTROL_NAME_LIST.
ToDictionary(Function(name) name, Function(name) name)
If svc.ShowDialog(oForm) = DialogResult.OK Then
Dim sql As New SQLValue(oForm.SQLCommand)
CURRENT_SQL_CON = oForm.SQLConnection
CURRENT_CONN_ID = oForm.SQLConnection
If oService.ShowDialog(oForm) = DialogResult.OK Then
Dim sql As New SQLValue(oForm.SQLCommand, oForm.SQLConnection)
' CURRENT_CONN_ID_FINAL_INDEX = oForm.SQLConnection
' CURRENT_CONN_ID = oForm.SQLConnection
value = sql
End If
End Using