Public Class frmRegistration

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

        btnsubmit.Enabled = False
        Panel1.Hide()
        Panel2.Hide()
       

    End Sub

    

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


        Confirm.Show()


    End Sub

  
    Private Sub btnregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnregister.Click



        Dim sql As String

        sql = "select * from tblVoters where StudentId='" & txtStudentId.Text & "'"
        ejbfindthis(sql)
        checkRegistration()
        MsgBox("Vote Wisely")



    End Sub

    Private Sub btnsubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsubmit.Click

        Dim sql As String

        sql = "select * from tblCandidate where cand_name ='" & lblPres.Text & "'"
        ejbfindthis(Sql)
        VoteScore()

        sql = "select * from tblCandidate where cand_name ='" & lblVpre.Text & "'"
        ejbfindthis(sql)
        VoteScore()


        ejbupdateVote("UPDATE tblVoters set VoteMonitor = Yes where StudentId = '" & txtStudentId.Text & "'")


        frmRegistration_Load(sender, e)

        Me.Close()



        frmBallot.Show()


    End Sub

    Private Sub ComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged

        lblPres.Text = ComboBox1.Text


    End Sub

    Private Sub ComboBox2_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox2.TextChanged
        lblVpre.Text = ComboBox2.Text
    End Sub
End Class