Public Class frmBelegFinden
    Public art = ""
    Public Standard_RKSV_KasseId = ""
    Public BenutzerId As Integer = -1

    Private Sub txt_KeyDown(sender As Object, e As KeyEventArgs) Handles txtBelegNrAlt.KeyDown, dat.KeyDown
        If e.KeyCode = Keys.Return Then
            btnOK.PerformClick()
        End If
        If e.KeyCode = Keys.Escape Then
            FlatButton1.PerformClick()
        End If
    End Sub

    Private Sub txt_KeyDown2(sender As Object, e As KeyEventArgs) Handles txtBelegNrNeu.KeyDown
        If e.KeyCode = Keys.Return Then
            btnOKNeu.PerformClick()
        End If
        If e.KeyCode = Keys.Escape Then
            FlatButton1.PerformClick()
        End If

    End Sub
    Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
        Label1.ForeColor = Color.Black
        Label4.ForeColor = Color.Black
        If txtBelegNrAlt.Text = "" Or Not IsNumeric(txtBelegNrAlt.Text) Or Not IsNumeric(cboBenutzer._value) Then
            Label4.ForeColor = Color.Red
            Me.DialogResult = Windows.Forms.DialogResult.None
        End If
        art = "ALT"
    End Sub

    Private Sub frmBelegFinden_Load(sender As Object, e As EventArgs) Handles Me.Load
        cboBenutzer.fillWithSQL("SELECT * FROM Personal WHERE [Standard_RKSV_KasseId]='" & Standard_RKSV_KasseId & "'", True, "FMZOLL", True)
        cboBenutzer.changeItem(BenutzerId)
    End Sub

    Private Sub frmPreisText_Shown(sender As Object, e As EventArgs) Handles Me.Shown
        txtBelegNrNeu.Focus()
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles btnOKNeu.Click
        Label1.ForeColor = Color.Black
        Label4.ForeColor = Color.Black
        If txtBelegNrNeu.Text = "" Or Not IsNumeric(txtBelegNrNeu.Text) Then
            Label1.ForeColor = Color.Red
            Me.DialogResult = Windows.Forms.DialogResult.None
        End If
        art = "NEU"
    End Sub


End Class