You are on page 1of 41

Online voting

system

Abstract

Aim:
The motto of the project is to build an enterprise site, which should

be able to allow people to cast their vote online.

SYSTEM ANALYSIS

Existing System

Remote voting is exercise into two different ways.

1.proxy voting

The person who is unable to be physically present authorized other

person on behalf of him.

2. close envelope ballet

In this the person cast is voter, enclosed in an envelope and post to

register post. The problem with this system is that not always the ballets are

riched in time. The proxy person may exercise other ballet then the one

synthezised the person.

Proposed System

Copyright from integrated ideas consultancy services 2003-2011

1
Online voting
system

In propose system remote and users can exercise .There voter within any favour

using this system any level of voting like ,lokha sab voting,rajya sab voting etc.

In the proposed system we can get the result without manually counting.The

computerized counting is simple and we can access any information of any

party.

Advantage of the proposed system

1. Time saving

2. Working load reduced to a large extent

3. Less prone to errors

4. Information available at time

5. Man power reduced

6. Many tasks are automated

7. It also provide security for the data

Copyright from integrated ideas consultancy services 2003-2011

2
Online voting
system

Modules description

1. Election commissioner: It check about the user details like id proof

and no proxy voting cannot be done. This is election commissioner home

page .

2.Generate voter id:It check details like

name,password,state,address,block,area about the voter.

3Prepare for Election:It check prepare for election like election no and

candidates no.

4.Insert party:We have to insert the party.

5.Automatic counting:It will count how many voting has be done by

public.

Copyright from integrated ideas consultancy services 2003-2011

3
Online voting
system

SYSTEM DESIGN

BLOCK DIAGRAM
Election
Election
Commissioner
Commissioner
Voting
VotingDay
DaySet
Set
Voter Id

Name Result Preparation


Voter
Password
Voting List
Address

Copyright from integrated ideas consultancy services 2003-2011

4
Online voting
system

City

Personal Information

Result

Voting Nation Wide

Candidate View

State Wise

Cast Vote

Party Wise

Voter List Validation

Data Flow Diagram.

Voter ID Result

Voting Date Voting

validation

Copyright from integrated ideas consultancy services 2003-2011

5
Online voting
system

Candidate

Voter ID Validation VVvvV


Validate user
Validate voting
date
Voter Date Validate

All Voters

Voting
Candidate List

Result

E-R Diagram

Entity Relationship Diagram


Voter no

Copyright from integrated


Voter master ideas consultancy services 2003-2011
Name
6
Online voting
system

Block

State Addresss
Participates

Party

Voting
Candidate

Date
has
Vote no

No

Candidates Name

Party

Total vote
Result

Vote no Winner
DataBase Table

Copyright from integrated ideas consultancy services 2003-2011

7
Online voting
system

Voter registration

Copyright from integrated ideas consultancy services 2003-2011

8
Online voting
system

Candidate Details

Copyright from integrated ideas consultancy services 2003-2011

9
Online voting
system

Form Design

Copyright from integrated ideas consultancy services 2003-2011

10
Online voting
system

This form is for election commissioner login

Copyright from integrated ideas consultancy services 2003-2011

11
Online voting
system

This is election commissioner Home page

Copyright from integrated ideas consultancy services 2003-2011

12
Online voting
system

Generate voter ID

Generate voter ID record successfully inserted

Copyright from integrated ideas consultancy services 2003-2011

13
Online voting
system

Copyright from integrated ideas consultancy services 2003-2011

14
Online voting
system

Election information inserted successfully

Voter home module

Copyright from integrated ideas consultancy services 2003-2011

15
Online voting
system

Election details

Copyright from integrated ideas consultancy services 2003-2011

16
Online voting
system

This form is for preparing candidates

Copyright from integrated ideas consultancy services 2003-2011

17
Online voting
system

This form is for insert party

Copyright from integrated ideas consultancy services 2003-2011

18
Online voting
system

Counting form

Copyright from integrated ideas consultancy services 2003-2011

19
Online voting
system

Copyright from integrated ideas consultancy services 2003-2011

20
Online voting
system

Source Code

Election Commissioner Home Page Coding

void Page_Load()

Label1.Text=Session["election"].ToString();

void LinkButton1_Click(object sender, EventArgs e)

Response.Redirect("ElecGenerateVoterId.aspx");

void LinkButton3_Click(object sender, EventArgs e)

Response.Redirect("ElecPrepareCandidates.aspx");

void LinkButton4_Click(object sender, EventArgs e)

Copyright from integrated ideas consultancy services 2003-2011

