MS Push2JJ

This commit is contained in:
2019-12-05 10:52:25 +01:00
parent a4fd234c98
commit 86bfebfeb0
25 changed files with 1057 additions and 33 deletions

View File

@@ -10,7 +10,7 @@ Public Class MyComService
Private _firebird As Firebird
Private _MSSQL As MSSQLServer
Private _Email As Email
Private _EmailAlt As clsEmail
'Private _EmailAlt As clsEmail
Public Shared threadEmailQueue As BackgroundWorker
Protected Overrides Sub OnStart(ByVal args() As String)
' Code zum Starten des Dienstes hier einfügen. Diese Methode sollte Vorgänge
@@ -28,7 +28,7 @@ Public Class MyComService
_firebird = New Firebird(MyLoConfig, My.Settings.FB_ConnString, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW)
End If
_Email = New Email(MyLoConfig)
_EmailAlt = New clsEmail(MyLoConfig)
'_EmailAlt = New clsEmail(MyLoConfig)
If My.Settings.SQLSERVER_CS <> String.Empty Then
_MSSQL = New MSSQLServer(MyLoConfig, My.Settings.SQLSERVER_CS)
End If
@@ -82,6 +82,9 @@ Public Class MyComService
Else
MyLoConfig.Debug = False
End If
If threadEmailQueue.IsBusy Then
Exit Sub
End If
_Email = New Email(MyLoConfig)
If My.Settings.FB_ConnString <> String.Empty Then
_firebird = New Firebird(MyLoConfig, My.Settings.FB_ConnString, My.Settings.FB_DATABASE, My.Settings.FB_USER, My.Settings.FB_PW)
@@ -190,11 +193,11 @@ Public Class MyComService
'End If
Dim oSendResult As Boolean = False
oSendResult = _EmailAlt.Email_Send_Independentsoft(oSubject, oBody, oEmailTo, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, oAttachment)
If oSendResult = False Then
oSendResult = _Email.NewEmail(oEmailTo, oSubject, oBody, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, "DDEDMI_ComService", oAttachment.ToString)
' oSendResult = _EmailAlt.Email_Send_Independentsoft(oSubject, oBody, oEmailTo, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, oAttachment)
' If oSendResult = False Then
oSendResult = _Email.NewEmail(oEmailTo, oSubject, oBody, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, "DDEDMI_ComService", oAttachment.ToString)
End If
' End If
If oSendResult = True Then
Dim upd = $"UPDATE TBEDM_EMAIL_QUEUE SET EMAIL_SENT = CURRENT_TIMESTAMP,COMMENT = '{oComment}' WHERE GUID = {oGUID}"
If upd.Contains(",COMMENT = ''") Then
@@ -303,10 +306,10 @@ Public Class MyComService
End Try
Dim oSendResult As Boolean = False
oSendResult = _EmailAlt.Email_Send_Independentsoft(oSubject, oBody, oEmailTo, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, oAttachment)
If oSendResult = False Then
oSendResult = _Email.NewEmail(oEmailTo, oSubject, oBody, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, "DDEDMI_ComService", oAttachment.ToString)
End If
'oSendResult = _EmailAlt.Email_Send_Independentsoft(oSubject, oBody, oEmailTo, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, oAttachment)
'If oSendResult = False Then
oSendResult = _Email.NewEmail(oEmailTo, oSubject, oBody, oMailFrom, oMailSMTP, oMailport, oMailUser, oMailPW, oAuthType, "DDEDMI_ComService", oAttachment.ToString)
' End If
If oSendResult = True Then
Dim oUpdCommand = "UPDATE TBEMLP_EMAIL_OUT SET EMAIL_SENT = GETDATE() WHERE GUID = " & oGUID
_MSSQL.NewExecutenonQuery(oUpdCommand)