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 LastUsedMandator As String = ""
Public Property Debug As Boolean = False Public Property Debug As Boolean = False
Public Property AutomaticPriceCalculation As Boolean = True Public Property AutomaticPriceCalculation As Boolean = True
Public Property AutomaticLoadingOnFormOpen As Boolean = False
End Class End Class

View File

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

View File

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