frmDocumentResultList
This commit is contained in:
@@ -8,6 +8,7 @@ Public Class ProfileSearches
|
||||
Private _Params As ClipboardWatcherParams
|
||||
|
||||
Public Class Search
|
||||
Public Guid As Integer
|
||||
Public DataTable As DataTable
|
||||
Public TabIndex As Integer
|
||||
Public TabCaption As String
|
||||
@@ -38,6 +39,7 @@ Public Class ProfileSearches
|
||||
Dim oProfileId As Integer = oRow.Item("PROFILE_ID")
|
||||
Dim oTabTitle As String = oRow.Item("TAB_TITLE")
|
||||
Dim oConnectionId As Integer = oRow.Item("CONN_ID")
|
||||
Dim oGuid As Integer = oRow.Item("GUID")
|
||||
|
||||
oSQL = oRow.Item("SQL_COMMAND")
|
||||
oSQL = oPatterns.ReplaceUserValues(oSQL, _Environment.User)
|
||||
@@ -46,6 +48,7 @@ Public Class ProfileSearches
|
||||
|
||||
Dim oDatatable As DataTable = _Environment.Database.GetDatatable(oSQL, oConnectionId)
|
||||
oDocSearches.Add(New Search() With {
|
||||
.Guid = oGuid,
|
||||
.DataTable = oDatatable,
|
||||
.ProfileId = oProfileId,
|
||||
.TabCaption = oTabTitle,
|
||||
|
||||
@@ -4,6 +4,7 @@ Imports DevExpress.XtraEditors
|
||||
Imports DigitalData.GUIs.Common
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Windows
|
||||
Imports DigitalData.Modules.Language
|
||||
Imports DigitalData.Modules.ZooFlow
|
||||
Imports DigitalData.Modules.ZooFlow.Params
|
||||
|
||||
@@ -182,6 +183,10 @@ Public Class frmMatch
|
||||
Dim oProfileId As Integer = oItem.Tag
|
||||
|
||||
Dim oProfileSearch As New ProfileSearches(_LogConfig, _Environment, _Params)
|
||||
Dim oProfile As ProfileData = _Params.MatchingProfiles.
|
||||
Where(Function(p) p.Guid = oProfileId).
|
||||
ToList().
|
||||
First()
|
||||
|
||||
Select Case oItem.Group.Name
|
||||
Case TileGroupData.Name
|
||||
@@ -189,7 +194,7 @@ Public Class frmMatch
|
||||
|
||||
Case TileGroupDocuments.Name
|
||||
Dim oSearches = Await oProfileSearch.LoadDocumentSearchesAsync()
|
||||
OpenDocumentResults(oProfileId, oSearches)
|
||||
OpenDocumentResults(oProfile, oSearches)
|
||||
|
||||
Case Else
|
||||
'OpenResultForms(oProfileId, ProfileType.ANY)
|
||||
@@ -198,12 +203,18 @@ Public Class frmMatch
|
||||
Hide()
|
||||
End Sub
|
||||
|
||||
Private Sub OpenDocumentResults(ProfileId As Integer, Searches As List(Of ProfileSearches.Search))
|
||||
Dim oParams = New ResultListParams()
|
||||
Private Sub OpenDocumentResults(Profile As ProfileData, Searches As List(Of ProfileSearches.Search))
|
||||
Dim oNameSlug = Language.Utils.ConvertTextToSlug(Profile.Name)
|
||||
Dim oSearchGuids = Searches.Select(Function(s) s.Guid).ToArray
|
||||
Dim oWindowGuid = $"{Profile.Guid}-{oNameSlug}-{String.Join("-", oSearchGuids)}"
|
||||
Dim oParams = New ResultListParams() With {
|
||||
.WindowGuid = oWindowGuid
|
||||
}
|
||||
|
||||
For Each oSearch In Searches
|
||||
oParams.Results.Add(New DocumentResult() With {
|
||||
.Datatable = oSearch.DataTable
|
||||
.Title = oSearch.TabCaption,
|
||||
.Datatable = oSearch.DataTable
|
||||
})
|
||||
Next
|
||||
|
||||
|
||||
Reference in New Issue
Block a user