Chapter No Title Page - No List of Figures List of Tables I

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 47

TABLE OF CONTENTS

CHAPTER NO TITLE PAGE.NO

ABSTRACT
LIST OF FIGURES
LIST OF TABLES
I INTRODUCTION
1.1 Introduction
1.2 Problem Description
1.3 About The Organization
II SYSTEM ANALYSIS
2.1 Existing System
2.2 Proposed System
2.3 Feasibility Analysis
III SOFTWARE REQUIREMENTS
3.1 Hardware Requirements
3.2 Software Requirements
3.3 Software Description
IV SYSTEM DESIGN
4.1 Introduction
4.2 Dataflow Diagram
4.3 Use Case Diagram
4.4 Sequence Diagram
4.5 Database Table Design
V IMPLEMENTATION
5.1 Introduction
5.2 Project Description
5.3 Form Design
VI TESTING
6.1 Introduction
6.2 Unit Testing
6.3 Integration Testing
6.4 Functional Testing
VII CONCLUSION
7.1 Conclusion
VIII FUTURE ENHANCEMENTS
8.1 Future Enhancements
BIBLIOGRAPHY
ANNEXURE I – Screenshot
ANNEXURE II – Coding
ANNEXURE III – Report
LIST OF TABLES

T.NO TABLE NAME PAGE.NO.


LIST OF FIGURES

F.NO FIGURE NAME PAGE.NO.


ABSTRACT

Fingerprint Based Voting Project is an application where the user is recognized by his
finger pattern. Since the finger pattern of each human being is different, the voter can be
easily authenticated. The system allows the voter to vote through his fingerprint. Finger print
is used to uniquely identify the user. The finger print minutiae features are different for each
human being. Finger print is used as a authentication of the voters.
Voter can vote the candidate only once, the system will not allow the candidate to
vote for the second time. The system will allow admin to add the candidate name and
candidate photo who are nominated for the election. Admin only has the right to add
candidate name and photo who are nominated. Admin will register the voters name by
verifying voter. Admin will authenticate the user by verifying the user’s identity proof and
then admin will register the voter. The number of candidate added to the system by the admin
will be automatically deleted after the completion of the election.
Admin has to add the date when the election going to end. Once the user has got the user id
and password from the admin the user can login and vote for the candidate who are
nominated. The system will allow the user to vote for only one candidate. The system will
allow the user to vote for one time for a particular election. Admin can add any number of
candidates when the new election will be announced. Admin can view the election result by
using the election id. Even user can view the election result.
INTRODUCTION

Introduction

Biometrics is the science and technology of measuring and analyzing biological data.
Biometrics refers to technologies that measure and analyze human body characteristics, such
as DNA, fingerprints, eye retinas and irises, voice patterns, facial patterns and hand
measurements, for authentication purposes. The field of biometrics was formed and has since
expanded on to many types of physical identification. Among the several human fingerprints
remain a very common identifier and the biometric method of choice among law
enforcement. These concepts of human identification have lead to the development of
fingerprint scanners that serve to quickly identify individuals and assign access privileges.
The basic point of these devices is also to examine the fingerprint data of an individual and
compare it to a database of other fingerprints.
In our project we have used fingerprint for the purpose of voter identification or
authentication. As the thumb impression of every individual is unique, it helps in minimizing
the error. A database is created containing the fingerprint images of all the voters as required.
Illegal votes and repetition of votes is checked for in this system with accurate coding. Hence
with the application of this fingerprint based EVM system elections could be made fair and
free from rigging. Further that the elections would is no longer a tedious and expensive job.
Problem Description

Now-a-days, democracy has become an important part of people's lives. The heart of
democracy is voting. The voting must be trust one and vote must be recorded and tallied with
accuracy and impartiality. This is achieved by using biometric system. An electronic voting
system defines valid voting and gives an fast method of counting votes, which helps to yield
a final result. Moreover, electronic voting systems can improve voter identification process
by using biometric recognition. Biometrics is becoming an essential personal identification
solution, since biometric identifiers cannot be misplaced and they represent an individual’s
identity. Biometric recognition refers to the use of iris, fingerprint, face, palm and speech
characteristics, called biometric identifiers. Fingerprint matching is a important for this
process. It is an extremely difficult problem, due to variations in different impressions of the
same finger. Fingerprints are unique to each individual and they do not change over time.
Voting system starts from the 18th century and many proposals for voting system have been
made till now. When designing an electronic voting system, it is essential to consider ways in
which the voting tasks can be performed electronically without sacrificing voter privacy or
introducing opportunities for fraud.
About The Organization

