Public Class frmATLAS_zbPos
    Dim zbPOS As cATLAS_zbPos_List = Nothing
    Dim CURRENT_INDEX = 0
   

    Sub New(list As cATLAS_zbPos_List)
        InitializeComponent()
        Me.zbPOS = list
    End Sub


    Private Sub frmATLAS_zbPos_Load(sender As Object, e As EventArgs) Handles Me.Load
        loadList()
    End Sub


    Sub loadList()
        If zbPOS IsNot Nothing Then

            txtBezugsNr.Text = zbPOS.LIST(CURRENT_INDEX).zbant_beznr
            txtRegistrierNr.Text = zbPOS.LIST(CURRENT_INDEX).zbant_regnr
            txtUrsprungsland.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_uland
            txtStatus.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_stat
            txtAntragsdatum.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_adat

            txtWarenbezeichnung.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_wabes
            txttarifNr.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_wanr
            txtPackst_Anz.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_stkanz
            txtPackst_Art.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_stkart
            txtPackst_Nr.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_stkzei
            txtEigenmasse.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_eigm
            txtRechnungspreis.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_rpreis
            txtZollwert.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_zollw
            txtNettopreis.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_netto
            txtArtikelpreis.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_artprs
            txtZusatztext.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_txzus

            txtEUST.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_eust

            txtNettopreisWaehrung.Text = zbPOS.LIST(CURRENT_INDEX).zbpos_waenet

            Label1.Text = (CURRENT_INDEX + 1) & "/" & zbPOS.LIST.Count
        Else
            Label1.Text = "-"


        End If
    End Sub


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If (CURRENT_INDEX + 1) < zbPOS.LIST.Count Then
            CURRENT_INDEX += 1
            loadList()
        End If
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        If (CURRENT_INDEX >= 1) Then
            CURRENT_INDEX -= 1
            loadList()
        End If
    End Sub

 
    Private Sub frmATLAS_zbPos_Shown(sender As Object, e As EventArgs) Handles Me.Shown
        txtBezugsNr.Focus()
        txtBezugsNr.SelectionLength = 0
    End Sub
End Class