This commit is contained in:
Jonathan Jenne 2022-06-29 09:24:29 +02:00
parent 9e77be80e7
commit ad289ae666
3 changed files with 16 additions and 17 deletions

View File

@ -44,10 +44,10 @@ Public Class SearchLoader
For Each oRow As DataRow In oTable.Rows
oAttributes.Add(New SearchAttribute With {
.Id = oRow.Item("GUID"),
.Caption = oRow.Item("CAPTION"),
.Description = oRow.Item("DESCRIPTION"),
.DataType = oRow.Item("DATA_TYPE")
.Id = oRow.ItemEx("GUID", 0),
.Caption = oRow.ItemEx("CAPTION", String.Empty),
.Description = oRow.ItemEx("DESCRIPTION", String.Empty),
.DataType = oRow.ItemEx("DATA_TYPE", "VARCHAR")
})
Next

View File

@ -1,9 +1,6 @@
Imports DigitalData.GUIs.Common.Base
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmMonitor
'Inherits DevExpress.XtraBars.Ribbon.RibbonForm
Inherits BaseRibbonForm
Inherits DevExpress.XtraBars.Ribbon.RibbonForm
'Das Formular überschreibt den Löschvorgang, um die Komponentenliste zu bereinigen.
<System.Diagnostics.DebuggerNonUserCode()> _

View File

@ -22,8 +22,10 @@ Imports DevExpress.XtraTreeList
Public Class frmMonitor
Public Property LogConfig As LogConfig
Public Property Logger As Logger
Public Property ConfigManager As ConfigManager(Of Config)
Public Property Database As MSSQLServer
Public Property FormHelper As FormHelper
Private ReadOnly SQLColumns As New List(Of String) From {"SELECT1", "SELECT2", "SELECT3", "SELECT4"}
Private ReadOnly DocViewColumns As New List(Of String) From {"DOCVIEW1", "DOCVIEW2"}
@ -78,9 +80,9 @@ Public Class frmMonitor
Private Sub frmStart_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "Monitor")
Logger = LogConfig.GetLogger()
ConfigManager = New ConfigManager(Of Config)(LogConfig, Application.UserAppDataPath, Application.UserAppDataPath, Application.StartupPath)
InitializeBaseForm(LogConfig)
FormHelper = New FormHelper(LogConfig, Me)
If ConfigManager.Config.ConnectionString = String.Empty Then
Dim oSQLConfig As New frmSQLConfig(LogConfig)
@ -89,7 +91,7 @@ Public Class frmMonitor
ConfigManager.Save()
Application.Restart()
Else
ShowErrorMessage("No Database configured. Application will close!")
FormHelper.ShowErrorMessage(New ApplicationException("No Database configured. Application will close!"), "Form Load")
Application.Exit()
End If
@ -145,7 +147,7 @@ Public Class frmMonitor
SplitContainerControl3.Collapsed = True
SplitContainerControl2.Collapsed = True
Catch ex As Exception
ShowErrorMessage(ex)
FormHelper.ShowErrorMessage(ex, "frmStart_Load")
End Try
End Sub
@ -193,14 +195,14 @@ Public Class frmMonitor
For Each oNode As TreeListNode In TreeListResults.Nodes
ExpandNodes(oNode, Function(n)
Dim oObjectValue = n.GetValue(oStateColumn)
Dim oValue As String = NotNull(oObjectValue, String.Empty)
Dim oValue As String = NotNull(oObjectValue.ToString, String.Empty)
Return oValue IsNot Nothing AndAlso (oValue = STATE_WARNING Or oValue = STATE_FAILURE)
End Function)
Next
Return True
Catch ex As Exception
ShowErrorMessage(ex)
FormHelper.ShowErrorMessage(ex, "LoadData")
Return False
End Try
End Function
@ -212,7 +214,7 @@ Public Class frmMonitor
cmbSearches.Properties.Items.Clear()
cmbSearches.Properties.Items.AddRange(SearchLoader.Searches)
Catch ex As Exception
ShowErrorMessage(ex)
FormHelper.ShowErrorMessage(ex, "LoadSearches")
End Try
End Sub
@ -411,7 +413,7 @@ Public Class frmMonitor
End Try
Next
Catch ex As Exception
ShowErrorMessage(ex)
FormHelper.ShowErrorMessage(ex, "TreeListResults_FocusedNodeChanged")
End Try
End Sub