ABOUT SCION RESEARCH & DEVELOPMENT


Founded in Feb2009, Scion Research & Development is one of the leaders in advanced
technique computer training programmes. Scion Research & Development Courses covers A
to Z in all areas of software, hardware & networking and multimedia. The courses are
designed to keep pace with the changing needs and times. Scion Research & Development
and generates software and hardware professionals. Students have been given fantabulous
computer training and they become extremely computer Savvy and expertly handle the IT
capabilities in their respective fields.
Scion Research & Development courses enable the students to prepare for the coveted
worldwide certifications. Theoretical teaching is reinforced with practical training again and
again. Guest lectures by experts from the group and outside are periodically arranged for
100% industry exposure.
We do have a R&D group to discover and create new knowledge about scientific and
technological topics for the purpose of uncovering and enabling development of valuable
new products, processes, and services.
MISSION
Our mission is to delight our customers by providing excellence in IT services, vales and
results. This is achieved by building a world class and competitive team with challenging,
rewarding and growth oriented work. Our values include integrity, respect for the individual,
open and honest communication, partnering, innovation and excellence.
VISION
Scion wish to become a company of world class employees, world class customers and a
desire to be the world leader in offshore consulting services. At scion, we help turn ideas into
reality. Scion stands out by virtue of building our success around one customer at a time.
SYSTEM ANALYSIS

Existing System

In paper-based elections voters cast their votes by simply depositing their ballots in sealed
boxes distributed across the electoral circuits around a given country. When the election
period ends, all these boxes are opened and votes are counted manually in presence of the
certified officials. In this process there can be error in counting of votes or in some cases
voters find ways to vote more than once. Sometimes votes are even manipulated to distort the
results of an election in favor of certain candidates

Disadvantage
 It is time consuming
 It consumes lot of manpower to better results
 The system will allow the voter to vote two or more candidates
Proposed System

We propose client-server web-enabled software architecture for the project. On the client
side we have a fingerprint scanner and a GUI that accepts voter’s aadhar number, provides an
interface to vote and display confirmation, status and error messages. The GUIs will only act
on events from the server and feedback of the voter without any extra processing. Servers are
placed at remote locations from the poll booths. They are used for carrying out all the
processing work such as image processing, transferring data between the client and the
database, generating statistics, sending messages to voters, etc
Advantage
 The system will not allow the voter to vote two or more candidates.
 The system will allow the user to vote for one time for a particular election
 The system will authenticate the user through his fingerprint so the user is uniquely
identified.
Feasibility Analysis

The feasibility of the project is analyzed in this phase and business proposal is put forth
with a very general plan for the project and some cost estimates. During system analysis the
feasibility study of the proposed system is to be carried out. This is to ensure that the
proposed system is not a burden to the company. For feasibility analysis, some
understanding of the major requirements for the system is essential.

Three key considerations involved in the feasibility analysis are

 Economical feasibility
 Technical feasibility
 Social feasibility

Economical Feasibility

This study is carried out to check the economic impact that the system will have on the
organization. The amount of fund that the company can pour into the research and
development of the system is limited. The expenditures must be justified. Thus the developed
system as well within the budget and this was achieved because most of the technologies
used are freely available. Only the customized products had to be purchased.

Technical Feasibility

This study is carried out to check the technical feasibility, that is, the technical
requirements of the system. Any system developed must not have a high demand on the
available technical resources. This will lead to high demands on the available technical
resources. This will lead to high demands being placed on the client. The developed system
must have a modest requirement, as only minimal or null changes are required for
implementing this system.

Social Feasibility

The aspect of study is to check the level of acceptance of the system by the user. This
includes the process of training the user to use the system efficiently. The user must not feel
threatened by the system, instead must accept it as a necessity. The level of acceptance by the
users solely depends on the methods that are employed to educate the user about the system
and to make him familiar with it. His level of confidence must be raised so that he is also
able to make some constructive criticism, which is welcomed, as he is the final user of the
system.
SOFTWARE REQUIREMENTS

