Public Class frmAPI

    Public id, progId, progName, maid, datetime, testsystem, type, mail, userName, firma, errorCode, errStack, errMessage, errMethodName, progVersion, mailcc, mailbcc, subject, mailtext, mailAnh



    Sub New()

        ' Dieser Aufruf ist für den Designer erforderlich.
        InitializeComponent()

        ' Fügen Sie Initialisierungen nach dem InitializeComponent()-Aufruf hinzu.
    End Sub


    Private Sub frmAPI_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        lblProgramm.Text = progId & " - " & progName & IIf(progVersion <> "", " (" & progVersion & ")", "")
        lblFirma.Text = IIf(firma IsNot DBNull.Value, firma, "")
        txtUser.Text = IIf(maid IsNot DBNull.Value, maid & ": ", "") & IIf(userName IsNot DBNull.Value, userName, "")
        txtType.Text = IIf(type IsNot DBNull.Value, type, "")
        txtMethode.Text = IIf(errMethodName IsNot DBNull.Value, errMethodName, "")
        txtDatetime.Text = IIf(datetime IsNot DBNull.Value, datetime, "")
        txtMail.Text = IIf(mail IsNot DBNull.Value, mail, "")

        txtAnhCount.Text = IIf(mailAnh IsNot DBNull.Value, mailAnh, "0")
        txtMailCC.Text = IIf(mailcc IsNot DBNull.Value, mailcc, "")
        txtMailBCC.Text = IIf(mailbcc IsNot DBNull.Value, mailbcc, "")
        txtSubject.Text = IIf(subject IsNot DBNull.Value, subject, "")

        If errMessage IsNot DBNull.Value Then rtferrMsg.Text = errMessage

        If errStack IsNot DBNull.Value Then rtferrStack.Text = errStack


        '    Public Enum cAPI_Status
        '    [NEW] = 0 ' Neu, noch nicht verarbeitet
        '    OK = 1 ' Erfolg! :)
        '    ERR = 90 ' Fehlversuch :(
        '    ERR_FINAL = 99 'Hier sollte kein Verarbeitungs-Versuch mehr gestartet werden
        'End Enum

        Select Case errorCode
            Case 0
                lblErrMsg.Text &= " (Error Code: " & errorCode & " - Neu, noch nicht verarbeitet)"
            Case 1
                lblErrMsg.Text &= " (Error Code: " & errorCode & " - OK)"
            Case 90
                lblErrMsg.Text &= " (Error Code: " & errorCode & " - Fehlversuch)"
            Case 99
                lblErrMsg.Text &= " (Error Code: " & errorCode & " - zu viele Fehler, kein Versuch mehr)"
        End Select



        If testsystem IsNot Nothing Then
            cbxTestsysten.Checked = testsystem
        End If


    End Sub


End Class