Public Class frmKundenTOBBKdNr

    Dim KUNDE_ERW As VERAG_PROG_ALLGEMEIN.cKundenErweitert = Nothing
    Dim KundenNr As Integer

    Sub New(KundenNr As Integer)
        InitializeComponent()
        Me.KundenNr = KundenNr
    End Sub

    Sub init(KundenNr)
        If KundenNr <= 0 Then Exit Sub
        KUNDE_ERW = New VERAG_PROG_ALLGEMEIN.cKundenErweitert(KundenNr)
        txtTOBB.Text = If(KUNDE_ERW.kde_TOBB_KundenNr, "")
    End Sub


    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If KUNDE_ERW Is Nothing Then Exit Sub
        KUNDE_ERW.kde_TOBB_KundenNr = isLeerNothing(txtTOBB.Text)
        If KUNDE_ERW.SAVE() Then
            Me.Close()
        End If
    End Sub

    Function isLeerNothing(o) As Object
        Return IIf(o = "", Nothing, o)
    End Function

    Private Sub frmKundenAufschubdatenBearbeiten_Load(sender As Object, e As EventArgs) Handles Me.Load
        init(KundenNr)
    End Sub
End Class