Hardware Requirements

Hard disk : 100GB

RAM : 2GB

Processor : Dual Core

Monitor : 17’’Color Monitor

Software Requirements

Front-End : Visual Studio 2010

Coding Language : ASP .Net

Operating System : Windows 7 32bit professional

Back End : SQL Server 2005


Software Description

Overview of Visual Studio .NET


C# is an elegant and type-safe object-oriented language that enables developers to
build a variety of secure and robust applications that run on the.NET Framework. You can
use C# to create Windows client applications, XML Web services, distributed components,
client-server applications, database applications, and much, much more. Visual C# provides
an advanced code editor, convenient user interface designers, integrated debugger, and many
other tools to make it easier to develop applications based on the C# language and the.NET
Framework.

The Visual C# documentation assumes that you have an understanding of basic


programming concepts. If you area complete beginner, you might want to explore Visual C#
Express, which is available on the Web. You can also take advantage of books and Web
resources about C# to learn practical programming skills. C# syntax is highly expressive, yet
it is also simple and easy to learn. The curly-brace syntax of C# will be instantly
recognizable to anyone familiar with C, C++ or Java. Developers who know any of these
languages are typically able to begin to work productively in C# within a very short time. C#
syntax simplifies many of the complexities of C++ and provides powerful features such as
null able value types, enumerations, delegates, lambda expressions and direct memory
access, which are not found in Java. C# supports generic methods and types, which provide
increased type safety and performance, and iterates, which enable implementers of collection
classes to define custom iteration behaviors that are simple to use by client code.

Language-Integrated Query (LINQ) expressions make the strongly-typed query a


first-class language construct. As an object-oriented language, C# supports the concepts of
encapsulation, inheritance, and polymorphism. All variables and methods, including the
Main method, the application's entry point, are encapsulated within class definitions. A class
may inherit directly from one parent class, but it may implement any number of interfaces.
Methods that override virtual methods in a parent class require the override keyword as a
way to avoid accidental redefinition. In C#, a struck is like a lightweight class; it is a stack-
allocated type that can implement interfaces but does not support inheritance. In addition to
these basic object-oriented principles, C# makes it easy to develop software components
through several innovative language constructs, including the following: Encapsulated
method signatures called delegates, which enable type-safe event notifications. Properties,
which serves accesses for private member variables. Attributes, which provide declarative
metadata about types at run time. Inline XML documentation comments.

Language-Integrated Query (LINQ) which provides built-in query capabilities across


a variety of data sources. If you have to interact with other Windows software such as COM
objects or native Win32 DLLs, you can do this in C# through a process called "Interop".
Interop enables C# programs to do almost anything that a native C++ application can do. C#
even supports pointers and the concept of "unsafe" code for those cases in which direct .NET
Framework Platform Architecture memory access is absolutely critical. The C# build process
is simple compared to C and C++ and more flexible than in Java. There are no separate
header files, and no requirement that methods and types be declared in a particular order. A
C# source file may define any number of classes, structs, interfaces, and events.

The following are additional C# resources: For a good general introduction to the
language, see Chapter 1 of the C# Language Specification. For detailed information about
specific aspects of the C# language, seethe C# Reference. For more information about LINQ,
seal INQ (Language-Integrated Query). C# programs run on the.NET Framework, an integral
component of Windows that includes a virtual execution system called the common language
runtime (CLR) and a unified set of class libraries. The CLR is the commercial
implementation by Microsoft of the common language infrastructure (CLI), an international
standard that is the basis for creating execution and development environments in which
languages and libraries work together seamlessly. Source code written in C# is compiled into
an intermediate language (IL) that conforms to the CLI specification. Their code and
resources, such as bitmaps and strings, restored on disk in an executable file called an
assembly, typically with an extension of .exe or .dll.

An assembly contains a manifest that provides information about the assembly's


types, version, culture, and security requirements. When the C# program is executed, the
assembly is loaded into the CLR, which might take various actions based on the information
in the manifest. Then, if the security requirements are met, the CLR performs just in time
(JIT) compilation to convert the IL code to native machine instructions. The CLR also
provides other services related to automatic garbage collection, exception handling, and
resource management. Code that is executed by the CLR is sometimes referred to as
"managed code," in contrast to "unmanaged code" which is compiled into native machine
language that targets a specific system.

