From e5d3d37005567e3dec05af0cbcc229dbeca612c9 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Thu, 30 Apr 2020 14:43:13 +0200 Subject: [PATCH] dont close viewer on missing input, show lookup control when multiselect is true --- Global_Indexer/ClassControls.vb | 2 +- Global_Indexer/frmIndex.vb | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Global_Indexer/ClassControls.vb b/Global_Indexer/ClassControls.vb index 238bfa2..a14a36e 100644 --- a/Global_Indexer/ClassControls.vb +++ b/Global_Indexer/ClassControls.vb @@ -96,7 +96,7 @@ Public Class ClassControls oConnectionString = ClassFormFunctions.GetConnectionString(conid) - If oConnectionString IsNot Nothing Then + If oConnectionString IsNot Nothing And oSql.Length > 0 Then LOGGER.Debug("Connection String (redacted): [{0}]", oConnectionString.Substring(0, 30)) If ClassPatterns.HasComplexPatterns(oSql) Then diff --git a/Global_Indexer/frmIndex.vb b/Global_Indexer/frmIndex.vb index 6cef84e..dc3b869 100644 --- a/Global_Indexer/frmIndex.vb +++ b/Global_Indexer/frmIndex.vb @@ -1625,6 +1625,7 @@ Public Class frmIndex Dim AddNewItems As Boolean = oRow.Item("VKT_ADD_ITEM") Dim PreventDuplicates As Boolean = oRow.Item("VKT_PREVENT_MULTIPLE_VALUES") Dim oControlName As String = oRow.Item("NAME") + Dim oConnectionId = NotNull(oRow.Item("CONNECTION_ID"), 0) If oDataType <> "BOOLEAN" Then addLabel(oControlName, oRow.Item("COMMENT").ToString, oLabelPosition, oControlCount) @@ -1641,8 +1642,8 @@ Public Class frmIndex pnlIndex.Controls.Add(chk) End If Case "INTEGER" - If oRow.Item("SUGGESTION") = True And oRow.Item("SQL_RESULT").ToString.Length > 0 Then - Dim oControl = oControls.AddVorschlag_ComboBox(oControlName, oControlPosition, oRow.Item("CONNECTION_ID"), oRow.Item("SQL_RESULT"), MultiSelect, oDataType, DefaultValue, AddNewItems, PreventDuplicates) + If (oRow.Item("SUGGESTION") = True And oRow.Item("SQL_RESULT").ToString.Length > 0) Or MultiSelect = True Then + Dim oControl = oControls.AddVorschlag_ComboBox(oControlName, oControlPosition, oConnectionId, oRow.Item("SQL_RESULT"), MultiSelect, oDataType, DefaultValue, AddNewItems, PreventDuplicates) If Not IsNothing(oControl) Then pnlIndex.Controls.Add(oControl) End If @@ -1654,8 +1655,8 @@ Public Class frmIndex End If End If Case "VARCHAR" - If oRow.Item("SUGGESTION") = True And oRow.Item("SQL_RESULT").ToString.Length > 0 Then - Dim oControl = oControls.AddVorschlag_ComboBox(oControlName, oControlPosition, oRow.Item("CONNECTION_ID"), oRow.Item("SQL_RESULT"), MultiSelect, oDataType, DefaultValue, AddNewItems, PreventDuplicates) + If (oRow.Item("SUGGESTION") = True And oRow.Item("SQL_RESULT").ToString.Length > 0) Or MultiSelect = True Then + Dim oControl = oControls.AddVorschlag_ComboBox(oControlName, oControlPosition, oConnectionId, oRow.Item("SQL_RESULT"), MultiSelect, oDataType, DefaultValue, AddNewItems, PreventDuplicates) If Not IsNothing(oControl) Then pnlIndex.Controls.Add(oControl) End If @@ -2560,8 +2561,7 @@ Public Class frmIndex ClearError() ClearNotice() - DocumentViewer1.CloseDocument() - DocumentViewer1.Done() + Me.Cursor = Cursors.WaitCursor ClassHelper.Refresh_RegexTable() @@ -2597,6 +2597,9 @@ Public Class frmIndex 'DTACTUAL_FILES.Clear() + DocumentViewer1.CloseDocument() + DocumentViewer1.Done() + CancelAttempts = 2 Me.Close() End If @@ -2613,6 +2616,9 @@ Public Class frmIndex End If End If + DocumentViewer1.CloseDocument() + DocumentViewer1.Done() + CancelAttempts = 2 Me.Close() End If