Zooflow: Include new SQLEditor into Zooflow

This commit is contained in:
Jonathan Jenne
2022-05-09 15:27:29 +02:00
parent 24fb1f00bc
commit 77a7cb4d75
13 changed files with 575 additions and 376 deletions

View File

@@ -18,14 +18,8 @@ Public Class frmSQLEditor
Public Property SQLCommand As String = ""
Public Property SQLConnection As Integer = 0
Public Enum PlaceholderCollection
Globix
Zooflow
End Enum
Public Sub SetPlaceholders(pCollection As PlaceholderCollection)
End Sub
Public Property PlaceholdersManual As List(Of String)
Public Property PlaceholdersAutomatic As List(Of String)
Public Sub New(pLogConfig As LogConfig, pDatabase As MSSQLServer)
' Dieser Aufruf ist für den Designer erforderlich.
@@ -41,6 +35,14 @@ Public Class frmSQLEditor
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
FormLoading = True
Try
If PlaceholdersAutomatic Is Nothing Then
PlaceholdersAutomatic = New List(Of String)
End If
If PlaceholdersManual Is Nothing Then
PlaceholdersManual = New List(Of String)
End If
If SQLCommand <> String.Empty Then
txtSQLCommand.Document.Text = SQLCommand
End If
@@ -63,8 +65,6 @@ Public Class frmSQLEditor
Dim oPlaceholderGroups = LoadPlaceholders()
GalleryPlaceholders.Gallery.Groups.AddRange(oPlaceholderGroups.ToArray)
ConfigureRichEditControl()
chkClearPlaceholders.Checked = ClearPlaceholdersAfterSuccessfulExecute
@@ -86,15 +86,12 @@ Public Class frmSQLEditor
SQLConnection = oConnection.Id
End Sub
Private Function LoadPlaceholders() As List(Of GalleryItemGroup)
Dim oInternalPlaceholders = Placeholders.GetInternalGroup()
Dim oUserPlaceholder = Placeholders.GetUserGroup()
Return New List(Of GalleryItemGroup)() From {
oInternalPlaceholders,
oUserPlaceholder
Placeholders.GetInternalGroup(),
Placeholders.GetUserGroup(),
Placeholders.GetAutomaticPlaceholders(PlaceholdersAutomatic),
Placeholders.GetManualPlaceholders(PlaceholdersManual)
}
End Function
@@ -169,6 +166,15 @@ Public Class frmSQLEditor
End Sub
Private Sub BarButtonItem3_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnExecuteSQL.ItemClick
ExecuteSQL()
End Sub
Private Class Connection
Public Property Id As Integer
Public Property Name As String
End Class
Private Sub ExecuteSQL()
Try
Dim oSql = txtSQLCommand.Document.Text
@@ -208,11 +214,6 @@ Public Class frmSQLEditor
End Try
End Sub
Private Class Connection
Public Property Id As Integer
Public Property Name As String
End Class
Private Sub BarCheckItem1_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles chkClearPlaceholders.CheckedChanged
If FormLoading = False Then
ClearPlaceholdersAfterSuccessfulExecute = chkClearPlaceholders.Checked
@@ -226,4 +227,15 @@ Public Class frmSQLEditor
Private Sub chkShowPlaceholders_CheckedChanged(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles chkShowPlaceholders.CheckedChanged
SplitContainerControl1.Collapsed = Not chkShowPlaceholders.Checked
End Sub
Private Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
SQLCommand = txtSQLCommand.Text
Close()
End Sub
Private Sub frmSQLEditor_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.F5 Then
ExecuteSQL()
End If
End Sub
End Class