From 81c8c26a9be982912c9f8b6a2686acff05c6a844 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 12 May 2022 11:04:53 +0200 Subject: [PATCH] Add new SQLEditor --- Global_Indexer/Global_Indexer.vbproj | 3 ++ Global_Indexer/frmAdministration.vb | 50 ++++++++++++++++++++++------ SetupVS19/Product.wxs | 1 + 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/Global_Indexer/Global_Indexer.vbproj b/Global_Indexer/Global_Indexer.vbproj index 321a6ff..126c543 100644 --- a/Global_Indexer/Global_Indexer.vbproj +++ b/Global_Indexer/Global_Indexer.vbproj @@ -163,6 +163,9 @@ ..\..\DDMonorepo\Controls.LookupGrid\bin\Debug\DigitalData.Controls.LookupGrid.dll + + ..\..\DDMonorepo\GUIs.Common\bin\Debug\DigitalData.GUIs.Common.dll + ..\..\DDMonorepo\GUIs.GlobalIndexer\bin\Debug\DigitalData.GUIs.GlobalIndexer.dll diff --git a/Global_Indexer/frmAdministration.vb b/Global_Indexer/frmAdministration.vb index 46d4f87..971706c 100644 --- a/Global_Indexer/frmAdministration.vb +++ b/Global_Indexer/frmAdministration.vb @@ -518,14 +518,27 @@ Public Class frmAdministration oSQLCommand = txtManIndexSQL.Text End If - Dim oForm As New frmSQL_DESIGNER(oIndexGuid, oDocTypeGuid) With { + 'Dim oForm As New frmSQL_DESIGNER(oIndexGuid, oDocTypeGuid) With { + ' .SQLCommand = oSQLCommand, + ' .ConnectionID = oConnection + '} + + + + Dim oDatatable = DATABASE_ECM.GetDatatable($"SELECT * FROM TBDD_INDEX_MAN WHERE DOK_ID = {oDocTypeGuid} AND ACTIVE = 1") + Dim oPlaceholders = oDatatable.AsEnumerable(). + ToDictionary(Of String, String)(Function(row) row.Item("NAME"), Function(row) row.Item("WD_INDEX")) + + Dim oForm2 As New DigitalData.GUIs.Common.frmSQLEditor(LOGCONFIG, DATABASE_ECM) With { .SQLCommand = oSQLCommand, - .ConnectionID = oConnection + .SQLConnection = oConnection, + .PlaceholdersManual = oPlaceholders } - If oForm.ShowDialog() = DialogResult.OK Then - txtManIndexSQL.Text = oForm.SQLCommand - txtManIndexConnectionId.Text = oForm.SQLConnectionId + Dim oResult = oForm2.ShowDialog() + If oResult = DialogResult.OK Then + txtManIndexSQL.Text = oForm2.SQLCommand + txtManIndexConnectionId.Text = oForm2.SQLConnection End If Catch ex As Exception LOGGER.Error(ex) @@ -630,14 +643,31 @@ Public Class frmAdministration oSQLCommand = txtAutomIndexSQLResult.Text End If - Dim oForm As New frmSQL_DESIGNER(oIndexGuid, oDocTypeGuid) With { + 'Dim oForm As New frmSQL_DESIGNER(oIndexGuid, oDocTypeGuid) With { + ' .SQLCommand = oSQLCommand, + ' .ConnectionID = oConnection + '} + + 'If oForm.ShowDialog() = DialogResult.OK Then + ' txtAutomIndexSQLResult.Text = oForm.SQLCommand + ' txtAutomIndexConnectionId.Text = oForm.SQLConnectionId + 'End If + + Dim oDatatable = DATABASE_ECM.GetDatatable($"SELECT * FROM TBDD_INDEX_MAN WHERE DOK_ID = {oDocTypeGuid} AND ACTIVE = 1") + Dim oPlaceholders = oDatatable.AsEnumerable(). + ToDictionary(Of String, String)(Function(row) row.Item("NAME"), Function(row) row.Item("WD_INDEX")) + + Dim oForm2 As New DigitalData.GUIs.Common.frmSQLEditor(LOGCONFIG, DATABASE_ECM) With { .SQLCommand = oSQLCommand, - .ConnectionID = oConnection + .SQLConnection = oConnection, + .PlaceholdersManual = oPlaceholders, + .PlaceholdersManualTitle = "Manueller Index" } - If oForm.ShowDialog() = DialogResult.OK Then - txtAutomIndexSQLResult.Text = oForm.SQLCommand - txtAutomIndexConnectionId.Text = oForm.SQLConnectionId + Dim oResult = oForm2.ShowDialog() + If oResult = DialogResult.OK Then + txtManIndexSQL.Text = oForm2.SQLCommand + txtManIndexConnectionId.Text = oForm2.SQLConnection End If Catch ex As Exception LOGGER.Error(ex) diff --git a/SetupVS19/Product.wxs b/SetupVS19/Product.wxs index a963d95..e90bfdd 100644 --- a/SetupVS19/Product.wxs +++ b/SetupVS19/Product.wxs @@ -123,6 +123,7 @@ +