21
Online voting
system

Response.Redirect("InsertParty.aspx");

void LinkButton5_Click(object sender, EventArgs e)

Response.Redirect("AutomaticCounting.aspx");

void LinkButton2_Click(object sender, EventArgs e)

Response.Redirect("ElecPrepareElection.aspx");

Copyright from integrated ideas consultancy services 2003-2011

22
Online voting
system

Voter Registration Coding

Void page_load()

Response.Write("<h2>"+"Welcome to the Voter Registration page"+"</h2>");

catch(Exception ex)

Response.Write(ex.ToString());

#region this method inert the voter registration data into the database

public int InsertVoterRegistration(string voterid, string voter_password, string

voterretypepassword, string state, string area, string block)

Copyright from integrated ideas consultancy services 2003-2011

23
Online voting
system

string connectionString = "server=\'(local)\'; trusted_connection=true;

database=\'onlinevoting\'";

System.Data.IDbConnection dbConnection = new

System.Data.SqlClient.SqlConnection(connectionString);

string queryString = "INSERT INTO [voterregistration] ([voterid],

[voter_password], [voterretypepasswor" +

"d], [state], [area], [block]) VALUES (@voterid, @voter_password,

@voterretypepas" +

"sword, @state, @area, @block)";

System.Data.IDbCommand dbCommand = new

System.Data.SqlClient.SqlCommand();

dbCommand.CommandText = queryString;

dbCommand.Connection = dbConnection;

System.Data.IDataParameter dbParam_voterid = new

System.Data.SqlClient.SqlParameter();

dbParam_voterid.ParameterName = "@voterid";

dbParam_voterid.Value = voterid;

dbParam_voterid.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_voterid);

System.Data.IDataParameter dbParam_voter_password = new

System.Data.SqlClient.SqlParameter();

dbParam_voter_password.ParameterName = "@voter_password";

dbParam_voter_password.Value = voter_password;

Copyright from integrated ideas consultancy services 2003-2011

24
Online voting
system

dbParam_voter_password.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_voter_password);

System.Data.IDataParameter dbParam_voterretypepassword = new

System.Data.SqlClient.SqlParameter();

dbParam_voterretypepassword.ParameterName = "@voterretypepassword";

dbParam_voterretypepassword.Value = voterretypepassword;

dbParam_voterretypepassword.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_voterretypepassword);

System.Data.IDataParameter dbParam_state = new

System.Data.SqlClient.SqlParameter();

dbParam_state.ParameterName = "@state";

dbParam_state.Value = state;

dbParam_state.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_state);

System.Data.IDataParameter dbParam_area = new

System.Data.SqlClient.SqlParameter();

dbParam_area.ParameterName = "@area";

dbParam_area.Value = area;

dbParam_area.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_area);

System.Data.IDataParameter dbParam_block = new

System.Data.SqlClient.SqlParameter();

dbParam_block.ParameterName = "@block";

dbParam_block.Value = block;

Copyright from integrated ideas consultancy services 2003-2011

25
Online voting
system

dbParam_block.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_block);

int rowsAffected = 0;

dbConnection.Open();