The following diagram illustrates the compile-time and run-time relationships of C#


source code files, the.NET Framework class libraries, assemblies, and the CLR. Language
interoperability is a key feature of the.NET Framework. Because the IL code produced by the
C# compiler conforms to the Common Type Specification (CTS), IL code generated from C#
can interact with code that was generated from the.NET versions of Visual Basic, Visual
C++, or any of more than 20 other CTS compliant languages. A single assembly may contain
multiple modules written in different .NET languages, and the See also types can reference
each other just as if they were written in the same language.
Overview of SQL
SQL is a language to operate databases; it includes database creation, deletion, fetching rows,
modifying rows, etc. SQL is an ANSI (American National Standards Institute) standard
language, but there are many different versions of the SQL language.
What is SQL?
SQL is Structured Query Language, which is a computer language for storing, manipulating
and retrieving data stored in a relational database.
SQL is the standard language for Relational Database System. All the Relational Database
Management Systems (RDMS) like MySQL, MS Access, Oracle, Sybase, Informix, Postgres
and SQL Server use SQL as their standard database language.
Also, they are using different dialects, such as −
 MS SQL Server using T-SQL,
 Oracle using PL/SQL,
 MS Access version of SQL is called JET SQL (native format) etc.
Why SQL?SQL is widely popular because it offers the following advantages :
 Allows users to access data in the relational database management systems.
 Allows users to describe the data.
 Allows users to define the data in a database and manipulate that data.
 Allows embedding within other languages using SQL modules, libraries & pre-
compilers.
 Allows users to create and drop databases and tables.
 Allows users to create view, stored procedure, functions in a database.
SYSTEM DESIGN

Introduction

Systems design is the process of defining the architecture, modules, interfaces, and data for
a system to satisfy specified requirements. Systems design could be seen as the application
of systems theory to product development. There is some overlap with the disciplines
of systems analysis, systems architecture and systems engineering. If the broader topic
of product development "blends the perspective of marketing, design, and manufacturing into
a single approach to product development,"[3]then design is the act of taking the marketing
information and creating the design of the product to be manufactured. Systems design is
therefore the process of defining and developing systems to satisfy specified requirements of
the user. The architectural design of a system emphasizes the design of the system
architecture that describes the structure, behavior and more views of that system and
analysis. The logical design of a system pertains to an abstract representation of the data
flows, inputs and outputs of the system. This is often conducted via modelling, using an over-
abstract (and sometimes graphical) model of the actual system. In the context of systems,
designs are included. Logical design includes entity-relationship diagrams (ER diagrams).
The physical design relates to the actual input and output processes of the system. This is explained in
terms of how data is input into a system, how it is verified/authenticated, how it is processed, and how
it is displayed. In physical design, the following requirements about the system are decided.
1. Input requirement,
2. Output requirements,
3. Storage requirements,
4. Processing requirements,
5. System control and backup or recovery.
Put another way, the physical portion of system design can generally be broken down into
three sub-tasks:
1. User Interface Design
2. Data Design
3. Process Design
User Interface Design is concerned with how users add information to the system and with
how the system presents information back to them. Data Design is concerned with how the
data is represented and stored within the system. Finally, Process Design is concerned with
how data moves through the system, and with how and where it is validated, secured and/or
transformed as it flows into, through and out of the system. At the end of the system design
phase, documentation describing the three sub-tasks is produced and made available for use
in the next phase.
Physical design, in this context, does not refer to the tangible physical design of an
information system. To use an analogy, a personal computer's physical design involves input
via a keyboard, processing within the CPU, and output via a monitor, printer, etc. It would
not concern the actual layout of the tangible hardware, which for a PC would be a monitor,
CPU, motherboard, hard drive, modems, video/graphics cards, USB slots, etc. It involves a
detailed design of a user and a product database structure processor and a control processor.
The H/S personal specification is developed for the proposed system.
Dataflow Diagram
Use Case Diagram
Sequence Diagram
Database Table Design

Voter Table

FIELD NAME DATA TYPE DESCRIPTION

NAME NCHAR(50) NAME


UID VARCHAR(10) USERID

DOB DATETIME DATE OF BIRTH


