Imports System.IO
Public Class Form3

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

    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Form2.Show()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        frmgenerate.Show()
        Me.Hide()
    End Sub

    Private Sub btnCirculation_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCirculation.Click
        Form2.Show()
        Me.Hide()
    End Sub

    Private Sub btnMaintenance_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMaintenance.Click
        Try
            Dim fbd As New FolderBrowserDialog
            If fbd.ShowDialog() = vbOK Then
                File.Copy("GenerallPayroll.accdb", fbd.SelectedPath & "\GenerallPayroll.accdb")
                MsgBox("Done...")
            End If
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub btnLogout_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogout.Click
        If MsgBox("Do you want to log-out?", vbYesNo + vbQuestion) = vbYes Then
            FormLogin.Show()
            Me.Close()




        End If
    End Sub

    Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
        Try
            System.Diagnostics.Process.Start("Notepad.exe")
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Private Sub CalculatorToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CalculatorToolStripMenuItem.Click
        Try
            System.Diagnostics.Process.Start("Calc.exe")
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label2.Text = FormLogin.TextBox1.Text
        Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        lblTime.Text = DateTime.Now.ToString("hh:mm:ss tt")
        lblDate.Text = DateTime.Now.ToString("MMMM  dd  yyyy")
    End Sub

    Private Sub btnCataloging_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCataloging.Click
        frmEmployee.Show()
        Me.Hide()

    End Sub

    Private Sub AddStaffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddStaffToolStripMenuItem.Click
        frmaddstaff.Show()

    End Sub

    Private Sub RemoveStaffToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveStaffToolStripMenuItem.Click
        frmremovestaff.Show()

    End Sub
End Class