ZUGFeRDService: Integrate with Config Module, Remove My.Settings
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
Imports System.IO
|
||||
Imports System.Timers
|
||||
Imports System.Xml.XPath
|
||||
Imports DigitalData.Modules.Config
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Jobs
|
||||
@@ -13,6 +14,7 @@ Public Class ThreadRunner
|
||||
Private WithEvents _workerThread As BackgroundWorker
|
||||
Private WithEvents _workerTimer As Timer
|
||||
|
||||
Private _config As Config
|
||||
Private _logConfig As LogConfig
|
||||
Private _logger As Logger
|
||||
Private _firebird As Firebird
|
||||
@@ -25,11 +27,11 @@ Public Class ThreadRunner
|
||||
Private _jobArguments As WorkerArgs
|
||||
Private _mssql As MSSQLServer
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
|
||||
Public Sub New(LogConfig As LogConfig, Config As ConfigManager(Of Config), Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
|
||||
_logConfig = LogConfig
|
||||
_logger = _logConfig.GetLogger()
|
||||
_logConfig.Debug = My.Settings.DEBUG
|
||||
_firebird = Firebird
|
||||
_config = Config
|
||||
_mssql = MSSQL
|
||||
Try
|
||||
Dim directory As New IO.DirectoryInfo(_logConfig.LogDirectory)
|
||||
@@ -138,7 +140,7 @@ Public Class ThreadRunner
|
||||
Dim args As WorkerArgs = e.Argument
|
||||
_logger.Debug("Background worker running..")
|
||||
|
||||
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, My.Settings.MSSQLEmailOutAccountID, _mssql)
|
||||
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, _config.MSSQLEmailOutAccountID, _mssql)
|
||||
job.Start(args)
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Background worker failed!")
|
||||
|
||||
Reference in New Issue
Block a user