Common/SQLEditor: Fix bugs, switch to dictionary

This commit is contained in:
Jonathan Jenne 2022-05-11 16:37:52 +02:00
parent ece2ec0e47
commit 25a1386bc6
12 changed files with 120 additions and 77 deletions

View File

@ -536,5 +536,8 @@
<ItemGroup>
<None Include="Resources\actions_database3.svg" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\selectdatamember.svg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.VisualBasic.targets" />
</Project>

View File

@ -138,6 +138,15 @@ Namespace DocumentResultList
End Sub
#End Region
#Region "Resetting Layout"
Public Sub DockManager_ResetLayout(pDockManager As DockManager)
Dim oFile = GetDockmanager_LayoutName()
If IO.File.Exists(oFile) Then
IO.File.Delete(oFile)
End If
End Sub
#End Region
Public Sub SetGroupPanelVisible(pVisible As Boolean)
For Each oView In GridViews
oView.OptionsView.ShowGroupPanel = pVisible

View File

@ -470,6 +470,16 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>
Friend ReadOnly Property selectdatamember() As DevExpress.Utils.Svg.SvgImage
Get
Dim obj As Object = ResourceManager.GetObject("selectdatamember", resourceCulture)
Return CType(obj,DevExpress.Utils.Svg.SvgImage)
End Get
End Property
'''<summary>
''' Sucht eine lokalisierte Ressource vom Typ DevExpress.Utils.Svg.SvgImage.
'''</summary>

View File

@ -121,9 +121,6 @@
<data name="bo_transition" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bo_transition.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="groupheader" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\groupheader.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="security_unlock" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\security_unlock.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@ -151,9 +148,6 @@
<data name="save2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save2.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="grid" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\grid.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@ -163,6 +157,9 @@
<data name="jpg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\jpg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="xls" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\xls.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="autoarrange" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\autoarrange1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@ -175,6 +172,9 @@
<data name="copy" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\copy.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="zoom_more" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zoom_more.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="togglefieldcodes" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\togglefieldcodes1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
@ -190,8 +190,8 @@
<data name="title" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\title.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="_page" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\_page.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="clearpivottable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clearpivottable.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="singlepageview1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\singlepageview1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@ -202,23 +202,26 @@
<data name="Open_32x32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Open_32x32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="singlepageview" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\singlepageview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="clearall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clearall1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="clearpivottable" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clearpivottable.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="categorize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\categorize.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
<data name="groupheader" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\groupheader.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="bo_contract" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bo_contract1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\open.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
<data name="clearall" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\clearall1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="_page" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\_page.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="categorize" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\categorize.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="singlepageview" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\singlepageview.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="actions_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="columnheaders" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\columnheaders.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
@ -229,8 +232,8 @@
<data name="actions_user" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_user1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="xls" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\xls.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\save.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="dwg" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\dwg.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -256,8 +259,8 @@
<data name="handtool" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\handtool1.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="zoom_more" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\zoom_more.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="open" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\open.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
<data name="ppt" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ppt.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -271,7 +274,7 @@
<data name="_blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\_blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="actions_database" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\actions_database3.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
<data name="selectdatamember" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\selectdatamember.svg;DevExpress.Utils.Svg.SvgImage, DevExpress.Data.v21.2, Version=21.2.4.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a</value>
</data>
</root>

View File

@ -0,0 +1,9 @@
<?xml version='1.0' encoding='UTF-8'?>
<svg x="0px" y="0px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" id="Select_Data_Member" style="enable-background:new 0 0 32 32">
<style type="text/css">
.Yellow{fill:#FFB115;}
.Black{fill:#727272;}
</style>
<path d="M22,14c0,0.3-0.1,0.6-0.3,0.9l-2.3-2.3C21,11.9,22,11,22,10V14z M12,12c5.5,0,10-1.8,10-4V4 c0-2.2-4.5-4-10-4S2,1.8,2,4v4C2,10.2,6.5,12,12,12z M12,18c1.4,0,2.8-0.1,4-0.3v-4c-1.2,0.2-2.6,0.3-4,0.3c-5.5,0-10-1.8-10-4v4 C2,16.2,6.5,18,12,18z M16,19.7c-1.2,0.2-2.6,0.3-4,0.3c-5.5,0-10-1.8-10-4v4c0,2.2,4.5,4,10,4c1.4,0,2.8-0.1,4-0.3V19.7z" class="Yellow" />
<path d="M24.2,26H30L18,14v16.5l4-4l2,5c0.2,0.4,0.6,0.6,1,0.4l0.7-0.3c0.4-0.2,0.6-0.6,0.4-1L24.2,26z" class="Black" />
</svg>

View File

@ -31,11 +31,11 @@ Namespace SQLEditor
FileFlow
End Enum
Public Sub New(pTitle As String, pDescription As String, pModule As String, pName As String)
Public Sub New(pTitle As String, pDescription As String, pModule As String, pValue As String)
Title = pTitle
Description = pDescription
Name = pName
Name = pValue
[Module] = pModule
End Sub

View File

@ -52,7 +52,7 @@ Namespace SQLEditor
Return oGroup1
End Function
Public Function GetManualPlaceholders(pPlaceholders As List(Of String), pPrefix As String) As GalleryItemGroup
Public Function GetManualPlaceholders(pPlaceholders As Dictionary(Of String, String), pPrefix As String) As GalleryItemGroup
Dim oImage As SvgImage = My.Resources.handtool
Dim oItems As New List(Of GalleryItem)()
Dim oPrefix As String = pPrefix
@ -63,7 +63,7 @@ Namespace SQLEditor
If pPlaceholders.Count > 0 Then
For Each oManualPlaceholder In pPlaceholders
Dim oPlaceholder = New Placeholder(oManualPlaceholder, "Manuelles Attribut", oPrefix, oManualPlaceholder)
Dim oPlaceholder = New Placeholder(oManualPlaceholder.Key, "Manuelles Attribut", oPrefix, oManualPlaceholder.Value)
oItems.Add(GetGalleryItem(oPlaceholder, oImage))
Next
Else Return Nothing
@ -74,7 +74,7 @@ Namespace SQLEditor
Return oGroup1
End Function
Public Function GetAutomaticPlaceholders(pPlaceholders As List(Of String), pPrefix As String) As GalleryItemGroup
Public Function GetAutomaticPlaceholders(pPlaceholders As Dictionary(Of String, String), pPrefix As String) As GalleryItemGroup
Dim oImage As SvgImage = My.Resources.autoarrange
Dim oItems As New List(Of GalleryItem)()
Dim oPrefix As String = pPrefix
@ -85,7 +85,7 @@ Namespace SQLEditor
If pPlaceholders.Count > 0 Then
For Each oManualPlaceholder In pPlaceholders
Dim oPlaceholder = New Placeholder(oManualPlaceholder, "Automatisches Attribut", oPrefix, oManualPlaceholder)
Dim oPlaceholder = New Placeholder(oManualPlaceholder.Key, "Automatisches Attribut", oPrefix, oManualPlaceholder.Value)
oItems.Add(GetGalleryItem(oPlaceholder, oImage))
Next

View File

@ -854,19 +854,7 @@ Public Class frmDocumentResultList
End Try
End Sub
Private Sub BarButtonResetLayout_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonResetGridLayout.ItemClick
If Not IsNothing(_ActiveGrid) Then
Try
Dim oFile = LayoutManager.GetGrid_LayoutName(_ActiveGrid.MainView)
If IO.File.Exists(oFile) Then
IO.File.Delete(oFile)
End If
LoadGridDataAndLayout()
Catch ex As Exception
Logger.Error(ex)
End Try
End If
End Sub
Private Function TestFileExists(pTitle As String) As Boolean
If _CurrentDocument Is Nothing Then
@ -1025,6 +1013,29 @@ Public Class frmDocumentResultList
End Sub
#End Region
#Region "Layout"
Private Sub BarButtonResetLayout_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonResetGridLayout.ItemClick
If Not IsNothing(_ActiveGrid) Then
Try
Dim oFile = LayoutManager.GetGrid_LayoutName(_ActiveGrid.MainView)
If IO.File.Exists(oFile) Then
IO.File.Delete(oFile)
End If
LoadGridDataAndLayout()
Catch ex As Exception
Logger.Error(ex)
End Try
End If
End Sub
Private Sub BarButtonItem6_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonResetWindowLayout.ItemClick
Try
LayoutManager.DockManager_ResetLayout(DockManager1)
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
Private Sub SplitContainerControl1_SplitterPositionChanged(sender As Object, e As EventArgs) Handles SplitContainerControl1.SplitterPositionChanged
If IsLoading = False Then
Config1.Config.SplitContainer1Distance = SplitContainerControl1.SplitterPosition
@ -1057,16 +1068,7 @@ Public Class frmDocumentResultList
RaiseEvent NeedsRefresh(Me, Params.ProfileGuid)
End Sub
Private Sub BarButtonItem6_ItemClick(sender As Object, e As ItemClickEventArgs) Handles BarButtonResetWindowLayout.ItemClick
Try
Dim oFile = LayoutManager.GetDockmanager_LayoutName()
If File.Exists(oFile) Then
File.Delete(oFile)
End If
Catch ex As Exception
Logger.Error(ex)
End Try
End Sub
Private Sub chkGridShowGrouping_CheckedChanged(sender As Object, e As ItemClickEventArgs) Handles chkGridShowGrouping.CheckedChanged

View File

@ -70,8 +70,10 @@ Partial Class frmSQLEditor
Me.RibbonControl1.Name = "RibbonControl1"
Me.RibbonControl1.Pages.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPage() {Me.RibbonPage1})
Me.RibbonControl1.ShowApplicationButton = DevExpress.Utils.DefaultBoolean.[False]
Me.RibbonControl1.ShowToolbarCustomizeItem = False
Me.RibbonControl1.Size = New System.Drawing.Size(1056, 158)
Me.RibbonControl1.StatusBar = Me.RibbonStatusBar1
Me.RibbonControl1.Toolbar.ShowCustomizeItem = False
'
'GalleryPlaceholders
'
@ -119,7 +121,7 @@ Partial Class frmSQLEditor
Me.GalleryConnection.Gallery.CheckDrawMode = DevExpress.XtraBars.Ribbon.Gallery.CheckDrawMode.ImageAndText
Me.GalleryConnection.Gallery.ColumnCount = 4
Me.GalleryConnection.Gallery.ItemCheckMode = DevExpress.XtraBars.Ribbon.Gallery.ItemCheckMode.SingleRadio
Me.GalleryConnection.Gallery.RowCount = 1
Me.GalleryConnection.Gallery.RowCount = 2
Me.GalleryConnection.Gallery.ShowItemText = True
Me.GalleryConnection.Id = 5
Me.GalleryConnection.Name = "GalleryConnection"
@ -183,7 +185,7 @@ Partial Class frmSQLEditor
'
Me.RibbonPage1.Groups.AddRange(New DevExpress.XtraBars.Ribbon.RibbonPageGroup() {Me.RibbonPageGroup3, Me.RibbonPageGroup1})
Me.RibbonPage1.Name = "RibbonPage1"
Me.RibbonPage1.Text = "RibbonPage1"
Me.RibbonPage1.Text = "Start"
'
'RibbonPageGroup3
'
@ -286,6 +288,7 @@ Partial Class frmSQLEditor
Me.Controls.Add(Me.SplitContainerControl1)
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.SvgImage = Global.DigitalData.GUIs.Common.My.Resources.Resources.selectdatamember
Me.KeyPreview = True
Me.Name = "frmSQLEditor"
Me.Ribbon = Me.RibbonControl1

View File

@ -1,4 +1,5 @@
Imports System.Windows.Forms
Imports System.ComponentModel
Imports System.Windows.Forms
Imports DevExpress.XtraBars.Ribbon
Imports DevExpress.XtraRichEdit.Services
Imports DigitalData.Modules.Database
@ -14,15 +15,16 @@ Public Class frmSQLEditor
Private ClearPlaceholdersAfterSuccessfulExecute As Boolean = False
Private FormLoading As Boolean = False
Private FormResult As DialogResult = DialogResult.Cancel
Public Property SQLCommand As String = ""
Public Property SQLConnection As Integer = 0
Public Property LoadClipboardPlaceholders As Boolean = False
Public Property PlaceholdersManual As List(Of String)
Public Property PlaceholdersManual As Dictionary(Of String, String)
Public Property PlaceholdersManualPrefix As String
Public Property PlaceholdersAutomatic As List(Of String)
Public Property PlaceholdersAutomatic As Dictionary(Of String, String)
Public Property PlaceholdersAutomaticPrefix As String
Public Property PlaceholdersWindream As List(Of String)
@ -42,11 +44,11 @@ Public Class frmSQLEditor
FormLoading = True
Try
If PlaceholdersAutomatic Is Nothing Then
PlaceholdersAutomatic = New List(Of String)
PlaceholdersAutomatic = New Dictionary(Of String, String)
End If
If PlaceholdersManual Is Nothing Then
PlaceholdersManual = New List(Of String)
PlaceholdersManual = New Dictionary(Of String, String)
End If
If PlaceholdersWindream Is Nothing Then
@ -126,7 +128,7 @@ Public Class frmSQLEditor
Private Function LoadConnections() As GalleryItemGroup
Try
Dim oSql = "SELECT GUID, Bezeichnung FROM [DD_ECM].[dbo].[TBDD_CONNECTION] WHERE AKTIV = 1"
Dim oSql = "SELECT GUID, Bezeichnung FROM TBDD_CONNECTION WHERE AKTIV = 1"
Dim oTable = Database.GetDatatable(oSql)
Dim oConnections = New List(Of Connection)
@ -263,6 +265,7 @@ Public Class frmSQLEditor
Private Sub btnSave_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnSave.ItemClick
SQLCommand = txtSQLCommand.Text
FormResult = DialogResult.OK
Close()
End Sub
@ -271,4 +274,9 @@ Public Class frmSQLEditor
ExecuteSQL()
End If
End Sub
Private Sub frmSQLEditor_Closing(sender As Object, e As CancelEventArgs) Handles Me.Closing
DialogResult = FormResult
End Sub
End Class

View File

@ -49,7 +49,7 @@ Public Class frmStart
Dim oForm As New frmSQLEditor(LogConfig, Database) With {
.SQLCommand = "SELECT * FROM TBDD_USER WHERE EMAIL = '{#USER#EMAIL}'",
.SQLConnection = 1,
.PlaceholdersAutomatic = New List(Of String) From {"test1", "test2"},
.PlaceholdersAutomatic = New Dictionary(Of String, String) From {{"Testindex 1", "test 1"}, {"Testindex 2", "test 2"}},
.PlaceholdersAutomaticPrefix = "MAN",
.PlaceholdersWindream = New List(Of String) From {"String Index 1", "String Index 2"}
}

View File

@ -10,8 +10,8 @@ Public Class frmAdmin_Globix
Public Property PrimaryKey As Integer Implements IAdminForm.PrimaryKey
Public Property GlobixHelper As ClassGIDatatables
Private AttributesManual As List(Of String)
Private AttributesAutomatic As List(Of String)
Private AttributesManual As new Dictionary(Of String, String)
Private AttributesAutomatic As New Dictionary(Of String, String)
Private Pages As ClassDetailPageManager
Public Sub New(PrimaryKey As Integer, Optional IsInsert As Boolean = False)
@ -120,10 +120,9 @@ Public Class frmAdmin_Globix
TBDD_INDEX_MANTableAdapter.Fill(GlobixDataset.TBDD_INDEX_MAN, PrimaryKey)
AttributesManual = GlobixDataset.TBDD_INDEX_MAN.
Cast(Of DataRow).
Select(Of String)(Function(row) row.Item("NAME")).
ToList()
AttributesManual = GlobixDataset.TBDD_INDEX_MAN.Cast(Of DataRow).
ToDictionary(Of String, String)(Function(row) row.Item("NAME"), Function(row) row.Item("WD_INDEX"))
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Exclamation, "Error in Load IndexeManuell: ")
@ -138,10 +137,8 @@ Public Class frmAdmin_Globix
TBDD_INDEX_AUTOMTableAdapter.Fill(GlobixDataset.TBDD_INDEX_AUTOM, PrimaryKey)
AttributesAutomatic = GlobixDataset.TBDD_INDEX_AUTOM.
Cast(Of DataRow).
Select(Of String)(Function(row) row.Item("NAME")).
ToList()
AttributesAutomatic = GlobixDataset.TBDD_INDEX_AUTOM.Cast(Of DataRow).
ToDictionary(Of String, String)(Function(row) row.Item("NAME"), Function(row) row.Item("WD_INDEX"))
Catch ex As Exception
MessageBox.Show(ex.Message)
@ -354,8 +351,7 @@ Public Class frmAdmin_Globix
Dim oForm2 As New frmSQLEditor(My.LogConfig, My.DatabaseECM) With {
.SQLCommand = SQL_RESULTTextBox.Text,
.SQLConnection = CONNECTION_IDTextBox.Text,
.PlaceholdersManual = AttributesManual,
.LoadClipboardPlaceholders = True
.PlaceholdersManual = AttributesManual
}
oForm2.ShowDialog()