From 00ac955f7877bb28345578f8af2b90d420e11be5 Mon Sep 17 00:00:00 2001 From: Jonathan Jenne Date: Wed, 17 Jun 2020 11:19:01 +0200 Subject: [PATCH] GUIs.Common: improve error message --- GUIs.Common/Constants.vb | 5 +++++ GUIs.Common/DataResultList/frmDataResultList.vb | 4 ++-- GUIs.Common/DocumentResultList/frmDocumentResultList.vb | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/GUIs.Common/Constants.vb b/GUIs.Common/Constants.vb index 268c2f34..ba999971 100644 --- a/GUIs.Common/Constants.vb +++ b/GUIs.Common/Constants.vb @@ -1,3 +1,8 @@ Public Class Constants Public Const NO_ROW_HANDLE = -1 + + Public Shared ReadOnly MESSAGE_TOO_MANY_SEARCHES = "You have more than three searches configured. This Window will only show the first three result lists!" + Public Shared ReadOnly MESSAGE_ERROR_IN_SEARCHES = $"An error occurred while executing searches or no searches were found!{vbNewLine} + Please check the SQL Queries for errors and if the correct connection was configured.{vbNewLine}{vbNewLine} + For more information check the Logfile." End Class diff --git a/GUIs.Common/DataResultList/frmDataResultList.vb b/GUIs.Common/DataResultList/frmDataResultList.vb index 6a941e7d..7ccbf02c 100644 --- a/GUIs.Common/DataResultList/frmDataResultList.vb +++ b/GUIs.Common/DataResultList/frmDataResultList.vb @@ -94,7 +94,7 @@ Public Class frmDataResultList CreateDataGrid(GridView3, oResult.Datatable) Case Else - MessageBox.Show("You have more than three searches configured. This Window will only show the first three result lists!") + MessageBox.Show(Constants.MESSAGE_TOO_MANY_SEARCHES) Exit For End Select Next @@ -108,7 +108,7 @@ Public Class frmDataResultList SwitchMainContainerHorizontal.Enabled = False SwitchDetailContainerHorizontal.Enabled = False - MessageBox.Show("Es ist ein Fehler beim Ausführen der Suchen aufgetreten oder es wurden keine Suchen gefunden!", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + MessageBox.Show(Constants.MESSAGE_ERROR_IN_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Case 1 SplitContainerControl1.SetPanelCollapsed(True) SplitContainerControl2.SetPanelCollapsed(True) diff --git a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb index c96f8c07..6faa0232 100644 --- a/GUIs.Common/DocumentResultList/frmDocumentResultList.vb +++ b/GUIs.Common/DocumentResultList/frmDocumentResultList.vb @@ -102,7 +102,7 @@ Public Class frmDocumentResultList UpdateGridHeader(index, oResult.Datatable.Rows.Count) Case Else - MessageBox.Show("You have more than three searches configured. This Window will only show the first three result lists!", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + MessageBox.Show(Constants.MESSAGE_TOO_MANY_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Exit For End Select Next @@ -116,7 +116,7 @@ Public Class frmDocumentResultList SwitchMainContainerHorizontal.Enabled = False SwitchDetailContainerHorizontal.Enabled = False - MessageBox.Show("Es ist ein Fehler beim Ausführen der Suchen aufgetreten oder es wurden keine Suchen gefunden!", Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) + MessageBox.Show(Constants.MESSAGE_ERROR_IN_SEARCHES, Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation) Case 1 SplitContainerControl1.SetPanelCollapsed(True) SplitContainerControl2.SetPanelCollapsed(True)