stuff and things

This commit is contained in:
Jonathan Jenne 2022-01-26 13:53:51 +01:00
parent eaf6551251
commit 9e77be80e7
5 changed files with 472 additions and 264 deletions

View File

@ -3,6 +3,6 @@
Public Class Config
<ConnectionString>
Public Property ConnectionString As String = String.Empty
Public Property IDB_Praefix As String = "IDB"
Public Property SearchKeySQL As String = $"SELECT T.ATTR_ID, T.ATTR_TITLE FROM {IDB_Praefix}.dbo.VWIDB_BE_ATTRIBUTE T, TBDD_MONITORING_ATTRIBUTES T1 WHERE T.ATTR_ID = T1.ATTRIBUTE_ID"
Public Property DBPrefix As String = "DD_ECM"
Public Property SearchSQL As String = $"SELECT * FROM {DBPrefix}.[dbo].TBDD_MONITORING_PROFILE WHERE ACTIVE = 1 ORDER BY SEQUENCE"
End Class

View File

@ -78,6 +78,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDMonorepo\GUIs.Common\bin\Debug\DigitalData.GUIs.Common.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Base">
<HintPath>..\..\DDMonorepo\Modules.Base\Base\bin\Debug\DigitalData.Modules.Base.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Config, Version=1.1.4.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDMonorepo\Modules.Config\bin\Debug\DigitalData.Modules.Config.dll</HintPath>
@ -86,9 +89,9 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDMonorepo\Modules.Database\bin\Debug\DigitalData.Modules.Database.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Language, Version=1.3.2.0, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="DigitalData.Modules.Language, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\DDMonorepo\Modules.Language\bin\Release\DigitalData.Modules.Language.dll</HintPath>
<HintPath>..\..\DDMonorepo\Modules.Language\bin\Debug\DigitalData.Modules.Language.dll</HintPath>
</Reference>
<Reference Include="DigitalData.Modules.Logging, Version=2.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -139,6 +142,7 @@
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="SearchLoader.vb" />
<EmbeddedResource Include="frmMonitor.resx">
<DependentUpon>frmMonitor.vb</DependentUpon>
</EmbeddedResource>

View File

@ -0,0 +1,79 @@
Imports DigitalData.Modules.Base
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language
Public Class SearchLoader
Inherits BaseClass
Private Config As Config
Private Database As MSSQLServer
Public Searches As New List(Of Search)
Public Sub New(pLogConfig As LogConfig, pConfig As Config, pDatabase As MSSQLServer)
MyBase.New(pLogConfig)
Config = pConfig
Database = pDatabase
End Sub
Public Sub LoadSearches()
Try
Dim oSQL = Config.SearchSQL
Dim oTable = Database.GetDatatable(oSQL)
For Each oRow As DataRow In oTable.Rows
Searches.Add(New Search With {
.Id = CInt(oRow.Item("GUID")),
.Title = oRow.ItemEx("TITLE", ""),
.Description = oRow.ItemEx("DESCRIPTION", ""),
.TypeName = "Varchar"
})
Next
Catch ex As Exception
Logger.Error(ex)
Throw ex
End Try
End Sub
Public Function LoadSearchAttributes(pSearchId As Integer) As List(Of SearchAttribute)
Dim oSQL As String = $"SELECT * FROM TBDD_MONITORING_PROFILE_ATTRIBUTES WHERE ACTIVE = 1 AND MONITOR_PROFILE_ID = {pSearchId} ORDER BY SEQUENCE"
Dim oTable As DataTable = Database.GetDatatable(oSQL)
Dim oAttributes As New List(Of SearchAttribute)
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")
})
Next
Return oAttributes
End Function
Public Class Search
Public Id As Integer
Public Title As String
Public Description As String
Public TypeName As String
Public Overrides Function ToString() As String
Return Title
End Function
End Class
Public Class SearchAttribute
Public Id As Integer
Public Caption As String
Public Description As String
Public DataType As String
Public Overrides Function ToString() As String
Return Caption
End Function
End Class
End Class

View File

