Public Class frmviewEmployee

    Private Sub TblEmployeeBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.TblEmployeeBindingSource.EndEdit()
        Me.TableAdapterManager.UpdateAll(Me.EmployeeDataDataSet)

    End Sub

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

    End Sub

    Private Sub txtSearch_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtSearch.TextChanged
        Me.TblEmployeeBindingSource.Filter = "LastName LIKE '" & txtSearch.Text & "%'"
    End Sub

    Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click

        txtReceipt.Text = ""
        txtReceipt.AppendText("                     Personal Information                       " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("Employee ID: " + vbTab & EmployeeNumberTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Department: " + vbTab & DepartmentTextBox.Text + vbNewLine)
        txtReceipt.AppendText("First Name: " + vbTab & FirstNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Middle Name: " + vbTab & MiddleNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Last Name: " + vbTab & LastNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Birth Date: " + vbTab & BirthDateTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Age: " + vbTab + vbTab & AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Address: " + vbTab & PAddressTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Citizenship: " + vbTab & CitizenShipTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Contact Number: " & ContactNumberTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Place of Birth: " + vbTab & PlaceOfBirthTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Height: " + vbTab + vbTab & HeightTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Weight: " + vbTab + vbTab & WeightTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Blood Type: " + vbTab & BloodTypeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Gender: " + vbTab + vbTab & GenderTextBox1.Text + vbNewLine)
        txtReceipt.AppendText("Status: " + vbTab + vbTab & STATUSLTextBox1.Text + vbNewLine)
        txtReceipt.AppendText("Email: " + vbTab + vbTab & EmailAddressTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Pag-IBIG #: " + vbTab & Pag_IBIGIDNumberTextBox.Text + vbNewLine)
        txtReceipt.AppendText("GSIS ID: " + vbTab & GSISIDTextBox.Text + vbNewLine)
        txtReceipt.AppendText("PhilHealth: " + vbTab & PhilHealthTextBox.Text + vbNewLine)
        txtReceipt.AppendText("SSS: " + vbTab + vbTab & SSSTextBox.Text + vbNewLine)
        txtReceipt.AppendText("TIN: " + vbTab + vbTab & TINTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Employee Status: " & EmployeeStatusTextBox1.Text + vbNewLine)
        txtReceipt.AppendText("___________________________________________________________________________________________________________" + vbNewLine)

        txtReceipt.AppendText("                     Educational Attainment                       " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("Elementary: " + vbTab + vbTab & ElementaryTextBox.Text + vbNewLine)
        txtReceipt.AppendText("High School: " + vbTab + vbTab & HighSchoolTextBox.Text + vbNewLine)
        txtReceipt.AppendText("College: " + vbTab + vbTab & CollegeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Vocational Trade Course: " + vbTab & VocationalTradeCourseTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Degree Course: " + vbTab + vbTab & DegreeCourseTextBox.Text + vbNewLine)
        txtReceipt.AppendText("* " + vbTab + vbTab + vbTab & DegreeCourse1TextBox.Text + vbNewLine)
        txtReceipt.AppendText("* " + vbTab + vbTab + vbTab & DegreeCourse2TextBox.Text + vbNewLine)
        txtReceipt.AppendText("* " + vbTab + vbTab + vbTab & DegreeCourse3TextBox.Text + vbNewLine)
        txtReceipt.AppendText("* " + vbTab + vbTab + vbTab & DegreeCourse4TextBox.Text + vbNewLine)
        txtReceipt.AppendText("___________________________________________________________________________________________________________" + vbNewLine)

        txtReceipt.AppendText("                     Name of Children ( Full List )                       " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("1 :" + vbTab & ChildName1AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("2 :" + vbTab & ChildName2AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("3 :" + vbTab & ChildName3AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("4 :" + vbTab & ChildName4AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("5 :" + vbTab & ChildName5AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("6 :" + vbTab & ChildName6AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("7 :" + vbTab & ChildName7AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("8 :" + vbTab & ChildName8AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("9 :" + vbTab & ChildName9AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("10 :" + vbTab & ChildName10AgeTextBox.Text + vbNewLine)
        txtReceipt.AppendText("___________________________________________________________________________________________________________" + vbNewLine)

        txtReceipt.AppendText("                     Family Background                       " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText(" Spouse Name                       " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("First Name: " + vbTab & SecFirstNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Name Extension: " & SecNameExtensionTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Middle Name: " + vbTab & SecMiddleNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Last Name: " + vbTab & SecLastNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Birth Date: " + vbTab & SecBirthdateTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Occupation: " + vbTab & SecOccupationTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Contact Number: " & SecContactNumberTextBox.Text + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText(" Mother`s Maiden Name                             Fathers Name " + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("First Name: " + vbTab & MoFirstNameTextBox.Text + vbTab + vbTab + vbTab & " First Name: " + vbTab & FaFirstNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Middle Name: " + vbTab & MoMiddleNameTextBox.Text + vbTab + vbTab + vbTab & " Name Extension: " & FaNameExtensionTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Last Name: " + vbTab & MoLastNameTextBox.Text + vbTab + vbTab + vbTab & " Middle Name: " + vbTab & FaNameExtensionTextBox.Text + vbNewLine)
        txtReceipt.AppendText("Occupation: " + vbTab & MoOccupationTextBox.Text + vbTab + vbTab + vbTab & " Last Name: " + vbTab & FaLastNameTextBox.Text + vbNewLine)
        txtReceipt.AppendText("" + vbTab + vbTab + vbTab + vbTab + vbTab & " Occupation: " + vbTab & FaOccupationTextBox.Text + vbNewLine)
        txtReceipt.AppendText("" + vbNewLine)
        txtReceipt.AppendText("___________________________________________________________________________________________________________" + vbNewLine)

        PrintPreviewDialog1.ShowDialog()
    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)
        e.Graphics.DrawImage(Me.PictureBox1.Image, 490, 130, PictureBox1.Width - 15, PictureBox1.Height - 25)
        Try
            e.Graphics.DrawImage(Me.TblPhotoPictureBox.Image, 500, 144, TblPhotoPictureBox.Width - 15, TblPhotoPictureBox.Height - 25)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()

    End Sub

    Private Sub PrintPreviewDialog1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PrintPreviewDialog1.Load

    End Sub

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

    End Sub
End Class