EMAILID VARCHAR(MAX) EMAILID
GENDER NCHAR(10) GENDER
ADDRESS VARCHAR(MAX) ADDRESS
VARDNUMBER INT VARDNUMBER
CONSTITVENCY NCHAR(10) CONSTITVENCY
MOB NUMBER NCHAR(10) MOBILE NUMBER
PHOTO VARCHAR(MAX) PHOTO
VOTE INT VOTE
PWD VARCHAR(MAX) PASSWORD
IMGID VARCHAR(MAX) IMAGE ID
FIMG VARBINARY(MAX) FINGER PRINT IMAGE

Admin

FIELD NAME DATA TYPE DESCRIPTION

USERNAME NCHAR(10) USER NAME

PWD NCHAR(10) PASSWORD


Result

FIELD NAME DATA TYPE DESCRIPTION

THOGUTHI VARCHAR(30) THOGUTHI

SUN INT SUN

LEAF INT LEAF

CONE INT CONE

HAND INT HAND

WINNER NCHAR(10) WINNER

KATCHI NCHAR(10) KATCHI

Voting

FIELD NAME DATA TYPE DESCRIPTION

SUN INT SUN

LEAF INT LEAF

HAND INT HAND

CONE INT CONE

ID NCHAR(10) ID
IMPLEMENTATION

Introduction

The project is entitled as “Online Voting Process “as the following form to make a secure
data. This project carried out by taking ASP.NET and SQL Server. It has following module
 Authentication module
 Registration module
 View member
 Voting module
 Result module

Project Description

Authentication module
An authentication module is a plug-in that collects user information such as a user ID and
password, and compares the information against entries in a database. If a user provides
information that meets the authentication criteria, the user is validated and, assuming the
appropriate policy configuration, granted access to the requested resource. If the user
provides information that does not meet the authentication criteria, the user is not validated
and denied access to the requested resource.
Registration module
Voter registration (or enrollment) is the requirement that a person otherwise eligible to vote
register (or enroll) on an electoral roll before they will be entitled or permitted to vote. Such
enrollment may be automatic or may require application being made by the eligible voter.
The rules governing registration vary between jurisdictions. Some jurisdictions have
"election day registration" and others do not require registration, or may require production
of evidence of entitlement to vote at time of voting. In some jurisdictions registration by
those of voting age is compulsory, while in most it is optional. In jurisdictions where
registration is voluntary, an effort may be made to encourage persons otherwise eligible to
vote to register, in what is called as a voter registration drive.
View member
It depends on which rights (also called permissions, user groups, bits or flags) are assigned
to accounts. This is determined by whether the editor is logged into an account, and whether
the account has a sufficient age and number of edits for certain automatic rights, and what
additional rights have been assigned manually to the account.
Voting module
Voting is a method for a group, such as a meeting or an electorate, in order to make a
collective decision or express an opinion, usually following discussions, debates or election
campaigns. Democracies elect holders of high office by voting. Residents of a place
represented by an elected official are called "constituents", and those constituents who cast
a ballot for their chosen candidate are called "voters". There are different systems for
collecting votes.
Result module
A result (also called upshot) is the final consequence of a sequence of actions or events
expressed qualitatively or quantitatively. Possible results,
include advantage, disadvantage, gain, injury, loss, value and victory. There may be a range
of possible outcomes associated with an event depending on the point of view, historical
distance or relevance. Reaching no result can mean that actions are inefficient, ineffective,
meaningless or flawed.
Form Design
TESTING

Introduction

The purpose of testing is to discover errors. Testing is the process of trying to discover every
conceivable fault or weakness in a work product. It provides a way to check the functionality
of components, sub assemblies, assemblies and/or a finished product It is the process of
exercising software with the intent of ensuring that the Software system meets its
requirements and user expectations and does not fail in an unacceptable manner. There are
various types of test. Each test type addresses a specific testing requirement.

Unit Testing
Unit testing involves the design of test cases that validate that the internal program
logic is functioning properly, and that program inputs produce valid outputs. All decision
branches and internal code flow should be validated. It is the testing of individual software
units of the application .it is done after the completion of an individual unit before
integration.
This is a structural testing, that relies on knowledge of its construction and is invasive. Unit
tests perform basic tests at component level and test a specific business process, application,
and/or system configuration. Unit tests ensure that each unique path of a business process
performs accurately to the documented specifications and contains clearly defined inputs and
expected results.
Integration Testing

