History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
Online voting
1. 1. INTRODUCTION
1.1 SYNOPSIS
The project titled “Online Voting System” is designed using ASP.NET as front end and SQL
SERVER as back end.
This project deals with voting in online. We can implement this software in a campus,
society or the State . This project mainly contains three levels, users Administrator, super wiser
of a booth and members. The Voters are thoroughly scrutinized and high end security system is
implemented , for maintaining a transparent and smooth Vote casing procedure.
Modules of the Project
1. Administrator
a. Creating Candidate
b. Confirm Members
c. Count Vote
d. Result
2. Users
a. Member registration
b. View Candidates
c. Voting
2. PROJECT DESCRIPTION
MODULE DESIGN
The proposed system consists of two modules,
• Administrator Module
• User Module
USER (VOTER) MODULE
User interface consists of a login name and unique password using which he/she can login into
the Online Voting System. This will be supplied by the administrator to the user. Once the user has
logged in, he has the privilege to view the names of the candidates listed by the administrator, view the
results after the termination date of the election. The user module constitutes only one sub module:
Authentication & Voting
• Each voter is provided with unique username and password manually by the administrator. The
voter uses the username and password for login and exercise the fundamental right of voting. if
incorrect username and password entered, the access to is denied to the user. And also voter is
allowed to vote only once. This is the security feature provided against external access of the
system.
• After login the voter enters the voter home page ,which provides the links :
Candidate List
This facilitates the voter to view the candidate names, the constituency name, their symbol
and their party name.
3. Vote
This provides the voter with a list of candidate with in his/her constituency along with
selection option (radio button) to select the preferred candidate from the list. If the voting date is
before termination date, the vote goes valid else goes invalid.
View Results
This provides graphical and user friendly representation of the votes obtained by each
candidate. It includes the percentage of the votes obtained by each candidate. But the result can be
viewed only after the termination date of the election.
Logout
This provides an option for the voter to quit the session ,while in the voter home page.
ADMINISTRATOR MOD
Administrator interface consists of a login name and unique password using which admin
can login into the Online Voting System. Administrator has the main control of the system. By logging
into the page it can perform the following tasks.
Add Candidate
Here the admin can add the list of candidates in the election. It includes candidates name,
address.gender,party, party symbol etc. The candidates will be added to the list only after completing
the procedures.
Add Voter
Here the voters can be added to the database. The voters have also the privilege to check the voters
list from the homepage. The voters details includes name, address, gender, age, constituency, image etc.
4. Add Election
Here the election to be conducted is selected. To add an election the constituency should be selected
and termination date of election should be specified.
Add Constituency
The constituency that is going to conduct election should be selected.
Voters List
Here we can view the voters list. Each constituency will be having separate voters list.
Candidate List
The list of candidates participating in the election can be seen. It includes the candidates name, party
name and party symbol.
The sub-modules of administrator are:
Voting Structure,
Voters Registration
Candidate Registration
Counting & Categorization of Results
Voting Structure
Here the eligible voters who are permitted to login to the system can utilize the right to vote.
Each voter can register a single vote to a candidate’s favour in his/her constituency. The security
measures taken within the system prevents them from exercising their votes again i.e. the second vote
by the same user goes invalid. The starting and ending dates of the election are specified by the
administrator. The user must have an identity card and he must be in voters list.
5. Voters Registration
The registration procedure of all the eligible voters .This registration process is done by the
administrator. According to voters database each voter is provided with a unique identification codes
which includes username and password.
The details of the voters include username, password, name, address, gender, constituency,
image etc.With the voter registration, thus producing the voter list with the given information of the
voters. The voter list can be viewed by anyone accessing the webpage. The admin can view the voter list
with in his homepage.
Candidate Registration
The registration of the candidates in each constituency is done by the administrator. The details
of the candidate includes name, address, gender ,his/her constituency, party and image. With the
candidate registration, thus producing the candidate list with the given information of the candidates.
The candidate list can be viewed by admin and the vote within their respective homepages. According to
candidates database (manual) each details of the candidates are stored in database controlled by the
admin including candidates details.
Counting & Categorization of Results
When the voter votes, the number of votes obtained by the selected candidate is incremented
by 1.The result is published only after the voting process is over. It is accessible from the next day after
the termination date. Here we depict the result in the graphical representation according to the
percentage of vote obtained by the candidate. Result can be viewed by everyone who visits into the site
without any authentication problem. A link to view the result is kept in the index page and both admin
and voter can view the result in their respective homepages. When the user clicks the “RESULT” link,
before the termination date of theelection, “Result not Published yet” Message will be displayed. The
result comes with their party symbol on the top of the graph representing the percentage of vote
obtained by each candidate.
21. CONCLUSION
In Performing Analysis, Design, Coding and Implementation we had made success in
matching the system objectives with the goals of the organization. The newly developed system
consumes less processing time and productivity is increased. Since the Navigation is
maintained throughout the system they are much user-friendlier. Even a Novice user can use
this System.
22. APPENDIX
CODING
Add Candidate
Imports System.Data.SqlClient
Imports System.Data
Partial Class Add_candidate
Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
Dim con1 As New SqlConnection
Dim cmd1 As New SqlCommand
Dim dr1 As SqlDataReader
Dim st
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
con1 = New SqlConnection("uid=sa;pwd=;Database=voting")
con1.Open()
End Sub
Public Sub cid()
cmd1 = New SqlCommand("select count(*)from Candidate_list", con1)
dr1 = cmd1.ExecuteReader
While dr1.Read
st = dr1.Item(0) + 1
End While
dr1.Close()
End Sub
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn1.Click
path = imgpath
cid()
Dim insert As String = "insert into Candidate_List values(" +
Trim(st) + ",'" & tb1.Text & "',@imageload,'" & tb2.Text & "','" & tb3.Text &
"','" & tb4.Text & "','" & tb5.Text & "')"
Dim cmd As New SqlCommand(insert, con)
cmd.Parameters.Add("@imageload", SqlDbType.Image)
cmd.Parameters("@imageload").Value = getbytefile(path)
con.Open()
cmd.ExecuteNonQuery()
MsgBox("RECORD INSERTED", MsgBoxStyle.OkOnly, "Insert")
con.Close()
Response.Redirect("Modify.aspx")
End Sub
Dim path As String
23. Shared imgpath As String
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
Try
path = up.Value
imgpath = path
image1.Src = imgpath
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
Function getbytefile(ByVal path) As Byte()
Dim fs As New System.IO.FileStream(path, IO.FileMode.Open,
IO.FileAccess.Read)
Dim b(fs.Length - 1) As Byte
fs.Read(b, 0, fs.Length - 1)
Return b
End Function
End Class
Add Voter
Imports System.Data.SqlClient
Imports System.Data
Partial Class Add_Voter
Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
Shared secret As String
Dim st As Integer
Dim con1 As New SqlConnection
Dim cmd1 As New SqlCommand
Dim dr1 As SqlDataReader
Dim stt
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn1.Click
'Dim cmd As New SqlCommand("insert into imge values(@imageload)", con)
'Image1.ImageUrl = up.Value
vid()
scode()
path = imgpath
Dim insert As String = "insert into Voter_List values(" + Trim(st) +
",'" & tb1.Text & "','" & stt & "',@imageload,'" & tb3.Text & "','" &
tb4.Text & "','" & tb5.Text & "','" & tb6.Text & "','" & tb7.Text & "','" &
tb8.Text & "')"
24. Dim cmd As New SqlCommand(insert, con)
cmd.Parameters.Add("@imageload", SqlDbType.Image)
cmd.Parameters("@imageload").Value = getbytefile(path)
con.Open()
cmd.ExecuteNonQuery()
MsgBox("RECORD INSERTED", MsgBoxStyle.OkOnly, "Insert")
con.Close()
Response.Redirect("Modify.aspx")
End Sub
Public Sub vid()
cmd1 = New SqlCommand("select count(*)from voter_list", con1)
dr1 = cmd1.ExecuteReader
While dr1.Read
st = dr1.Item(0) + 1
End While
dr1.Close()
End Sub
Public Sub scode()
cmd1 = New SqlCommand("select count(*)from voter_list", con1)
dr1 = cmd1.ExecuteReader
While dr1.Read
stt = dr1.Item(0) + 20001
End While
dr1.Close()
End Sub
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button1.Click
Response.Redirect("Modify.aspx")
End Sub
Protected Sub tb1_TextChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles tb1.TextChanged
'Dim rnd As New Random
'If tb1.Text = "" Then
' Response.Write("<script defer>alert('provide voter
name')</script>")
' secret = "TnGoV"
'Else
' secret = "TnGoV"
'End If
'Dim s As String = tb1.Text
'secret = s.Substring(2, 4) & secret
'secret = StringEncryption.SimpleEncrypt(secret)
End Sub
Dim path As String
Shared imgpath As String
25. Protected Sub btnup_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnup.Click
Try
imgpath = up.Value
img1.Src = imgpath
Catch ex As Exception
Response.Write(ex.Message)
End Try
End Sub
Function getbytefile(ByVal path) As Byte()
Dim fs As New System.IO.FileStream(path, IO.FileMode.Open,
IO.FileAccess.Read)
Dim b(fs.Length - 1) As Byte
fs.Read(b, 0, fs.Length - 1)
Return b
End Function
Public Sub New()
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
con1 = New SqlConnection("uid=sa;pwd=;Database=voting")
con1.Open()
End Sub
End Class
Candidate List
Imports System.Data.SqlClient
Imports System.Data
Partial Class Candidate_Listaspx
Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim cmd As New SqlCommand("Select distinct Candidate_Area from
Candidate_List", con)
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader
While dr.Read
Dim Sym As New ListItem
26. Sym.Text = dr("Candidate_Area")
Sym.Value = dr(0)
ddl1.Items.Add(Sym)
End While
con.Close()
End If
End Sub
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn1.Click
bind()
End Sub
Protected Sub dg1_CancelCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.CancelCommand
End Sub
Protected Sub dg1_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
dg1.PageIndexChanged
dg1.CurrentPageIndex = e.NewPageIndex
bind()
End Sub
Sub bind()
Dim cmd As New SqlCommand("select
Candidate_Name,Candidate_Image,Candidate_Symbol,Candidate_Party,Candidate_Are
a from Candidate_List where Candidate_Area='" & ddl1.SelectedItem.Text & "'",
con)
con.Open()
Dim adap As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adap.Fill(ds)
dg1.DataSource = ds
dg1.DataBind()
con.Close()
End Sub
End Class
Candidate Modification
Imports System.Data
Imports System.Data.SqlClient
Partial Class Candidate_Modification
Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
27. Function bind1()
Dim cmd As New SqlCommand("Select * from Candidate_List", con)
Dim adp As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adp.Fill(ds)
dg1.DataSource = ds
dg1.DataBind()
Return ds
End Function
Protected Sub dg1_CancelCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.CancelCommand
dg1.EditItemIndex = -1
Dim ds As DataSet = bind1()
' binddata(ds)
End Sub
Protected Sub dg1_DeleteCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.DeleteCommand
End Sub
Protected Sub dg1_EditCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.EditCommand
dg1.EditItemIndex = e.Item.ItemIndex
Dim ds As DataSet = bind1()
'binddata(ds)
End Sub
Sub binddata(ByVal ds As DataSet)
dg1.DataSource = ds.Tables("Candidate_List")
Me.DataBind()
End Sub
Protected Sub dg1_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.UpdateCommand
Dim name, city, party, symbol As String
name = CType(e.Item.FindControl("txtname"), TextBox).Text
city = CType(e.Item.FindControl("txtarea"), TextBox).Text
party = CType(e.Item.FindControl("txtparty"), TextBox).Text
symbol = CType(e.Item.FindControl("txtsym"), TextBox).Text
Dim ID As Integer
ID = e.Item.Cells(0).Text
Dim update As String
update = "Update Candidate_List set Candidate_Name='" & name &
"',Candidate_Symbol='" & symbol & "',Candidate_Party='" & party &
"',Candidate_Area='" & city & "' where Candidate_Id=" & ID
Dim cmd As New SqlCommand(update, con)
con.Open()
cmd.ExecuteNonQuery()
MsgBox("RECORD UPDATED", MsgBoxStyle.OkOnly, "UPDATED")
con.Close()
Response.Redirect("modify.aspx")
End Sub
28. Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
bind1()
End If
End Sub
Protected Sub dg1_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
dg1.PageIndexChanged
dg1.CurrentPageIndex = e.NewPageIndex
bind1()
End Sub
Protected Sub dg1_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.ItemCommand
If e.CommandName = "Delete" Then
Dim id As Integer
id = e.Item.Cells(0).Text
Dim cmd As New SqlCommand("Delete Candidate_List where
Candidate_Id=" & id, con)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
bind1()
' Response.Redirect("Candidate Modification.aspx")
End If
End Sub
Protected Sub dg1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles dg1.SelectedIndexChanged
End Sub
End Class
Topper List
Imports System.Data.SqlClient
Imports System.Data
Partial Class Topper_List
Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim cmd As New SqlCommand("Select distinct Candidate_Area from
Candidate_List", con)
con.Open()
29. Dim dr As SqlDataReader = cmd.ExecuteReader
While dr.Read
Dim Sym As New ListItem
Sym.Text = dr("Candidate_Area")
Sym.Value = dr(0)
ddl1.Items.Add(Sym)
End While
con.Close()
End If
End Sub
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn1.Click
Dim cmd As New SqlCommand("select * from Candidate_List where
Candidate_Area='" & ddl1.SelectedItem.Text & "' order by Number_Of_Votes desc
", con)
con.Open()
Dim adap As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adap.Fill(ds)
dg1.DataSource = ds
dg1.DataBind()
con.Close()
End Sub
End Class
Vote Page
Partial Class Vote_Page
Inherits System.Web.UI.Page
Dim ke As String
Protected Sub btn_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn.Click
If rdb1.SelectedItem.Text = "Select by Candidates" Then
Session("ke") = "Candidates"
callng()
ElseIf rdb1.SelectedItem.Text = "Select by Symbols" Then
Session("ke") = "Symbols"
callng()
Else
Session("ke") = "Party"
callng()
End If
End Sub
Sub callng()
Response.Redirect("Voting Page.aspx")
End Sub
End Class
30. Voter Modification
Imports System.Data
Imports System.Data.SqlClient
Partial Class Voter_modification
Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
Function bind1()
Dim cmd As New SqlCommand("Select * from Voter_List", con)
Dim adp As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adp.Fill(ds)
dg1.DataSource = ds
dg1.DataBind()
Return ds
End Function
Protected Sub dg1_CancelCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.CancelCommand
dg1.EditItemIndex = -1
Dim ds As DataSet = bind1()
' binddata(ds)
End Sub
Protected Sub dg1_DeleteCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.DeleteCommand
End Sub
Protected Sub dg1_EditCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.EditCommand
dg1.EditItemIndex = e.Item.ItemIndex
Dim ds As DataSet = bind1()
'binddata(ds)
End Sub
Sub binddata(ByVal ds As DataSet)
dg1.DataSource = ds.Tables("Candidate_List")
Me.DataBind()
End Sub
Protected Sub dg1_UpdateCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.UpdateCommand
Dim name, seccode, fname, age, add, city, state As String
name = CType(e.Item.FindControl("txtname"), TextBox).Text
seccode = CType(e.Item.FindControl("txtsec"), TextBox).Text
fname = CType(e.Item.FindControl("txtfname"), TextBox).Text
age = CType(e.Item.FindControl("txtage"), TextBox).Text
add = CType(e.Item.FindControl("txtadd"), TextBox).Text
city = CType(e.Item.FindControl("txtcity"), TextBox).Text
31. state = CType(e.Item.FindControl("txtstate"), TextBox).Text
Dim ID As Integer
ID = e.Item.Cells(0).Text
Dim update As String
update = "Update Voter_List set Voter_Name='" & name & "',
[Voter_Secret Code]='" & seccode & "',[Father_Name/Husband_Name]='" & fname &
"',Voter_Age='" & age & "',Voter_Address='" & add & "',Voter_City='" & city &
"', Voter_State='" & state & "' where Voter_Id=" & ID
Dim cmd As New SqlCommand(update, con)
con.Open()
cmd.ExecuteNonQuery()
MsgBox("RECORD UPDATED", MsgBoxStyle.OkOnly, "UPDATED")
con.Close()
Response.Redirect("modify.aspx")
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
bind1()
End If
End Sub
Protected Sub dg1_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dg1.ItemCommand
If e.CommandName = "Delete" Then
Dim id As Integer
id = e.Item.Cells(0).Text
Dim cmd As New SqlCommand("Delete Voter_List where Voter_Id=" &
id, con)
con.Open()
cmd.ExecuteNonQuery()
con.Close()
bind1()
End If
End Sub
Protected Sub dg1_PageIndexChanged(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataGridPageChangedEventArgs) Handles
dg1.PageIndexChanged
dg1.CurrentPageIndex = e.NewPageIndex
bind1()
End Sub
End Class
Voter List
Imports System.Data.SqlClient
Imports System.Data
Partial Class _Default
32. Inherits System.Web.UI.Page
Dim con As New SqlConnection("initial catalog=Voting; uid=sa; pwd=;
connect timeout=1500")
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim cmd As New SqlCommand("Select distinct Voter_City from
Voter_List", con)
con.Open()
Dim dr As SqlDataReader = cmd.ExecuteReader
While dr.Read
Dim Sym As New ListItem
Sym.Text = dr("Voter_City")
Sym.Value = dr(0)
ddl1.Items.Add(Sym)
End While
con.Close()
End If
End Sub
Protected Sub btn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btn1.Click
Dim cmd As New SqlCommand("select * from Voter_List where
Voter_City='" & ddl1.SelectedItem.Text & "'", con)
con.Open()
Dim adap As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adap.Fill(ds)
dg1.DataSource = ds
dg1.DataBind()
con.Close()
End Sub
End Class
33. BIBLIOGRAPHY
Book Reference
1. “E-Commerce security issues” – Randy C. Marchany, Joseph G. Tront,
-Proceedings Of the 35th Hawaii Intemational Conference on
System Sciences,(January 7- 10,2002.)
2. “Electronic Commerce and the Law” - Lim, E.,
-Bcom (Honors) Dissertation, MSIS, University of Auckland,
NewZealand,(2000).
3. “Investigating Web Services on the World Wide Web” - E. Al-Masri, and Q.H.
Mahmoud,
-In Proceedings of the 17th International World Wide Web
Conference (WWW2008), pp. 795-804, (2008).
4. “Efficient and Transparent Web Services Selection,” - N. Gibelin and M.
Makpangou,
34. -In Proceedings of the International Conference on Service
Oriented Computing (ICSOC), 38(26):527-532. (2005).
5.“Toward Autonomic Web Services Trust and election,” –M. Maximilien, and
M. Singh,
- Proceedings of 2nd International Conference on Service
Oriented Computing, pp. 212-221, (2004)
Web Reference
www.altavista.com
www.asp.net.com
www.google.com
www.sourcecode.com