5.system Implementation
5.system Implementation
5.SYSTEM IMPLEMENTATION
ssss
Admin Login:
Imports System.Data.Sql
Imports System.Data.SqlClient
Public Class Admin
Inherits System.Web.UI.Page
Candidate Login:
Imports System.Data.Sql
Imports System.Data.SqlClient
Partial Class candidatelogin
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim sql, sql1 As String
con = New SqlConnection("Data Source=lb3-87;Initial Catalog=reg;User ID=sa;Password=skc")
sql = "select candidateid from canreg"
sql1 = "select password from canreg"
con.Open()
cmd = New SqlCommand(sql, con)
Dim a As Object = cmd.ExecuteScalar
cmd = New SqlCommand(sql1, con)
Dim b As Object = cmd.ExecuteScalar
If TextBox1.Text = a And TextBox2.Text = b Then
MsgBox("Login Success", MsgBoxStyle.OkOnly)
Server.Transfer("Voting1.aspx")
Else
MsgBox("Login Failed", MsgBoxStyle.Exclamation)
TextBox2.Text = ""
End If
End Sub
End Class
Dim a As String
If FileUpload2.HasFile Then
FileUpload2.SaveAs(Server.MapPath(FileUpload2.FileName))
a = "insert into
canreg(candidateid,fname,lname,fathername,gender,dob,addressline1,addressline2,city,state,pinc
ode,phoneno,email,aadhar,certificate,photo,password,confpassword)values('" & TextBox1.Text
& "','" & TextBox14.Text & "','" & TextBox12.Text & "','" & TextBox2.Text & "','" &
RadioButtonList1.SelectedItem.Value & "','" & TextBox3.Text & "','" & TextBox4.Text & "','"
& TextBox5.Text & "','" & DropDownList1.SelectedItem.Value & "','" &
DropDownList2.SelectedItem.Value & "','" & TextBox6.Text & "','" & TextBox7.Text & "','" &
TextBox8.Text & "','" & TextBox13.Text & "','" & FileUpload2.FileName & "','" &
TextBox10.Text & "','" & TextBox11.Text & "')"
End If
cmd = New SqlCommand(a, con)
cmd.ExecuteNonQuery()
MsgBox("Registration Success", MsgBoxStyle.OkOnly)
con.Close()
End Sub
End Class
Voter Login:
Imports System.Data.Sql
Imports System.Data.SqlClient
Partial Class Voterlogin
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim con As SqlConnection
Dim cmd As SqlCommand
Dim sql, sql1 As String
con = New SqlConnection("Data Source=lb3-87;Initial Catalog=reg;User ID=sa;Password=skc")
sql = "select voterid from votreg"
sql1 = "select password from votreg"
con.Open()
cmd = New SqlCommand(sql, con)
Dim a As Object = cmd.ExecuteScalar
cmd = New SqlCommand(sql1, con)
Dim b As Object = cmd.ExecuteScalar
If TextBox1.Text = a And TextBox2.Text = b Then
MsgBox("Login Success", MsgBoxStyle.OkOnly)
Server.Transfer("Voting.aspx")
Else
MsgBox("Login Failed", MsgBoxStyle.Exclamation)
TextBox2.Text = ""
End If
End Sub
End Class
Voting:
Imports System.Data.Sql
Imports System.Data.SqlClient
Partial Class Voting
Inherits System.Web.UI.Page
Protected Sub ImageButton5_Click(ByVal sender As Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles ImageButton5.Click
Dim con As SqlConnection
Dim cmd As SqlCommand