MS clsEmail - Anpassungen divers
This commit is contained in:
@@ -6,16 +6,18 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||
If My.Settings.myConnString = String.Empty Then
|
||||
Dim dbPath As String = Application.StartupPath & "\Database\wdResultHandler.db3"
|
||||
If IO.File.Exists(dbPath) Then
|
||||
My.Settings.myConnString = dbPath
|
||||
My.Settings.Save()
|
||||
Else
|
||||
MsgBox("Achtung: Die SQLite-Database File exisitiert nicht am angegebenen Ort: " & vbNewLine & dbPath, MsgBoxStyle.Critical, "Fehler:")
|
||||
DB_Path()
|
||||
End If
|
||||
End If
|
||||
'TODO: Diese Codezeile lädt Daten in die Tabelle "MyDataset.TBDD_EMAIL_ACCOUNT". Sie können sie bei Bedarf verschieben oder entfernen.
|
||||
|
||||
'If My.Settings.myConnString = String.Empty Then
|
||||
' Dim dbPath As String = Application.StartupPath & "\Database\wdResultHandler.db3"
|
||||
' If IO.File.Exists(dbPath) Then
|
||||
' My.Settings.myConnString = dbPath
|
||||
' My.Settings.Save()
|
||||
' Else
|
||||
' MsgBox("Achtung: Die SQLite-Database File exisitiert nicht am angegebenen Ort: " & vbNewLine & dbPath, MsgBoxStyle.Critical, "Fehler:")
|
||||
' DB_Path()
|
||||
' End If
|
||||
'End If
|
||||
Load_Constring()
|
||||
Try
|
||||
' Windream instanziieren
|
||||
@@ -28,6 +30,7 @@ Public Class frmMain
|
||||
Load_Profil()
|
||||
Load_Uebersicht()
|
||||
clsLogger.Init(My.Application.Info.DirectoryPath & "\Log", "logResultHandler_")
|
||||
ToolStripStatusLabelVersion.Text = String.Format("Version {0}", My.Application.Info.Version.ToString)
|
||||
End Sub
|
||||
Sub Load_Uebersicht()
|
||||
' Try
|
||||
@@ -98,6 +101,8 @@ Public Class frmMain
|
||||
Me.TBWMRH_PROFILTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Me.TBWMRH_PROFIL_FILE_JOBTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
Me.TBDD_EMAIL_ACCOUNTTableAdapter.Connection.ConnectionString = My.Settings.SQLSERVER_CS
|
||||
|
||||
Load_Grundkonfig()
|
||||
End Sub
|
||||
Sub Load_Grundkonfig()
|
||||
@@ -157,9 +162,7 @@ Public Class frmMain
|
||||
Me.tsstatus.Visible = visible
|
||||
Me.tsstatus.Text = Text
|
||||
End Sub
|
||||
Private Sub btnDatenbankConnect_Click(sender As Object, e As EventArgs) Handles btnDatenbankConnect.Click
|
||||
DB_Path()
|
||||
End Sub
|
||||
|
||||
Sub DB_Path()
|
||||
With OpenFileDialog1
|
||||
' Do
|
||||
@@ -211,11 +214,20 @@ Public Class frmMain
|
||||
Load_Profil()
|
||||
Case 2
|
||||
Load_Grundkonfig()
|
||||
Case 3
|
||||
load_Emails
|
||||
End Select
|
||||
End Sub
|
||||
Private Sub TBPROFILBindingSource_BindingComplete(sender As Object, e As BindingCompleteEventArgs)
|
||||
statuslabel(True, "TBPROFILBindingSource.BindingComplete - " & GUIDTextBox.Text)
|
||||
End Sub
|
||||
Sub load_Emails()
|
||||
Try
|
||||
Me.TBDD_EMAIL_ACCOUNTTableAdapter.Fill(Me.MyDataset.TBDD_EMAIL_ACCOUNT)
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Load Emails:")
|
||||
End Try
|
||||
End Sub
|
||||
Sub Checkbox_Days()
|
||||
Dim days As String
|
||||
If CheckBox1.Checked Then
|
||||
@@ -414,7 +426,7 @@ Public Class frmMain
|
||||
Dim result As MsgBoxResult
|
||||
result = MessageBox.Show("Sind Sie sicher dass Sie diesen Job löschen wollen?", "Bestätigung erforderlich:", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
|
||||
If result = MsgBoxResult.Yes Then
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Delete(Me.GUIDTextBox1.Text)
|
||||
Me.TBWMRH_PROFIL_JOBTableAdapter.Delete(Me.PROFILJOB_GUIDTextBox.Text)
|
||||
Load_Jobs(Me.GUIDTextBox.Text)
|
||||
statuslabel(True, "Job wurde erfolgreich gelöscht! - " & Now)
|
||||
End If
|
||||
@@ -433,21 +445,47 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
Private Sub JOB_TYPComboBox_SelectedIndexChanged(sender As Object, e As EventArgs) Handles JOB_TYPComboBox.SelectedIndexChanged
|
||||
Show_String_Lables
|
||||
End Sub
|
||||
Sub Show_String_Lables()
|
||||
btnJOB_addSpeicherort.Visible = False
|
||||
lblString1.Text = ""
|
||||
lblString2.Text = ""
|
||||
Select Case JOB_TYPComboBox.SelectedIndex
|
||||
Case 0
|
||||
lblString3.Text = ""
|
||||
lblString4.Text = ""
|
||||
STRING1TextBox.Visible = False
|
||||
STRING2TextBox.Visible = False
|
||||
STRING3TextBox.Visible = False
|
||||
STRING4TextBox.Visible = False
|
||||
Select Case JOB_TYPComboBox.Text
|
||||
Case "Export HDD"
|
||||
lblString1.Text = "Speicherort für windream-Ergebnisse:"
|
||||
STRING1TextBox.Visible = True
|
||||
btnJOB_addSpeicherort.Visible = True
|
||||
Case 1
|
||||
Case "Create Mail Attachment"
|
||||
lblString1.Text = "Email-Empfänger:"
|
||||
Case 2 'json BNS
|
||||
STRING1TextBox.Visible = True
|
||||
Case "BNS json Download" 'json BNS
|
||||
lblString1.Text = "User Kunde:"
|
||||
STRING1TextBox.Visible = True
|
||||
lblString2.Text = "BNS Kundennummer:"
|
||||
STRING2TextBox.Visible = True
|
||||
Case "Concat Files to one pdf" ' Concat Files to one pdf
|
||||
lblString1.Text = "Speicherort der zusammengefügten Datei:"
|
||||
STRING1TextBox.Visible = True
|
||||
lblString2.Text = "Löschen der exportierten Dateien (Ja/Nein)"
|
||||
STRING2TextBox.Visible = True
|
||||
Case "Send concatted file via mail"
|
||||
lblString1.Text = "Email-Empfänger:"
|
||||
STRING1TextBox.Visible = True
|
||||
lblString2.Text = "Email-Betreff:"
|
||||
STRING2TextBox.Visible = True
|
||||
lblString3.Text = "Email-Body:"
|
||||
STRING3TextBox.Visible = True
|
||||
lblString4.Text = "Email-Profil:"
|
||||
STRING4TextBox.Visible = True
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
Private Sub btnJOB_addSpeicherort_Click(sender As Object, e As EventArgs) Handles btnJOB_addSpeicherort.Click
|
||||
With FolderBrowserDialog1
|
||||
' Do
|
||||
@@ -682,4 +720,63 @@ Public Class frmMain
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler bei Öffnen der windream-Suche:")
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub TBWMRH_PROFIL_JOBBindingSource_CurrentChanged(sender As Object, e As EventArgs) Handles TBWMRH_PROFIL_JOBBindingSource.CurrentChanged
|
||||
If IsNumeric(PROFILJOB_GUIDTextBox.Text) Then
|
||||
Show_String_Lables()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
|
||||
Process.Start(System.IO.Path.GetDirectoryName(clsLogger.LogFilename))
|
||||
End Sub
|
||||
|
||||
Private Sub TBDD_EMAIL_ACCOUNTBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_EMAIL_ACCOUNTBindingSource.AddingNew
|
||||
MyDataset.TBDD_EMAIL_ACCOUNT.ADDED_WHOColumn.DefaultValue = Environment.UserName
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton15_Click(sender As Object, e As EventArgs) Handles ToolStripButton15.Click
|
||||
TBDD_EMAIL_ACCOUNTBindingSource.AddNew()
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton21_Click(sender As Object, e As EventArgs) Handles ToolStripButton21.Click
|
||||
SaveEmail
|
||||
End Sub
|
||||
Sub SaveEmail()
|
||||
Try
|
||||
Me.TBDD_EMAIL_ACCOUNTBindingSource.EndEdit()
|
||||
If MyDataset.TBDD_EMAIL_ACCOUNT.GetChanges Is Nothing = False Then
|
||||
Me.GEAENDERT_WERTextBox.Text = Environment.UserName
|
||||
Me.TBDD_EMAIL_ACCOUNTBindingSource.EndEdit()
|
||||
Me.TBDD_EMAIL_ACCOUNTTableAdapter.Update(MyDataset.TBDD_EMAIL_ACCOUNT)
|
||||
statuslabel(True, "Email-Data gespeichert - " & Now)
|
||||
|
||||
End If
|
||||
Catch ex As Exception
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Fehler in Save Email:")
|
||||
End Try
|
||||
End Sub
|
||||
Private Sub btnsendtestmail_Click(sender As Object, e As EventArgs) Handles btnsendtestmail.Click
|
||||
If txtTestmail.Text <> String.Empty Then
|
||||
Dim wrapper As New clsEncryption("!35452didalog=")
|
||||
|
||||
Dim PWPlain = wrapper.DecryptData(EMAIL_PWTextBox.Text)
|
||||
|
||||
|
||||
clsEmail.Send_EMail("Testmail DD Windream-ResultHandler", "This is the body (text will be replaced within profile)", txtTestmail.Text,
|
||||
EMAIL_FROMTextBox.Text, EMAIL_SMTPTextBox.Text, EMAIL_USERTextBox.Text, PWPlain, "", True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
Dim wrapper As New clsEncryption("!35452didalog=")
|
||||
Dim pwencrypted = wrapper.EncryptData(txtnewpasswort.Text)
|
||||
EMAIL_PWTextBox.Text = pwencrypted
|
||||
SaveEmail()
|
||||
MsgBox("Passwort was encrypted!")
|
||||
End Sub
|
||||
|
||||
Private Sub ToolStripButton22_Click(sender As Object, e As EventArgs) Handles ToolStripButton22.Click
|
||||
load_Emails()
|
||||
End Sub
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user