Public Class frmDD_EMAIL_ACCOUNT

    Private Sub TBDD_EMAIL_ACCOUNTBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs) Handles TBDD_EMAIL_ACCOUNTBindingNavigatorSaveItem.Click
        Save_EmailProfile()
    End Sub
    Sub Save_EmailProfile()
        Try
            Me.TBDD_EMAIL_ACCOUNTBindingSource.EndEdit()
            If DD_DMSDataSet.TBDD_EMAIL_ACCOUNT.GetChanges Is Nothing = False Then
                Me.CHANGED_WHOTextBox.Text = Environment.UserName
                Me.TBDD_EMAIL_ACCOUNTBindingSource.EndEdit()
                TBDD_EMAIL_ACCOUNTTableAdapter.Update(Me.DD_DMSDataSet.TBDD_EMAIL_ACCOUNT)
                lblSave.Visible = True
            Else
                lblSave.Visible = False
            End If
        Catch ex As Exception
            MsgBox("Fehler bei Save_EmailProfile:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub
    Private Sub frmDD_EMAIL_ACCOUNT_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Try
            TBDD_EMAIL_ACCOUNTTableAdapter.Connection.ConnectionString = MyConnectionString
            Me.TBDD_EMAIL_ACCOUNTTableAdapter.Fill(Me.DD_DMSDataSet.TBDD_EMAIL_ACCOUNT)
        Catch ex As Exception
            MsgBox("Error in Load-Form: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
        End Try
    End Sub

    Private Sub TBDD_EMAIL_ACCOUNTBindingSource_AddingNew(sender As Object, e As System.ComponentModel.AddingNewEventArgs) Handles TBDD_EMAIL_ACCOUNTBindingSource.AddingNew
        Me.DD_DMSDataSet.TBDD_EMAIL_ACCOUNT.ADDED_WHOColumn.DefaultValue = Environment.UserName
    End Sub

    Private Sub btnEmailTest_Click(sender As Object, e As EventArgs) Handles btnEmailTest.Click
        If txttestReceipiant.Text <> "" Then
            If ClassEmail.Send_EMail(txttestReceipiant.Text, "Test Email Wiedervorlage", "Default-Bodytext: Wird mit dem Profil Bodytext ersetzt.", EMAIL_SMTPTextBox.Text, EMAIL_USERTextBox.Text, EMAIL_PWTextBox.Text, EMAIL_FROMTextBox.Text) = True Then
                MsgBox("Die Test Email wurde erfolgrecih versendet!", MsgBoxStyle.Information, "Erfolgsmeldung:")
            End If
        End If
    End Sub
End Class