Compare commits
11 Commits
e2389321ce
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f35fecfa2 | |||
| 45ca73af35 | |||
| 48f9673472 | |||
|
|
a70f006bb1 | ||
|
|
36e2d97b20 | ||
|
|
6add3760bd | ||
|
|
2a76d515cb | ||
|
|
52c3939ad6 | ||
|
|
268e4d595e | ||
|
|
10f417eb7c | ||
|
|
90868864ab |
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.9.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.9.0.0")>
|
||||
<Assembly: AssemblyVersion("3.0.0.0")>
|
||||
<Assembly: AssemblyFileVersion("3.0.0.0")>
|
||||
|
||||
@@ -57,7 +57,8 @@ Public Class clsJob_Work
|
||||
If Attachment_Filename <> String.Empty Then
|
||||
oAttMt.Add(Attachment_Filename)
|
||||
End If
|
||||
If _mail.Connect(oMAILSMTP, oMAIL_PORT, oMAIL_USER, oPWPlain, oMAIL_AUTH_TYPE) = True Then
|
||||
Dim oSession = _mail.Connect(oMAILSMTP, oMAIL_PORT, oMAIL_USER, oPWPlain, oMAIL_AUTH_TYPE)
|
||||
If oSession.Connected = True Then
|
||||
Logger.Info($"MAIL: Connection to {oMAILSMTP} successfull!")
|
||||
If _mail.SendMail(oSendto, oMAILFROM, Email_subject, Email_Body, Now, oAttMt, 0) = True Then
|
||||
Return True
|
||||
|
||||
@@ -5,10 +5,12 @@ Imports Newtonsoft.Json
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Messaging
|
||||
Imports DigitalData.Modules.Messaging.Mail
|
||||
Imports DigitalData.Modules.Messaging.Mail.MailSession
|
||||
|
||||
Public Class clsProfil
|
||||
Inherits clsCURRENT
|
||||
Dim Logger As Logger
|
||||
Dim MyLogConfig As LogConfig
|
||||
#Region "***** Variablen *****"
|
||||
Private Shared CriticalError As Boolean = False
|
||||
Private windream As clsWindream_allgemein
|
||||
@@ -19,27 +21,28 @@ Public Class clsProfil
|
||||
Private _email As MailSender
|
||||
Private Shared WD_aktivesDokument As WMObject
|
||||
#End Region
|
||||
Sub New(MyLogger As LogConfig, PROFIL_ID As Integer)
|
||||
Logger = MyLogger.GetLogger()
|
||||
windream = New clsWindream_allgemein(MyLogger)
|
||||
windream_index = New clsWindream_Index(MyLogger)
|
||||
_database = New clsDatabase(MyLogger)
|
||||
_dateiverarbeitung = New clsDateiverarbeitung(MyLogger)
|
||||
_email = New MailSender(MyLogger)
|
||||
_JobWork = New clsJob_Work(MyLogger, _email)
|
||||
Sub New(pLogConfig As LogConfig, PROFIL_ID As Integer)
|
||||
Logger = pLogConfig.GetLogger()
|
||||
MyLogConfig = pLogConfig
|
||||
windream = New clsWindream_allgemein(pLogConfig)
|
||||
windream_index = New clsWindream_Index(pLogConfig)
|
||||
_database = New clsDatabase(pLogConfig)
|
||||
_dateiverarbeitung = New clsDateiverarbeitung(pLogConfig)
|
||||
_email = New MailSender(pLogConfig)
|
||||
_JobWork = New clsJob_Work(pLogConfig, _email)
|
||||
|
||||
End Sub
|
||||
Public Function Init(PROFIL_ID As Integer)
|
||||
Public Function Init(PROFIL_ID As Integer, pManual As Boolean)
|
||||
Try
|
||||
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)
|
||||
If DT.Rows.Count > 0 Then
|
||||
If DT.Rows.Count = 1 Then
|
||||
For Each DR As DataRow In DT.Rows
|
||||
_profGUID = PROFIL_ID
|
||||
_Profilname = CStr(DR.Item("Profilname"))
|
||||
Logger.Debug("Check Profilname '" & _Profilname & "', GUID: " & _profGUID & " geladen")
|
||||
' Ü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")
|
||||
Return False
|
||||
Else
|
||||
@@ -64,23 +67,24 @@ Public Class clsProfil
|
||||
|
||||
End Function
|
||||
'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
|
||||
Try
|
||||
Dim Run_Profile As Boolean = False
|
||||
Dim oRunProfile As Boolean = False
|
||||
If pManRun = False Then
|
||||
'Soll die Verarbeitung heute durchgeführt werden??
|
||||
Dim Dayofweek As Integer = My.Computer.Clock.LocalTime.DayOfWeek
|
||||
Dim SUBS As Integer = 0
|
||||
Dim RUNTODAY As Integer = 0
|
||||
If Dayofweek = 0 Then
|
||||
SUBS = 6
|
||||
Else
|
||||
|
||||
End If
|
||||
RUNTODAY = _profDay.Substring(Dayofweek - 1, 1)
|
||||
|
||||
|
||||
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
|
||||
Logger.Debug("Verarbeitung soll heute durchgeführt werden!")
|
||||
Logger.Debug("_RunType: " & _profRunType)
|
||||
@@ -96,11 +100,11 @@ Public Class clsProfil
|
||||
Logger.Debug("_RunTime.ToShortTimeString: " & _RunTime.ToShortTimeString & " # " & "Now.ToShortTimeString: " & Now.ToShortTimeString)
|
||||
If Time_next.ToString.StartsWith("11.11.1911") Then
|
||||
Logger.Info("Manueller Durchlauf des Profils - 11.11.1911")
|
||||
Run_Profile = True
|
||||
oRunProfile = True
|
||||
Else
|
||||
'Ist die Uhrzeit in der Range
|
||||
If _RunTime.ToShortTimeString = Now.ToShortTimeString Then
|
||||
Run_Profile = True
|
||||
oRunProfile = True
|
||||
Else
|
||||
Logger.Debug("No run as " & _RunTime.ToShortTimeString & "<>" & Now.ToShortTimeString)
|
||||
End If
|
||||
@@ -115,18 +119,20 @@ Public Class clsProfil
|
||||
|
||||
If DiffMin >= CInt(arr(1)) Then
|
||||
'Den Durchlauf erlauben
|
||||
Run_Profile = True
|
||||
oRunProfile = True
|
||||
Else
|
||||
Logger.Debug("No run as DiffMin (" & DiffMin & ") <= Intervall(" & arr(1) & ")")
|
||||
End If
|
||||
Case Else
|
||||
Logger.Warn("_profRunType konnte nicht ausgewertet werden - " & arr(0))
|
||||
End Select
|
||||
If Run_Profile = False And manually = True Then
|
||||
Logger.Info("This is a manual run of profile!")
|
||||
Run_Profile = True
|
||||
Else
|
||||
Logger.Info("### This is a manual run of profile! ###")
|
||||
oRunProfile = True
|
||||
End If
|
||||
If Run_Profile = True Then
|
||||
|
||||
|
||||
If oRunProfile = True Then
|
||||
Logger.Debug($"'{_Profilname}' - Run_Profile = True")
|
||||
clsCURRENT.DT_TBDD_EMAIL = _database.Return_Datatable("SELECT * FROM TBDD_EMAIL_ACCOUNT WHERE ACTIVE = 1")
|
||||
clsCURRENT.PROFILE_HandledFiles = Nothing
|
||||
@@ -170,6 +176,15 @@ Public Class clsProfil
|
||||
Dim oCountDocs As Integer = 0
|
||||
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
|
||||
|
||||
oEmailAttachment_path = String.Empty
|
||||
@@ -215,14 +230,8 @@ Public Class clsProfil
|
||||
Return False
|
||||
End If
|
||||
|
||||
|
||||
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"
|
||||
|
||||
If oCountDocs = 1 Then
|
||||
Logger.Debug("##### EMAIL BASICS CONSTRUCT (oCountDocs = 1) ######")
|
||||
For Each emailrow As DataRow In clsCURRENT.DT_TBDD_EMAIL.Rows
|
||||
If emailrow.Item("GUID") = CInt(EMAIL_PROFIL) Then
|
||||
MAILFROM = emailrow.Item("EMAIL_FROM")
|
||||
@@ -252,6 +261,8 @@ Public Class clsProfil
|
||||
Email_Empfänger = _dateiverarbeitung.REGEX_REPLACE(WMdok, Email_Empfänger)
|
||||
Logger.Debug("Email_Empfänger: " & Email_Empfänger)
|
||||
End If
|
||||
End If
|
||||
|
||||
|
||||
oEmail_Betreff = _dateiverarbeitung.REGEX_REPLACE(WMdok, oEmail_Betreff)
|
||||
Email_Body = _dateiverarbeitung.REGEX_REPLACE(WMdok, Email_Body)
|
||||
@@ -270,24 +281,36 @@ Public Class clsProfil
|
||||
oAttMt.Add(oAttachment_FullFilename)
|
||||
clsCURRENT.TEMP_FILES.Add(oAttachment_FullFilename)
|
||||
End If
|
||||
Logger.Debug("Now _email and Messaging...")
|
||||
If Not IsNothing(_email) And _email.Connected2Server = False Then
|
||||
If _email.Connect(MAILSMTP, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_AUTH_TYPE) = True Then
|
||||
|
||||
Dim oReInit As Boolean = False
|
||||
If oCountDocs = 1 Or IsNothing(MAILSession) 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!")
|
||||
Else
|
||||
Logger.Warn($"{oFileRunNo} Email_ConnectToServer was not successfull!")
|
||||
Logger.Warn($"{oFileRunNo} - _email.Connect was not successfull!")
|
||||
FileJobSuccessful = False
|
||||
End If
|
||||
|
||||
End If
|
||||
|
||||
If Not IsNothing(_email) And _email.SendMail(oSendto, MAILFROM, oEmail_Betreff, Email_Body, Now, oAttMt, 0) = True Then
|
||||
FileJobSuccessful = True
|
||||
Else
|
||||
FileJobSuccessful = False
|
||||
Logger.Info("Setting MAILSession.Connected to [false]")
|
||||
MAILSession.Connected = False
|
||||
If IsNothing(_email) Then
|
||||
Logger.Info($"_email is nothing")
|
||||
Else
|
||||
Logger.Info($"{oFileRunNo} Email_SendMail was not successfull!")
|
||||
Logger.Info($"{oFileRunNo} - Email_SendMail was not successfull!")
|
||||
|
||||
End If
|
||||
|
||||
@@ -350,7 +373,7 @@ Public Class clsProfil
|
||||
'Für jeden File-Job
|
||||
For Each DR_PR_FILE_JOB As DataRow In DT_PROFIL_FILE_JOB.Rows
|
||||
If FileJobSuccessful = False Then
|
||||
Logger.Info($"{oFileRunNo} AUSSTIEG FOR SCHLEIFE cause FileJobSuccessful = False...")
|
||||
Logger.Info($"{oFileRunNo} FileJobSuccessful = False...Exit For")
|
||||
Exit For
|
||||
End If
|
||||
|
||||
@@ -482,7 +505,8 @@ Public Class clsProfil
|
||||
Try
|
||||
If Not IsNothing(_email) Then
|
||||
If _email.Connected2Server = True Then
|
||||
_email.DisconnectFromServer()
|
||||
Logger.Warn("KEINE File-JOBS für Profil '" & _Profilname & "' angelegt!")
|
||||
_email.Disconnect()
|
||||
End If
|
||||
|
||||
End If
|
||||
@@ -602,12 +626,12 @@ Public Class clsProfil
|
||||
Dim EMAIL_PROFIL = DR_PR_JB.Item("STRING4")
|
||||
Logger.Debug("EMAIL_PROFIL: " & EMAIL_PROFIL)
|
||||
If Not IsNothing(clsCURRENT.DT_TBDD_EMAIL) And clsCURRENT.DT_TBDD_EMAIL.Rows.Count >= 1 Then
|
||||
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 Integer
|
||||
MAILFROM = ""
|
||||
MAILSMTP = ""
|
||||
MAIL_USER = ""
|
||||
MAIL_USER_PW = ""
|
||||
MAIL_AUTH_TYPE = "SSL"
|
||||
MAIL_PORT = 0
|
||||
|
||||
For Each emailrow As DataRow In clsCURRENT.DT_TBDD_EMAIL.Rows
|
||||
If emailrow.Item("GUID") = CInt(EMAIL_PROFIL) Then
|
||||
@@ -646,17 +670,28 @@ Public Class clsProfil
|
||||
oAttMt.Add(clsCURRENT.CONCATTED_FILE)
|
||||
clsCURRENT.TEMP_FILES.Add(clsCURRENT.CONCATTED_FILE)
|
||||
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
|
||||
|
||||
If _email.Connect(MAILSMTP, MAIL_PORT, MAIL_USER, MAIL_USER_PW, MAIL_AUTH_TYPE) = True Then
|
||||
End If
|
||||
|
||||
If MAILSession.Connected = True Then
|
||||
If _email.SendMail(oSendto, MAILFROM, Email_Betreff, Email_Body, Now, oAttMt, 0) = True Then
|
||||
FileJobSuccessful = True
|
||||
Else
|
||||
Logger.Warn("Email_SendMail2 was not successfull!")
|
||||
Logger.Warn("Email_SendMail(2) was not successfull!")
|
||||
FileJobSuccessful = False
|
||||
End If
|
||||
_email.DisconnectFromServer()
|
||||
_email.Disconnect()
|
||||
Else
|
||||
Logger.Warn($"Email_ConnectToServer2 was not successfull!")
|
||||
Logger.Warn($"Email_ConnectToServer(2) was not successfull!")
|
||||
FileJobSuccessful = False
|
||||
End If
|
||||
|
||||
@@ -766,9 +801,7 @@ Public Class clsProfil
|
||||
End If
|
||||
|
||||
End If
|
||||
Else
|
||||
Logger.Info("Verarbeitung für JETZT NICHT konfiguriert")
|
||||
End If
|
||||
|
||||
'Abschluss des Profiles
|
||||
_database.Execute_non_Query("UPDATE TBWMRH_PROFIL SET Running = 0 WHERE GUID = " & _profGUID)
|
||||
Return True
|
||||
|
||||
@@ -167,7 +167,7 @@ Public Class DDWDResultHandler
|
||||
_PROFIL_ID = CInt(DR.Item("GUID"))
|
||||
_profil = New clsProfil(MyLogger, _PROFIL_ID)
|
||||
'Und nun das Profil durchlaufen
|
||||
Dim initresult = _profil.Init(_PROFIL_ID)
|
||||
Dim initresult = _profil.Init(_PROFIL_ID, False)
|
||||
If initresult = True Then
|
||||
'##### Profildurchlauf ########
|
||||
_profil.Profil_Durchlauf(False)
|
||||
|
||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
||||
' übernehmen, indem Sie "*" eingeben:
|
||||
' <Assembly: AssemblyVersion("1.0.*")>
|
||||
|
||||
<Assembly: AssemblyVersion("2.3.0.0")>
|
||||
<Assembly: AssemblyFileVersion("2.3.0.0")>
|
||||
<Assembly: AssemblyVersion("2.4.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" />
|
||||
</configSections>
|
||||
<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>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
|
||||
|
||||
@@ -15,7 +15,7 @@ Option Explicit On
|
||||
Namespace My
|
||||
|
||||
<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)> _
|
||||
Partial Friend NotInheritable Class MySettings
|
||||
Inherits Global.System.Configuration.ApplicationSettingsBase
|
||||
@@ -54,17 +54,6 @@ Namespace My
|
||||
End Get
|
||||
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.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("")> _
|
||||
@@ -100,6 +89,17 @@ Namespace My
|
||||
Me("Debug_Active") = value
|
||||
End Set
|
||||
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 Namespace
|
||||
|
||||
|
||||
@@ -2,14 +2,6 @@
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="My" GeneratedClassName="MySettings" UseMySettingsClassName="true">
|
||||
<Profiles />
|
||||
<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">
|
||||
<Value Profile="(Default)" />
|
||||
</Setting>
|
||||
@@ -19,5 +11,13 @@
|
||||
<Setting Name="Debug_Active" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
</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>
|
||||
</SettingsFile>
|
||||
@@ -4,6 +4,7 @@ Imports DigitalData.Modules.Messaging
|
||||
Imports DD_WMResulthandler
|
||||
Imports System.Net.Mail
|
||||
Imports System.Net
|
||||
Imports DigitalData.Modules.Messaging.Mail
|
||||
|
||||
Public Class frmMain
|
||||
Private _windream As clsWindream_allgemein
|
||||
@@ -732,7 +733,7 @@ Public Class frmMain
|
||||
For Each DR As DataRow In DT.Rows
|
||||
clsCURRENT._PROFIL_ID = CInt(DR.Item("GUID"))
|
||||
'Und nun das Profil durchlaufen
|
||||
Dim initresult = _profil.Init(clsCURRENT._PROFIL_ID)
|
||||
Dim initresult = _profil.Init(clsCURRENT._PROFIL_ID, True)
|
||||
If initresult = True Then
|
||||
_profil.Profil_Durchlauf(True)
|
||||
ElseIf initresult = False Then
|
||||
@@ -911,26 +912,27 @@ Public Class frmMain
|
||||
End Sub
|
||||
Private Sub btnsendtestmail_Click(sender As Object, e As EventArgs) Handles btnsendtestmail.Click
|
||||
' Dim _ss2email As New Email(MyLogger)
|
||||
Dim llmail As New MailSender(MyLogger)
|
||||
Dim oSender As New MailSender(MyLogger)
|
||||
|
||||
If txtTestmailTo.Text <> String.Empty Then
|
||||
My.Settings.Save()
|
||||
Dim wrapper As New clsEncryption("!35452didalog=")
|
||||
|
||||
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)
|
||||
oSendto.Add(txtTestmailTo.Text)
|
||||
Dim oAttMt As New List(Of String)
|
||||
If txtAttachment.Text <> String.Empty Then
|
||||
oAttMt.Add(txtAttachment.Text)
|
||||
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)
|
||||
Else
|
||||
MsgBox("Could not send the testmail. Please check the log.", MsgBoxStyle.Exclamation)
|
||||
End If
|
||||
llmail.DisconnectFromServer()
|
||||
oSender.Disconnect()
|
||||
Else
|
||||
MsgBox("Could not connect to server. Please check the log.", MsgBoxStyle.Exclamation)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user