Allow delete of config, add F5 for loading data in windows

This commit is contained in:
Jonathan Jenne
2022-01-28 12:05:41 +01:00
parent 6d6dd725d9
commit 5a8440ff05
18 changed files with 316 additions and 166 deletions

View File

@@ -223,37 +223,13 @@ Public Class frmImportMain
End Sub
Private Sub btnLoadFiles_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnLoadFiles.ItemClick
Try
SplashScreenManager.ShowWaitForm()
SetDocumentButtonsEnabled(False)
GridControlFiles.Enabled = False
btnLoadFiles.Enabled = False
SplitContainerGrids.Enabled = False
LoadFiles()
End Sub
AddHandler DocumentLoader.FileLoadComplete, Sub(_sender As Object, _e As Documents.DocumentLoader.FileLoadInfo)
Dim oMessage = String.Format("Lade Dateien ({0}/{1})", _e.FilesLoaded, _e.FilesTotal)
SplashScreenManager.SetWaitFormDescription(oMessage)
End Sub
If DocumentLoader.LoadFiles(CurrentTemplate, lookupMandator.EditValue) Then
GridControlFiles.DataSource = Nothing
GridControlFiles.DataSource = DocumentLoader.Files
txtFilesLoaded.Caption = String.Format(My.Resources.frmImportMainExtra._0__Dateien_geladen, DocumentLoader.Files.Count)
End If
Catch ex As NoMandatorException
MsgBox(My.Resources.frmImportMainExtra.Es_konnte_kein_passender_Mandant_ermittelt_werden, MsgBoxStyle.Information, Text)
Catch ex As Exception
FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Laden_der_Dokumente)
Finally
SplitContainerGrids.Enabled = True
btnLoadFiles.Enabled = True
GridControlFiles.Enabled = True
SetDocumentButtonsEnabled(True)
SplashScreenManager.CloseWaitForm()
End Try
Private Sub frmImportMain_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.F5 Then
LoadFiles()
End If
End Sub
Private Sub btnReloadFile_ItemClick(sender As Object, e As DevExpress.XtraBars.ItemClickEventArgs) Handles btnReloadFile.ItemClick
@@ -633,4 +609,38 @@ Public Class frmImportMain
' Export it to pdf
oReport.ExportToPdf(oFilePath)
End Sub
Private Sub LoadFiles()
Try
SplashScreenManager.ShowWaitForm()
SetDocumentButtonsEnabled(False)
GridControlFiles.Enabled = False
btnLoadFiles.Enabled = False
SplitContainerGrids.Enabled = False
AddHandler DocumentLoader.FileLoadComplete, Sub(_sender As Object, _e As Documents.DocumentLoader.FileLoadInfo)
Dim oMessage = String.Format("Lade Dateien ({0}/{1})", _e.FilesLoaded, _e.FilesTotal)
SplashScreenManager.SetWaitFormDescription(oMessage)
End Sub
If DocumentLoader.LoadFiles(CurrentTemplate, lookupMandator.EditValue) Then
GridControlFiles.DataSource = Nothing
GridControlFiles.DataSource = DocumentLoader.Files
txtFilesLoaded.Caption = String.Format(My.Resources.frmImportMainExtra._0__Dateien_geladen, DocumentLoader.Files.Count)
End If
Catch ex As NoMandatorException
MsgBox(My.Resources.frmImportMainExtra.Es_konnte_kein_passender_Mandant_ermittelt_werden, MsgBoxStyle.Information, Text)
Catch ex As Exception
FormHelper.ShowError(ex, My.Resources.frmImportMainExtra.Laden_der_Dokumente)
Finally
SplitContainerGrids.Enabled = True
btnLoadFiles.Enabled = True
GridControlFiles.Enabled = True
SetDocumentButtonsEnabled(True)
SplashScreenManager.CloseWaitForm()
End Try
End Sub
End Class