Imports IntraSell_DLL

Public Class ucVorgangFunktionen
    Public Event Aktion(name As VorgangAktionenEnum)

    Private Sub btnStorno_Click(sender As Object, e As EventArgs) Handles btnStorno.Click
        RaiseEvent Aktion(VorgangAktionenEnum.STORNO)
    End Sub

    Private Sub btnAusdruck_Click(sender As Object, e As EventArgs) Handles btnAusdruck.Click
        RaiseEvent Aktion(VorgangAktionenEnum.DRUCK)
    End Sub

    Private Sub btnAbschliessen_Click(sender As Object, e As EventArgs) Handles btnAbschliessen.Click
        RaiseEvent Aktion(VorgangAktionenEnum.ABSCHLIESSEN)
    End Sub

    Private Sub btnKonvertieren_Click(sender As Object, e As EventArgs) Handles btnKonvertieren.Click
        RaiseEvent Aktion(VorgangAktionenEnum.KONVERTIEREN)
    End Sub

    Private Sub btnNeu_Click(sender As Object, e As EventArgs) Handles btnNeu.Click
        RaiseEvent Aktion(VorgangAktionenEnum.NEU)
    End Sub

    Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
        RaiseEvent Aktion(VorgangAktionenEnum.EXPORT)
    End Sub

    Private Sub btnBerechnen_Click(sender As Object, e As EventArgs) Handles btnBerechnen.Click
        RaiseEvent Aktion(VorgangAktionenEnum.BERECHNEN)
    End Sub

    Private Sub ButtonBezahlt_Click(sender As Object, e As EventArgs) Handles ButtonBezahlt.Click
        RaiseEvent Aktion(VorgangAktionenEnum.BEZAHLT)
    End Sub

    Private Sub btnVorlage_Click(sender As Object, e As EventArgs) Handles btnVorlage.Click
        RaiseEvent Aktion(VorgangAktionenEnum.VORLAGE)
    End Sub

    Private Sub btnPDF_Click(sender As Object, e As EventArgs) Handles btnPDF.Click
        RaiseEvent Aktion(VorgangAktionenEnum.PDF)
    End Sub

    Private Sub btnMail_Click_1(sender As Object, e As EventArgs) Handles btnMail.Click
        RaiseEvent Aktion(VorgangAktionenEnum.EMAIL)
    End Sub

    Private Sub ucVorgangFunktionen_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
        KonfiguriereButtons()
    End Sub

    Public Sub KonfiguriereButtons()
        Dim isArfaian = False
        Try
            isArfaian = VarValue(Variablen.FIRMA).StartsWith("Arfaian")
        Catch
        End Try

        ButtonBezahlt.Visible = Not isArfaian
        btnExport.Visible = Not isArfaian
        btnPDF.Visible = Not isArfaian
        btnVorlage.Visible = Not isArfaian
        btnMail.Visible = Not isArfaian
        If isArfaian Then
            Me.TableLayoutPanel3.Controls.Remove(Me.btnEtiketten)
            Me.TableLayoutPanel3.Controls.Add(Me.btnEtiketten, 1, 4)
        End If
    End Sub

    Private Sub ButtonEtiketten_Click(sender As Object, e As EventArgs) Handles btnEtiketten.Click
        RaiseEvent Aktion(VorgangAktionenEnum.ETIKETTEN)
    End Sub

    Private Sub ButtonSignieren_Click(sender As Object, e As EventArgs) Handles btnSignieren.Click
        RaiseEvent Aktion(VorgangAktionenEnum.SIGNIEREN)
    End Sub

    Private Sub btnVersandBerechnen_Click(sender As Object, e As EventArgs) Handles btnVersandBerechnen.Click
        RaiseEvent Aktion(VorgangAktionenEnum.VERSAND)
    End Sub
End Class