try {

rowsAffected = dbCommand.ExecuteNonQuery();

finally {

dbConnection.Close();

return rowsAffected;

#endregion

Election preparetion Details Coding

void Button1_Click(object sender, EventArgs e)

int i=InsertElection(NewElectionNumber(),

DateTime.Parse(txtDate.Text), txtElecType.Text,txtState.Text);

Copyright from integrated ideas consultancy services 2003-2011

26
Online voting
system

if(i>0)

Response.Write("Election information inserted successfully");

int NewElectionNumber() {

string connectionString = "server=\'(local)\';

trusted_connection=true; database=\'onlinevoting\'";

System.Data.IDbConnection dbConnection = new

System.Data.SqlClient.SqlConnection(connectionString);

string queryString = "SELECT max([election_date].

[election_no]) FROM [election_date]";

System.Data.IDbCommand dbCommand = new

System.Data.SqlClient.SqlCommand();

dbCommand.CommandText = queryString;

dbCommand.Connection = dbConnection;

dbConnection.Open();

System.Data.IDataReader dataReader =

dbCommand.ExecuteReader(System.Data.CommandBehavior.CloseConnection);

int i=0;

while(dataReader.Read())

try

Copyright from integrated ideas consultancy services 2003-2011

27
Online voting
system

i=int.Parse(dataReader[0].ToString());

}catch(Exception ex)

i++;

return i;

int InsertElection(int election_no, System.DateTime date, string

election_type, string state) {

string connectionString = "server=\'(local)\';

trusted_connection=true; database=\'onlinevoting\'";

System.Data.IDbConnection dbConnection = new

System.Data.SqlClient.SqlConnection(connectionString);

string queryString = "INSERT INTO [election_date]

([election_no], [date], [election_type], [state]) VAL" +

"UES (@election_no, @date, @election_type, @state)";

System.Data.IDbCommand dbCommand = new

System.Data.SqlClient.SqlCommand();

dbCommand.CommandText = queryString;

dbCommand.Connection = dbConnection;

Copyright from integrated ideas consultancy services 2003-2011

28
Online voting
system

System.Data.IDataParameter dbParam_election_no = new

System.Data.SqlClient.SqlParameter();

dbParam_election_no.ParameterName = "@election_no";

dbParam_election_no.Value = election_no;

dbParam_election_no.DbType = System.Data.DbType.Int32;

dbCommand.Parameters.Add(dbParam_election_no);

System.Data.IDataParameter dbParam_date = new

System.Data.SqlClient.SqlParameter();

dbParam_date.ParameterName = "@date";

dbParam_date.Value = date;

dbParam_date.DbType = System.Data.DbType.DateTime;

dbCommand.Parameters.Add(dbParam_date);

System.Data.IDataParameter dbParam_election_type = new

System.Data.SqlClient.SqlParameter();

dbParam_election_type.ParameterName = "@election_type";

dbParam_election_type.Value = election_type;

dbParam_election_type.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_election_type);

System.Data.IDataParameter dbParam_state = new

System.Data.SqlClient.SqlParameter();

dbParam_state.ParameterName = "@state";

dbParam_state.Value = state;

dbParam_state.DbType = System.Data.DbType.String;

dbCommand.Parameters.Add(dbParam_state);

int rowsAffected = 0;

dbConnection.Open();

Copyright from integrated ideas consultancy services 2003-2011

29
Online voting
system

try {

rowsAffected = dbCommand.ExecuteNonQuery();

finally {

dbConnection.Close();

return rowsAffected;

void Button2_Click(object sender, EventArgs e)

DataGrid1.DataSource=ElectionDetails();

DataGrid1.DataBind();

System.Data.DataSet ElectionDetails() {

string connectionString = "server=\'(local)\';

trusted_connection=true; database=\'onlinevoting\'";

System.Data.IDbConnection dbConnection = new

System.Data.SqlClient.SqlConnection(connectionString);

string queryString = "SELECT [election_date].* FROM

[election_date] order by date desc";

Copyright from integrated ideas consultancy services 2003-2011

30
Online voting
system

System.Data.IDbCommand dbCommand = new

System.Data.SqlClient.SqlCommand();

dbCommand.CommandText = queryString;

dbCommand.Connection = dbConnection;

System.Data.IDbDataAdapter dataAdapter = new

System.Data.SqlClient.SqlDataAdapter();

dataAdapter.SelectCommand = dbCommand;

System.Data.DataSet dataSet = new System.Data.DataSet();

dataAdapter.Fill(dataSet);

return dataSet;

</script>

<html>

<head>

</head>

<body>

<form runat="server">

<uc1:Header id="Header1" runat="server"></uc1:Header>

<table style="WIDTH: 550px; HEIGHT: 152px"

bgcolor="cornflowerblue" border="3">

<tbody>

<tr>

<td>

<p>
Copyright from integrated ideas consultancy services 2003-2011

31
Online voting
system

<asp:Label id="Label2" runat="server"

text="Name of the

Election"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n

bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n

bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;<asp:TextBox id="txtElecType"

runat="server"></asp:TextBox>

</p>

<p>

Date of the

Election&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs

p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs

p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:TextBox id="txtDate" runat="server"

TextMode="SingleLine"></asp:TextBox>

yy/mm/dd

</p>

<p>

<asp:Label id="Label3" runat="server"

text="State"></asp:Label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp

;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp

;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp

;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp

;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;

<asp:TextBox id="txtState"

runat="server"></asp:TextBox>

Copyright from integrated ideas consultancy services 2003-2011

32
Online voting
system

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;

</p>

<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</p>

<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</p>

</td>

</tr>

</tbody>

</table>

<table style="WIDTH: 551px; HEIGHT: 43px"

bgcolor="cornflowerblue" border="3">

<tbody>

<tr>

<td>

Copyright from integrated ideas consultancy services 2003-2011

33
Online voting
system

<asp:Label id="Label1" runat="server"

text="Enter the Election Details" font-bold="True" height="29px"

width="537px" backcolor="#C0C0FF"></asp:Label></td>

</tr>

</tbody>

</table>

<table style="WIDTH: 549px; HEIGHT: 38px"

bgcolor="cornflowerblue" border="3">

<tbody>

<tr>

<td>

<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

<asp:Button id="Button1"

onclick="Button1_Click" runat="server" Text="Submit"></asp:Button>

&nbsp;&nbsp;<asp:Button id="Button2"

onclick="Button2_Click" runat="server" Text="View Election

Details"></asp:Button>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;

</p>

Copyright from integrated ideas consultancy services 2003-2011

34
Online voting
system

<p>

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

</p>

</td>

</tr>

</tbody>

</table>

<!-- Insert content here -->

</form>

<asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid>

</body>

</html>

SQL Server queries


create database onlinevoting
use onlinevoting

Copyright from integrated ideas consultancy services 2003-2011

35
Online voting
system

create table voterregistration(voterid varchar(50),voter_password


varchar(50),voterretypepassword varchar(100),state varchar(100),area
varchar(50),block varchar(100))
select * from voterregistration
delete from voterregistration
create table electioncomLogin(ele_name varchar(100),ele_password
varchar(100))
insert into electioncomLogin values('online','voting')

create table generatevoterid(voter_id int,voter_name


varchar(100),photo_string varchar(100),address varchar(200),dateofbirth
DateTime,fathersname varchar(100))
drop table generatevoterid
select * from generatevoterid
delete from generatevoterid

create table election_date(election_no int,date datetime,election_type


varchar(100),state varchar(100))
create table party(name varchar(100),symbol varchar(200))
insert into party values('BJP','BJP.jpg')
insert into party values('congress','Congress.jpg')
delete from party
select * from party
select * from election_date
delete from election_date

create table candidate(election_no int,candidate_no int,name


varchar(100),party varchar(100),state varchar(100),block varchar(100))
select * from candidate
delete from candidate

create table castvote(voter_id int,election_no int)


create table vote(election_no int,candidate_no int,total_vote int)
insert into vote values(1,2,0)
select * from vote
select * from vote
delete from vote

select
vote.election_no,vote.candidate_no,candidate.name,vote.total_vote,party.
name as party,candidate.state,candidate.block from vote,party,candidate
where (total_vote =(select max(total_vote) from vote where
election_no=1)) and (party.name=candidate.party) and
(candidate.candidate_no=vote.candidate_no) and (candidate.block in
(select distinct(block)from candidate))

Copyright from integrated ideas consultancy services 2003-2011

36
Online voting
system

SYSTEM ENVIRONMENT

Software Requirements

Operating System : Windows XP Professional.

Technology : ASP.Net.

Server Side Coding Tool : C#.Net

Frame Work : .Net Frame Work

Back-end : Microsoft SQL Server 2000

Browser : Internet Explorer 6.

Hardware Requirement

I. Pentium or AMD processors with speed minimum 1GHz.

II. Minimum 256MB RAM.

III. Accelerated Graphics Card.

IV. Minimum 2GB Hard Disk.

V. Better performance with 82KB and above Cache Memory.

Copyright from integrated ideas consultancy services 2003-2011

37
Online voting
system

FUTURE ENHANCEMENT

The future scope for this software is very dynamic. Next stage may be

implementated depening on the time factor.

The main advantages of this projects are:

1.It provides easy information about easy information about procedure of

online voting system.

2.It provides well structured information.

1. It makes free from manual work.

2. Any information needed can be obtained by any time by quering

it.

Copyright from integrated ideas consultancy services 2003-2011

38
Online voting
system

CONCLUSION

Generally voting has to be perform by user by going to the voting

center. Many users like army personal or NRI cannot come to the

voting place.Therefore we have to implement a online voting system by

which the users can vote over the online.It will be greatest of

advantage for NRI and personWhich are go outside of the country the

can vote on online by the by our software only.

Copyright from integrated ideas consultancy services 2003-2011

39
Online voting
system

BIBLIOGRAPHY

C# and .Net platform by Andrew Troelsen.

Inside C# by Tom Archer.

Fundamentals of database Systems by Ramez Elmasri

ans S. B. Navathe

Software Engineering-Roger S. Pressman

An Introduction to database system C.J.Date

The Unified modeling language user guide-

G.Booch,J.Rambough and I Jacobson.

Copyright from integrated ideas consultancy services 2003-2011

40
Online voting
system

Copyright from integrated ideas consultancy services 2003-2011

41

You might also like