Integration tests are designed to test integrated software components to determine if


they actually run as one program. Testing is event driven and is more concerned with the
basic outcome of screens or fields. Integration tests demonstrate that although the
components were individually satisfaction, as shown by successfully unit testing, the
combination of components is correct and consistent. Integration testing is specifically aimed
at exposing the problems that arise from the combination of components.
Functional Testing

Functional tests provide systematic demonstrations that functions tested are available
as specified by the business and technical requirements, system documentation, and user
manuals.

Functional testing is centered on the following items:

Valid Input : identified classes of valid input must be accepted.

Invalid Input : identified classes of invalid input must be rejected.

Functions : identified functions must be exercised.

Output : identified classes of application outputs must be exercised.

Systems/ Procedures : interfacing systems or procedures must be invoked.

Organization and preparation of functional tests is focused on requirements, key


functions, or special test cases. In addition, systematic coverage pertaining to identify
Business process flows; data fields, predefined processes, and successive processes must be
considered for testing. Before functional testing is complete, additional tests are identified
and the effective value of current tests is determined.
CONCLUSION

Conclusion

Fingerprints considered as one of the most popular biometric methods used for human
recognition. Every person in the globe is born with unique fingerprint even twins born with
totally different fingerprints and fingerprint is naturally unchangeable throughout life. For
that reason fingerprint voting system has been made and the person ID has been replaced
with his fingerprint. This fingerprint voting system is implemented and evaluated
successfully. The evaluation of the system is made using different PCs with different
specifications in order to stand on system strength and weaknesses. The final result of the
fingerprint voting system was amazingly significant and computable with other voting
system. The system’s accuracy came from the image enhancement by removing or reducing
the noise and Gabor filter.
FUTURE ENHANCEMENTS

Future Enhancements

Future development, an additional biometric feature could be added to strengthen security


such as eye. In addition the security features at database level should be strengthened too
towards accessibility of government database. It will be better to design a fingerprint voting
machine works dependently without need for PC to perform the voting in order to decrease
the project cost.
BIBLIOGRAPHY

Journal

1. D. Maio, D. Maltoni, A. K. Jain, and S. Prabhakar (2003). Handbook of


FingerprintRecognition. Springer Verlag.

2. Jain, K, Ross, A, Prabhakar, S (2004). An Introduction to Biometric Recognition.


New York, USA.

3. Farah Azirar, (2011). Fingerprint Recognition. Bachelor Thesis. School of


Electronics and Physical Sciences, Department of Electronic Engineering, University
of Surrey.

4. Jawad Nagi, (2009). Design of an Efficient High-speed fingerprint Recognition


System. Final Year Project Proposal. College of Engineering, Universiti Tenaga
Nasional.

5. Meng, T. Y. (2008). Electronic Voting Systems: Security Implications of the


Administrative Workflow. University of the Aegean, Samosl Greece.

6. Phil Brimblecombe, (2005). Face Detection Using Gabor filter, Bachelor Thesis.
School of Electronics and Physical Sciences, Department of Electronic Engineering.
University of Surrey.

7. A. Ross, S. Dass, and A. K. Jain (2010). A deformable model for fingerprint


matching,Pattern Recognition. University of Michigan.

8. Z. Pan, H. Bolouri (2010). figerprint matching on Discrete Cosine Transform and


Neural Networks. University of Hertfordshire, Herts, United Kingdom.

Website

1. www.gov.in
2. www.vottingsystem.in
ANNEXURE I – Screenshot

User Page

Admin Page
ANNEXURE II – Coding

About
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class About : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

AddUser
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class AddUserDetails : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
}
}

AddVote
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Web.Configuration;
using System.Configuration;

public partial class AddVote : System.Web.UI.Page


{
string connectionString =
ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString;

protected void Page_Load(object sender, EventArgs e)


{

}
protected void btnAddVote_Click(object sender, EventArgs e)
{
try
{
SqlConnection myConnection = new SqlConnection(connectionString);

myConnection.Open();
string query = "INSERT INTO AddVote (ElectorName, VoterId, District, Party,
CanditateName) VALUES ('" + txtElectorName.Text + "','" + txtVoterId.Text + "','" +
ddlDistrict.Value + "','" + ddlParty.Value + "','')";

SqlCommand myCommand = new SqlCommand(query, myConnection);


myCommand.ExecuteNonQuery();

Response.Redirect("UserLogin.aspx");
}
catch
{
}
}
}
Default
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
}

