Add Text icon, fix EXPANDED setting, fix result count label visibility, add search time label
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
Imports System.ComponentModel
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports DevExpress.Utils
|
||||
Imports DevExpress.XtraEditors
|
||||
Imports DevExpress.XtraEditors.Controls
|
||||
Imports DevExpress.XtraEditors.Repository
|
||||
Imports DevExpress.XtraGrid
|
||||
Imports DevExpress.XtraGrid.Columns
|
||||
Imports DevExpress.XtraGrid.Views.Grid
|
||||
@@ -13,7 +9,6 @@ Imports DevExpress.XtraTreeList
|
||||
Imports DevExpress.XtraTreeList.Columns
|
||||
Imports DevExpress.XtraTreeList.Nodes
|
||||
Imports DigitalData.Controls.DocumentViewer
|
||||
Imports DigitalData.Controls.SQLConfig
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.GUIs.Monitor.Constants
|
||||
Imports DigitalData.Modules.Config
|
||||
@@ -173,6 +168,7 @@ Public Class frmMonitor
|
||||
Return Database.GetScalarValue(oSQL)
|
||||
End Function
|
||||
|
||||
|
||||
Private Async Sub buttonSearch_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles buttonSearch.ItemClick
|
||||
Await LoadData()
|
||||
End Sub
|
||||
@@ -203,6 +199,7 @@ Public Class frmMonitor
|
||||
Dim oControls As List(Of Control) = LayoutControl1.Controls.Cast(Of Control).ToList()
|
||||
Dim oSQL = Patterns.ReplaceControlValues(oSearch.SQLCommand, oControls)
|
||||
Dim oTable As DataTable = Await Database.GetDatatableAsync(oSQL)
|
||||
Dim oStartTime = Now
|
||||
|
||||
If oSearch.ReturnType = Constants.ReturnTypeEnum.TreeView Then
|
||||
GridControlResults.Visible = False
|
||||
@@ -213,6 +210,8 @@ Public Class frmMonitor
|
||||
|
||||
TreeListResults.DataSource = oTable
|
||||
|
||||
lbResultCount.Visibility = DevExpress.XtraBars.BarItemVisibility.Never
|
||||
|
||||
Dim oMaxLength = 0
|
||||
For Each oRow As DataRow In oTable.Rows
|
||||
Dim oProcess = oRow.Item("COLUMN1")
|
||||
@@ -240,12 +239,7 @@ Public Class frmMonitor
|
||||
Next
|
||||
|
||||
For Each oNode As TreeListNode In TreeListResults.Nodes
|
||||
Try
|
||||
Dim oExpanded As TristateBoolean = Utils.NotNull(oNode.Item("EXPANDED"), TristateBoolean.Indeterminate)
|
||||
ExpandCollapseNode(oNode, oExpanded)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
SetExpandedForChildNodes(oNode)
|
||||
Next
|
||||
|
||||
SetResultCount(TreeListResults.AllNodesCount)
|
||||
@@ -262,6 +256,8 @@ Public Class frmMonitor
|
||||
GridViewResults.PopulateColumns()
|
||||
GridBuilder.SetDateTimeColumns(GridViewResults)
|
||||
|
||||
lbResultCount.Visibility = DevExpress.XtraBars.BarItemVisibility.Always
|
||||
|
||||
For Each oColumn As GridColumn In GridViewResults.Columns
|
||||
If oColumn.ColumnType = GetType(Integer) Then
|
||||
oColumn.AppearanceCell.TextOptions.HAlignment = HorzAlignment.Center
|
||||
@@ -290,6 +286,9 @@ Public Class frmMonitor
|
||||
|
||||
btnExportMain.Enabled = True
|
||||
|
||||
Dim oTotalTime = Now.Subtract(oStartTime)
|
||||
lbSearchTime.Caption = oTotalTime.ToString("mm':'ss")
|
||||
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
FormHelper.ShowErrorMessage(ex, "LoadData")
|
||||
@@ -299,6 +298,23 @@ Public Class frmMonitor
|
||||
End Try
|
||||
End Function
|
||||
|
||||
Private Sub SetExpandedForChildNodes(pRootNode As TreeListNode, Optional pDepth As Integer = 0)
|
||||
If pDepth > 10 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
For Each oNode As TreeListNode In pRootNode.Nodes
|
||||
Try
|
||||
Dim oExpanded As TristateBoolean = NotNull(oNode.Item("EXPANDED"), TristateBoolean.Indeterminate)
|
||||
ExpandCollapseNode(oNode, oExpanded)
|
||||
|
||||
SetExpandedForChildNodes(oNode, pDepth + 1)
|
||||
Catch ex As Exception
|
||||
Logger.Error(ex)
|
||||
End Try
|
||||
Next
|
||||
End Sub
|
||||
|
||||
Private Sub LoadSearches()
|
||||
Try
|
||||
SearchLoader.LoadSearchParameters()
|
||||
|
||||
Reference in New Issue
Block a user