Public Class frmTrainings

    Private Sub GenPayFinalBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.GenPayFinalBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.GenerallPayrollDataSet)

    End Sub

    Private Sub frmTrainings_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'GenerallPayrollDataSet.GenPayFinal' table. You can move, or remove it, as needed.
        Me.GenPayFinalTableAdapter.Fill(Me.GenerallPayrollDataSet.GenPayFinal)

    End Sub

    Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
        If ComboBox1.Text = "LastName" Then
            Me.GenPayFinalBindingSource.Filter = "RMKS LIKE '" & txtSearch.Text & "%'"
        Else
            ComboBox1.Text = "Trainings"
            Me.GenPayFinalBindingSource.Filter = "TRWQ LIKE '" & txtSearch.Text & "%'"

        End If
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
        
    End Sub

    Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
        e.Graphics.DrawString(txtReceipt.Text, Font, Brushes.Black, 140, 140)
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
        txtReceipt.Text = ""
        txtReceipt.AppendText("                     Employee Information                       " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("Training Number: " + vbTab & PlantIDTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Employee ID: " + vbTab + vbTab & EmployeeNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Department: " + vbTab + vbTab & NameOfRecepientTextBox.Text + vbNewLine)
        txtReceipt.AppendText("First Name: " + vbTab + vbTab & RTOBTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Middle Name: " + vbTab + vbTab & SignatureTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Last Name: " + vbTab + vbTab & RMKSTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Title of Training: " + vbTab + vbTab & TRWQTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Inclusive Dates: " + vbTab + vbTab & HYTTTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Venue Name: " + vbTab + vbTab & BTQQQTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Conducted and Sponsored by: " & BTSSTextBox.Text + vbNewLine)
        txtReceipt.AppendText("___________________________________________" + vbNewLine)

        PrintPreviewDialog1.ShowDialog()
    End Sub

    Private Sub frmTrainings_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
        Form3.Show()

    End Sub
End Class