Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Timer1.Start()

        btnopen.Enabled = False
        btnreset.Enabled = False
        btnview.Enabled = False
        btnvotersid.Enabled = False
        btnunfnshvoter.Enabled = False
        btnAddID.Enabled = False
        btnviewcand.Enabled = False
        btnuseracc.Enabled = False

    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Label1.Text = TimeOfDay

    End Sub

    Private Sub btnloin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnloin.Click

        Dim f As Form = New login()

        f.Show()
        f.Focus()

        If btnloin.Text = "Log-Out" Then

            btnloin.Text = "Log In"

            btnopen.Enabled = False
            btnreset.Enabled = False
            btnview.Enabled = False
            btnvotersid.Enabled = False
            btnunfnshvoter.Enabled = False
            btnAddID.Enabled = False
            btnviewcand.Enabled = False
            btnuseracc.Enabled = False


        Else
            btnloin.Text = "Log In"


        End If

    End Sub

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

    End Sub

    Private Sub btnviewcand_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnviewcand.Click

        Dim f As Form = New frmCandidates()

        f.ShowDialog()
    End Sub

    Private Sub btnAddID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddID.Click

        Dim f As Form = New frmVoters()

        f.ShowDialog()
    End Sub

    Private Sub btnunfnshvoter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnunfnshvoter.Click
        Dim f As Form = New frmWalaVote()

        f.ShowDialog()


    End Sub

    Private Sub btnvotersid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnvotersid.Click

        Dim f As Form = New frmScore()

        f.ShowDialog()
    End Sub

    Private Sub btnview_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnview.Click

        Dim f As Form = New frmVotingDetails()

        f.ShowDialog()
    End Sub

    Private Sub btnopen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnopen.Click

        'Me.Hide()
        Dim f As Form = New frmAy()

        f.ShowDialog()

        'frmRegistration.Show()

    End Sub

    Private Sub btnreset_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnreset.Click
        MsgBox("YOU SURE")
        ejbupdate("update tblCandidate set cand_score = 0")

    End Sub

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


        Dim f As Form = New frmUserAccountsProfile()

        f.ShowDialog()
    End Sub
End Class
