Imports IntraSell_DLL
Imports IntraSell_Net_Base

Public Class PLZ
    Inherits AbstractForm

    Private Sub Form_Verlassen() Handles MyBase.Verlassen
        Me.Close()
    End Sub
    Private Sub GrlandBindingNavigatorSaveItem_Click(sender As Object, e As System.EventArgs) Handles MyBase.Save
        Try
            Validate()
            GrPLZBindingSource.EndEdit()
            TableAdapterManager.UpdateAll(DsPLZ)


        Catch ex As Exception
            HandleAppError(ex)
        End Try
    End Sub

    Private Sub Land_Load(sender As Object, e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'DsPLZ.grplz' table. You can move, or remove it, as needed.

        Try
            GrlandTableAdapter.Fill(DsPLZ.grland)
            GrplzTableAdapter.Fill(DsPLZ.grplz)
            ds = DsPLZ
            ParentBindingNavigator.BindingSource = GrPLZBindingSource
        Catch ex As Exception
            HandleAppError(ex)
        End Try
    End Sub

    Private Sub TextBoxFilter_TextChanged(sender As Object, e As EventArgs) Handles TextBoxFilter.TextChanged
        Try
            Dim suche = TextBoxFilter.Text
            'filter dataset 
            If TextBoxFilter.Text.Length > 0 Then
                GrPLZBindingSource.Filter = "Ort like '%" + suche + "%' or PLZ Like '%" + suche + "%'"
            Else
                GrPLZBindingSource.Filter = Nothing
            End If
        Catch ex As Exception
            HandleAppError(ex)
        End Try
    End Sub
End Class