Compare commits
6 Commits
2a76d515cb
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f35fecfa2 | |||
| 45ca73af35 | |||
| 48f9673472 | |||
|
|
a70f006bb1 | ||
|
|
36e2d97b20 | ||
|
|
6add3760bd |
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.9.0.0")>
|
<Assembly: AssemblyVersion("3.0.0.0")>
|
||||||
<Assembly: AssemblyFileVersion("2.9.0.0")>
|
<Assembly: AssemblyFileVersion("3.0.0.0")>
|
||||||
|
|||||||
@@ -5,10 +5,12 @@ Imports Newtonsoft.Json
|
|||||||
Imports DigitalData.Modules.Logging
|
Imports DigitalData.Modules.Logging
|
||||||
Imports DigitalData.Modules.Messaging
|
Imports DigitalData.Modules.Messaging
|
||||||
Imports DigitalData.Modules.Messaging.Mail
|
Imports DigitalData.Modules.Messaging.Mail
|
||||||
|
Imports DigitalData.Modules.Messaging.Mail.MailSession
|
||||||
|
|
||||||
Public Class clsProfil
|
Public Class clsProfil
|
||||||
Inherits clsCURRENT
|
Inherits clsCURRENT
|
||||||
Dim Logger As Logger
|
Dim Logger As Logger
|
||||||
|
Dim MyLogConfig As LogConfig
|
||||||
#Region "***** Variablen *****"
|
#Region "***** Variablen *****"
|
||||||
Private Shared CriticalError As Boolean = False
|
Private Shared CriticalError As Boolean = False
|
||||||
Private windream As clsWindream_allgemein
|
Private windream As clsWindream_allgemein
|
||||||
@@ -19,27 +21,28 @@ Public Class clsProfil
|
|||||||
Private _email As MailSender
|
Private _email As MailSender
|
||||||
Private Shared WD_aktivesDokument As WMObject
|
Private Shared WD_aktivesDokument As WMObject
|
||||||
#End Region
|
#End Region
|
||||||
Sub New(MyLogger As LogConfig, PROFIL_ID As Integer)
|
Sub New(pLogConfig As LogConfig, PROFIL_ID As Integer)
|
||||||
Logger = MyLogger.GetLogger()
|
Logger = pLogConfig.GetLogger()
|
||||||
windream = New clsWindream_allgemein(MyLogger)
|
MyLogConfig = pLogConfig
|
||||||
windream_index = New clsWindream_Index(MyLogger)
|
windream = New clsWindream_allgemein(pLogConfig)
|
||||||
_database = New clsDatabase(MyLogger)
|
windream_index = New clsWindream_Index(pLogConfig)
|
||||||
_dateiverarbeitung = New clsDateiverarbeitung(MyLogger)
|
_database = New clsDatabase(pLogConfig)
|
||||||
_email = New MailSender(MyLogger)
|
_dateiverarbeitung = New clsDateiverarbeitung(pLogConfig)
|
||||||
_JobWork = New clsJob_Work(MyLogger, _email)
|
_email = New MailSender(pLogConfig)
|
||||||
|
_JobWork = New clsJob_Work(pLogConfig, _email)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
Public Function Init(PROFIL_ID As Integer)
|
Public Function Init(PROFIL_ID As Integer, pManual As Boolean)
|
||||||
Try
|
Try
|
||||||
Logger.Debug("Start Initialisierung Profil für GUID: " & PROFIL_ID.ToString)
|
Logger.Debug("Start Initialisierung Profil für GUID: " & PROFIL_ID.ToString)
|
||||||
Dim DT As DataTable = _database.Return_Datatable("Select * from TBWMRH_PROFIL where GUID = " & PROFIL_ID)
|
Dim DT As DataTable = _database.Return_Datatable("Select * from TBWMRH_PROFIL where GUID = " & PROFIL_ID)
|
||||||
If DT.Rows.Count > 0 Then
|
If DT.Rows.Count = 1 Then
|
||||||
For Each DR As DataRow In DT.Rows
|
For Each DR As DataRow In DT.Rows
|
||||||
_profGUID = PROFIL_ID
|
_profGUID = PROFIL_ID
|
||||||
_Profilname = CStr(DR.Item("Profilname"))
|
_Profilname = CStr(DR.Item("Profilname"))
|
||||||
Logger.Debug("Check Profilname '" & _Profilname & "', GUID: " & _profGUID & " geladen")
|
Logger.Debug("Check Profilname '" & _Profilname & "', GUID: " & _profGUID & " geladen")
|
||||||
' Überprüfen ob Profil aktiv oder inaktiv
|
' Überprüfen ob Profil aktiv oder inaktiv
|
||||||
If CBool(DR.Item("Aktiv")) = False Then
|
If CBool(DR.Item("Aktiv")) = False And pManual = False Then
|
||||||
Logger.Info("## Profil '" & _Profilname & "' ist inaktiv geschaltet")
|
Logger.Info("## Profil '" & _Profilname & "' ist inaktiv geschaltet")
|
||||||
Return False
|
Return False
|
||||||
Else
|
Else
|
||||||
@@ -64,23 +67,24 @@ Public Class clsProfil
|
|||||||
|
|
||||||
End Function
|
End Function
|
||||||
'Durchlauf des Profils wird aus dem Service gestartet wenn Init = True war
|
'Durchlauf des Profils wird aus dem Service gestartet wenn Init = True war
|
||||||
Public Function Profil_Durchlauf(manually As Boolean) As Boolean
|
Public Function Profil_Durchlauf(pManRun As Boolean) As Boolean
|
||||||
Dim _error As Boolean = False
|
Dim _error As Boolean = False
|
||||||
Try
|
Try
|
||||||
Dim Run_Profile As Boolean = False
|
Dim oRunProfile As Boolean = False
|
||||||
|
If pManRun = False Then
|
||||||
'Soll die Verarbeitung heute durchgeführt werden??
|
'Soll die Verarbeitung heute durchgeführt werden??
|
||||||
Dim Dayofweek As Integer = My.Computer.Clock.LocalTime.DayOfWeek
|
Dim Dayofweek As Integer = My.Computer.Clock.LocalTime.DayOfWeek
|
||||||
Dim SUBS As Integer = 0
|
Dim SUBS As Integer = 0
|
||||||
Dim RUNTODAY As Integer = 0
|
|
||||||
If Dayofweek = 0 Then
|
If Dayofweek = 0 Then
|
||||||
SUBS = 6
|
SUBS = 6
|
||||||
Else
|
Else
|
||||||
|
|
||||||
End If
|
End If
|
||||||
RUNTODAY = _profDay.Substring(Dayofweek - 1, 1)
|
|
||||||
|
|
||||||
|
|
||||||
If _profDay.Substring(Dayofweek - 1, 1) = 1 Then
|
If _profDay.Substring(Dayofweek - 1, 1) = 1 Then
|
||||||
|
oRunProfile = True
|
||||||
|
Else
|
||||||
|
Logger.Info("Verarbeitung für JETZT NICHT konfiguriert")
|
||||||
|
End If
|
||||||
'Verarbeitung soll heute durchgeführt werden
|
'Verarbeitung soll heute durchgeführt werden
|
||||||
Logger.Debug("Verarbeitung soll heute durchgeführt werden!")
|
Logger.Debug("Verarbeitung soll heute durchgeführt werden!")
|
||||||
Logger.Debug("_RunType: " & _profRunType)
|
Logger.Debug("_RunType: " & _profRunType)
|
||||||
@@ -96,11 +100,11 @@ Public Class clsProfil
|
|||||||
Logger.Debug("_RunTime.ToShortTimeString: " & _RunTime.ToShortTimeString & " # " & "Now.ToShortTimeString: " & Now.ToShortTimeString)
|
Logger.Debug("_RunTime.ToShortTimeString: " & _RunTime.ToShortTimeString & " # " & "Now.ToShortTimeString: " & Now.ToShortTimeString)
|
||||||
If Time_next.ToString.StartsWith("11.11.1911") Then
|
If Time_next.ToString.StartsWith("11.11.1911") Then
|
||||||
Logger.Info("Manueller Durchlauf des Profils - 11.11.1911")
|
Logger.Info("Manueller Durchlauf des Profils - 11.11.1911")
|
||||||
Run_Profile = True
|
oRunProfile = True
|
||||||
Else
|
Else
|
||||||
'Ist die Uhrzeit in der Range
|
'Ist die Uhrzeit in der Range
|
||||||
If _RunTime.ToShortTimeString = Now.ToShortTimeString Then
|
If _RunTime.ToShortTimeString = Now.ToShortTimeString Then
|
||||||
Run_Profile = True
|
oRunProfile = True
|
||||||
Else
|
Else
|
||||||
Logger.Debug("No run as " & _RunTime.ToShortTimeString & "<>" & Now.ToShortTimeString)
|
Logger.Debug("No run as " & _RunTime.ToShortTimeString & "<>" & Now.ToShortTimeString)
|
||||||
End If
|
End If
|
||||||
@@ -115,18 +119,20 @@ Public Class clsProfil
|
|||||||
|
|
||||||
If DiffMin >= CInt(arr(1)) Then
|
If DiffMin >= CInt(arr(1)) Then
|
||||||
'Den Durchlauf erlauben
|
'Den Durchlauf erlauben
|
||||||
Run_Profile = True
|
oRunProfile = True
|
||||||
Else
|
Else
|
||||||
Logger.Debug("No run as DiffMin (" & DiffMin & ") <= Intervall(" & arr(1) & ")")
|
Logger.Debug("No run as DiffMin (" & DiffMin & ") <= Intervall(" & arr(1) & ")")
|
||||||
End If
|
End If
|
||||||
Case Else
|
Case Else
|
||||||
Logger.Warn("_profRunType konnte nicht ausgewertet werden - " & arr(0))
|
Logger.Warn("_profRunType konnte nicht ausgewertet werden - " & arr(0))
|
||||||
End Select
|
End Select
|
||||||
If Run_Profile = False And manually = True Then
|
Else
|
||||||
Logger.Info("This is a manual run of profile!")
|
Logger.Info("### This is a manual run of profile! ###")
|
||||||
Run_Profile = True
|
oRunProfile = True
|
||||||
End If
|
End If
|
||||||
If Run_Profile = True Then
|
|
||||||
|
|
||||||
|
If oRunProfile = True Then
|
||||||
Logger.Debug($"'{_Profilname}' - Run_Profile = True")
|
Logger.Debug($"'{_Profilname}' - Run_Profile = True")
|
||||||
clsCURRENT.DT_TBDD_EMAIL = _database.Return_Datatable("SELECT * FROM TBDD_EMAIL_ACCOUNT WHERE ACTIVE = 1")
|
clsCURRENT.DT_TBDD_EMAIL = _database.Return_Datatable("SELECT * FROM TBDD_EMAIL_ACCOUNT WHERE ACTIVE = 1")
|
||||||
clsCURRENT.PROFILE_HandledFiles = Nothing
|
clsCURRENT.PROFILE_HandledFiles = Nothing
|
||||||
@@ -170,6 +176,15 @@ Public Class clsProfil
|
|||||||
Dim oCountDocs As Integer = 0
|
Dim oCountDocs As Integer = 0
|
||||||
Dim oEmailAttachment_path As String
|
Dim oEmailAttachment_path As String
|
||||||
|
|
||||||
|
|
||||||
|
Dim MAILFROM As String = ""
|
||||||
|
Dim MAILSMTP As String = ""
|
||||||
|
Dim MAIL_USER As String = ""
|
||||||
|
Dim MAIL_USER_PW As String = ""
|
||||||
|
Dim MAIL_AUTH_TYPE As String = "SSL"
|
||||||
|
Dim MAIL_PORT As String = "25"
|
||||||
|
Dim MAILSession As SessionInfo
|
||||||
|
|
||||||
For Each WMdok As WMObject In windreamSucheErgebnisse
|
For Each WMdok As WMObject In windreamSucheErgebnisse
|
||||||
|
|
||||||
oEmailAttachment_path = String.Empty
|
oEmailAttachment_path = String.Empty
|
||||||
@@ -215,14 +230,8 @@ Public Class clsProfil
|
|||||||
Return False
|
Return False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If oCountDocs = 1 Then
|
||||||
Dim MAILFROM As String = ""
|
Logger.Debug("##### EMAIL BASICS CONSTRUCT (oCountDocs = 1) ######")
|
||||||
Dim MAILSMTP As String = ""
|
|
||||||
Dim MAIL_USER As String = ""
|
|
||||||
Dim MAIL_USER_PW As String = ""
|
|
||||||
Dim MAIL_AUTH_TYPE As String = "SSL"
|
|
||||||
Dim MAIL_PORT As String = "25"
|
|
||||||
|
|
||||||
For Each emailrow As DataRow In clsCURRENT.DT_TBDD_EMAIL.Rows
|
For Each emailrow As DataRow In clsCURRENT.DT_TBDD_EMAIL.Rows
|
||||||
If emailrow.Item("GUID") = CInt(EMAIL_PROFIL) Then
|
If emailrow.Item("GUID") = CInt(EMAIL_PROFIL) Then
|
||||||
MAILFROM = emailrow.Item("EMAIL_FROM")
|
MAILFROM = emailrow.Item("EMAIL_FROM")
|
||||||
@@ -252,6 +261,8 @@ Public Class clsProfil
|
|||||||
Email_Empfänger = _dateiverarbeitung.REGEX_REPLACE(WMdok, Email_Empfänger)
|
Email_Empfänger = _dateiverarbeitung.REGEX_REPLACE(WMdok, Email_Empfänger)
|
||||||
Logger.Debug("Email_Empfänger: " & Email_Empfänger)
|
Logger.Debug("Email_Empfänger: " & Email_Empfänger)
|
||||||
End If
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
|
||||||
oEmail_Betreff = _dateiverarbeitung.REGEX_REPLACE(WMdok, oEmail_Betreff)
|
oEmail_Betreff = _dateiverarbeitung.REGEX_REPLACE(WMdok, oEmail_Betreff)
|
||||||
Email_Body = _dateiverarbeitung.REGEX_REPLACE(WMdok, Email_Body)
|
Email_Body = _dateiverarbeitung.REGEX_REPLACE(WMdok, Email_Body)
|
||||||
@@ -270,25 +281,36 @@ Public Class clsProfil
|
|||||||
oAttMt.Add(oAttachment_FullFilename)
|
oAttMt.Add(oAttachment_FullFilename)
|
||||||
clsCURRENT.TEMP_FILES.Add(oAttachment_FullFilename)
|
clsCURRENT.TEMP_FILES.Add(oAttachment_FullFilename)
|
||||||
End If
|
End If
|
||||||
Logger.Debug("Now _email and Messaging...")
|
|
||||||
If Not IsNothing(_email) And _email.Connected2Server = False Then
|
Dim oReInit As Boolean = False
|
||||||
Dim oSession = _email.Connect(MAILSMTP, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_AUTH_TYPE)
|
If oCountDocs = 1 Or IsNothing(MAILSession) Then
|
||||||
If oSession.Connected = True Then
|
Logger.Debug("Init MAILSession...")
|
||||||
|
oReInit = True
|
||||||
|
ElseIf IsNothing(_email) Or _email.Connected2Server = False Or MAILSession.Connected = False Then
|
||||||
|
Logger.Info("Re-Init MAILSession...")
|
||||||
|
oReInit = True
|
||||||
|
End If
|
||||||
|
If oReInit = True Then
|
||||||
|
_email = New MailSender(MyLogConfig)
|
||||||
|
MAILSession = _email.Connect(MAILSMTP, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_AUTH_TYPE)
|
||||||
|
If MAILSession.Connected = True Then
|
||||||
Logger.Info($"MAIL: Connection to {MAILSMTP} successfull!")
|
Logger.Info($"MAIL: Connection to {MAILSMTP} successfull!")
|
||||||
Else
|
Else
|
||||||
Logger.Warn($"{oFileRunNo} Email_ConnectToServer was not successfull!")
|
Logger.Warn($"{oFileRunNo} - _email.Connect was not successfull!")
|
||||||
FileJobSuccessful = False
|
FileJobSuccessful = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If Not IsNothing(_email) And _email.SendMail(oSendto, MAILFROM, oEmail_Betreff, Email_Body, Now, oAttMt, 0) = True Then
|
If Not IsNothing(_email) And _email.SendMail(oSendto, MAILFROM, oEmail_Betreff, Email_Body, Now, oAttMt, 0) = True Then
|
||||||
FileJobSuccessful = True
|
FileJobSuccessful = True
|
||||||
Else
|
Else
|
||||||
FileJobSuccessful = False
|
FileJobSuccessful = False
|
||||||
|
Logger.Info("Setting MAILSession.Connected to [false]")
|
||||||
|
MAILSession.Connected = False
|
||||||
If IsNothing(_email) Then
|
If IsNothing(_email) Then
|
||||||
Logger.Info($"_email is nothing")
|
Logger.Info($"_email is nothing")
|
||||||
Else
|
Else
|
||||||
Logger.Info($"{oFileRunNo} Email_SendMail was not successfull!")
|
Logger.Info($"{oFileRunNo} - Email_SendMail was not successfull!")
|
||||||
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -351,7 +373,7 @@ Public Class clsProfil
|
|||||||
'Für jeden File-Job
|
'Für jeden File-Job
|
||||||
For Each DR_PR_FILE_JOB As DataRow In DT_PROFIL_FILE_JOB.Rows
|
For Each DR_PR_FILE_JOB As DataRow In DT_PROFIL_FILE_JOB.Rows
|
||||||
If FileJobSuccessful = False Then
|
If FileJobSuccessful = False Then
|
||||||
Logger.Info($"{oFileRunNo} AUSSTIEG FOR SCHLEIFE cause FileJobSuccessful = False...")
|
Logger.Info($"{oFileRunNo} FileJobSuccessful = False...Exit For")
|
||||||
Exit For
|
Exit For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -483,6 +505,7 @@ Public Class clsProfil
|
|||||||
Try
|
Try
|
||||||
If Not IsNothing(_email) Then
|
If Not IsNothing(_email) Then
|
||||||
If _email.Connected2Server = True Then
|
If _email.Connected2Server = True Then
|
||||||
|
Logger.Warn("KEINE File-JOBS für Profil '" & _Profilname & "' angelegt!")
|
||||||
_email.Disconnect()
|
_email.Disconnect()
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -603,12 +626,12 @@ Public Class clsProfil
|
|||||||
Dim EMAIL_PROFIL = DR_PR_JB.Item("STRING4")
|
Dim EMAIL_PROFIL = DR_PR_JB.Item("STRING4")
|
||||||
Logger.Debug("EMAIL_PROFIL: " & EMAIL_PROFIL)
|
Logger.Debug("EMAIL_PROFIL: " & EMAIL_PROFIL)
|
||||||
If Not IsNothing(clsCURRENT.DT_TBDD_EMAIL) And clsCURRENT.DT_TBDD_EMAIL.Rows.Count >= 1 Then
|
If Not IsNothing(clsCURRENT.DT_TBDD_EMAIL) And clsCURRENT.DT_TBDD_EMAIL.Rows.Count >= 1 Then
|
||||||
Dim MAILFROM As String = ""
|
MAILFROM = ""
|
||||||
Dim MAILSMTP As String = ""
|
MAILSMTP = ""
|
||||||
Dim MAIL_USER As String = ""
|
MAIL_USER = ""
|
||||||
Dim MAIL_USER_PW As String = ""
|
MAIL_USER_PW = ""
|
||||||
Dim MAIL_AUTH_TYPE As String = "SSL"
|
MAIL_AUTH_TYPE = "SSL"
|
||||||
Dim MAIL_PORT As Integer
|
MAIL_PORT = 0
|
||||||
|
|
||||||
For Each emailrow As DataRow In clsCURRENT.DT_TBDD_EMAIL.Rows
|
For Each emailrow As DataRow In clsCURRENT.DT_TBDD_EMAIL.Rows
|
||||||
If emailrow.Item("GUID") = CInt(EMAIL_PROFIL) Then
|
If emailrow.Item("GUID") = CInt(EMAIL_PROFIL) Then
|
||||||
@@ -647,18 +670,28 @@ Public Class clsProfil
|
|||||||
oAttMt.Add(clsCURRENT.CONCATTED_FILE)
|
oAttMt.Add(clsCURRENT.CONCATTED_FILE)
|
||||||
clsCURRENT.TEMP_FILES.Add(clsCURRENT.CONCATTED_FILE)
|
clsCURRENT.TEMP_FILES.Add(clsCURRENT.CONCATTED_FILE)
|
||||||
End If
|
End If
|
||||||
|
If Not IsNothing(_email) And _email.Connected2Server = False And MAILSession.Connected = True Then
|
||||||
|
Logger.Debug("Re/init MAILSession(2)...")
|
||||||
|
MAILSession = _email.Connect(MAILSMTP, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_AUTH_TYPE)
|
||||||
|
If MAILSession.Connected = True Then
|
||||||
|
Logger.Info($"MAIL: Connection to {MAILSMTP} successfull!")
|
||||||
|
Else
|
||||||
|
Logger.Warn($"{oFileRunNo} Email_ConnectToServer was not successfull!")
|
||||||
|
FileJobSuccessful = False
|
||||||
|
End If
|
||||||
|
|
||||||
Dim oSession = _email.Connect(MAILSMTP, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_AUTH_TYPE)
|
End If
|
||||||
If oSession.Connected = True Then
|
|
||||||
|
If MAILSession.Connected = True Then
|
||||||
If _email.SendMail(oSendto, MAILFROM, Email_Betreff, Email_Body, Now, oAttMt, 0) = True Then
|
If _email.SendMail(oSendto, MAILFROM, Email_Betreff, Email_Body, Now, oAttMt, 0) = True Then
|
||||||
FileJobSuccessful = True
|
FileJobSuccessful = True
|
||||||
Else
|
Else
|
||||||
Logger.Warn("Email_SendMail2 was not successfull!")
|
Logger.Warn("Email_SendMail(2) was not successfull!")
|
||||||
FileJobSuccessful = False
|
FileJobSuccessful = False
|
||||||
End If
|
End If
|
||||||
_email.Disconnect()
|
_email.Disconnect()
|
||||||
Else
|
Else
|
||||||
Logger.Warn($"Email_ConnectToServer2 was not successfull!")
|
Logger.Warn($"Email_ConnectToServer(2) was not successfull!")
|
||||||
FileJobSuccessful = False
|
FileJobSuccessful = False
|
||||||
End If
|
End If
|
||||||
|
|
||||||
@@ -768,9 +801,7 @@ Public Class clsProfil
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
End If
|
End If
|
||||||
Else
|
|
||||||
Logger.Info("Verarbeitung für JETZT NICHT konfiguriert")
|
|
||||||
End If
|
|
||||||
'Abschluss des Profiles
|
'Abschluss des Profiles
|
||||||
_database.Execute_non_Query("UPDATE TBWMRH_PROFIL SET Running = 0 WHERE GUID = " & _profGUID)
|
_database.Execute_non_Query("UPDATE TBWMRH_PROFIL SET Running = 0 WHERE GUID = " & _profGUID)
|
||||||
Return True
|
Return True
|
||||||
|
|||||||
@@ -167,7 +167,7 @@ Public Class DDWDResultHandler
|
|||||||
_PROFIL_ID = CInt(DR.Item("GUID"))
|
_PROFIL_ID = CInt(DR.Item("GUID"))
|
||||||
_profil = New clsProfil(MyLogger, _PROFIL_ID)
|
_profil = New clsProfil(MyLogger, _PROFIL_ID)
|
||||||
'Und nun das Profil durchlaufen
|
'Und nun das Profil durchlaufen
|
||||||
Dim initresult = _profil.Init(_PROFIL_ID)
|
Dim initresult = _profil.Init(_PROFIL_ID, False)
|
||||||
If initresult = True Then
|
If initresult = True Then
|
||||||
'##### Profildurchlauf ########
|
'##### Profildurchlauf ########
|
||||||
_profil.Profil_Durchlauf(False)
|
_profil.Profil_Durchlauf(False)
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.3.0.0")>
|
<Assembly: AssemblyVersion("2.4.0.0")>
|
||||||
<Assembly: AssemblyFileVersion("2.3.0.0")>
|
<Assembly: AssemblyFileVersion("2.4.0.0")>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="ResultHandler_Konfig.My.MySettings.SQLSERVER_CS" connectionString="Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd" providerName="System.Data.SqlClient" />
|
<add name="ResultHandler_Konfig.My.MySettings.SQLSERVER_CS" connectionString="Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd"
|
||||||
|
providerName="System.Data.SqlClient" />
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
<startup>
|
<startup>
|
||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ Option Explicit On
|
|||||||
Namespace My
|
Namespace My
|
||||||
|
|
||||||
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
<Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
|
||||||
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.3.0.0"), _
|
Global.System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.5.0.0"), _
|
||||||
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
|
||||||
Partial Friend NotInheritable Class MySettings
|
Partial Friend NotInheritable Class MySettings
|
||||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||||
@@ -54,17 +54,6 @@ Namespace My
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
|
||||||
Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _
|
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Secu"& _
|
|
||||||
"rity Info=True;User ID=sa;Password=dd")> _
|
|
||||||
Public ReadOnly Property SQLSERVER_CS() As String
|
|
||||||
Get
|
|
||||||
Return CType(Me("SQLSERVER_CS"),String)
|
|
||||||
End Get
|
|
||||||
End Property
|
|
||||||
|
|
||||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||||
@@ -100,6 +89,17 @@ Namespace My
|
|||||||
Me("Debug_Active") = value
|
Me("Debug_Active") = value
|
||||||
End Set
|
End Set
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
<Global.System.Configuration.ApplicationScopedSettingAttribute(), _
|
||||||
|
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||||
|
Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _
|
||||||
|
Global.System.Configuration.DefaultSettingValueAttribute("Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Secu"& _
|
||||||
|
"rity Info=True;User ID=sa;Password=dd")> _
|
||||||
|
Public ReadOnly Property SQLSERVER_CS() As String
|
||||||
|
Get
|
||||||
|
Return CType(Me("SQLSERVER_CS"),String)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
End Class
|
End Class
|
||||||
End Namespace
|
End Namespace
|
||||||
|
|
||||||
|
|||||||
@@ -2,14 +2,6 @@
|
|||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||||
<Profiles />
|
<Profiles />
|
||||||
<Settings>
|
<Settings>
|
||||||
<Setting Name="SQLSERVER_CS" Type="(Connection string)" Scope="Application">
|
|
||||||
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
|
||||||
<SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
|
|
||||||
<ConnectionString>Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd</ConnectionString>
|
|
||||||
<ProviderName>System.Data.SqlClient</ProviderName>
|
|
||||||
</SerializableConnectionString></DesignTimeValue>
|
|
||||||
<Value Profile="(Default)">Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="BNSAPI_HOST" Type="System.String" Scope="User">
|
<Setting Name="BNSAPI_HOST" Type="System.String" Scope="User">
|
||||||
<Value Profile="(Default)" />
|
<Value Profile="(Default)" />
|
||||||
</Setting>
|
</Setting>
|
||||||
@@ -19,5 +11,13 @@
|
|||||||
<Setting Name="Debug_Active" Type="System.Boolean" Scope="User">
|
<Setting Name="Debug_Active" Type="System.Boolean" Scope="User">
|
||||||
<Value Profile="(Default)">False</Value>
|
<Value Profile="(Default)">False</Value>
|
||||||
</Setting>
|
</Setting>
|
||||||
|
<Setting Name="SQLSERVER_CS" Type="(Connection string)" Scope="Application">
|
||||||
|
<DesignTimeValue Profile="(Default)"><?xml version="1.0" encoding="utf-16"?>
|
||||||
|
<SerializableConnectionString xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<ConnectionString>Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd</ConnectionString>
|
||||||
|
<ProviderName>System.Data.SqlClient</ProviderName>
|
||||||
|
</SerializableConnectionString></DesignTimeValue>
|
||||||
|
<Value Profile="(Default)">Data Source=SDD-VMP04-SQL17\DD_DEVELOP01;Initial Catalog=DD_ECM_TEST;Persist Security Info=True;User ID=sa;Password=dd</Value>
|
||||||
|
</Setting>
|
||||||
</Settings>
|
</Settings>
|
||||||
</SettingsFile>
|
</SettingsFile>
|
||||||
@@ -4,6 +4,7 @@ Imports DigitalData.Modules.Messaging
|
|||||||
Imports DD_WMResulthandler
|
Imports DD_WMResulthandler
|
||||||
Imports System.Net.Mail
|
Imports System.Net.Mail
|
||||||
Imports System.Net
|
Imports System.Net
|
||||||
|
Imports DigitalData.Modules.Messaging.Mail
|
||||||
|
|
||||||
Public Class frmMain
|
Public Class frmMain
|
||||||
Private _windream As clsWindream_allgemein
|
Private _windream As clsWindream_allgemein
|
||||||
@@ -732,7 +733,7 @@ Public Class frmMain
|
|||||||
For Each DR As DataRow In DT.Rows
|
For Each DR As DataRow In DT.Rows
|
||||||
clsCURRENT._PROFIL_ID = CInt(DR.Item("GUID"))
|
clsCURRENT._PROFIL_ID = CInt(DR.Item("GUID"))
|
||||||
'Und nun das Profil durchlaufen
|
'Und nun das Profil durchlaufen
|
||||||
Dim initresult = _profil.Init(clsCURRENT._PROFIL_ID)
|
Dim initresult = _profil.Init(clsCURRENT._PROFIL_ID, True)
|
||||||
If initresult = True Then
|
If initresult = True Then
|
||||||
_profil.Profil_Durchlauf(True)
|
_profil.Profil_Durchlauf(True)
|
||||||
ElseIf initresult = False Then
|
ElseIf initresult = False Then
|
||||||
@@ -911,26 +912,27 @@ Public Class frmMain
|
|||||||
End Sub
|
End Sub
|
||||||
Private Sub btnsendtestmail_Click(sender As Object, e As EventArgs) Handles btnsendtestmail.Click
|
Private Sub btnsendtestmail_Click(sender As Object, e As EventArgs) Handles btnsendtestmail.Click
|
||||||
' Dim _ss2email As New Email(MyLogger)
|
' Dim _ss2email As New Email(MyLogger)
|
||||||
Dim llmail As New MailSender(MyLogger)
|
Dim oSender As New MailSender(MyLogger)
|
||||||
|
|
||||||
If txtTestmailTo.Text <> String.Empty Then
|
If txtTestmailTo.Text <> String.Empty Then
|
||||||
My.Settings.Save()
|
My.Settings.Save()
|
||||||
Dim wrapper As New clsEncryption("!35452didalog=")
|
Dim wrapper As New clsEncryption("!35452didalog=")
|
||||||
|
|
||||||
Dim PWPlain = wrapper.DecryptData(EMAIL_PWTextBox.Text)
|
Dim PWPlain = wrapper.DecryptData(EMAIL_PWTextBox.Text)
|
||||||
If llmail.ConnectToServer(EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text) = True Then
|
Dim oSession = oSender.Connect(EMAIL_SMTPTextBox.Text, PORTTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, AUTH_TYPEComboBox.Text)
|
||||||
|
If oSession.Connected = True Then
|
||||||
Dim oSendto As New List(Of String)
|
Dim oSendto As New List(Of String)
|
||||||
oSendto.Add(txtTestmailTo.Text)
|
oSendto.Add(txtTestmailTo.Text)
|
||||||
Dim oAttMt As New List(Of String)
|
Dim oAttMt As New List(Of String)
|
||||||
If txtAttachment.Text <> String.Empty Then
|
If txtAttachment.Text <> String.Empty Then
|
||||||
oAttMt.Add(txtAttachment.Text)
|
oAttMt.Add(txtAttachment.Text)
|
||||||
End If
|
End If
|
||||||
If llmail.SendMail(oSendto, EMAIL_FROMTextBox.Text, "Testmail from GUI WMResultHandler", "TEST", Now, oAttMt, 1) = True Then
|
If oSender.SendMail(oSendto, EMAIL_FROMTextBox.Text, "Testmail from GUI WMResultHandler", "TEST", Now, oAttMt, 1) = True Then
|
||||||
MsgBox("Email has been sent successfully.", MsgBoxStyle.Information)
|
MsgBox("Email has been sent successfully.", MsgBoxStyle.Information)
|
||||||
Else
|
Else
|
||||||
MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation)
|
MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation)
|
||||||
End If
|
End If
|
||||||
llmail.DisconnectFromServer()
|
oSender.Disconnect()
|
||||||
Else
|
Else
|
||||||
MsgBox("Could not connect to server. Please check the log.", MsgBoxStyle.Exclamation)
|
MsgBox("Could not connect to server. Please check the log.", MsgBoxStyle.Exclamation)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user