Zooflow: Replace old Usermenu, waiting overlay for search and globix

This commit is contained in:
Jonathan Jenne
2022-02-21 16:41:11 +01:00
parent 77597f0ef2
commit 227bd7cf1b
25 changed files with 685 additions and 586 deletions

View File

@@ -1,11 +1,11 @@
Imports DevExpress.XtraEditors
Imports DevExpress.XtraSplashScreen
Imports DigitalData.GUIs.Common
Imports DigitalData.GUIs.ZooFlow.ClassConstants
Imports DigitalData.Modules.Logging
Imports DigitalData.Modules.ZooFlow
Public Class frmFlowSearch1
Private _Params As ClipboardWatcherParams
Private _Environment As Environment
Private Logger As Logger
@@ -222,24 +222,27 @@ Public Class frmFlowSearch1
End Sub
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
Search_GO()
End Sub
Private Sub Search_GO()
Dim owTITLE
Private Async Function BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) As Threading.Tasks.Task Handles BarButtonItem1.ItemClick
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
Try
Await Search_GO()
Catch ex As Exception
Logger.Error(ex)
Finally
SplashScreenManager.CloseOverlayForm(oHandle)
End Try
End Function
Private Async Function Search_GO() As Threading.Tasks.Task
Dim oWindowTitle
Dim oSearchTerm = txtSearchInput.Text
If My.Application.User.Language = "de-DE" Then
owTITLE = $"Suche nach ""{oSearchTerm}"""
End If
_Params = New ClipboardWatcherParams()
_Params.ClipboardContents = oSearchTerm
Dim oParams = New DocumentResultList.Params() With {
.WindowGuid = "FlowSearch",
.WindowTitle = GetResultWindowString(oSearchTerm),
.OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow,
.ProfileGuid = 354522
}
}
Dim oP3 = $"{SEARCH_FACT_DATE_ATTRIBUTE}~{SEARCH_PARAM3}"
If ExplizitDate Then
@@ -250,44 +253,38 @@ Public Class frmFlowSearch1
oDate2 = CDate(DateEditFrom.EditValue)
End If
Dim oProc = $"EXEC PRIDB_SEARCH_ADD_USR_DATE {My.Application.User.UserId},'{CDate(DateEditFrom.EditValue)}','{oDate2}'"
If My.DatabaseIDB.ExecuteNonQuery(oProc) = True Then
If Await My.Database.ExecuteNonQueryIDBAsync(oProc) = True Then
oP3 = $"{SEARCH_FACT_DATE_ATTRIBUTE}~DATEPART"
End If
End If
Dim oSQL = $"EXEC PRIDB_SEARCH_TEXT_GET_RESULTS {My.Application.User.UserId},'{oSearchTerm}','{oP3}'"
If My.DatabaseIDB.ExecuteNonQuery(oSQL) = True Then
Dim oDTDocResult = My.DatabaseIDB.GetDatatable(oBASESEARCH)
Dim oSQL = $"EXEC PRIDB_SEARCH_TEXT_GET_RESULTS {My.Application.User.UserId},'{oSearchTerm}','{oP3}'"
If Await My.Database.ExecuteNonQueryIDBAsync(oSQL) = True Then
Dim oDTDocResult = Await My.Database.GetDatatableIDBAsync(oBASESEARCH)
If oDTDocResult.Rows.Count > 0 Then
oParams.Results.Add(New DocumentResultList.DocumentResult() With {
.Title = "FlowSearchXYZ",
.Datatable = oDTDocResult})
.Title = "FlowSearchXYZ",
.Datatable = oDTDocResult
})
Dim oForm As New frmDocumentResultList(My.LogConfig, _Environment, oParams)
'AddHandler oForm.FormClosed, AddressOf ProfileResultForm_Closed
'AddHandler oForm.NeedsRefresh, AddressOf ProfileResultForm_NeedsRefresh
'OpenForms.Add(oForm)
oForm.Show()
Else
bsiStatus.Caption = "No Results"
End If
Else
bsiStatus.Caption = "Error oin FlowSearch - Check Your log"
bsiStatus.Caption = "Error in FlowSearch - Check Your log"
End If
'
End Function
End Sub
Private Sub txtSearchInput_KeyUp(sender As Object, e As KeyEventArgs) Handles txtSearchInput.KeyUp
Private Async Function txtSearchInput_KeyUp(sender As Object, e As KeyEventArgs) As Threading.Tasks.Task Handles txtSearchInput.KeyUp
If e.KeyCode = Keys.Return Then
If txtSearchInput.Text = String.Empty Then
Exit Sub
Return
End If
Search_GO()
Await Search_GO()
End If
End Sub
End Function
Private Function GetResultWindowString(SearchContent As String) As String
If SearchContent <> String.Empty Then
If My.Application.User.Language = State.UserState.LANG_DE_DE Then
@@ -308,7 +305,7 @@ Public Class frmFlowSearch1
End Function
Private Sub BarButtonItem2_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem2.ItemClick
Me.txtSearchInput.Text = ""
txtSearchInput.Text = ""
ResetTogglesDate()
ToggleSwitchDateto.IsOn = False
ExplizitDate = False