Home
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;

public partial class Home : System.Web.UI.Page


{
string connectionString =
ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString;

protected void Page_Load(object sender, EventArgs e)


{
try
{
lblADMK.Text = "0";
lblBJP.Text = "0";
lblCommunist.Text = "0";
lblCongress.Text = "0";
lblDMK.Text = "0";

SqlDataAdapter da = new SqlDataAdapter("select Party,count(*) as Total from


AddVote group by party", connectionString);
DataTable dt = new DataTable();
da.Fill(dt);

if (dt.Rows.Count > 0)
{
for (int i = 0; dt.Rows.Count > i; i++)
{
if (dt.Rows[i]["Party"].ToString() == "ADMK")
{
lblADMK.Text = dt.Rows[i]["Total"].ToString();
}
if (dt.Rows[i]["Party"].ToString() == "BJP")
{
lblBJP.Text = dt.Rows[i]["Total"].ToString();
}
if (dt.Rows[i]["Party"].ToString() == "Communist")
{
lblCommunist.Text = dt.Rows[i]["Total"].ToString();
}
if (dt.Rows[i]["Party"].ToString() == "Congress")
{
lblCongress.Text = dt.Rows[i]["Total"].ToString();
}
if (dt.Rows[i]["Party"].ToString() == "DMK")
{
lblDMK.Text = dt.Rows[i]["Total"].ToString();
}
}
}

SqlConnection con = new SqlConnection(connectionString);


con.Open();
SqlCommand cmd = new SqlCommand("select District,Party,count(*) as Total from
AddVote group by District,party order by District ASC", con);
SqlDataReader dr = cmd.ExecuteReader();
GridView1.DataSource = dr;
GridView1.DataBind();
con.Close();
}
catch
{
}
}

UserLogin
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;

public partial class UserLogin : System.Web.UI.Page


{
string connectionString =
ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString;

protected void Page_Load(object sender, EventArgs e)


{
}
protected void btnUpload_Click(object sender, EventArgs e)
{
try
{
//Read the uploaded file using BinaryReader and convert it to Byte Array.
BinaryReader br = new BinaryReader(FileUpload1.PostedFile.InputStream);
byte[] bytes = br.ReadBytes((int)FileUpload1.PostedFile.InputStream.Length);

//Convert the Byte Array to Base64 Encoded string.


string uploadbase64String = Convert.ToBase64String(bytes, 0, bytes.Length);

for (int i = 1; i <= 8; i++)


{
string imagename = "fingerprint" + i + ".jpg";
string imagePath = @"E:\Dhilipan\OnlineVoting\Images\" + imagename;
string imgBase64String = GetBase64StringForImage(imagePath);

if (FileUpload1.FileName == imagename)
{
if (uploadbase64String == imgBase64String)
{

SqlDataAdapter da = new SqlDataAdapter("select * from CheckFingerPrint


where FingerName='" + uploadbase64String + "'", connectionString);
DataTable dt = new DataTable();
da.Fill(dt);

if (dt.Rows.Count > 0)
{
ClientScript.RegisterStartupScript(GetType(), "hwa", "CheckVote();",
true);
}
else
{
SqlConnection myConnection = new SqlConnection(connectionString);
myConnection.Open();

string query = "INSERT INTO CheckFingerPrint (FingerName) VALUES


('" + uploadbase64String + "')";

SqlCommand myCommand = new SqlCommand(query, myConnection);


myCommand.ExecuteNonQuery();

Response.Redirect("AddVote.aspx");
}

}
else
{
ClientScript.RegisterStartupScript(GetType(), "hwa", "validate();", true);
}
}

}
}
catch
{
}
}
protected static string GetBase64StringForImage(string imgPath)
{
string base64String = "";
try
{
byte[] imageBytes = System.IO.File.ReadAllBytes(imgPath);
base64String = Convert.ToBase64String(imageBytes);

}
catch
{
}
return base64String;
}
}

Voting
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Voting : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{

}
ANNEXURE III – Report

You might also like