load searches only for clicked profile, acutally filter profiles by search results
This commit is contained in:
@@ -23,13 +23,14 @@ Public Class ProfileSearches
|
||||
_Params = Params
|
||||
End Sub
|
||||
|
||||
Public Async Function LoadDocumentSearchesAsync() As Task(Of List(Of Search))
|
||||
Return Await Task.Run(AddressOf DoLoadDocumentSearches)
|
||||
Public Async Function LoadDocumentSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search))
|
||||
Return Await Task.Run(Function()
|
||||
Return DoLoadDocumentSearches(ProfileId)
|
||||
End Function)
|
||||
End Function
|
||||
|
||||
Private Function DoLoadDocumentSearches() As List(Of Search)
|
||||
Dim oMatchingIds = String.Join(",", _Params.MatchingProfiles.Select(Function(p) p.Guid).ToArray())
|
||||
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID in ({oMatchingIds}) ORDER BY TAB_INDEX"
|
||||
Private Function DoLoadDocumentSearches(ProfileId As Integer) As List(Of Search)
|
||||
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DOC_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX"
|
||||
Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
|
||||
Dim oDocSearches As New List(Of Search)
|
||||
Dim oCounter As Integer = 0
|
||||
@@ -62,16 +63,17 @@ Public Class ProfileSearches
|
||||
Return oDocSearches
|
||||
End Function
|
||||
|
||||
Public Async Function LoadDataSearchesAsync() As Task(Of List(Of Search))
|
||||
Return Await Task.Run(AddressOf DoLoadDataSearches)
|
||||
Public Async Function LoadDataSearchesAsync(ProfileId As Integer) As Task(Of List(Of Search))
|
||||
Return Await Task.Run(Function()
|
||||
Return DoLoadDataSearches(ProfileId)
|
||||
End Function)
|
||||
End Function
|
||||
|
||||
Private Function DoLoadDataSearches() As List(Of Search)
|
||||
Private Function DoLoadDataSearches(ProfileId As Integer) As List(Of Search)
|
||||
Dim oDataSearches As New List(Of Search)
|
||||
|
||||
Try
|
||||
Dim oMatchingIds = String.Join(",", _Params.MatchingProfiles.Select(Function(p) p.Guid).ToArray())
|
||||
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID in ({oMatchingIds}) ORDER BY TAB_INDEX"
|
||||
Dim oSQL As String = $"SELECT * FROM TBCW_PROF_DATA_SEARCH WHERE ACTIVE = 1 AND PROFILE_ID = {ProfileId} ORDER BY TAB_INDEX"
|
||||
Dim oSearchesDataTable = _Environment.Database.GetDatatable(oSQL)
|
||||
|
||||
Dim oCounter As Integer = 0
|
||||
|
||||
Reference in New Issue
Block a user