@ -40,15 +40,10 @@ Partial Class frmMonitor
Me.RibbonStatusBar1 = New DevExpress.XtraBars.Ribbon.RibbonStatusBar()
Me.RibbonPage2 = New DevExpress.XtraBars.Ribbon.RibbonPage()
Me.LayoutControl1 = New DevExpress.XtraLayout.LayoutControl()
Me.TextEdit1 = New DevExpress.XtraEditors.TextEdit()
Me.cmbSearchKeys = New DevExpress.XtraEditors.ComboBoxEdit()
Me.TextEdit2 = New DevExpress.XtraEditors.ComboBoxEdit()
Me.DateEdit1 = New DevExpress.XtraEditors.DateEdit()
Me.cmbSearches = New DevExpress.XtraEditors.ComboBoxEdit()
Me.Root = New DevExpress.XtraLayout.LayoutControlGroup()
Me.LayoutItemSearchValue_Text = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem2 = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutItemSearchValue_Date = New DevExpress.XtraLayout.LayoutControlItem()
Me.LayoutControlItem3 = New DevExpress.XtraLayout.LayoutControlItem()
Me.ParameterRoot = New DevExpress.XtraLayout.LayoutControlGroup()
Me.XtraTabControl1 = New DevExpress.XtraTab.XtraTabControl()
Me.XtraTabPageFile1 = New DevExpress.XtraTab.XtraTabPage()
Me.DocumentViewer1 = New DigitalData.Controls.DocumentViewer.DocumentViewer()
@ -61,6 +56,20 @@ Partial Class frmMonitor
Me.GridControl1 = New DevExpress.XtraGrid.GridControl()
Me.GridView1 = New DevExpress.XtraGrid.Views.Grid.GridView()
Me.TreeListResults = New DevExpress.XtraTreeList.TreeList()
Me.colState = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.colICON = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.colCOLUMN1 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.colCOLUMN2 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.colCOLUMN3 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.colADDED_WHEN = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn1 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn2 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn3 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn4 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn5 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn6 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn7 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.TreeListColumn8 = New DevExpress.XtraTreeList.Columns.TreeListColumn()
Me.SvgImageCollection1 = New DevExpress.Utils.SvgImageCollection(Me.components)
Me.SplitContainerControl1 = New DevExpress.XtraEditors.SplitContainerControl()
Me.SplitContainerControl3 = New DevExpress.XtraEditors.SplitContainerControl()
@ -84,16 +93,10 @@ Partial Class frmMonitor
CType(Me.ApplicationMenu1, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.LayoutControl1.SuspendLayout()
CType(Me.TextEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.cmbSearchKeys.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.TextEdit2.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DateEdit1.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.DateEdit1.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.cmbSearches.Properties, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.Root, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutItemSearchValue_Text, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutItemSearchValue_Date, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.ParameterRoot, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.XtraTabControl1.SuspendLayout()
Me.XtraTabPageFile1.SuspendLayout()
@ -168,7 +171,7 @@ Partial Class frmMonitor
'
'buttonSearch
'
Me.buttonSearch.Caption = "Sicht laden"
Me.buttonSearch.Caption = "Suche ausführen (F5)"
Me.buttonSearch.Id = 1
Me.buttonSearch.ImageOptions.SvgImage = Global.DigitalData.GUIs.Monitor.My.Resources.Resources.gettingstarted
Me.buttonSearch.Name = "buttonSearch"
@ -233,10 +236,7 @@ Partial Class frmMonitor
'
'LayoutControl1
'
Me.LayoutControl1.Controls.Add(Me.TextEdit1)
Me.LayoutControl1.Controls.Add(Me.cmbSearchKeys)
Me.LayoutControl1.Controls.Add(Me.TextEdit2)
Me.LayoutControl1.Controls.Add(Me.DateEdit1)
Me.LayoutControl1.Controls.Add(Me.cmbSearches)
Me.LayoutControl1.Dock = System.Windows.Forms.DockStyle.Fill
Me.LayoutControl1.Location = New System.Drawing.Point(0, 0)
Me.LayoutControl1.Name = "LayoutControl1"
@ -245,100 +245,45 @@ Partial Class frmMonitor
Me.LayoutControl1.TabIndex = 0
Me.LayoutControl1.Text = "LayoutControl1"
'
'TextEdit1
'cmbSearches
'
Me.TextEdit1.Location = New System.Drawing.Point(15, 77)
Me.TextEdit1.MenuManager = Me.RibbonControl1
Me.TextEdit1.Name = "TextEdit1"
Me.TextEdit1.Size = New System.Drawing.Size(205, 20)
Me.TextEdit1.StyleController = Me.LayoutControl1
Me.TextEdit1.TabIndex = 4
'
'cmbSearchKeys
'
Me.cmbSearchKeys.Location = New System.Drawing.Point(15, 31)
Me.cmbSearchKeys.MenuManager = Me.RibbonControl1
Me.cmbSearchKeys.Name = "cmbSearchKeys"
Me.cmbSearchKeys.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.cmbSearchKeys.Size = New System.Drawing.Size(205, 20)
Me.cmbSearchKeys.StyleController = Me.LayoutControl1
Me.cmbSearchKeys.TabIndex = 5
'
'TextEdit2
'
Me.TextEdit2.Location = New System.Drawing.Point(15, 169)
Me.TextEdit2.MenuManager = Me.RibbonControl1
Me.TextEdit2.Name = "TextEdit2"
Me.TextEdit2.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.TextEdit2.Size = New System.Drawing.Size(205, 20)
Me.TextEdit2.StyleController = Me.LayoutControl1
Me.TextEdit2.TabIndex = 6
'
'DateEdit1
'
Me.DateEdit1.EditValue = Nothing
Me.DateEdit1.Location = New System.Drawing.Point(15, 123)
Me.DateEdit1.MenuManager = Me.RibbonControl1
Me.DateEdit1.Name = "DateEdit1"
Me.DateEdit1.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.DateEdit1.Properties.CalendarTimeProperties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.DateEdit1.Size = New System.Drawing.Size(205, 20)
Me.DateEdit1.StyleController = Me.LayoutControl1
Me.DateEdit1.TabIndex = 7
Me.cmbSearches.Location = New System.Drawing.Point(10, 26)
Me.cmbSearches.MenuManager = Me.RibbonControl1
Me.cmbSearches.Name = "cmbSearches"
Me.cmbSearches.Properties.Buttons.AddRange(New DevExpress.XtraEditors.Controls.EditorButton() {New DevExpress.XtraEditors.Controls.EditorButton(DevExpress.XtraEditors.Controls.ButtonPredefines.Combo)})
Me.cmbSearches.Properties.TextEditStyle = DevExpress.XtraEditors.Controls.TextEditStyles.DisableTextEditor
Me.cmbSearches.Size = New System.Drawing.Size(215, 20)
Me.cmbSearches.StyleController = Me.LayoutControl1
Me.cmbSearches.TabIndex = 5
'
'Root
'
Me.Root.EnableIndentsWithoutBorders = DevExpress.Utils.DefaultBoolean.[True]
Me.Root.GroupBordersVisible = False
Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutItemSearchValue_Text, Me.LayoutControlItem2, Me.LayoutItemSearchValue_Date, Me.LayoutControlItem3})
Me.Root.Items.AddRange(New DevExpress.XtraLayout.BaseLayoutItem() {Me.LayoutControlItem2, Me.ParameterRoot})
Me.Root.Name = "Root"
Me.Root.Size = New System.Drawing.Size(235, 563)
Me.Root.TextVisible = False
'
'LayoutItemSearchValue_Text
'
Me.LayoutItemSearchValue_Text.Control = Me.TextEdit1
Me.LayoutItemSearchValue_Text.Location = New System.Drawing.Point(0, 46)
Me.LayoutItemSearchValue_Text.Name = "LayoutItemSearchValue_Text"
Me.LayoutItemSearchValue_Text.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutItemSearchValue_Text.Size = New System.Drawing.Size(215, 46)
Me.LayoutItemSearchValue_Text.Text = "Text Parameter:"
Me.LayoutItemSearchValue_Text.TextLocation = DevExpress.Utils.Locations.Top
Me.LayoutItemSearchValue_Text.TextSize = New System.Drawing.Size(88, 13)
'
'LayoutControlItem2
'
Me.LayoutControlItem2.Control = Me.cmbSearchKeys
Me.LayoutControlItem2.Control = Me.cmbSearches
Me.LayoutControlItem2.Location = New System.Drawing.Point(0, 0)
Me.LayoutControlItem2.Name = "LayoutControlItem2"
Me.LayoutControlItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem2.Size = New System.Drawing.Size(215, 46)
Me.LayoutControlItem2.Padding = New DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0)
Me.LayoutControlItem2.Size = New System.Drawing.Size(215, 36)
Me.LayoutControlItem2.Text = "Suchen nach:"
Me.LayoutControlItem2.TextLocation = DevExpress.Utils.Locations.Top
Me.LayoutControlItem2.TextSize = New System.Drawing.Size(88, 13)
Me.LayoutControlItem2.TextSize = New System.Drawing.Size(69, 13)
'
'LayoutItemSearchValue_Date
'ParameterRoot
'
Me.LayoutItemSearchValue_Date.Control = Me.DateEdit1
Me.LayoutItemSearchValue_Date.Location = New System.Drawing.Point(0, 92)
Me.LayoutItemSearchValue_Date.Name = "LayoutItemSearchValue_Date"
Me.LayoutItemSearchValue_Date.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutItemSearchValue_Date.Size = New System.Drawing.Size(215, 46)
Me.LayoutItemSearchValue_Date.Text = "Datum Parameter"
Me.LayoutItemSearchValue_Date.TextLocation = DevExpress.Utils.Locations.Top
Me.LayoutItemSearchValue_Date.TextSize = New System.Drawing.Size(88, 13)
Me.LayoutItemSearchValue_Date.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never
'
'LayoutControlItem3
'
Me.LayoutControlItem3.Control = Me.TextEdit2
Me.LayoutControlItem3.Location = New System.Drawing.Point(0, 138)
Me.LayoutControlItem3.Name = "LayoutControlItem3"
Me.LayoutControlItem3.Padding = New DevExpress.XtraLayout.Utils.Padding(5, 5, 5, 5)
Me.LayoutControlItem3.Size = New System.Drawing.Size(215, 405)
Me.LayoutControlItem3.Text = "Auswertung"
Me.LayoutControlItem3.TextLocation = DevExpress.Utils.Locations.Top
Me.LayoutControlItem3.TextSize = New System.Drawing.Size(88, 13)
Me.ParameterRoot.GroupBordersVisible = False
Me.ParameterRoot.Location = New System.Drawing.Point(0, 36)
Me.ParameterRoot.Name = "ParameterRoot"
Me.ParameterRoot.Padding = New DevExpress.XtraLayout.Utils.Padding(0, 0, 0, 0)
Me.ParameterRoot.Size = New System.Drawing.Size(215, 507)
Me.ParameterRoot.Text = "Suchvariablen"
'
'XtraTabControl1
'
@ -370,7 +315,7 @@ Partial Class frmMonitor
'
Me.XtraTabPageFile2.Controls.Add(Me.DocumentViewer2)
Me.XtraTabPageFile2.Name = "XtraTabPageFile2"
Me.XtraTabPageFile2.Size = New System.Drawing.Size(407, 541)
Me.XtraTabPageFile2.Size = New System.Drawing.Size(407, 540)
Me.XtraTabPageFile2.Text = "File 2"
'
'DocumentViewer2
@ -379,14 +324,14 @@ Partial Class frmMonitor
Me.DocumentViewer2.FileLoaded = False
Me.DocumentViewer2.Location = New System.Drawing.Point(0, 0)
Me.DocumentViewer2.Name = "DocumentViewer2"
Me.DocumentViewer2.Size = New System.Drawing.Size(407, 541)
Me.DocumentViewer2.Size = New System.Drawing.Size(407, 540)
Me.DocumentViewer2.TabIndex = 1
'
'XtraTabPageHtml1
'
Me.XtraTabPageHtml1.Controls.Add(Me.RichEditControl1)
Me.XtraTabPageHtml1.Name = "XtraTabPageHtml1"
Me.XtraTabPageHtml1.Size = New System.Drawing.Size(407, 541)
Me.XtraTabPageHtml1.Size = New System.Drawing.Size(407, 540)
Me.XtraTabPageHtml1.Text = "HTML 1"
'
'RichEditControl1
@ -399,14 +344,14 @@ Partial Class frmMonitor
Me.RichEditControl1.Name = "RichEditControl1"
Me.RichEditControl1.Options.HorizontalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden
Me.RichEditControl1.Options.VerticalRuler.Visibility = DevExpress.XtraRichEdit.RichEditRulerVisibility.Hidden
Me.RichEditControl1.Size = New System.Drawing.Size(407, 541)
Me.RichEditControl1.Size = New System.Drawing.Size(407, 540)
Me.RichEditControl1.TabIndex = 0
'
'XtraTabPageHtml2
'
Me.XtraTabPageHtml2.Controls.Add(Me.RichEditControl2)
Me.XtraTabPageHtml2.Name = "XtraTabPageHtml2"
Me.XtraTabPageHtml2.Size = New System.Drawing.Size(407, 541)
Me.XtraTabPageHtml2.Size = New System.Drawing.Size(407, 540)
Me.XtraTabPageHtml2.Text = "HTML 2"
'
'RichEditControl2
@ -415,7 +360,7 @@ Partial Class frmMonitor
Me.RichEditControl2.Location = New System.Drawing.Point(0, 0)
Me.RichEditControl2.MenuManager = Me.RibbonControl1
Me.RichEditControl2.Name = "RichEditControl2"
Me.RichEditControl2.Size = New System.Drawing.Size(407, 541)
Me.RichEditControl2.Size = New System.Drawing.Size(407, 540)
Me.RichEditControl2.TabIndex = 1
'
'GridControl1
@ -425,7 +370,7 @@ Partial Class frmMonitor
Me.GridControl1.MainView = Me.GridView1
Me.GridControl1.MenuManager = Me.RibbonControl1
Me.GridControl1.Name = "GridControl1"
Me.GridControl1.Size = New System.Drawing.Size(711, 350)
Me.GridControl1.Size = New System.Drawing.Size(711, 349)
Me.GridControl1.TabIndex = 0
Me.GridControl1.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView1})
'
@ -436,14 +381,124 @@ Partial Class frmMonitor
'
'TreeListResults
'
Me.TreeListResults.Columns.AddRange(New DevExpress.XtraTreeList.Columns.TreeListColumn() {Me.colState, Me.colICON, Me.colCOLUMN1, Me.colCOLUMN2, Me.colCOLUMN3, Me.colADDED_WHEN, Me.TreeListColumn1, Me.TreeListColumn2, Me.TreeListColumn3, Me.TreeListColumn4, Me.TreeListColumn5, Me.TreeListColumn6, Me.TreeListColumn7, Me.TreeListColumn8})
Me.TreeListResults.Dock = System.Windows.Forms.DockStyle.Fill
Me.TreeListResults.Location = New System.Drawing.Point(0, 0)
Me.TreeListResults.MenuManager = Me.RibbonControl1
Me.TreeListResults.Name = "TreeListResults"
Me.TreeListResults.OptionsView.ShowColumns = False
Me.TreeListResults.Size = New System.Drawing.Size(713, 181)
Me.TreeListResults.TabIndex = 4
'
'colState
'
Me.colState.Caption = "Status"
Me.colState.FieldName = "STATE"
Me.colState.MinWidth = 150
Me.colState.Name = "colState"
Me.colState.OptionsColumn.AllowSize = False
Me.colState.OptionsColumn.AllowSort = False
Me.colState.Visible = True
Me.colState.VisibleIndex = 0
Me.colState.Width = 150
'
'colICON
'
Me.colICON.Caption = "Icon"
Me.colICON.FieldName = "ICON"
Me.colICON.Name = "colICON"
Me.colICON.OptionsColumn.AllowSort = False
Me.colICON.Visible = True
Me.colICON.VisibleIndex = 1
Me.colICON.Width = 108
'
'colCOLUMN1
'
Me.colCOLUMN1.Caption = "Vorgang"
Me.colCOLUMN1.FieldName = "COLUMN1"
Me.colCOLUMN1.Name = "colCOLUMN1"
Me.colCOLUMN1.OptionsColumn.AllowSort = False
Me.colCOLUMN1.Visible = True
Me.colCOLUMN1.VisibleIndex = 2
Me.colCOLUMN1.Width = 108
'
'colCOLUMN2
'
Me.colCOLUMN2.Caption = "Beschreibung"
Me.colCOLUMN2.FieldName = "COLUMN2"
Me.colCOLUMN2.Name = "colCOLUMN2"
Me.colCOLUMN2.OptionsColumn.AllowSort = False
Me.colCOLUMN2.Visible = True
Me.colCOLUMN2.VisibleIndex = 3
Me.colCOLUMN2.Width = 108
'
'colCOLUMN3
'
Me.colCOLUMN3.Caption = "Beschreibung 2"
Me.colCOLUMN3.FieldName = "COLUMN3"
Me.colCOLUMN3.Name = "colCOLUMN3"
Me.colCOLUMN3.OptionsColumn.AllowSort = False
Me.colCOLUMN3.Visible = True
Me.colCOLUMN3.VisibleIndex = 4
Me.colCOLUMN3.Width = 107
'
'colADDED_WHEN
'
Me.colADDED_WHEN.Caption = "Datum"
Me.colADDED_WHEN.FieldName = "ADDED_WHEN"
Me.colADDED_WHEN.Name = "colADDED_WHEN"
Me.colADDED_WHEN.OptionsColumn.AllowSort = False
Me.colADDED_WHEN.Visible = True
Me.colADDED_WHEN.VisibleIndex = 5
Me.colADDED_WHEN.Width = 107
'
'TreeListColumn1
'
Me.TreeListColumn1.Caption = "TreeListColumn1"
Me.TreeListColumn1.FieldName = "SELECT1"
Me.TreeListColumn1.Name = "TreeListColumn1"
'
'TreeListColumn2
'
Me.TreeListColumn2.Caption = "TreeListColumn2"
Me.TreeListColumn2.FieldName = "SELECT2"
Me.TreeListColumn2.Name = "TreeListColumn2"
'
'TreeListColumn3
'
Me.TreeListColumn3.Caption = "TreeListColumn3"
Me.TreeListColumn3.FieldName = "SELECT3"
Me.TreeListColumn3.Name = "TreeListColumn3"
'
'TreeListColumn4
'
Me.TreeListColumn4.Caption = "TreeListColumn4"
Me.TreeListColumn4.FieldName = "SELECT4"
Me.TreeListColumn4.Name = "TreeListColumn4"
'
'TreeListColumn5
'
Me.TreeListColumn5.Caption = "TreeListColumn5"
Me.TreeListColumn5.FieldName = "DOCVIEW1"
Me.TreeListColumn5.Name = "TreeListColumn5"
'
'TreeListColumn6
'
Me.TreeListColumn6.Caption = "TreeListColumn6"
Me.TreeListColumn6.FieldName = "DOCVIEW2"
Me.TreeListColumn6.Name = "TreeListColumn6"
'
'TreeListColumn7
'
Me.TreeListColumn7.Caption = "TreeListColumn7"
Me.TreeListColumn7.FieldName = "HTML1"
Me.TreeListColumn7.Name = "TreeListColumn7"
'
'TreeListColumn8
'
Me.TreeListColumn8.Caption = "TreeListColumn8"
Me.TreeListColumn8.FieldName = "HTML2"
Me.TreeListColumn8.Name = "TreeListColumn8"
'
'SvgImageCollection1
'
Me.SvgImageCollection1.Add("default", "image://svgimages/outlook inspired/about.svg")
@ -535,7 +590,7 @@ Partial Class frmMonitor
'
Me.XtraTabPageSQL2.Controls.Add(Me.GridControl3)
Me.XtraTabPageSQL2.Name = "XtraTabPageSQL2"
Me.XtraTabPageSQL2.Size = New System.Drawing.Size(711, 350)
Me.XtraTabPageSQL2.Size = New System.Drawing.Size(711, 349)
Me.XtraTabPageSQL2.Text = "SQL 2"
'
'GridControl3
@ -545,7 +600,7 @@ Partial Class frmMonitor
Me.GridControl3.MainView = Me.GridView3
Me.GridControl3.MenuManager = Me.RibbonControl1
Me.GridControl3.Name = "GridControl3"
Me.GridControl3.Size = New System.Drawing.Size(711, 350)
Me.GridControl3.Size = New System.Drawing.Size(711, 349)
Me.GridControl3.TabIndex = 1
Me.GridControl3.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView3})
'
@ -558,7 +613,7 @@ Partial Class frmMonitor
'
Me.XtraTabPageSQL3.Controls.Add(Me.GridControl4)
Me.XtraTabPageSQL3.Name = "XtraTabPageSQL3"
Me.XtraTabPageSQL3.Size = New System.Drawing.Size(711, 350)
Me.XtraTabPageSQL3.Size = New System.Drawing.Size(711, 349)
Me.XtraTabPageSQL3.Text = "SQL 3"
'
'GridControl4
@ -568,7 +623,7 @@ Partial Class frmMonitor
Me.GridControl4.MainView = Me.GridView4
Me.GridControl4.MenuManager = Me.RibbonControl1
Me.GridControl4.Name = "GridControl4"
Me.GridControl4.Size = New System.Drawing.Size(711, 350)
Me.GridControl4.Size = New System.Drawing.Size(711, 349)
Me.GridControl4.TabIndex = 1
Me.GridControl4.ViewCollection.AddRange(New DevExpress.XtraGrid.Views.Base.BaseView() {Me.GridView4})
'
@ -581,7 +636,7 @@ Partial Class frmMonitor
'
Me.XtraTabPageSQL4.Controls.Add(Me.GridControl1)
Me.XtraTabPageSQL4.Name = "XtraTabPageSQL4"
Me.XtraTabPageSQL4.Size = New System.Drawing.Size(711, 350)
Me.XtraTabPageSQL4.Size = New System.Drawing.Size(711, 349)
Me.XtraTabPageSQL4.Text = "SQL 4"
'
'SplitContainerControl2
@ -628,7 +683,7 @@ Partial Class frmMonitor
Me.XtraTabPage4.ImageOptions.SvgImage = Global.DigitalData.GUIs.Monitor.My.Resources.Resources.bo_dashboard
Me.XtraTabPage4.ImageOptions.SvgImageSize = New System.Drawing.Size(16, 16)
Me.XtraTabPage4.Name = "XtraTabPage4"
Me.XtraTabPage4.Size = New System.Drawing.Size(1377, 564)
Me.XtraTabPage4.Size = New System.Drawing.Size(1377, 563)
Me.XtraTabPage4.Text = "Dashboard"
'
'XtraSaveFileDialog1
@ -644,6 +699,7 @@ Partial Class frmMonitor
Me.Controls.Add(Me.RibbonStatusBar1)
Me.Controls.Add(Me.RibbonControl1)
Me.IconOptions.SvgImage = Global.DigitalData.GUIs.Monitor.My.Resources.Resources.charttype_line
Me.KeyPreview = True
Me.Name = "frmMonitor"
Me.Ribbon = Me.RibbonControl1
Me.StatusBar = Me.RibbonStatusBar1
@ -652,16 +708,10 @@ Partial Class frmMonitor
CType(Me.ApplicationMenu1, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.LayoutControl1.ResumeLayout(False)
CType(Me.TextEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.cmbSearchKeys.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.TextEdit2.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.DateEdit1.Properties.CalendarTimeProperties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.DateEdit1.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.cmbSearches.Properties, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Root, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutItemSearchValue_Text, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutItemSearchValue_Date, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.LayoutControlItem3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.ParameterRoot, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.XtraTabControl1, System.ComponentModel.ISupportInitialize).EndInit()
Me.XtraTabControl1.ResumeLayout(False)
Me.XtraTabPageFile1.ResumeLayout(False)
@ -716,14 +766,10 @@ Partial Class frmMonitor
Friend WithEvents RibbonStatusBar1 As DevExpress.XtraBars.Ribbon.RibbonStatusBar
Friend WithEvents RibbonPage2 As DevExpress.XtraBars.Ribbon.RibbonPage
Friend WithEvents LayoutControl1 As DevExpress.XtraLayout.LayoutControl
Friend WithEvents TextEdit1 As DevExpress.XtraEditors.TextEdit
Friend WithEvents cmbSearchKeys As DevExpress.XtraEditors.ComboBoxEdit
Friend WithEvents cmbSearches As DevExpress.XtraEditors.ComboBoxEdit
Friend WithEvents Root As DevExpress.XtraLayout.LayoutControlGroup
Friend WithEvents LayoutItemSearchValue_Text As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents LayoutControlItem2 As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents LayoutControlItem3 As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents buttonSearch As DevExpress.XtraBars.BarButtonItem
Friend WithEvents TextEdit2 As DevExpress.XtraEditors.ComboBoxEdit
Friend WithEvents TreeListResults As DevExpress.XtraTreeList.TreeList
Friend WithEvents GridControl1 As DevExpress.XtraGrid.GridControl
Friend WithEvents GridView1 As DevExpress.XtraGrid.Views.Grid.GridView
@ -753,8 +799,6 @@ Partial Class frmMonitor
Friend WithEvents DocumentViewer2 As Controls.DocumentViewer.DocumentViewer
Friend WithEvents RichEditControl1 As DevExpress.XtraRichEdit.RichEditControl
Friend WithEvents RichEditControl2 As DevExpress.XtraRichEdit.RichEditControl
Friend WithEvents DateEdit1 As DevExpress.XtraEditors.DateEdit
Friend WithEvents LayoutItemSearchValue_Date As DevExpress.XtraLayout.LayoutControlItem
Friend WithEvents SvgImageCollection1 As DevExpress.Utils.SvgImageCollection
Friend WithEvents ApplicationMenu1 As DevExpress.XtraBars.Ribbon.ApplicationMenu
Friend WithEvents BarButtonItem1 As DevExpress.XtraBars.BarButtonItem
@ -763,4 +807,19 @@ Partial Class frmMonitor
Friend WithEvents XtraSaveFileDialog1 As DevExpress.XtraEditors.XtraSaveFileDialog
Friend WithEvents BarButtonItem3 As DevExpress.XtraBars.BarButtonItem
Friend WithEvents BarStaticItem1 As DevExpress.XtraBars.BarStaticItem
Friend WithEvents ParameterRoot As DevExpress.XtraLayout.LayoutControlGroup
Friend WithEvents colCOLUMN1 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents colCOLUMN2 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents colCOLUMN3 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents colADDED_WHEN As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents colState As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents colICON As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn1 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn2 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn3 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn4 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn5 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn6 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn7 As DevExpress.XtraTreeList.Columns.TreeListColumn
Friend WithEvents TreeListColumn8 As DevExpress.XtraTreeList.Columns.TreeListColumn
End Class

View File

@ -7,6 +7,7 @@ Imports DigitalData.Modules.Config
Imports DigitalData.Modules.Database
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.Language.Utils
Imports DigitalData.Modules.Language
Imports DevExpress.XtraTab
Imports DigitalData.Controls.DocumentViewer
Imports DevExpress.XtraEditors
@ -15,14 +16,15 @@ Imports DevExpress.XtraTreeList.Columns
Imports DevExpress.XtraEditors.Repository
Imports DevExpress.Utils
Imports DevExpress.XtraEditors.Controls
Imports DigitalData.GUIs.Monitor.SearchLoader
Imports DevExpress.XtraLayout
Imports DevExpress.XtraTreeList
Public Class frmMonitor
Public Property LogConfig As LogConfig
Public Property ConfigManager As ConfigManager(Of Config)
Public Property Database As MSSQLServer
Private ReadOnly SearchKeys As New List(Of SearchKey)
Private ReadOnly SQLColumns As New List(Of String) From {"SELECT1", "SELECT2", "SELECT3", "SELECT4"}
Private ReadOnly DocViewColumns As New List(Of String) From {"DOCVIEW1", "DOCVIEW2"}
Private ReadOnly HtmlViewColumns As New List(Of String) From {"HTML1", "HTML2"}
@ -33,7 +35,7 @@ Public Class frmMonitor
Private ReadOnly DisplayColumns As New List(Of String) From {"COLUMN1", "COLUMN2", "COLUMN3", "ADDED_WHEN", "STATE", "ICON"}
Private SearchLoader As SearchLoader
Private SQLResultGrids As List(Of GridControl)
@ -77,6 +79,7 @@ Public Class frmMonitor
Try
LogConfig = New LogConfig(LogConfig.PathType.AppData, Nothing, Nothing, "Digital Data", "Monitor")
ConfigManager = New ConfigManager(Of Config)(LogConfig, Application.UserAppDataPath, Application.UserAppDataPath, Application.StartupPath)
InitializeBaseForm(LogConfig)
If ConfigManager.Config.ConnectionString = String.Empty Then
@ -91,17 +94,18 @@ Public Class frmMonitor
End If
End If
If ConfigManager.Config.IDB_Praefix <> "" Then
If ConfigManager.Config.SearchKeySQL.Contains("@IDB_PRAEFIX") Then
Dim oREPLACE = ConfigManager.Config.SearchKeySQL.Replace("@IDB_PRAEFIX", ConfigManager.Config.IDB_Praefix)
ConfigManager.Config.SearchKeySQL = oREPLACE
If ConfigManager.Config.DBPrefix <> "" Then
If ConfigManager.Config.SearchSQL.Contains("@IDB_PRAEFIX") Then
Dim oREPLACE = ConfigManager.Config.SearchSQL.Replace("@IDB_PRAEFIX", ConfigManager.Config.DBPrefix)
ConfigManager.Config.SearchSQL = oREPLACE
ConfigManager.Save()
End If
Console.WriteLine(ConfigManager.Config.SearchKeySQL)
Console.WriteLine(ConfigManager.Config.SearchSQL)
End If
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
Dim oConnectionString = MSSQLServer.DecryptConnectionString(ConfigManager.Config.ConnectionString)
Database = New MSSQLServer(LogConfig, oConnectionString)
SearchLoader = New SearchLoader(LogConfig, ConfigManager.Config, Database)
GridBuilder = New GridBuilder(New List(Of GridView) From {GridView1, GridView2, GridView3, GridView4})
GridBuilder.
WithDefaults().
@ -118,7 +122,7 @@ Public Class frmMonitor
HtmlResultViewers = New List(Of RichEditControl) From {RichEditControl1, RichEditControl2}
HtmlResultTabs = New List(Of XtraTabPage) From {XtraTabPageHtml1, XtraTabPageHtml2}
LoadSearchKeys()
LoadSearches()
Dim oLicense = LoadGDPicture()
@ -156,15 +160,25 @@ Public Class frmMonitor
Private Function LoadData() As Boolean
Try
If cmbSearches.EditValue Is Nothing Then
Return False
End If
Dim oSQL As String = $"EXEC [{ConfigManager.Config.IDB_Praefix}].[dbo].[PRDD_MONITORING_GET_TREEVIEW_RESULT] '{cmbSearchKeys.EditValue}','{TextEdit1.EditValue.ToString}',1"
Dim oSQL As String = $"EXEC [{ConfigManager.Config.DBPrefix}].[dbo].[PRDD_MONITORING_GET_TREEVIEW_RESULT] '{cmbSearches.EditValue}','irgendwas','irgendwas','irgendwas',1"
Dim oTable As DataTable = Database.GetDatatable(oSQL)
TreeListResults.DataSource = oTable
TreeListResults.PopulateColumns()
InitTreeList()
Dim oMaxLength = 0
For Each oRow As DataRow In oTable.Rows
Dim oProcess = oRow.Item("COLUMN1")
Dim oLength = oProcess.ToString.Length
If oLength > oMaxLength Then
oMaxLength = oLength
End If
Next
InitTreeList(oMaxLength)
' Show all columns in DisplayColumns List
For Each oColumn In TreeListResults.Columns
@ -173,14 +187,9 @@ Public Class frmMonitor
oColumn.Format.FormatType = FormatType.DateTime
oColumn.Format.FormatString = "dd.MM.yyyy HH:MM:ss"
End If
Next
'Dim edit As New RepositoryItemDateEdit()
'TreeListResults.Columns("ADDED_WHEN").ColumnEdit = edit
'edit.Mask.EditMask = "g"
'edit.Mask.UseMaskAsDisplayFormat = True
Dim oStateColumn As TreeListColumn = TreeListResults.Columns.Item("STATE")
Dim oStateColumn As TreeListColumn = TreeListResults.Columns.Item("STATE")
For Each oNode As TreeListNode In TreeListResults.Nodes
ExpandNodes(oNode, Function(n)
Dim oObjectValue = n.GetValue(oStateColumn)
@ -188,6 +197,7 @@ Public Class frmMonitor
Return oValue IsNot Nothing AndAlso (oValue = STATE_WARNING Or oValue = STATE_FAILURE)
End Function)
Next
Return True
Catch ex As Exception
ShowErrorMessage(ex)
@ -195,27 +205,18 @@ Public Class frmMonitor
End Try
End Function
Private Sub LoadSearchKeys()
Private Sub LoadSearches()
Try
Dim oSQL = ConfigManager.Config.SearchKeySQL
Dim oTable = Database.GetDatatable(oSQL)
SearchLoader.LoadSearches()
For Each oRow As DataRow In oTable.Rows
SearchKeys.Add(New SearchKey With {
.Id = CInt(oRow.Item(0)),
.Title = oRow.Item(1).ToString,
.TypeName = "Varchar"'oRow.Item(2).ToString
})
Next
cmbSearchKeys.Properties.Items.Clear()
cmbSearchKeys.Properties.Items.AddRange(SearchKeys)
cmbSearches.Properties.Items.Clear()
cmbSearches.Properties.Items.AddRange(SearchLoader.Searches)
Catch ex As Exception
ShowErrorMessage(ex)
End Try
End Sub
Private Sub InitTreeList()
Private Sub InitTreeList(pMaxLength As Integer)
TreeListResults.KeyFieldName = "GUID"
TreeListResults.ParentFieldName = "PARENT_ID"
@ -253,11 +254,21 @@ Public Class frmMonitor
oStateColumn.VisibleIndex = 1
oIconColumn.VisibleIndex = 2
Dim oColumnLength = pMaxLength * 5
With oColumn1
.MinWidth = oColumnLength
.MaxWidth = oColumnLength
.Width = oColumnLength
.OptionsColumn.AllowSize = False
End With
With oStateColumn
.ColumnEdit = oStateEdit
.MaxWidth = 25
.MinWidth = 25
.Width = 25
.Caption = " "
.OptionsColumn.AllowSize = False
.ImageOptions.Image = SvgImageCollection1.GetImage(NodeImage.Success)
End With
@ -265,30 +276,40 @@ Public Class frmMonitor
.ColumnEdit = oStateEdit
.MaxWidth = 25
.MinWidth = 25
.Width = 25
.Caption = " "
.OptionsColumn.AllowSize = False
.ImageOptions.Image = SvgImageCollection1.GetImage(NodeImage.SQL)
End With
End Sub
Private Sub cmbSearchKeys_SelectedValueChanged(sender As Object, e As EventArgs) Handles cmbSearchKeys.SelectedValueChanged
Dim oItem As SearchKey = CType(cmbSearchKeys.SelectedItem, SearchKey)
Private Sub cmbSearches_SelectedValueChanged(sender As Object, e As EventArgs) Handles cmbSearches.SelectedValueChanged
Dim oSearch As Search = CType(cmbSearches.SelectedItem, Search)
Dim oAttributes = SearchLoader.LoadSearchAttributes(oSearch.Id)
Select Case oItem.TypeName
Case "VARCHAR"
LayoutItemSearchValue_Date.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never
LayoutItemSearchValue_Text.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always
TextEdit1.EditValue = String.Empty
Case "DATE"
LayoutItemSearchValue_Date.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always
LayoutItemSearchValue_Text.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never
ParameterRoot.Items.Clear()
Case Else
LayoutItemSearchValue_Date.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never
LayoutItemSearchValue_Text.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Always
BarStaticItem1.Caption = "oItem.TypeName=" + oItem.TypeName
For Each oAttribute In oAttributes
Dim oControl As Control
Select Case oAttribute.DataType
Case "DATE"
oControl = New DateEdit
Case Else
oControl = New TextEdit
End Select
Dim oItem As LayoutControlItem = ParameterRoot.AddItem()
oItem.Text = oAttribute.Caption
oItem.Control = oControl
oItem.TextLocation = Locations.Top
oItem.TextToControlDistance = 3
oItem.Padding = New DevExpress.XtraLayout.Utils.Padding(0, 0, 10, 0)
Next
End Select
End Sub
Private Sub TreeListResults_FocusedNodeChanged(sender As Object, e As DevExpress.XtraTreeList.FocusedNodeChangedEventArgs) Handles TreeListResults.FocusedNodeChanged
@ -296,98 +317,102 @@ Public Class frmMonitor
Exit Sub
End If
Dim oValues As Dictionary(Of String, String) = GetValuesFromNode(e.Node, DataColumns)
Try
Dim oValues As Dictionary(Of String, String) = GetValuesFromNode(e.Node, DataColumns)
Dim oSQLCommands = oValues.
Where(Function(v) v.Key.StartsWith("SELECT")).
Where(Function(v) v.Value IsNot Nothing).
ToDictionary(Function(v) v.Key, Function(v) v.Value)
Dim oSQLCommands = oValues.
Where(Function(v) v.Key.StartsWith("SELECT")).
Where(Function(v) v.Value IsNot Nothing).
ToDictionary(Function(v) v.Key, Function(v) v.Value)
Dim oFilePaths = oValues.
Where(Function(v) v.Key.StartsWith("DOCVIEW")).
Where(Function(v) v.Value IsNot Nothing).
ToDictionary(Function(v) v.Key, Function(v) v.Value)
Dim oFilePaths = oValues.
Where(Function(v) v.Key.StartsWith("DOCVIEW")).
Where(Function(v) v.Value IsNot Nothing).
ToDictionary(Function(v) v.Key, Function(v) v.Value)
Dim oHtmlDocuments = oValues.
Where(Function(v) v.Key.StartsWith("HTML")).
Where(Function(v) v.Value IsNot Nothing).
ToDictionary(Function(v) v.Key, Function(v) v.Value)
Dim oHtmlDocuments = oValues.
Where(Function(v) v.Key.StartsWith("HTML")).
Where(Function(v) v.Value IsNot Nothing).
ToDictionary(Function(v) v.Key, Function(v) v.Value)
Dim oAllTabs = SQLResultTabs.
Concat(FileResultTabs).
Concat(HtmlResultTabs)
For Each oTabPage In oAllTabs
oTabPage.PageVisible = False
Next
Dim oAllTabs = SQLResultTabs.
Concat(FileResultTabs).
Concat(HtmlResultTabs)
For Each oTabPage In oAllTabs
oTabPage.PageVisible = False
Next
SplitContainerControl3.Collapsed = oSQLCommands.Count = 0
SplitContainerControl2.Collapsed = (oFilePaths.Count + oHtmlDocuments.Count) = 0
SplitContainerControl3.Collapsed = True
SplitContainerControl2.Collapsed = True
For Each oSQLCommand As KeyValuePair(Of String, String) In oSQLCommands
Try
Dim oExtracted = ExtractTitle(oSQLCommand.Value)
Dim oCommand = oExtracted.Item1
Dim oTitle = oExtracted.Item2
For Each oSQLCommand As KeyValuePair(Of String, String) In oSQLCommands
Try
Dim oExtracted = ExtractTitle(oSQLCommand.Value)
Dim oCommand = oExtracted.Item1
Dim oTitle = oExtracted.Item2
Dim oTable As DataTable = Database.GetDatatable(oCommand)
Dim oTable As DataTable = Database.GetDatatable(oCommand)
If oTable Is Nothing Then
If oTable Is Nothing Then
Continue For
End If
Dim oGridIndex = Integer.Parse(oSQLCommand.Key.Last()) - 1
Dim oGridControl As GridControl = SQLResultGrids.Item(oGridIndex)
FillResultGrid(oGridControl, oTable, oTitle)
Catch ex As Exception
Logger.Error(ex)
Continue For
End If
End Try
Next
Dim oGridIndex = Integer.Parse(oSQLCommand.Key.Last()) - 1
Dim oGridControl As GridControl = SQLResultGrids.Item(oGridIndex)
For Each oFile As KeyValuePair(Of String, String) In oFilePaths
Try
Dim oExtracted = ExtractTitle(oFile.Value)
Dim oPath = oExtracted.Item1
Dim oTitle = oExtracted.Item2
FillResultGrid(oGridControl, oTable, oTitle)
Catch ex As Exception
Logger.Error(ex)
Continue For
End Try
Next
If oPath Is Nothing Then
Continue For
End If
For Each oFile As KeyValuePair(Of String, String) In oFilePaths
Try
Dim oExtracted = ExtractTitle(oFile.Value)
Dim oPath = oExtracted.Item1
Dim oTitle = oExtracted.Item2
If Not IO.File.Exists(oPath) Then
Continue For
End If
If oPath Is Nothing Then
Dim oViewerIndex = Integer.Parse(oFile.Key.Last()) - 1
Dim oViewer As DocumentViewer = FileResultViewers.Item(oViewerIndex)
FillResultViewer(oViewer, oPath, oTitle)
Catch ex As Exception
Logger.Error(ex)
Continue For
End If
End Try
Next
If Not IO.File.Exists(oPath) Then
For Each oFile As KeyValuePair(Of String, String) In oHtmlDocuments
Try
Dim oExtracted = ExtractTitle(oFile.Value)
Dim oHtml = oExtracted.Item1
Dim oTitle = oExtracted.Item2
If oHtml Is Nothing Then
Continue For
End If
Dim oViewerIndex = Integer.Parse(oFile.Key.Last()) - 1
Dim oViewer As RichEditControl = HtmlResultViewers.Item(oViewerIndex)
FillResultHtmlViewer(oViewer, oHtml, oTitle)
Catch ex As Exception
Logger.Error(ex)
Continue For
End If
Dim oViewerIndex = Integer.Parse(oFile.Key.Last()) - 1
Dim oViewer As DocumentViewer = FileResultViewers.Item(oViewerIndex)
FillResultViewer(oViewer, oPath, oTitle)
Catch ex As Exception
Logger.Error(ex)
Continue For
End Try
Next
For Each oFile As KeyValuePair(Of String, String) In oHtmlDocuments
Try
Dim oExtracted = ExtractTitle(oFile.Value)
Dim oHtml = oExtracted.Item1
Dim oTitle = oExtracted.Item2
If oHtml Is Nothing Then
Continue For
End If
Dim oViewerIndex = Integer.Parse(oFile.Key.Last()) - 1
Dim oViewer As RichEditControl = HtmlResultViewers.Item(oViewerIndex)
FillResultHtmlViewer(oViewer, oHtml, oTitle)
Catch ex As Exception
Logger.Error(ex)
Continue For
End Try
Next
End Try
Next
Catch ex As Exception
ShowErrorMessage(ex)
End Try
End Sub
Private Function ExtractTitle(Value As String) As Tuple(Of String, String)
@ -552,7 +577,7 @@ Public Class frmMonitor
Database = New MSSQLServer(LogConfig, oSQLConfig.ConnectionString)
LoadSearchKeys()
LoadSearches()
End If
End Sub
@ -573,14 +598,55 @@ Public Class frmMonitor
TreeListResults.ExportToXlsx(XtraSaveFileDialog1.FileName)
End If
End Sub
Private Sub frmMonitor_KeyUp(sender As Object, e As KeyEventArgs) Handles Me.KeyUp
If e.KeyCode = Keys.F5 Then
Debug.Write("Debug.Write")
Console.WriteLine("Console.WriteLine")
Debug.Print("Debug.Print")
LoadData()
End If
End Sub
Private Sub TreeListResults_MouseClick(sender As Object, e As MouseEventArgs) Handles TreeListResults.MouseClick
Dim oInfo As TreeListHitInfo = TreeListResults.CalcHitInfo(New Point(e.X, e.Y))
If oInfo.InRowCell Then
Dim oNode = oInfo.Node
Dim oValues As Dictionary(Of String, String) = GetValuesFromNode(oNode, DataColumns)
Console.WriteLine()
Dim oShouldToggleSQL = False
Dim oShouldToggleFile = False
For Each oValue As KeyValuePair(Of String, String) In oValues
If oValue.Key.Contains("SELECT") AndAlso oValue.Value IsNot Nothing Then
oShouldToggleSQL = True
Exit For
End If
Next
For Each oValue As KeyValuePair(Of String, String) In oValues
If oValue.Key.Contains("DOCVIEW") AndAlso oValue.Value IsNot Nothing Then
oShouldToggleFile = True
Exit For
End If
If oValue.Key.Contains("HTML") AndAlso oValue.Value IsNot Nothing Then
oShouldToggleFile = True
Exit For
End If
Next
If oShouldToggleSQL Then
SplitContainerControl3.Collapsed = Not SplitContainerControl3.Collapsed
End If
If oShouldToggleFile Then
SplitContainerControl2.Collapsed = Not SplitContainerControl2.Collapsed
End If
End If
End Sub
End Class
Friend Class SearchKey
Public Id As Integer
Public Title As String
Public TypeName As String
Public Overrides Function ToString() As String
Return Title
End Function
End Class