Add configuration to autoload data on form open

This commit is contained in:
Jonathan Jenne 2022-07-04 09:10:38 +02:00
parent a0217d0582
commit f0a340f742
3 changed files with 8 additions and 1 deletions

View File

@ -6,4 +6,5 @@ Public Class Config
Public Property LastUsedMandator As String = ""
Public Property Debug As Boolean = False
Public Property AutomaticPriceCalculation As Boolean = True
Public Property AutomaticLoadingOnFormOpen As Boolean = False
End Class

View File

@ -90,6 +90,10 @@ Public Class frmExportMain
Where(Function(mandator) mandator.Id = ConfigManager.Config.LastUsedMandator).
FirstOrDefault()
End If
If ConfigManager.Config.AutomaticLoadingOnFormOpen = True Then
SearchDocuments()
End If
Catch ex As Exception
FormHelper.ShowError(ex, "Initialisierung der Form")
End Try

View File

@ -118,7 +118,9 @@ Public Class frmImportMain
btnLoadFiles.Enabled = True
End Try
Await LoadFiles()
If ConfigManager.Config.AutomaticLoadingOnFormOpen = True Then
Await LoadFiles()
End If
End Sub
Private Sub frmImportMain_FormClosing(sender As Object, e As FormClosingEventArgs) Handles Me.FormClosing