Improve Search, clean up

This commit is contained in:
Jonathan Jenne
2022-04-28 15:02:31 +02:00
parent ee90c3c96c
commit a15259166d
41 changed files with 277 additions and 2988 deletions

View File

@@ -165,6 +165,7 @@ Public Class frmFlowForm
Private FileEx As Filesystem.File
Private ErrorHandler As BaseErrorHandler
Private Modules As ClassModules
Private Search As SearchRunner
' Globix Helper Classes
Private FileDropNew As FileDrop
@@ -233,6 +234,9 @@ Public Class frmFlowForm
ErrorHandler = New BaseErrorHandler(My.LogConfig, Logger, Me)
Modules = New ClassModules(My.LogConfig, My.SystemConfig)
FileEx = New Filesystem.File(My.LogConfig)
Search = New SearchRunner(My.LogConfig, Environment, "FlowSearch")
Search.BaseSearchSQL = DocResultBaseSearch
' === Initialize Theming ===
If My.Application.Palette = "" Then
UserLookAndFeel.Default.SetSkinStyle(My.Application.Skin)
@@ -1182,12 +1186,12 @@ Public Class frmFlowForm
Private Async Sub TextEdit1_KeyUp(sender As Object, e As KeyEventArgs) Handles txtQuicksearch1.KeyUp
If e.KeyCode = Keys.Return Then
Await CheckRunSearch1()
Await CheckQuickSearch1()
End If
End Sub
Async Function CheckRunSearch1() As Threading.Tasks.Task
Private Async Function CheckQuickSearch1() As Threading.Tasks.Task
Dim oSearchText = txtQuicksearch1.Text
If oSearchText <> String.Empty Then
@@ -1195,7 +1199,10 @@ Public Class frmFlowForm
Dim oToken = RunningTaskTokenSource.Token
Try
Await RunQuickSearch1(oSearchText)
Dim oResult = Await Search.Run(oSearchText)
If oResult.OK = False Then
NotifyIcon.ShowBalloonTip(5_000, "Info", oResult.ErrorMessage, ToolTipIcon.Info)
End If
Catch ex As Exception
ShowErrorMessage(ex)
@@ -1256,7 +1263,7 @@ Public Class frmFlowForm
End Sub
Private Async Sub PictureEditQuicksearch1_Click(sender As Object, e As EventArgs) Handles PictureEditQuicksearch1.Click
Await CheckRunSearch1()
Await CheckQuickSearch1()
End Sub
Private Sub bbtnitmAusblenden_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles bbtnitmAusblenden.ItemClick
@@ -1275,38 +1282,43 @@ Public Class frmFlowForm
oForm.Show()
End Sub
Private Sub PictureEditQuicksearch1_EditValueChanged(sender As Object, e As EventArgs) Handles PictureEditQuicksearch1.EditValueChanged
End Sub
Private Sub AdvBandedGridView1_DoubleClick(sender As Object, e As EventArgs) Handles RecentFilesView.DoubleClick
If RecentFilesView.FocusedRowHandle >= 0 Then
Dim oFile As DataRowView = RecentFilesView.GetRow(RecentFilesView.FocusedRowHandle)
Dim oRow As DataRow = oFile.Row
Dim oObjectId As Long = oRow.Item("DocId")
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
Try
Dim oFile As DataRowView = RecentFilesView.GetRow(RecentFilesView.FocusedRowHandle)
Dim oRow As DataRow = oFile.Row
Dim oObjectId As Long = oRow.Item("DocId")
Dim oDataSource As DataTable = GridControl1.DataSource
Dim oResult = oDataSource.AsEnumerable().
Where(Function(row) row.Item("DocId") = oObjectId).
CopyToDataTable()
Dim oDataSource As DataTable = GridControl1.DataSource
Dim oResult = oDataSource.AsEnumerable().
Where(Function(row) row.Item("DocId") = oObjectId).
CopyToDataTable()
Dim oParams = New DocumentResultList.Params() With {
.WindowGuid = "SingleDocument",
.WindowTitle = "Einzelnes Dokument",
.OperationModeOverride = DigitalData.Modules.ZooFlow.Constants.OperationMode.ZooFlow,
.ProfileGuid = 354521,
.ShowBackNavigation = False,
.ShowFileList = False,
.Results = New List(Of DocumentResultList.DocumentResult) From {
New DocumentResultList.DocumentResult() With {
.Title = "Einzelnes Dokument",
.Datatable = oResult
}
}
}
Search.Run(oResult, "Suche")
Dim oForm As New frmDocumentResultList(My.LogConfig, Environment, oParams)
oForm.Show()
'Dim oParams = New DocumentResultList.Params() With {
' .WindowGuid = "SingleDocument",
' .WindowTitle = "Einzelnes Dokument",
' .OperationModeOverride = DigitalData.Modules.ZooFlow.Constants.OperationMode.ZooFlow,
' .ProfileGuid = 354521,
' .ShowBackNavigation = False,
' .ShowFileList = False,
' .Results = New List(Of DocumentResultList.DocumentResult) From {
' New DocumentResultList.DocumentResult() With {
' .Title = "Einzelnes Dokument",
' .Datatable = oResult
' }
' }
'}
'Dim oForm As New frmDocumentResultList(My.LogConfig, Environment, oParams)
'oForm.Show()
Catch ex As Exception
ErrorHandler.ShowErrorMessage(ex, "Laden eines Dokuments")
Finally
SplashScreenManager.CloseOverlayForm(oHandle)
End Try
End If
End Sub
End Class