Add MSSQL Functions to ZUGFeRD Service
This commit is contained in:
@@ -22,18 +22,27 @@ Public Class ThreadRunner
|
||||
Private _originalEmailDirectory As String
|
||||
Private _zugferd As ZUGFeRDInterface
|
||||
Private _jobArguments As WorkerArgs
|
||||
Private _mssql As MSSQLServer
|
||||
|
||||
Private Const TIMER_INTERVAL_MS = 10_000
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Firebird)
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Firebird, Optional MSSQL As MSSQLServer = Nothing)
|
||||
_logConfig = LogConfig
|
||||
_logger = _logConfig.GetLogger()
|
||||
_firebird = Firebird
|
||||
_zugferd = New ZUGFeRDInterface(_logConfig)
|
||||
_mssql = MSSQL
|
||||
|
||||
Dim args As New WorkerArgs()
|
||||
args = LoadFolderConfig(args)
|
||||
args = LoadPropertyMapFor(args, "DEFAULT")
|
||||
|
||||
' Use MSSQL Server if available
|
||||
If _mssql IsNot Nothing Then
|
||||
_logger.Debug("Data will be inserted into MSSQL Server.")
|
||||
args.InsertIntoSQLServer = True
|
||||
End If
|
||||
|
||||
_jobArguments = args
|
||||
|
||||
_logger.Debug("Checking SuccessDirectory {0}", args.SuccessDirectory)
|
||||
@@ -104,7 +113,7 @@ Public Class ThreadRunner
|
||||
|
||||
_logger.Debug("Background worker running..")
|
||||
|
||||
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird)
|
||||
Dim job As New ImportZUGFeRDFiles(_logConfig, _firebird, _mssql)
|
||||
job.Start(args)
|
||||
Catch ex As Exception
|
||||
_logger.Warn("Background worker failed!")
|
||||
|
||||
Reference in New Issue
Block a user