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

@@ -14,6 +14,9 @@ Imports DigitalData.Modules.Windows
Imports DigitalData.Modules.ZooFlow
Imports DigitalData.GUIs.Common.Base
Imports DigitalData.GUIs.Common
Imports DigitalData.Controls.SQLConfig
Imports DigitalData.Modules.Language
Imports DevExpress.LookAndFeel
Public Class frmFlowForm
#Region "Sidebar DllImport"
@@ -492,15 +495,10 @@ Public Class frmFlowForm
End Sub
Private Sub VerwaltungToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VerwaltungToolStripMenuItem.Click
Me.Cursor = Cursors.WaitCursor
Cursor = Cursors.WaitCursor
AdminForm = New frmAdmin_Start()
frmAdmin_Start.Show()
If TimerCheckActiveForms.Enabled = False Then
TimerCheckActiveForms.Enabled = True
End If
Me.Cursor = Cursors.Default
AdminForm.Show()
Cursor = Cursors.Default
End Sub
Private Sub frmFlowForm_DragEnter(sender As Object, e As DragEventArgs) Handles MyBase.DragEnter
@@ -559,7 +557,29 @@ Public Class frmFlowForm
End Function
Private Sub DatenbankverbindungToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DatenbankverbindungToolStripMenuItem.Click
frmConfigDatabase.ShowDialog()
Dim oForm As New frmSQLConfig(My.LogConfig) With {
.ConnectionString = My.SystemConfig.ConnectionString,
.FormTitle = "ECM Datenbank"
}
Dim oResult = oForm.ShowDialog()
If oResult = DialogResult.OK Then
My.SystemConfig.ConnectionString = oForm.ConnectionString
My.SystemConfigManager.Save()
End If
End Sub
Private Sub DatenbankverbindungToolStripMenuItem1_Click(sender As Object, e As EventArgs)
Dim oForm As New frmSQLConfig(My.LogConfig) With {
.ConnectionString = My.SystemConfig.ConnectionString,
.FormTitle = "ECM Datenbank"
}
Dim oResult = oForm.ShowDialog()
If oResult = DialogResult.OK Then
My.SystemConfig.ConnectionString = oForm.ConnectionString
My.SystemConfigManager.Save()
End If
End Sub
Private Sub NotifyIcon_DoubleClick(sender As Object, e As EventArgs) Handles NotifyIcon.DoubleClick
@@ -1075,29 +1095,20 @@ Public Class frmFlowForm
}
End Function).ToList()
'RaiseEvent ResultsRefreshed(Me, Nothing)
oThisForm.RefreshResults(oResults)
End If
End Sub
Private Sub PictureBoxPM1_Click(sender As Object, e As EventArgs) Handles PictureBoxPM1.Click
ToastNotificationsManager1.ShowNotification(ToastNotificationsManager1.Notifications(1))
End Sub
Private Sub TestToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TestToolStripMenuItem.Click
frmtest.Show()
End Sub
Private Sub BasisKonfigurationToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BasisKonfigurationToolStripMenuItem.Click
frmConfigBasic.ShowDialog()
Quicksearch1(True)
End Sub
Private Sub ShowErrorMessage(pEx As Exception)
Dim oCallingClass = LogConfig.GetClassFullName(IncludeMethodNames:=True, Parts:=2)
ErrorHandler.ShowErrorMessage(pEx, oCallingClass)
@@ -1111,35 +1122,35 @@ Public Class frmFlowForm
Else
Return $"Search For '{SearchContent}'"
End If
Else
Return String.Empty
End If
End Function
Sub RunQuickSearch1()
Async Function RunQuickSearch1(pSearchText As String) As Threading.Tasks.Task
Dim oHandle = SplashScreenManager.ShowOverlayForm(Me)
Try
Dim oSQL = $"EXEC PRIDB_SEARCH_TEXT_GET_RESULTS {My.Application.User.UserId},'{TextEdit1.Text}',''"
Dim oSQL = $"EXEC PRIDB_SEARCH_TEXT_GET_RESULTS {My.Application.User.UserId},'{pSearchText}',''"
Dim oParams = New DocumentResultList.Params() With {
.WindowGuid = "QuickFlowSearch1",
.WindowTitle = GetResultWindowString(TextEdit1.Text),
.OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow,
.ProfileGuid = 354521
}
.WindowGuid = "QuickFlowSearch1",
.WindowTitle = GetResultWindowString(pSearchText),
.OperationModeOverride = Modules.ZooFlow.Constants.OperationMode.ZooFlow,
.ProfileGuid = 354521
}
If Await My.Database.ExecuteNonQueryIDBAsync(oSQL) = True Then
Dim oDTDocResult = Await My.Database.GetDatatableIDBAsync(DocResultBaseSearch)
If My.DatabaseIDB.ExecuteNonQuery(oSQL) = True Then
Dim oDTDocResult = My.DatabaseIDB.GetDatatable(DocResultBaseSearch)
If oDTDocResult.Rows.Count > 0 Then
Logger.Debug($"Quicksearch1 got {oDTDocResult.Rows.Count} results")
oParams.Results.Add(New DocumentResultList.DocumentResult() With {
.Title = GetResultWindowString(TextEdit1.Text),
.Datatable = oDTDocResult})
.Title = GetResultWindowString(pSearchText),
.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
Dim oMessage As String
If My.Application.User.Language = "de-DE" Then
@@ -1148,64 +1159,76 @@ Public Class frmFlowForm
oMessage = "No results"
End If
NotifyIcon.ShowBalloonTip(20000, $"Info", oMessage, ToolTipIcon.Info)
End If
End If
Catch ex As Exception
Logger.Error(ex)
MsgBox("Unhandled exception in RunQuickSearch1: " & ex.Message, MsgBoxStyle.Critical)
Finally
SplashScreenManager.CloseOverlayForm(oHandle)
End Try
End Function
End Sub
Private Sub TextEdit1_KeyUp(sender As Object, e As KeyEventArgs) Handles TextEdit1.KeyUp
Private Async Sub TextEdit1_KeyUp(sender As Object, e As KeyEventArgs) Handles TextEdit1.KeyUp
If e.KeyCode = Keys.Return Then
CheckRunSearch1()
Await CheckRunSearch1()
End If
End Sub
Sub CheckRunSearch1()
If TextEdit1.Text <> String.Empty Then
If TextEdit1.Text = "porn" Then
NotifyIcon.ShowBalloonTip(20000, $"Info", "Think about Your search term an search again..", ToolTipIcon.Info)
Exit Sub
End If
RunQuickSearch1()
Async Function CheckRunSearch1() As Threading.Tasks.Task
Dim oSearchText = TextEdit1.Text
If oSearchText <> String.Empty Then
'If TextEdit1.Text = "porn" Then
' NotifyIcon.ShowBalloonTip(20000, $"Info", "Think about Your search term an search again..", ToolTipIcon.Info)
' Exit Sub
'End If
Await RunQuickSearch1(oSearchText)
End If
End Sub
Private Sub PictureEdit1_Click(sender As Object, e As EventArgs) Handles PictureEdit1.Click
End Function
Private Async Function PictureEdit1_Click(sender As Object, e As EventArgs) As Threading.Tasks.Task Handles PictureEdit1.Click
If TextEdit1.Text = String.Empty Then
Open_FlowSearch()
Exit Sub
Return
Else
Await CheckRunSearch1()
End If
CheckRunSearch1()
End Sub
End Function
Private Sub frmFlowForm_Shown(sender As Object, e As EventArgs) Handles Me.Shown
End Sub
Private Sub GrundeinstellungenToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GrundeinstellungenToolStripMenuItem.Click
frmConfigBasic.ShowDialog()
Quicksearch1(True)
End Sub
Private Sub DatenbankverbindungToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles DatenbankverbindungToolStripMenuItem1.Click
frmConfigDatabase.ShowDialog()
End Sub
Private Sub NeustartZooflowToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles NeustartZooflowToolStripMenuItem.Click
Application.Restart()
End Sub
Private Sub ZooflowBeendenToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles ZooflowBeendenToolStripMenuItem1.Click
Private Sub buttonExitZooflow_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles buttonExitZooflow.ItemClick
ExitZooflow()
End Sub
Private Sub AppServiceToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AppServiceToolStripMenuItem.Click
Private Sub BarButtonItem1_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem1.ItemClick
Application.Restart()
End Sub
Private Sub BarButtonItem6_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem6.ItemClick
frmServiceConfig.ShowDialog()
End Sub
Private Sub BarButtonItem7_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem7.ItemClick
Dim oForm As New frmSQLConfig(My.LogConfig) With {
.ConnectionString = My.SystemConfig.ConnectionString,
.FormTitle = "ECM Datenbank"
}
Dim oResult = oForm.ShowDialog()
If oResult = DialogResult.OK Then
My.SystemConfig.ConnectionString = oForm.ConnectionString
My.SystemConfigManager.Save()
End If
End Sub
Private Sub BarButtonItem8_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles BarButtonItem8.ItemClick
frmConfigBasic.ShowDialog()
Quicksearch1(True)
End Sub
End Class