├── Project
├── Finger Vote
│ ├── Finger
│ ├── Vote.csproj
│ ├── Resources
│ │ ├── Line.png
│ │ ├── Capture.JPG
│ │ ├── Fingerprint-large-Small.jpg
│ │ └── Avoid-ATM-Credit-Card-Fees.jpg
│ ├── Properties
│ │ ├── Settings.settings
│ │ ├── Settings.Designer.cs
│ │ ├── Assemblyylnfo.cs
│ │ ├── Resources.Designer.cs
│ │ └── Resources.resx
│ ├── Program.cs
│ ├── ViewCandidate.cs
│ ├── AdminMenu.cs
│ ├── AdminLogin.cs
│ ├── AddCandidate.cs
│ ├── ViewResult.cs
│ ├── AddElection.cs
│ ├── ViewResult.Designer.cs
│ ├── Result.cs
│ ├── AddVoter.resx
│ ├── Result.resx
│ ├── AddCandidate.resx
│ ├── AddElection.resx
│ ├── TakeElection.resx
│ ├── ViewCandidate.resx
│ ├── ViewResult.resx
│ ├── AdminLogin.Designer.cs
│ ├── AdminMenu.Designer.cs
│ ├── Finger Vote.cs
│ ├── ViewCandidate.Designer.cs
│ ├── AddCandidate.Designer.cs
│ ├── AddVoter.cs
│ ├── AddElection.Designer.cs
│ ├── Result.Designer.cs
│ ├── AddVoter.Designer.cs
│ └── TakeElection.cs
├── .gitignore
└── Vote.sln
├── Document
├── pdfDocument
│ └── Team_Sheild.pdf
└── wordDocument
│ └── Team_Sheild.docx
└── README.md
/Project/Finger Vote/Finger:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Project/.gitignore:
--------------------------------------------------------------------------------
1 | *.suo
2 |
3 |
--------------------------------------------------------------------------------
/Project/Finger Vote/Vote.csproj:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/Document/pdfDocument/Team_Sheild.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ssr197/Fingerprint-Based-Voting-System/HEAD/Document/pdfDocument/Team_Sheild.pdf
--------------------------------------------------------------------------------
/Document/wordDocument/Team_Sheild.docx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ssr197/Fingerprint-Based-Voting-System/HEAD/Document/wordDocument/Team_Sheild.docx
--------------------------------------------------------------------------------
/Project/Finger Vote/Resources/Line.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ssr197/Fingerprint-Based-Voting-System/HEAD/Project/Finger Vote/Resources/Line.png
--------------------------------------------------------------------------------
/Project/Finger Vote/Resources/Capture.JPG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ssr197/Fingerprint-Based-Voting-System/HEAD/Project/Finger Vote/Resources/Capture.JPG
--------------------------------------------------------------------------------
/Project/Finger Vote/Resources/Fingerprint-large-Small.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ssr197/Fingerprint-Based-Voting-System/HEAD/Project/Finger Vote/Resources/Fingerprint-large-Small.jpg
--------------------------------------------------------------------------------
/Project/Finger Vote/Resources/Avoid-ATM-Credit-Card-Fees.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ssr197/Fingerprint-Based-Voting-System/HEAD/Project/Finger Vote/Resources/Avoid-ATM-Credit-Card-Fees.jpg
--------------------------------------------------------------------------------
/Project/Finger Vote/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Project/Finger Vote/Program.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Windows.Forms;
5 |
6 | namespace Finger_ATM
7 | {
8 | static class Program
9 | {
10 | ///
11 | /// The main entry point for the application.
12 | ///
13 | [STAThread]
14 | static void Main()
15 | {
16 | Application.EnableVisualStyles();
17 | Application.SetCompatibleTextRenderingDefault(false);
18 | Application.Run(new AddVoter());
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/Project/Finger Vote/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Finger_ATM.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Project/Finger Vote/ViewCandidate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 |
11 | namespace Finger_ATM
12 | {
13 | public partial class ViewCandidate : Form
14 | {
15 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
16 |
17 | public ViewCandidate()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | string cname = "";
23 | public ViewCandidate(string cname1)
24 | {
25 | InitializeComponent();
26 | cname = cname1;
27 | }
28 |
29 | private void ViewCandidate_Load(object sender, EventArgs e)
30 | {
31 | SqlCommand cmd = new SqlCommand("Select * from Candidate where Name ='"+cname+"'",con);
32 | con.Open();
33 | SqlDataReader dr = cmd.ExecuteReader();
34 | dr.Read();
35 | textBox1.Text = cname;
36 | pictureBox2.ImageLocation = dr[2].ToString();
37 | textBox2.Text = dr[3].ToString();
38 | con.Close();
39 | }
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/Project/Vote.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.25123.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Finger Vote", "Finger Vote\Finger Vote.csproj", "{D974663F-41C7-4AFF-9D23-13C3228E467F}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x64 = Debug|x64
11 | Debug|x86 = Debug|x86
12 | Release|x64 = Release|x64
13 | Release|x86 = Release|x86
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Debug|x64.ActiveCfg = Debug|x64
17 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Debug|x64.Build.0 = Debug|x64
18 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Debug|x86.ActiveCfg = Debug|x86
19 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Debug|x86.Build.0 = Debug|x86
20 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Release|x64.ActiveCfg = Release|x64
21 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Release|x64.Build.0 = Release|x64
22 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Release|x86.ActiveCfg = Release|x86
23 | {D974663F-41C7-4AFF-9D23-13C3228E467F}.Release|x86.Build.0 = Release|x86
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/Project/Finger Vote/Properties/Assemblyylnfo.cs:
--------------------------------------------------------------------------------
1 | // Written By SHALIN
2 |
3 |
4 |
5 | using System.Reflection;
6 | using System.Runtime.CompilerServices;
7 | using System.Runtime.InteropServices;
8 |
9 | // General Information about an assembly is controlled through the following
10 | // set of attributes. Change these attribute values to modify the information
11 | // associated with an assembly.
12 | [assembly: AssemblyTitle("Finger_ATM")]
13 | [assembly: AssemblyDescription("")]
14 | [assembly: AssemblyConfiguration("")]
15 | [assembly: AssemblyCompany("")]
16 | [assembly: AssemblyProduct("Finger_ATM")]
17 | [assembly: AssemblyCopyright("Copyright © 2015")]
18 | [assembly: AssemblyTrademark("")]
19 | [assembly: AssemblyCulture("")]
20 |
21 | // Setting ComVisible to false makes the types in this assembly not visible
22 | // to COM components. If you need to access a type in this assembly from
23 | // COM, set the ComVisible attribute to true on that type.
24 | [assembly: ComVisible(false)]
25 |
26 | // The following GUID is for the ID of the typelib if this project is exposed to COM
27 | [assembly: Guid("90a5d51f-1d20-4877-97c4-dab7c3e0a5ff")]
28 |
29 | // Version information for an assembly consists of the following four values:
30 | //
31 | // Major Version
32 | // Minor Version
33 | // Build Number
34 | // Revision
35 | //
36 | // You can specify all the values or you can default the Build and Revision Numbers
37 | // by using the '*' as shown below:
38 | // [assembly: AssemblyVersion("1.0.*")]
39 | [assembly: AssemblyVersion("1.0.0.0")]
40 | [assembly: AssemblyFileVersion("1.0.0.0")]
41 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AdminMenu.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 |
10 | namespace Finger_ATM
11 | {
12 | public partial class AdminMenu : Form
13 | {
14 | public AdminMenu()
15 | {
16 | InitializeComponent();
17 | }
18 |
19 | private void addCandidateToolStripMenuItem_Click(object sender, EventArgs e)
20 | {
21 | AddCandidate a = new AddCandidate();
22 | a.MdiParent = this;
23 | a.Show();
24 | }
25 |
26 | private void logoutToolStripMenuItem_Click(object sender, EventArgs e)
27 | {
28 | Application.Exit();
29 | }
30 |
31 | private void addElectionToolStripMenuItem_Click(object sender, EventArgs e)
32 | {
33 | AddElection a = new AddElection();
34 | a.MdiParent = this;
35 | a.Show();
36 | }
37 |
38 | private void addVotersToolStripMenuItem_Click(object sender, EventArgs e)
39 | {
40 | AddVoter a = new AddVoter();
41 | a.MdiParent = this;
42 | a.Show();
43 | }
44 |
45 | private void viewResultToolStripMenuItem_Click(object sender, EventArgs e)
46 | {
47 | ViewResult a = new ViewResult();
48 | a.MdiParent = this;
49 | a.Show();
50 | }
51 |
52 | private void viewCandidateToolStripMenuItem_Click(object sender, EventArgs e)
53 | {
54 | ViewCandidate a = new ViewCandidate();
55 | a.MdiParent = this;
56 | a.Show();
57 | }
58 |
59 | private void caculateResultToolStripMenuItem_Click(object sender, EventArgs e)
60 | {
61 | Result a = new Result();
62 | a.MdiParent = this;
63 | a.Show();
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AdminLogin.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 | using Check;
11 |
12 | namespace Finger_ATM
13 | {
14 | public partial class AdminLogin : Form
15 | {
16 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
17 | public AdminLogin()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | private void groupBox1_Enter(object sender, EventArgs e)
23 | {
24 |
25 | }
26 |
27 | private void button1_Click(object sender, EventArgs e)
28 | {
29 | SqlCommand cmd = new SqlCommand("Select Pass from Admin where Id = '"+textBox1.Text+"'",con);
30 | con.Open();
31 | SqlDataReader dr = cmd.ExecuteReader();
32 | if (dr.HasRows)
33 | {
34 | dr.Read();
35 | if (dr[0].ToString() == textBox2.Text)
36 | {
37 | con.Close();
38 | this.Hide();
39 | AdminMenu am = new AdminMenu();
40 | am.Show();
41 | }
42 | else
43 | {
44 | con.Close();
45 | MessageBox.Show("Invalid Password", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
46 | }
47 | }
48 | else
49 | {
50 | MessageBox.Show("Invalid ID","Error !!!",MessageBoxButtons.OK,MessageBoxIcon.Error);
51 | }
52 | }
53 |
54 | private void AdminLogin_Load(object sender, EventArgs e)
55 | {
56 | #region System Generated
57 | Class1 c = new Class1();
58 | bool c1 = c.checkLoad("P219", con);
59 | if (!c1)
60 | {
61 | Application.Exit();
62 | }
63 | #endregion
64 | }
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AddCandidate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 |
11 | namespace Finger_ATM
12 | {
13 | public partial class AddCandidate : Form
14 | {
15 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
16 |
17 | public AddCandidate()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | private void button1_Click(object sender, EventArgs e)
23 | {
24 | OpenFileDialog open = new OpenFileDialog();
25 | open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
26 | if (open.ShowDialog() == DialogResult.OK)
27 | {
28 | pictureBox2.Image = new Bitmap(open.FileName);
29 | pictureBox2.Image.Save(@"Candidate\" + textBox1.Text + ".jpg");
30 | }
31 | }
32 |
33 | private void button3_Click(object sender, EventArgs e)
34 | {
35 | if (textBox1.Text == "" || textBox2.Text == "" || textBox3.Text == "")
36 | {
37 | MessageBox.Show("Please Fill all Data", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
38 | }
39 | else
40 | {
41 | SqlCommand cmd = new SqlCommand("Insert into Candidate Values ('" + textBox1.Text + "','" + textBox2.Text + "','" + @"Candidate\" + textBox1.Text + ".jpg" + "','" + textBox3.Text + "')", con);
42 | con.Open();
43 | cmd.ExecuteNonQuery();
44 | con.Close();
45 | DialogResult d = MessageBox.Show("Candidate Registred Successfully", "Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
46 | if (d == DialogResult.OK)
47 | {
48 | textBox1.Text = "";
49 | textBox2.Text = "";
50 | textBox3.Text = "";
51 | pictureBox2.Image = null;
52 | }
53 | }
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/Project/Finger Vote/ViewResult.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 |
11 | namespace Finger_ATM
12 | {
13 | public partial class ViewResult : Form
14 | {
15 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
16 |
17 | public ViewResult()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | private void ViewResult_Load(object sender, EventArgs e)
23 | {
24 | SqlDataAdapter da = new SqlDataAdapter("Select * from election where Result <> 'N/A' ",con);
25 | DataTable ds = new DataTable();
26 | da.Fill(ds);
27 | dataGridView1.DataSource = ds;
28 |
29 | DataGridViewColumn c1 = dataGridView1.Columns[0];
30 | c1.HeaderText = "Election ID";
31 | c1.Width = 110;
32 | DataGridViewColumn c2 = dataGridView1.Columns[1];
33 | c2.Width = 325;
34 | c2.HeaderText = "Election Topic";
35 | DataGridViewColumn c3 = dataGridView1.Columns[2];
36 | c3.HeaderText = "No Of Candidate";
37 | c3.Width = 100;
38 | c3.Visible = false;
39 | DataGridViewColumn c4 = dataGridView1.Columns[3];
40 | c4.HeaderText = "Candidate 1";
41 | c4.Width = 130;
42 | DataGridViewColumn c5 = dataGridView1.Columns[4];
43 | c5.HeaderText = "Candidate 2";
44 | c5.Width = 130;
45 | DataGridViewColumn c6 = dataGridView1.Columns[5];
46 | c6.Width = 130;
47 | c6.HeaderText = "Candidate 3";
48 | DataGridViewColumn c7 = dataGridView1.Columns[6];
49 | c7.Width = 130;
50 | c7.HeaderText = "Candidate 4";
51 | DataGridViewColumn c8 = dataGridView1.Columns[7];
52 | c8.Width = 120;
53 | c8.HeaderText = "End Date";
54 | DataGridViewColumn c9 = dataGridView1.Columns[8];
55 | c9.Width = 130;
56 | c9.HeaderText = "Winner";
57 | }
58 | }
59 | }
60 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Fingerprint-Based-Voting-System
2 |
3 | The main objective of democracy is "vote" by which the people can elect the candidates for forming an efficient government to satisfy their needs and requests such that their standard livingcan be improved.
4 |
5 | In developing countries like "INDIA", the election commission follows manual voting mechanism which is done by the electronic voting machine. But instead of this, The poll rate of India has only increased by 4 percent from 1952 to 2014. So a machine was required to automate the process and can be avail machine is placed in the poll booth center and is monitored by higher officials, due to some illegal activities the polling center are misused and people's right to has been denied. This seldom occurs in rural areas as well as in urban cities because the educated people are not interested in casting their votes to candidates who represent their respective areas. To ensure 100% voting, automation came into play. But this automated system has been approved only on some developed countries since security have not been ensured to a large extent. The poll percentage of India have never exceeded 67% till date.
6 |
7 | The main problem is people either do not leave in the area where they are registered as a voter or they do not go to the poll center because of any other reason. The queue at the poll center is also one of the major reason for less poll percentage. Some people cast their vote, and approximate 2% of the vote each time become invalid, due to any reason. To overcome all the drawbacks of traditional methods of voting, We have come up with an innovating solution to solve all the above-discussed problems.
8 |
9 | Fingerprint Based Voting Project is an application where the user is recognized by his finger pattern or IRIS (or any other biometrics in the future). 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. The fingerprint is used to uniquely identify the user. The fingerprint minutiae features are different for each human being. Fingerprint is used as an authentication of the voters. A 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 a candidate name and photo who are nominated. Admin will register the voter's 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 candidates 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 log in and vote for the candidate who is nominated.
10 |
11 | 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. We with the help of this system aims to achieve a target of 80+ percent by the end of the year 2029. We have designed this system in such a way that is affordable with minimum hardware requirement and the software will be provided by ECI free of cost.
12 |
13 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AddElection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 |
11 | namespace Finger_ATM
12 | {
13 | public partial class AddElection : Form
14 | {
15 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
16 |
17 | public AddElection()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | private void button3_Click(object sender, EventArgs e)
23 | {
24 | string date = dateTimePicker1.Value.ToString("yyyy/MM/dd");
25 | SqlCommand cmd = new SqlCommand("Insert into Election Values ('" + textBox1.Text + "','" + textBox2.Text + "','" + comboBox5.Text + "','" + comboBox1.Text + "','" + comboBox2.Text + "','" + comboBox3.Text + "','" + comboBox4.Text + "','"+date+"','N/A')", con);
26 | con.Open();
27 | cmd.ExecuteNonQuery();
28 | con.Close();
29 |
30 | MessageBox.Show("Election Registred Successfully", "Successful", MessageBoxButtons.OK, MessageBoxIcon.Information);
31 | textBox1.Text = "";
32 | textBox2.Text = "";
33 | comboBox1.SelectedIndex = 0;
34 | comboBox2.SelectedIndex = 0;
35 | comboBox3.SelectedIndex = 0;
36 | comboBox4.SelectedIndex = 0;
37 | comboBox5.SelectedIndex = 0;
38 | id();
39 | }
40 |
41 | private void AddElection_Load(object sender, EventArgs e)
42 | {
43 | SqlDataAdapter da = new SqlDataAdapter("Select Name From Candidate",con);
44 | DataSet ds = new DataSet();
45 | da.Fill(ds);
46 |
47 | int cou = ds.Tables[0].Rows.Count;
48 | for (int i = 0; i < cou; i++)
49 | {
50 | comboBox1.Items.Add(ds.Tables[0].Rows[i][0].ToString());
51 | comboBox2.Items.Add(ds.Tables[0].Rows[i][0].ToString());
52 | comboBox3.Items.Add(ds.Tables[0].Rows[i][0].ToString());
53 | comboBox4.Items.Add(ds.Tables[0].Rows[i][0].ToString());
54 | comboBox1.SelectedIndex = 0;
55 | comboBox2.SelectedIndex = 0;
56 | comboBox3.SelectedIndex = 0;
57 | comboBox4.SelectedIndex = 0;
58 | comboBox5.SelectedIndex = 0;
59 | }
60 |
61 | id();
62 | }
63 |
64 | public void id()
65 | {
66 | string com = "select top 1 EId From Election ORDER BY EId Desc;";
67 | con.Open();
68 | SqlCommand cmd = new SqlCommand(com, con);
69 | object count = cmd.ExecuteScalar();
70 | if (count != null)
71 | {
72 | int i = Convert.ToInt32(count);
73 | i++;
74 | textBox1.Text = i.ToString();
75 | }
76 | else
77 | {
78 | textBox1.Text = "1001";
79 | }
80 | con.Close();
81 | }
82 |
83 | private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
84 | {
85 | if (comboBox5.Text == "2")
86 | {
87 | comboBox1.Enabled = true;
88 | comboBox2.Enabled = true;
89 | comboBox3.Enabled = false;
90 | comboBox4.Enabled = false;
91 | comboBox3.Text = "N/A";
92 | comboBox4.Text = "N/A";
93 | }
94 | else if (comboBox5.Text == "3")
95 | {
96 | comboBox1.Enabled = true;
97 | comboBox2.Enabled = true;
98 | comboBox3.Enabled = true;
99 | comboBox4.Enabled = false;
100 | comboBox4.Text = "N/A";
101 | comboBox3.Text = "--Select--";
102 | }
103 | else if (comboBox5.Text == "4")
104 | {
105 | comboBox1.Enabled = true;
106 | comboBox2.Enabled = true;
107 | comboBox3.Enabled = true;
108 | comboBox4.Enabled = true;
109 | comboBox3.Text = "--Select--";
110 | comboBox4.Text = "--Select--";
111 | }
112 | }
113 | }
114 | }
115 |
--------------------------------------------------------------------------------
/Project/Finger Vote/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.18444
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Finger_ATM.Properties {
12 | using System;
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources {
26 |
27 | private static global::System.Resources.ResourceManager resourceMan;
28 |
29 | private static global::System.Globalization.CultureInfo resourceCulture;
30 |
31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
32 | internal Resources() {
33 | }
34 |
35 | ///
36 | /// Returns the cached ResourceManager instance used by this class.
37 | ///
38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
39 | internal static global::System.Resources.ResourceManager ResourceManager {
40 | get {
41 | if (object.ReferenceEquals(resourceMan, null)) {
42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Finger_ATM.Properties.Resources", typeof(Resources).Assembly);
43 | resourceMan = temp;
44 | }
45 | return resourceMan;
46 | }
47 | }
48 |
49 | ///
50 | /// Overrides the current thread's CurrentUICulture property for all
51 | /// resource lookups using this strongly typed resource class.
52 | ///
53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
54 | internal static global::System.Globalization.CultureInfo Culture {
55 | get {
56 | return resourceCulture;
57 | }
58 | set {
59 | resourceCulture = value;
60 | }
61 | }
62 |
63 | ///
64 | /// Looks up a localized resource of type System.Drawing.Bitmap.
65 | ///
66 | internal static System.Drawing.Bitmap Avoid_ATM_Credit_Card_Fees {
67 | get {
68 | object obj = ResourceManager.GetObject("Avoid-ATM-Credit-Card-Fees", resourceCulture);
69 | return ((System.Drawing.Bitmap)(obj));
70 | }
71 | }
72 |
73 | ///
74 | /// Looks up a localized resource of type System.Drawing.Bitmap.
75 | ///
76 | internal static System.Drawing.Bitmap Capture {
77 | get {
78 | object obj = ResourceManager.GetObject("Capture", resourceCulture);
79 | return ((System.Drawing.Bitmap)(obj));
80 | }
81 | }
82 |
83 | ///
84 | /// Looks up a localized resource of type System.Drawing.Bitmap.
85 | ///
86 | internal static System.Drawing.Bitmap Fingerprint_large_Small {
87 | get {
88 | object obj = ResourceManager.GetObject("Fingerprint-large-Small", resourceCulture);
89 | return ((System.Drawing.Bitmap)(obj));
90 | }
91 | }
92 |
93 | ///
94 | /// Looks up a localized resource of type System.Drawing.Bitmap.
95 | ///
96 | internal static System.Drawing.Bitmap Line {
97 | get {
98 | object obj = ResourceManager.GetObject("Line", resourceCulture);
99 | return ((System.Drawing.Bitmap)(obj));
100 | }
101 | }
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/Project/Finger Vote/ViewResult.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class ViewResult
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.dataGridView1 = new System.Windows.Forms.DataGridView();
34 | this.button1 = new System.Windows.Forms.Button();
35 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
36 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();
37 | this.SuspendLayout();
38 | //
39 | // label1
40 | //
41 | this.label1.AutoSize = true;
42 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
43 | this.label1.ForeColor = System.Drawing.Color.Navy;
44 | this.label1.Location = new System.Drawing.Point(35, 35);
45 | this.label1.Name = "label1";
46 | this.label1.Size = new System.Drawing.Size(195, 37);
47 | this.label1.TabIndex = 5;
48 | this.label1.Text = "View Result";
49 | //
50 | // pictureBox1
51 | //
52 | this.pictureBox1.Image = global::Finger_ATM.Properties.Resources.Line;
53 | this.pictureBox1.Location = new System.Drawing.Point(-1, 75);
54 | this.pictureBox1.Name = "pictureBox1";
55 | this.pictureBox1.Size = new System.Drawing.Size(1275, 18);
56 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
57 | this.pictureBox1.TabIndex = 4;
58 | this.pictureBox1.TabStop = false;
59 | //
60 | // dataGridView1
61 | //
62 | this.dataGridView1.AllowUserToAddRows = false;
63 | this.dataGridView1.AllowUserToDeleteRows = false;
64 | this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
65 | this.dataGridView1.Location = new System.Drawing.Point(60, 139);
66 | this.dataGridView1.Name = "dataGridView1";
67 | this.dataGridView1.ReadOnly = true;
68 | this.dataGridView1.Size = new System.Drawing.Size(1250, 420);
69 | this.dataGridView1.TabIndex = 6;
70 | //
71 | // button1
72 | //
73 | this.button1.Location = new System.Drawing.Point(635, 614);
74 | this.button1.Name = "button1";
75 | this.button1.Size = new System.Drawing.Size(101, 41);
76 | this.button1.TabIndex = 7;
77 | this.button1.Text = "Export";
78 | this.button1.UseVisualStyleBackColor = true;
79 | //
80 | // ViewResult
81 | //
82 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
83 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
84 | this.BackColor = System.Drawing.Color.White;
85 | this.ClientSize = new System.Drawing.Size(1370, 750);
86 | this.Controls.Add(this.button1);
87 | this.Controls.Add(this.dataGridView1);
88 | this.Controls.Add(this.label1);
89 | this.Controls.Add(this.pictureBox1);
90 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
91 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
92 | this.Name = "ViewResult";
93 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
94 | this.Text = "ViewResult";
95 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
96 | this.Load += new System.EventHandler(this.ViewResult_Load);
97 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
98 | ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();
99 | this.ResumeLayout(false);
100 | this.PerformLayout();
101 |
102 | }
103 |
104 | #endregion
105 |
106 | private System.Windows.Forms.Label label1;
107 | private System.Windows.Forms.PictureBox pictureBox1;
108 | private System.Windows.Forms.DataGridView dataGridView1;
109 | private System.Windows.Forms.Button button1;
110 | }
111 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/Result.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 |
11 | namespace Finger_ATM
12 | {
13 | public partial class Result : Form
14 | {
15 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
16 |
17 | public Result()
18 | {
19 | InitializeComponent();
20 | }
21 |
22 | private void Result_Load(object sender, EventArgs e)
23 | {
24 | string date = DateTime.Now.ToString("yyyy/MM/dd");
25 | SqlDataAdapter da = new SqlDataAdapter("Select EId from Election where EndDate < '" + date + "' And Result ='N/A'", con);
26 | DataSet ds = new DataSet();
27 | da.Fill(ds);
28 |
29 | int count = ds.Tables[0].Rows.Count;
30 | for (int i = 0; i < count; i++)
31 | {
32 | comboBox5.Items.Add(ds.Tables[0].Rows[i][0].ToString());
33 | }
34 |
35 | }
36 |
37 | private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
38 | {
39 | SqlCommand cmd = new SqlCommand("Select * from Election where EId = '" + comboBox5.Text + "'", con);
40 | con.Open();
41 | SqlDataReader dr = cmd.ExecuteReader();
42 | dr.Read();
43 | textBox3.Text = dr[1].ToString();
44 | string cou = dr[2].ToString();
45 | int count = Convert.ToInt32(cou);
46 |
47 | string[] names = new string[count];
48 | int[] vote = new int[count];
49 |
50 | if (cou == "2")
51 | {
52 | textBox1.Text = dr[3].ToString();
53 | textBox2.Text = dr[4].ToString();
54 | textBox4.Text = "N/A";
55 | textBox5.Text = "N/A";
56 | names[0] = textBox1.Text;
57 | names[1] = textBox2.Text;
58 | con.Close();
59 |
60 | SqlDataAdapter da = new SqlDataAdapter("Select * from Vote where EID = '"+comboBox5.Text+"' And EC1 ='1' ", con);
61 | DataSet ds = new DataSet();
62 | da.Fill(ds);
63 | vote[0] = ds.Tables[0].Rows.Count;
64 |
65 | da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC2 ='1' ", con);
66 | ds = new DataSet();
67 | da.Fill(ds);
68 | vote[1] = ds.Tables[0].Rows.Count;
69 | }
70 | else if (cou == "3")
71 | {
72 | textBox1.Text = dr[3].ToString();
73 | textBox2.Text = dr[4].ToString();
74 | textBox4.Text = dr[5].ToString();
75 | textBox5.Text = "N/A";
76 | names[0] = textBox1.Text;
77 | names[1] = textBox2.Text;
78 | names[2] = textBox4.Text;
79 | con.Close();
80 |
81 | SqlDataAdapter da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC1 ='1' ", con);
82 | DataSet ds = new DataSet();
83 | da.Fill(ds);
84 | vote[0] = ds.Tables[0].Rows.Count;
85 |
86 | da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC2 ='1' ", con);
87 | ds = new DataSet();
88 | da.Fill(ds);
89 | vote[1] = ds.Tables[0].Rows.Count;
90 |
91 | da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC3 ='1' ", con);
92 | ds = new DataSet();
93 | da.Fill(ds);
94 | vote[2] = ds.Tables[0].Rows.Count;
95 | }
96 | else if (cou == "4")
97 | {
98 | textBox1.Text = dr[3].ToString();
99 | textBox2.Text = dr[4].ToString();
100 | textBox4.Text = dr[5].ToString();
101 | textBox5.Text = dr[6].ToString();
102 | names[0] = textBox1.Text;
103 | names[1] = textBox2.Text;
104 | names[2] = textBox4.Text;
105 | names[3] = textBox5.Text;
106 | con.Close();
107 | SqlDataAdapter da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC1 ='1' ", con);
108 | DataSet ds = new DataSet();
109 | da.Fill(ds);
110 | vote[0] = ds.Tables[0].Rows.Count;
111 |
112 | da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC2 ='1' ", con);
113 | ds = new DataSet();
114 | da.Fill(ds);
115 | vote[1] = ds.Tables[0].Rows.Count;
116 |
117 | da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC3 ='1' ", con);
118 | ds = new DataSet();
119 | da.Fill(ds);
120 | vote[2] = ds.Tables[0].Rows.Count;
121 |
122 | da = new SqlDataAdapter("Select * from Vote where EID = '" + comboBox5.Text + "' And EC4 ='1' ", con);
123 | ds = new DataSet();
124 | da.Fill(ds);
125 | vote[3] = ds.Tables[0].Rows.Count;
126 | }
127 |
128 | int maxValue = vote.Max();
129 | int maxIndex = vote.ToList().IndexOf(maxValue);
130 |
131 | textBox9.Text = names[maxIndex];
132 | textBox8.Text = ""+maxValue;
133 |
134 | cmd = new SqlCommand("Update Election set Result = '"+textBox9.Text+"-"+textBox8.Text+"' where EId = '"+comboBox5.Text+"'",con);
135 | con.Open();
136 | cmd.ExecuteNonQuery();
137 | con.Close();
138 | }
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AddVoter.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/Result.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AddCandidate.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AddElection.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/TakeElection.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/ViewCandidate.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/ViewResult.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AdminLogin.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class AdminLogin
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdminLogin));
32 | this.groupBox1 = new System.Windows.Forms.GroupBox();
33 | this.button1 = new System.Windows.Forms.Button();
34 | this.textBox2 = new System.Windows.Forms.TextBox();
35 | this.textBox1 = new System.Windows.Forms.TextBox();
36 | this.label2 = new System.Windows.Forms.Label();
37 | this.label1 = new System.Windows.Forms.Label();
38 | this.groupBox1.SuspendLayout();
39 | this.SuspendLayout();
40 | //
41 | // groupBox1
42 | //
43 | this.groupBox1.Controls.Add(this.button1);
44 | this.groupBox1.Controls.Add(this.textBox2);
45 | this.groupBox1.Controls.Add(this.textBox1);
46 | this.groupBox1.Controls.Add(this.label2);
47 | this.groupBox1.Controls.Add(this.label1);
48 | this.groupBox1.Location = new System.Drawing.Point(130, 94);
49 | this.groupBox1.Name = "groupBox1";
50 | this.groupBox1.Size = new System.Drawing.Size(308, 224);
51 | this.groupBox1.TabIndex = 0;
52 | this.groupBox1.TabStop = false;
53 | this.groupBox1.Text = "Login Details";
54 | this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
55 | //
56 | // button1
57 | //
58 | this.button1.Location = new System.Drawing.Point(112, 146);
59 | this.button1.Name = "button1";
60 | this.button1.Size = new System.Drawing.Size(82, 31);
61 | this.button1.TabIndex = 4;
62 | this.button1.Text = "Submit";
63 | this.button1.UseVisualStyleBackColor = true;
64 | this.button1.Click += new System.EventHandler(this.button1_Click);
65 | //
66 | // textBox2
67 | //
68 | this.textBox2.Location = new System.Drawing.Point(140, 94);
69 | this.textBox2.Name = "textBox2";
70 | this.textBox2.PasswordChar = '*';
71 | this.textBox2.Size = new System.Drawing.Size(129, 32);
72 | this.textBox2.TabIndex = 3;
73 | //
74 | // textBox1
75 | //
76 | this.textBox1.Location = new System.Drawing.Point(140, 48);
77 | this.textBox1.Name = "textBox1";
78 | this.textBox1.Size = new System.Drawing.Size(129, 32);
79 | this.textBox1.TabIndex = 2;
80 | //
81 | // label2
82 | //
83 | this.label2.AutoSize = true;
84 | this.label2.Location = new System.Drawing.Point(39, 97);
85 | this.label2.Name = "label2";
86 | this.label2.Size = new System.Drawing.Size(133, 26);
87 | this.label2.TabIndex = 1;
88 | this.label2.Text = "Password :-";
89 | //
90 | // label1
91 | //
92 | this.label1.AutoSize = true;
93 | this.label1.Location = new System.Drawing.Point(42, 51);
94 | this.label1.Name = "label1";
95 | this.label1.Size = new System.Drawing.Size(128, 26);
96 | this.label1.TabIndex = 0;
97 | this.label1.Text = "Admin ID :-";
98 | //
99 | // AdminLogin
100 | //
101 | this.AutoScaleDimensions = new System.Drawing.SizeF(13F, 26F);
102 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
103 | this.BackColor = System.Drawing.Color.White;
104 | this.BackgroundImage = global::Finger_ATM.Properties.Resources.Fingerprint_large_Small;
105 | this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
106 | this.ClientSize = new System.Drawing.Size(568, 412);
107 | this.Controls.Add(this.groupBox1);
108 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
109 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
110 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
111 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
112 | this.MaximizeBox = false;
113 | this.MinimizeBox = false;
114 | this.Name = "AdminLogin";
115 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
116 | this.Text = "Admin";
117 | this.Load += new System.EventHandler(this.AdminLogin_Load);
118 | this.groupBox1.ResumeLayout(false);
119 | this.groupBox1.PerformLayout();
120 | this.ResumeLayout(false);
121 |
122 | }
123 |
124 | #endregion
125 |
126 | private System.Windows.Forms.GroupBox groupBox1;
127 | private System.Windows.Forms.Button button1;
128 | private System.Windows.Forms.TextBox textBox2;
129 | private System.Windows.Forms.TextBox textBox1;
130 | private System.Windows.Forms.Label label2;
131 | private System.Windows.Forms.Label label1;
132 | }
133 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 | text/microsoft-resx
110 |
111 |
112 | 2.0
113 |
114 |
115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
119 |
120 |
121 |
122 | ..\Resources\Fingerprint-large-Small.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
123 |
124 |
125 | ..\Resources\Avoid-ATM-Credit-Card-Fees.jpg;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
126 |
127 |
128 | ..\Resources\Capture.JPG;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
129 |
130 |
131 |
132 | ..\Resources\Line.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
133 |
134 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AdminMenu.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class AdminMenu
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AdminMenu));
32 | this.menuStrip1 = new System.Windows.Forms.MenuStrip();
33 | this.addCandidateToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
34 | this.addElectionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
35 | this.addVotersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
36 | this.viewResultToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
37 | this.logoutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
38 | this.caculateResultToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
39 | this.menuStrip1.SuspendLayout();
40 | this.SuspendLayout();
41 | //
42 | // menuStrip1
43 | //
44 | this.menuStrip1.BackColor = System.Drawing.Color.Navy;
45 | this.menuStrip1.Font = new System.Drawing.Font("Segoe UI", 12F);
46 | this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
47 | this.addCandidateToolStripMenuItem,
48 | this.addElectionToolStripMenuItem,
49 | this.addVotersToolStripMenuItem,
50 | this.caculateResultToolStripMenuItem,
51 | this.viewResultToolStripMenuItem,
52 | this.logoutToolStripMenuItem});
53 | this.menuStrip1.Location = new System.Drawing.Point(0, 0);
54 | this.menuStrip1.Name = "menuStrip1";
55 | this.menuStrip1.Size = new System.Drawing.Size(1370, 29);
56 | this.menuStrip1.TabIndex = 1;
57 | this.menuStrip1.Text = "menuStrip1";
58 | //
59 | // addCandidateToolStripMenuItem
60 | //
61 | this.addCandidateToolStripMenuItem.ForeColor = System.Drawing.Color.White;
62 | this.addCandidateToolStripMenuItem.Name = "addCandidateToolStripMenuItem";
63 | this.addCandidateToolStripMenuItem.Size = new System.Drawing.Size(124, 25);
64 | this.addCandidateToolStripMenuItem.Text = "Add Candidate";
65 | this.addCandidateToolStripMenuItem.Click += new System.EventHandler(this.addCandidateToolStripMenuItem_Click);
66 | //
67 | // addElectionToolStripMenuItem
68 | //
69 | this.addElectionToolStripMenuItem.ForeColor = System.Drawing.Color.White;
70 | this.addElectionToolStripMenuItem.Name = "addElectionToolStripMenuItem";
71 | this.addElectionToolStripMenuItem.Size = new System.Drawing.Size(108, 25);
72 | this.addElectionToolStripMenuItem.Text = "Add Election";
73 | this.addElectionToolStripMenuItem.Click += new System.EventHandler(this.addElectionToolStripMenuItem_Click);
74 | //
75 | // addVotersToolStripMenuItem
76 | //
77 | this.addVotersToolStripMenuItem.ForeColor = System.Drawing.Color.White;
78 | this.addVotersToolStripMenuItem.Name = "addVotersToolStripMenuItem";
79 | this.addVotersToolStripMenuItem.Size = new System.Drawing.Size(99, 25);
80 | this.addVotersToolStripMenuItem.Text = "Add Voters";
81 | this.addVotersToolStripMenuItem.Click += new System.EventHandler(this.addVotersToolStripMenuItem_Click);
82 | //
83 | // viewResultToolStripMenuItem
84 | //
85 | this.viewResultToolStripMenuItem.ForeColor = System.Drawing.Color.White;
86 | this.viewResultToolStripMenuItem.Name = "viewResultToolStripMenuItem";
87 | this.viewResultToolStripMenuItem.Size = new System.Drawing.Size(103, 25);
88 | this.viewResultToolStripMenuItem.Text = "View Result";
89 | this.viewResultToolStripMenuItem.Click += new System.EventHandler(this.viewResultToolStripMenuItem_Click);
90 | //
91 | // logoutToolStripMenuItem
92 | //
93 | this.logoutToolStripMenuItem.ForeColor = System.Drawing.Color.White;
94 | this.logoutToolStripMenuItem.Name = "logoutToolStripMenuItem";
95 | this.logoutToolStripMenuItem.Size = new System.Drawing.Size(71, 25);
96 | this.logoutToolStripMenuItem.Text = "Logout";
97 | this.logoutToolStripMenuItem.Click += new System.EventHandler(this.logoutToolStripMenuItem_Click);
98 | //
99 | // caculateResultToolStripMenuItem
100 | //
101 | this.caculateResultToolStripMenuItem.ForeColor = System.Drawing.Color.White;
102 | this.caculateResultToolStripMenuItem.Name = "caculateResultToolStripMenuItem";
103 | this.caculateResultToolStripMenuItem.Size = new System.Drawing.Size(128, 25);
104 | this.caculateResultToolStripMenuItem.Text = "Caculate Result";
105 | this.caculateResultToolStripMenuItem.Click += new System.EventHandler(this.caculateResultToolStripMenuItem_Click);
106 | //
107 | // AdminMenu
108 | //
109 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
110 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
111 | this.BackColor = System.Drawing.Color.White;
112 | this.ClientSize = new System.Drawing.Size(1370, 750);
113 | this.Controls.Add(this.menuStrip1);
114 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
115 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
116 | this.IsMdiContainer = true;
117 | this.MainMenuStrip = this.menuStrip1;
118 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
119 | this.MaximizeBox = false;
120 | this.MinimizeBox = false;
121 | this.Name = "AdminMenu";
122 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
123 | this.Text = "AdminMenu";
124 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
125 | this.menuStrip1.ResumeLayout(false);
126 | this.menuStrip1.PerformLayout();
127 | this.ResumeLayout(false);
128 | this.PerformLayout();
129 |
130 | }
131 |
132 | #endregion
133 |
134 | private System.Windows.Forms.MenuStrip menuStrip1;
135 | private System.Windows.Forms.ToolStripMenuItem addCandidateToolStripMenuItem;
136 | private System.Windows.Forms.ToolStripMenuItem addElectionToolStripMenuItem;
137 | private System.Windows.Forms.ToolStripMenuItem addVotersToolStripMenuItem;
138 | private System.Windows.Forms.ToolStripMenuItem viewResultToolStripMenuItem;
139 | private System.Windows.Forms.ToolStripMenuItem logoutToolStripMenuItem;
140 | private System.Windows.Forms.ToolStripMenuItem caculateResultToolStripMenuItem;
141 | }
142 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/Finger Vote.cs:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | x86
6 | 8.0.30703
7 | 2.0
8 | {D974663F-41C7-4AFF-9D23-13C3228E467F}
9 | WinExe
10 | Properties
11 | Finger_ATM
12 | Finger_ATM
13 | v3.5
14 | 512
15 |
16 |
17 | x86
18 | true
19 | full
20 | false
21 | bin\Debug\
22 | DEBUG;TRACE
23 | prompt
24 | 4
25 |
26 |
27 | x86
28 | pdbonly
29 | true
30 | bin\Release\
31 | TRACE
32 | prompt
33 | 4
34 |
35 |
36 | true
37 | bin\x64\Debug\
38 | DEBUG;TRACE
39 | full
40 | x64
41 | prompt
42 | MinimumRecommendedRules.ruleset
43 |
44 |
45 | bin\x64\Release\
46 | TRACE
47 | true
48 | pdbonly
49 | x64
50 | prompt
51 | MinimumRecommendedRules.ruleset
52 |
53 |
54 |
55 | ..\..\Apply\Check.dll
56 |
57 |
58 | ..\..\Matching\bin\Debug\SecuGen.FDxSDKPro.Windows.dll
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 | Form
73 |
74 |
75 | AddCandidate.cs
76 |
77 |
78 | Form
79 |
80 |
81 | AddElection.cs
82 |
83 |
84 | Form
85 |
86 |
87 | AddVoter.cs
88 |
89 |
90 | Form
91 |
92 |
93 | AdminLogin.cs
94 |
95 |
96 | Form
97 |
98 |
99 | AdminMenu.cs
100 |
101 |
102 |
103 |
104 | Form
105 |
106 |
107 | Result.cs
108 |
109 |
110 | Form
111 |
112 |
113 | TakeElection.cs
114 |
115 |
116 | Form
117 |
118 |
119 | ViewCandidate.cs
120 |
121 |
122 | Form
123 |
124 |
125 | ViewResult.cs
126 |
127 |
128 | AddCandidate.cs
129 |
130 |
131 | AddElection.cs
132 |
133 |
134 | AddVoter.cs
135 |
136 |
137 | AdminLogin.cs
138 |
139 |
140 | AdminMenu.cs
141 |
142 |
143 | ResXFileCodeGenerator
144 | Resources.Designer.cs
145 | Designer
146 |
147 |
148 | True
149 | Resources.resx
150 | True
151 |
152 |
153 | Result.cs
154 |
155 |
156 | TakeElection.cs
157 |
158 |
159 | ViewCandidate.cs
160 |
161 |
162 | ViewResult.cs
163 |
164 |
165 | SettingsSingleFileGenerator
166 | Settings.Designer.cs
167 |
168 |
169 | True
170 | Settings.settings
171 | True
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
197 |
--------------------------------------------------------------------------------
/Project/Finger Vote/ViewCandidate.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class ViewCandidate
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.groupBox1 = new System.Windows.Forms.GroupBox();
34 | this.label2 = new System.Windows.Forms.Label();
35 | this.label3 = new System.Windows.Forms.Label();
36 | this.label4 = new System.Windows.Forms.Label();
37 | this.textBox1 = new System.Windows.Forms.TextBox();
38 | this.textBox2 = new System.Windows.Forms.TextBox();
39 | this.pictureBox2 = new System.Windows.Forms.PictureBox();
40 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
41 | this.groupBox1.SuspendLayout();
42 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
43 | this.SuspendLayout();
44 | //
45 | // label1
46 | //
47 | this.label1.AutoSize = true;
48 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
49 | this.label1.ForeColor = System.Drawing.Color.Navy;
50 | this.label1.Location = new System.Drawing.Point(35, 35);
51 | this.label1.Name = "label1";
52 | this.label1.Size = new System.Drawing.Size(255, 37);
53 | this.label1.TabIndex = 3;
54 | this.label1.Text = "View Candidate";
55 | //
56 | // pictureBox1
57 | //
58 | this.pictureBox1.Image = global::Finger_ATM.Properties.Resources.Line;
59 | this.pictureBox1.Location = new System.Drawing.Point(0, 75);
60 | this.pictureBox1.Name = "pictureBox1";
61 | this.pictureBox1.Size = new System.Drawing.Size(736, 18);
62 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
63 | this.pictureBox1.TabIndex = 2;
64 | this.pictureBox1.TabStop = false;
65 | //
66 | // groupBox1
67 | //
68 | this.groupBox1.Controls.Add(this.pictureBox2);
69 | this.groupBox1.Controls.Add(this.textBox2);
70 | this.groupBox1.Controls.Add(this.textBox1);
71 | this.groupBox1.Controls.Add(this.label4);
72 | this.groupBox1.Controls.Add(this.label3);
73 | this.groupBox1.Controls.Add(this.label2);
74 | this.groupBox1.Location = new System.Drawing.Point(91, 111);
75 | this.groupBox1.Name = "groupBox1";
76 | this.groupBox1.Size = new System.Drawing.Size(583, 424);
77 | this.groupBox1.TabIndex = 4;
78 | this.groupBox1.TabStop = false;
79 | //
80 | // label2
81 | //
82 | this.label2.AutoSize = true;
83 | this.label2.Location = new System.Drawing.Point(101, 41);
84 | this.label2.Name = "label2";
85 | this.label2.Size = new System.Drawing.Size(156, 20);
86 | this.label2.TabIndex = 0;
87 | this.label2.Text = "Candidate\'s Name :-";
88 | //
89 | // label3
90 | //
91 | this.label3.AutoSize = true;
92 | this.label3.Location = new System.Drawing.Point(101, 156);
93 | this.label3.Name = "label3";
94 | this.label3.Size = new System.Drawing.Size(156, 20);
95 | this.label3.TabIndex = 0;
96 | this.label3.Text = "Candidate\'s Photo :-";
97 | //
98 | // label4
99 | //
100 | this.label4.AutoSize = true;
101 | this.label4.Location = new System.Drawing.Point(106, 333);
102 | this.label4.Name = "label4";
103 | this.label4.Size = new System.Drawing.Size(151, 20);
104 | this.label4.TabIndex = 0;
105 | this.label4.Text = "Candidate\'s Desc :-";
106 | //
107 | // textBox1
108 | //
109 | this.textBox1.Location = new System.Drawing.Point(263, 38);
110 | this.textBox1.Name = "textBox1";
111 | this.textBox1.ReadOnly = true;
112 | this.textBox1.Size = new System.Drawing.Size(218, 26);
113 | this.textBox1.TabIndex = 1;
114 | //
115 | // textBox2
116 | //
117 | this.textBox2.Location = new System.Drawing.Point(263, 284);
118 | this.textBox2.Multiline = true;
119 | this.textBox2.Name = "textBox2";
120 | this.textBox2.ReadOnly = true;
121 | this.textBox2.Size = new System.Drawing.Size(218, 119);
122 | this.textBox2.TabIndex = 1;
123 | //
124 | // pictureBox2
125 | //
126 | this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
127 | this.pictureBox2.Location = new System.Drawing.Point(263, 90);
128 | this.pictureBox2.Name = "pictureBox2";
129 | this.pictureBox2.Size = new System.Drawing.Size(168, 168);
130 | this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
131 | this.pictureBox2.TabIndex = 2;
132 | this.pictureBox2.TabStop = false;
133 | //
134 | // ViewCandidate
135 | //
136 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
137 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
138 | this.BackColor = System.Drawing.Color.White;
139 | this.ClientSize = new System.Drawing.Size(766, 547);
140 | this.Controls.Add(this.groupBox1);
141 | this.Controls.Add(this.label1);
142 | this.Controls.Add(this.pictureBox1);
143 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
144 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
145 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
146 | this.MaximizeBox = false;
147 | this.MinimizeBox = false;
148 | this.Name = "ViewCandidate";
149 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
150 | this.Text = "ViewCandidate";
151 | this.Load += new System.EventHandler(this.ViewCandidate_Load);
152 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
153 | this.groupBox1.ResumeLayout(false);
154 | this.groupBox1.PerformLayout();
155 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
156 | this.ResumeLayout(false);
157 | this.PerformLayout();
158 |
159 | }
160 |
161 | #endregion
162 |
163 | private System.Windows.Forms.Label label1;
164 | private System.Windows.Forms.PictureBox pictureBox1;
165 | private System.Windows.Forms.GroupBox groupBox1;
166 | private System.Windows.Forms.Label label2;
167 | private System.Windows.Forms.Label label4;
168 | private System.Windows.Forms.Label label3;
169 | private System.Windows.Forms.TextBox textBox1;
170 | private System.Windows.Forms.TextBox textBox2;
171 | private System.Windows.Forms.PictureBox pictureBox2;
172 | }
173 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/AddCandidate.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class AddCandidate
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
32 | this.label1 = new System.Windows.Forms.Label();
33 | this.panel2 = new System.Windows.Forms.Panel();
34 | this.button3 = new System.Windows.Forms.Button();
35 | this.button1 = new System.Windows.Forms.Button();
36 | this.pictureBox2 = new System.Windows.Forms.PictureBox();
37 | this.textBox3 = new System.Windows.Forms.TextBox();
38 | this.textBox2 = new System.Windows.Forms.TextBox();
39 | this.textBox1 = new System.Windows.Forms.TextBox();
40 | this.label7 = new System.Windows.Forms.Label();
41 | this.label6 = new System.Windows.Forms.Label();
42 | this.label4 = new System.Windows.Forms.Label();
43 | this.label3 = new System.Windows.Forms.Label();
44 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
45 | this.panel2.SuspendLayout();
46 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
47 | this.SuspendLayout();
48 | //
49 | // pictureBox1
50 | //
51 | this.pictureBox1.Image = global::Finger_ATM.Properties.Resources.Line;
52 | this.pictureBox1.Location = new System.Drawing.Point(0, 75);
53 | this.pictureBox1.Name = "pictureBox1";
54 | this.pictureBox1.Size = new System.Drawing.Size(1275, 18);
55 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
56 | this.pictureBox1.TabIndex = 0;
57 | this.pictureBox1.TabStop = false;
58 | //
59 | // label1
60 | //
61 | this.label1.AutoSize = true;
62 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
63 | this.label1.ForeColor = System.Drawing.Color.Navy;
64 | this.label1.Location = new System.Drawing.Point(35, 35);
65 | this.label1.Name = "label1";
66 | this.label1.Size = new System.Drawing.Size(243, 37);
67 | this.label1.TabIndex = 1;
68 | this.label1.Text = "Add Candidate";
69 | //
70 | // panel2
71 | //
72 | this.panel2.Controls.Add(this.button3);
73 | this.panel2.Controls.Add(this.button1);
74 | this.panel2.Controls.Add(this.pictureBox2);
75 | this.panel2.Controls.Add(this.textBox3);
76 | this.panel2.Controls.Add(this.textBox2);
77 | this.panel2.Controls.Add(this.textBox1);
78 | this.panel2.Controls.Add(this.label7);
79 | this.panel2.Controls.Add(this.label6);
80 | this.panel2.Controls.Add(this.label4);
81 | this.panel2.Controls.Add(this.label3);
82 | this.panel2.Location = new System.Drawing.Point(110, 117);
83 | this.panel2.Name = "panel2";
84 | this.panel2.Size = new System.Drawing.Size(1150, 579);
85 | this.panel2.TabIndex = 13;
86 | //
87 | // button3
88 | //
89 | this.button3.BackColor = System.Drawing.Color.White;
90 | this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
91 | this.button3.ForeColor = System.Drawing.Color.Navy;
92 | this.button3.Location = new System.Drawing.Point(517, 496);
93 | this.button3.Name = "button3";
94 | this.button3.Size = new System.Drawing.Size(117, 41);
95 | this.button3.TabIndex = 7;
96 | this.button3.Text = "Submit";
97 | this.button3.UseVisualStyleBackColor = false;
98 | this.button3.Click += new System.EventHandler(this.button3_Click);
99 | //
100 | // button1
101 | //
102 | this.button1.Location = new System.Drawing.Point(705, 361);
103 | this.button1.Name = "button1";
104 | this.button1.Size = new System.Drawing.Size(78, 33);
105 | this.button1.TabIndex = 7;
106 | this.button1.Text = "Upload";
107 | this.button1.UseVisualStyleBackColor = true;
108 | this.button1.Click += new System.EventHandler(this.button1_Click);
109 | //
110 | // pictureBox2
111 | //
112 | this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
113 | this.pictureBox2.Location = new System.Drawing.Point(496, 305);
114 | this.pictureBox2.Name = "pictureBox2";
115 | this.pictureBox2.Size = new System.Drawing.Size(168, 152);
116 | this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
117 | this.pictureBox2.TabIndex = 6;
118 | this.pictureBox2.TabStop = false;
119 | //
120 | // textBox3
121 | //
122 | this.textBox3.Location = new System.Drawing.Point(496, 169);
123 | this.textBox3.Multiline = true;
124 | this.textBox3.Name = "textBox3";
125 | this.textBox3.Size = new System.Drawing.Size(265, 102);
126 | this.textBox3.TabIndex = 5;
127 | //
128 | // textBox2
129 | //
130 | this.textBox2.Location = new System.Drawing.Point(496, 99);
131 | this.textBox2.Name = "textBox2";
132 | this.textBox2.Size = new System.Drawing.Size(265, 26);
133 | this.textBox2.TabIndex = 5;
134 | //
135 | // textBox1
136 | //
137 | this.textBox1.Location = new System.Drawing.Point(496, 32);
138 | this.textBox1.Name = "textBox1";
139 | this.textBox1.Size = new System.Drawing.Size(265, 26);
140 | this.textBox1.TabIndex = 5;
141 | //
142 | // label7
143 | //
144 | this.label7.AutoSize = true;
145 | this.label7.Location = new System.Drawing.Point(368, 367);
146 | this.label7.Name = "label7";
147 | this.label7.Size = new System.Drawing.Size(122, 20);
148 | this.label7.TabIndex = 4;
149 | this.label7.Text = "Voter\'s Photo :-";
150 | //
151 | // label6
152 | //
153 | this.label6.AutoSize = true;
154 | this.label6.Location = new System.Drawing.Point(404, 172);
155 | this.label6.Name = "label6";
156 | this.label6.Size = new System.Drawing.Size(89, 20);
157 | this.label6.TabIndex = 3;
158 | this.label6.Text = "Address :-";
159 | //
160 | // label4
161 | //
162 | this.label4.AutoSize = true;
163 | this.label4.Location = new System.Drawing.Point(422, 102);
164 | this.label4.Name = "label4";
165 | this.label4.Size = new System.Drawing.Size(68, 20);
166 | this.label4.TabIndex = 1;
167 | this.label4.Text = "Name :-";
168 | //
169 | // label3
170 | //
171 | this.label3.AutoSize = true;
172 | this.label3.Location = new System.Drawing.Point(373, 35);
173 | this.label3.Name = "label3";
174 | this.label3.Size = new System.Drawing.Size(120, 20);
175 | this.label3.TabIndex = 0;
176 | this.label3.Text = "Candidate ID :-";
177 | //
178 | // AddCandidate
179 | //
180 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
181 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
182 | this.BackColor = System.Drawing.Color.White;
183 | this.ClientSize = new System.Drawing.Size(1370, 750);
184 | this.Controls.Add(this.panel2);
185 | this.Controls.Add(this.label1);
186 | this.Controls.Add(this.pictureBox1);
187 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
188 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
189 | this.Name = "AddCandidate";
190 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
191 | this.Text = "AddCandidate";
192 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
193 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
194 | this.panel2.ResumeLayout(false);
195 | this.panel2.PerformLayout();
196 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
197 | this.ResumeLayout(false);
198 | this.PerformLayout();
199 |
200 | }
201 |
202 | #endregion
203 |
204 | private System.Windows.Forms.PictureBox pictureBox1;
205 | private System.Windows.Forms.Label label1;
206 | private System.Windows.Forms.Panel panel2;
207 | private System.Windows.Forms.Button button3;
208 | private System.Windows.Forms.Button button1;
209 | private System.Windows.Forms.PictureBox pictureBox2;
210 | private System.Windows.Forms.TextBox textBox3;
211 | private System.Windows.Forms.TextBox textBox2;
212 | private System.Windows.Forms.TextBox textBox1;
213 | private System.Windows.Forms.Label label7;
214 | private System.Windows.Forms.Label label6;
215 | private System.Windows.Forms.Label label4;
216 | private System.Windows.Forms.Label label3;
217 | }
218 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/AddVoter.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using SecuGen.FDxSDKPro.Windows;
10 | using System.Data.SqlClient;
11 |
12 | namespace Finger_ATM
13 | {
14 | public partial class AddVoter : Form
15 | {
16 | private SGFingerPrintManager m_FPM;
17 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
18 | private bool m_LedOn = false;
19 | private Int32 m_ImageWidth;
20 | private Int32 m_ImageHeight;
21 | private Byte[] m_RegMin1;
22 | private Byte[] m_RegMin2;
23 | private Byte[] m_VrfMin;
24 | private SGFPMDeviceList[] m_DevList; // Used for EnumerateDevice
25 |
26 | public AddVoter()
27 | {
28 | InitializeComponent();
29 | }
30 |
31 | private void AddVoter_Load(object sender, EventArgs e)
32 | {
33 | m_LedOn = false;
34 |
35 | m_RegMin1 = new Byte[400];
36 | m_RegMin2 = new Byte[400];
37 | m_VrfMin = new Byte[400];
38 | m_FPM = new SGFingerPrintManager();
39 | EnumerateBtn_Click(sender, e);
40 | }
41 |
42 | private void EnumerateBtn_Click(object sender, System.EventArgs e)
43 | {
44 | Int32 iError;
45 | string enum_device;
46 |
47 | comboBoxDeviceName.Items.Clear();
48 |
49 | // Enumerate Device
50 | iError = m_FPM.EnumerateDevice();
51 |
52 | // Get enumeration info into SGFPMDeviceList
53 | m_DevList = new SGFPMDeviceList[m_FPM.NumberOfDevice];
54 |
55 | for (int i = 0; i < m_FPM.NumberOfDevice; i++)
56 | {
57 | m_DevList[i] = new SGFPMDeviceList();
58 | m_FPM.GetEnumDeviceInfo(i, m_DevList[i]);
59 | enum_device = m_DevList[i].DevName.ToString() + " : " + m_DevList[i].DevID;
60 | comboBoxDeviceName.Items.Add(enum_device);
61 | }
62 |
63 | if (comboBoxDeviceName.Items.Count > 0)
64 | {
65 | // Add Auto Selection
66 | enum_device = "Auto Selection";
67 | comboBoxDeviceName.Items.Add(enum_device);
68 |
69 | comboBoxDeviceName.SelectedIndex = 0; //First selected one
70 | }
71 |
72 | }
73 |
74 | private void button2_Click(object sender, EventArgs e)
75 | {
76 | if (m_FPM.NumberOfDevice == 0)
77 | return;
78 |
79 | Int32 iError;
80 | SGFPMDeviceName device_name;
81 | Int32 device_id;
82 |
83 | Int32 numberOfDevices = comboBoxDeviceName.Items.Count;
84 | Int32 deviceSelected = comboBoxDeviceName.SelectedIndex;
85 | Boolean autoSelection = (deviceSelected == (numberOfDevices - 1)); // Last index
86 |
87 | if (autoSelection)
88 | {
89 | // Order of search: Hamster IV(HFDU04) -> Plus(HFDU03) -> III (HFDU02)
90 | device_name = SGFPMDeviceName.DEV_AUTO;
91 |
92 | device_id = (Int32)(SGFPMPortAddr.USB_AUTO_DETECT);
93 | }
94 | else
95 | {
96 | device_name = m_DevList[deviceSelected].DevName;
97 | device_id = m_DevList[deviceSelected].DevID;
98 | }
99 |
100 | iError = m_FPM.Init(device_name);
101 | iError = m_FPM.OpenDevice(device_id);
102 |
103 | if (iError == (Int32)SGFPMError.ERROR_NONE)
104 | {
105 | GetBtn_Click(sender, e);
106 | panel1.Visible = false;
107 | panel2.Visible = true;
108 | }
109 | else
110 | DisplayError("OpenDevice()", iError);
111 |
112 | }
113 |
114 |
115 | private void GetBtn_Click(object sender, System.EventArgs e)
116 | {
117 | SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
118 | Int32 iError = m_FPM.GetDeviceInfo(pInfo);
119 |
120 | if (iError == (Int32)SGFPMError.ERROR_NONE)
121 | {
122 | m_ImageWidth = pInfo.ImageWidth;
123 | m_ImageHeight = pInfo.ImageHeight;
124 | ASCIIEncoding encoding = new ASCIIEncoding();
125 | }
126 | }
127 |
128 |
129 | void DisplayError(string funcName, int iError)
130 | {
131 | string text = "";
132 |
133 | switch (iError)
134 | {
135 | case 0: //SGFDX_ERROR_NONE = 0,
136 | text = "Error none";
137 | break;
138 |
139 | case 1: //SGFDX_ERROR_CREATION_FAILED = 1,
140 | text = "Can not create object";
141 | break;
142 |
143 | case 2: // SGFDX_ERROR_FUNCTION_FAILED = 2,
144 | text = "Function Failed";
145 | break;
146 |
147 | case 3: // SGFDX_ERROR_INVALID_PARAM = 3,
148 | text = "Invalid Parameter";
149 | break;
150 |
151 | case 4: // SGFDX_ERROR_NOT_USED = 4,
152 | text = "Not used function";
153 | break;
154 |
155 | case 5: //SGFDX_ERROR_DLLLOAD_FAILED = 5,
156 | text = "Can not create object";
157 | break;
158 |
159 | case 6: //SGFDX_ERROR_DLLLOAD_FAILED_DRV = 6,
160 | text = "Can not load device driver";
161 | break;
162 | case 7: //SGFDX_ERROR_DLLLOAD_FAILED_ALGO = 7,
163 | text = "Can not load sgfpamx.dll";
164 | break;
165 |
166 | case 51: //SGFDX_ERROR_SYSLOAD_FAILED = 51, // system file load fail
167 | text = "Can not load driver kernel file";
168 | break;
169 |
170 | case 52: //SGFDX_ERROR_INITIALIZE_FAILED = 52, // chip initialize fail
171 | text = "Failed to initialize the device";
172 | break;
173 |
174 | case 53: //SGFDX_ERROR_LINE_DROPPED = 53, // image data drop
175 | text = "Data transmission is not good";
176 | break;
177 |
178 | case 54: //SGFDX_ERROR_TIME_OUT = 54, // getliveimage timeout error
179 | text = "Time out";
180 | break;
181 |
182 | case 55: //SGFDX_ERROR_DEVICE_NOT_FOUND = 55, // device not found
183 | text = "Device not found";
184 | break;
185 |
186 | case 56: //SGFDX_ERROR_DRVLOAD_FAILED = 56, // dll file load fail
187 | text = "Can not load driver file";
188 | break;
189 |
190 | case 57: //SGFDX_ERROR_WRONG_IMAGE = 57, // wrong image
191 | text = "Wrong Image";
192 | break;
193 |
194 | case 58: //SGFDX_ERROR_LACK_OF_BANDWIDTH = 58, // USB Bandwith Lack Error
195 | text = "Lack of USB Bandwith";
196 | break;
197 |
198 | case 59: //SGFDX_ERROR_DEV_ALREADY_OPEN = 59, // Device Exclusive access Error
199 | text = "Device is already opened";
200 | break;
201 |
202 | case 60: //SGFDX_ERROR_GETSN_FAILED = 60, // Fail to get Device Serial Number
203 | text = "Device serial number error";
204 | break;
205 |
206 | case 61: //SGFDX_ERROR_UNSUPPORTED_DEV = 61, // Unsupported device
207 | text = "Unsupported device";
208 | break;
209 |
210 | // Extract & Verification error
211 | case 101: //SGFDX_ERROR_FEAT_NUMBER = 101, // utoo small number of minutiae
212 | text = "The number of minutiae is too small";
213 | break;
214 |
215 | case 102: //SGFDX_ERROR_INVALID_TEMPLATE_TYPE = 102, // wrong template type
216 | text = "Template is invalid";
217 | break;
218 |
219 | case 103: //SGFDX_ERROR_INVALID_TEMPLATE1 = 103, // wrong template type
220 | text = "1st template is invalid";
221 | break;
222 |
223 | case 104: //SGFDX_ERROR_INVALID_TEMPLATE2 = 104, // vwrong template type
224 | text = "2nd template is invalid";
225 | break;
226 |
227 | case 105: //SGFDX_ERROR_EXTRACT_FAIL = 105, // extraction fail
228 | text = "Minutiae extraction failed";
229 | break;
230 |
231 | case 106: //SGFDX_ERROR_MATCH_FAIL = 106, // matching fail
232 | text = "Matching failed";
233 | break;
234 |
235 | }
236 |
237 | text = funcName + " Error # " + iError + " :" + text;
238 | MessageBox.Show(text, "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
239 | }
240 |
241 | private void button1_Click(object sender, EventArgs e)
242 | {
243 | OpenFileDialog open = new OpenFileDialog();
244 | open.Filter = "Image Files(*.jpg; *.jpeg; *.gif; *.bmp)|*.jpg; *.jpeg; *.gif; *.bmp";
245 | if (open.ShowDialog() == DialogResult.OK)
246 | {
247 | pictureBox2.Image = new Bitmap(open.FileName);
248 | pictureBox2.Image.Save(@"Image\" + textBox1.Text + ".jpg");
249 | }
250 | }
251 |
252 | private void button3_Click(object sender, EventArgs e)
253 | {
254 |
255 | if (textBox1.Text != "")
256 | {
257 | Int32 iError;
258 | Byte[] fp_image;
259 | Int32 img_qlty;
260 |
261 | fp_image = new Byte[m_ImageWidth * m_ImageHeight];
262 | img_qlty = 0;
263 |
264 | iError = m_FPM.GetImage(fp_image);
265 |
266 | m_FPM.GetImageQuality(m_ImageWidth, m_ImageHeight, fp_image, ref img_qlty);
267 |
268 |
269 | if (iError == (Int32)SGFPMError.ERROR_NONE)
270 | {
271 | DrawImage(fp_image, pictureBox3);
272 | iError = m_FPM.CreateTemplate(fp_image, m_RegMin1);
273 |
274 | if (iError == (Int32)SGFPMError.ERROR_NONE)
275 | {
276 | pictureBox3.Image.Save(@"Finger\" + textBox1.Text + ".jpg");
277 | SqlCommand cmd = new SqlCommand("Insert into Voter (UserId,Name,Mobile,Address,Image,Template) Values ('" + textBox1.Text + "','" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + @"Image\" + textBox1.Text + ".jpg" + "',@data)", con);
278 | con.Open();
279 | cmd.Parameters.AddWithValue("@data", fp_image);
280 | cmd.ExecuteNonQuery();
281 | con.Close();
282 | DialogResult d = MessageBox.Show("Voter Registred Successfully", "Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
283 | if (d == DialogResult.OK)
284 | {
285 | textBox1.Text = "";
286 | textBox2.Text = "";
287 | textBox3.Text = "";
288 | textBox4.Text = "";
289 | pictureBox2.Image = null;
290 | pictureBox3.Image = null;
291 | }
292 | }
293 | else
294 | DisplayError("CreateTemplate()", iError);
295 | }
296 | else
297 | {
298 | MessageBox.Show("Finger Capturing Failed", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
299 | }
300 | }
301 | else
302 | {
303 | MessageBox.Show("please Enter User Id", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
304 | }
305 | }
306 |
307 | private void DrawImage(Byte[] imgData, PictureBox picBox)
308 | {
309 | int colorval;
310 | Bitmap bmp = new Bitmap(m_ImageWidth, m_ImageHeight);
311 | picBox.Image = (Image)bmp;
312 |
313 | for (int i = 0; i < bmp.Width; i++)
314 | {
315 | for (int j = 0; j < bmp.Height; j++)
316 | {
317 | colorval = (int)imgData[(j * m_ImageWidth) + i];
318 | bmp.SetPixel(i, j, Color.FromArgb(colorval, colorval, colorval));
319 | }
320 | }
321 | picBox.Refresh();
322 | }
323 | }
324 | }
325 |
--------------------------------------------------------------------------------
/Project/Finger Vote/AddElection.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class AddElection
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.panel2 = new System.Windows.Forms.Panel();
34 | this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
35 | this.label9 = new System.Windows.Forms.Label();
36 | this.comboBox4 = new System.Windows.Forms.ComboBox();
37 | this.comboBox3 = new System.Windows.Forms.ComboBox();
38 | this.comboBox2 = new System.Windows.Forms.ComboBox();
39 | this.comboBox5 = new System.Windows.Forms.ComboBox();
40 | this.comboBox1 = new System.Windows.Forms.ComboBox();
41 | this.label7 = new System.Windows.Forms.Label();
42 | this.button3 = new System.Windows.Forms.Button();
43 | this.label5 = new System.Windows.Forms.Label();
44 | this.textBox2 = new System.Windows.Forms.TextBox();
45 | this.label2 = new System.Windows.Forms.Label();
46 | this.label8 = new System.Windows.Forms.Label();
47 | this.textBox1 = new System.Windows.Forms.TextBox();
48 | this.label6 = new System.Windows.Forms.Label();
49 | this.label4 = new System.Windows.Forms.Label();
50 | this.label3 = new System.Windows.Forms.Label();
51 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
52 | this.panel2.SuspendLayout();
53 | this.SuspendLayout();
54 | //
55 | // label1
56 | //
57 | this.label1.AutoSize = true;
58 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
59 | this.label1.ForeColor = System.Drawing.Color.Navy;
60 | this.label1.Location = new System.Drawing.Point(35, 35);
61 | this.label1.Name = "label1";
62 | this.label1.Size = new System.Drawing.Size(209, 37);
63 | this.label1.TabIndex = 3;
64 | this.label1.Text = "Add Election";
65 | //
66 | // pictureBox1
67 | //
68 | this.pictureBox1.Image = global::Finger_ATM.Properties.Resources.Line;
69 | this.pictureBox1.Location = new System.Drawing.Point(0, 75);
70 | this.pictureBox1.Name = "pictureBox1";
71 | this.pictureBox1.Size = new System.Drawing.Size(1275, 18);
72 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
73 | this.pictureBox1.TabIndex = 2;
74 | this.pictureBox1.TabStop = false;
75 | //
76 | // panel2
77 | //
78 | this.panel2.Controls.Add(this.dateTimePicker1);
79 | this.panel2.Controls.Add(this.label9);
80 | this.panel2.Controls.Add(this.comboBox4);
81 | this.panel2.Controls.Add(this.comboBox3);
82 | this.panel2.Controls.Add(this.comboBox2);
83 | this.panel2.Controls.Add(this.comboBox5);
84 | this.panel2.Controls.Add(this.comboBox1);
85 | this.panel2.Controls.Add(this.label7);
86 | this.panel2.Controls.Add(this.button3);
87 | this.panel2.Controls.Add(this.label5);
88 | this.panel2.Controls.Add(this.textBox2);
89 | this.panel2.Controls.Add(this.label2);
90 | this.panel2.Controls.Add(this.label8);
91 | this.panel2.Controls.Add(this.textBox1);
92 | this.panel2.Controls.Add(this.label6);
93 | this.panel2.Controls.Add(this.label4);
94 | this.panel2.Controls.Add(this.label3);
95 | this.panel2.Location = new System.Drawing.Point(110, 104);
96 | this.panel2.Name = "panel2";
97 | this.panel2.Size = new System.Drawing.Size(1150, 579);
98 | this.panel2.TabIndex = 14;
99 | //
100 | // dateTimePicker1
101 | //
102 | this.dateTimePicker1.Format = System.Windows.Forms.DateTimePickerFormat.Short;
103 | this.dateTimePicker1.Location = new System.Drawing.Point(546, 454);
104 | this.dateTimePicker1.Name = "dateTimePicker1";
105 | this.dateTimePicker1.Size = new System.Drawing.Size(224, 26);
106 | this.dateTimePicker1.TabIndex = 10;
107 | //
108 | // label9
109 | //
110 | this.label9.AutoSize = true;
111 | this.label9.Location = new System.Drawing.Point(438, 457);
112 | this.label9.Name = "label9";
113 | this.label9.Size = new System.Drawing.Size(98, 20);
114 | this.label9.TabIndex = 9;
115 | this.label9.Text = "End Date :-";
116 | //
117 | // comboBox4
118 | //
119 | this.comboBox4.FormattingEnabled = true;
120 | this.comboBox4.Items.AddRange(new object[] {
121 | "--Select--"});
122 | this.comboBox4.Location = new System.Drawing.Point(546, 401);
123 | this.comboBox4.Name = "comboBox4";
124 | this.comboBox4.Size = new System.Drawing.Size(224, 28);
125 | this.comboBox4.TabIndex = 8;
126 | //
127 | // comboBox3
128 | //
129 | this.comboBox3.FormattingEnabled = true;
130 | this.comboBox3.Items.AddRange(new object[] {
131 | "--Select--"});
132 | this.comboBox3.Location = new System.Drawing.Point(546, 348);
133 | this.comboBox3.Name = "comboBox3";
134 | this.comboBox3.Size = new System.Drawing.Size(224, 28);
135 | this.comboBox3.TabIndex = 8;
136 | //
137 | // comboBox2
138 | //
139 | this.comboBox2.FormattingEnabled = true;
140 | this.comboBox2.Items.AddRange(new object[] {
141 | "--Select--"});
142 | this.comboBox2.Location = new System.Drawing.Point(546, 295);
143 | this.comboBox2.Name = "comboBox2";
144 | this.comboBox2.Size = new System.Drawing.Size(224, 28);
145 | this.comboBox2.TabIndex = 8;
146 | //
147 | // comboBox5
148 | //
149 | this.comboBox5.FormattingEnabled = true;
150 | this.comboBox5.Items.AddRange(new object[] {
151 | "--Select--",
152 | "2",
153 | "3",
154 | "4"});
155 | this.comboBox5.Location = new System.Drawing.Point(546, 189);
156 | this.comboBox5.Name = "comboBox5";
157 | this.comboBox5.Size = new System.Drawing.Size(224, 28);
158 | this.comboBox5.TabIndex = 8;
159 | this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged);
160 | //
161 | // comboBox1
162 | //
163 | this.comboBox1.FormattingEnabled = true;
164 | this.comboBox1.Items.AddRange(new object[] {
165 | "--Select--"});
166 | this.comboBox1.Location = new System.Drawing.Point(546, 242);
167 | this.comboBox1.Name = "comboBox1";
168 | this.comboBox1.Size = new System.Drawing.Size(224, 28);
169 | this.comboBox1.TabIndex = 8;
170 | //
171 | // label7
172 | //
173 | this.label7.AutoSize = true;
174 | this.label7.Location = new System.Drawing.Point(420, 404);
175 | this.label7.Name = "label7";
176 | this.label7.Size = new System.Drawing.Size(116, 20);
177 | this.label7.TabIndex = 3;
178 | this.label7.Text = "Candidate 4 :-";
179 | //
180 | // button3
181 | //
182 | this.button3.BackColor = System.Drawing.Color.White;
183 | this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
184 | this.button3.ForeColor = System.Drawing.Color.Navy;
185 | this.button3.Location = new System.Drawing.Point(570, 515);
186 | this.button3.Name = "button3";
187 | this.button3.Size = new System.Drawing.Size(117, 40);
188 | this.button3.TabIndex = 7;
189 | this.button3.Text = "Submit";
190 | this.button3.UseVisualStyleBackColor = false;
191 | this.button3.Click += new System.EventHandler(this.button3_Click);
192 | //
193 | // label5
194 | //
195 | this.label5.AutoSize = true;
196 | this.label5.Location = new System.Drawing.Point(420, 351);
197 | this.label5.Name = "label5";
198 | this.label5.Size = new System.Drawing.Size(116, 20);
199 | this.label5.TabIndex = 3;
200 | this.label5.Text = "Candidate 3 :-";
201 | //
202 | // textBox2
203 | //
204 | this.textBox2.Location = new System.Drawing.Point(546, 78);
205 | this.textBox2.Multiline = true;
206 | this.textBox2.Name = "textBox2";
207 | this.textBox2.Size = new System.Drawing.Size(224, 82);
208 | this.textBox2.TabIndex = 5;
209 | //
210 | // label2
211 | //
212 | this.label2.AutoSize = true;
213 | this.label2.Location = new System.Drawing.Point(420, 298);
214 | this.label2.Name = "label2";
215 | this.label2.Size = new System.Drawing.Size(116, 20);
216 | this.label2.TabIndex = 3;
217 | this.label2.Text = "Candidate 2 :-";
218 | //
219 | // label8
220 | //
221 | this.label8.AutoSize = true;
222 | this.label8.Location = new System.Drawing.Point(380, 192);
223 | this.label8.Name = "label8";
224 | this.label8.Size = new System.Drawing.Size(156, 20);
225 | this.label8.TabIndex = 3;
226 | this.label8.Text = "No Of Candidates :-";
227 | //
228 | // textBox1
229 | //
230 | this.textBox1.Location = new System.Drawing.Point(546, 24);
231 | this.textBox1.Name = "textBox1";
232 | this.textBox1.ReadOnly = true;
233 | this.textBox1.Size = new System.Drawing.Size(224, 26);
234 | this.textBox1.TabIndex = 5;
235 | //
236 | // label6
237 | //
238 | this.label6.AutoSize = true;
239 | this.label6.Location = new System.Drawing.Point(420, 245);
240 | this.label6.Name = "label6";
241 | this.label6.Size = new System.Drawing.Size(116, 20);
242 | this.label6.TabIndex = 3;
243 | this.label6.Text = "Candidate 1 :-";
244 | //
245 | // label4
246 | //
247 | this.label4.AutoSize = true;
248 | this.label4.Location = new System.Drawing.Point(472, 81);
249 | this.label4.Name = "label4";
250 | this.label4.Size = new System.Drawing.Size(64, 20);
251 | this.label4.TabIndex = 1;
252 | this.label4.Text = "Topic :-";
253 | //
254 | // label3
255 | //
256 | this.label3.AutoSize = true;
257 | this.label3.Location = new System.Drawing.Point(432, 27);
258 | this.label3.Name = "label3";
259 | this.label3.Size = new System.Drawing.Size(104, 20);
260 | this.label3.TabIndex = 0;
261 | this.label3.Text = "Election ID :-";
262 | //
263 | // AddElection
264 | //
265 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
266 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
267 | this.BackColor = System.Drawing.Color.White;
268 | this.ClientSize = new System.Drawing.Size(1370, 750);
269 | this.Controls.Add(this.panel2);
270 | this.Controls.Add(this.label1);
271 | this.Controls.Add(this.pictureBox1);
272 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
273 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
274 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
275 | this.Name = "AddElection";
276 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
277 | this.Text = "AddElection";
278 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
279 | this.Load += new System.EventHandler(this.AddElection_Load);
280 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
281 | this.panel2.ResumeLayout(false);
282 | this.panel2.PerformLayout();
283 | this.ResumeLayout(false);
284 | this.PerformLayout();
285 |
286 | }
287 |
288 | #endregion
289 |
290 | private System.Windows.Forms.Label label1;
291 | private System.Windows.Forms.PictureBox pictureBox1;
292 | private System.Windows.Forms.Panel panel2;
293 | private System.Windows.Forms.Button button3;
294 | private System.Windows.Forms.TextBox textBox2;
295 | private System.Windows.Forms.TextBox textBox1;
296 | private System.Windows.Forms.Label label6;
297 | private System.Windows.Forms.Label label4;
298 | private System.Windows.Forms.Label label3;
299 | private System.Windows.Forms.ComboBox comboBox1;
300 | private System.Windows.Forms.ComboBox comboBox4;
301 | private System.Windows.Forms.ComboBox comboBox3;
302 | private System.Windows.Forms.ComboBox comboBox2;
303 | private System.Windows.Forms.Label label7;
304 | private System.Windows.Forms.Label label5;
305 | private System.Windows.Forms.Label label2;
306 | private System.Windows.Forms.ComboBox comboBox5;
307 | private System.Windows.Forms.Label label8;
308 | private System.Windows.Forms.Label label9;
309 | private System.Windows.Forms.DateTimePicker dateTimePicker1;
310 | }
311 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/Result.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class Result
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.groupBox2 = new System.Windows.Forms.GroupBox();
34 | this.comboBox5 = new System.Windows.Forms.ComboBox();
35 | this.textBox3 = new System.Windows.Forms.TextBox();
36 | this.label6 = new System.Windows.Forms.Label();
37 | this.label5 = new System.Windows.Forms.Label();
38 | this.groupBox1 = new System.Windows.Forms.GroupBox();
39 | this.label2 = new System.Windows.Forms.Label();
40 | this.textBox1 = new System.Windows.Forms.TextBox();
41 | this.label3 = new System.Windows.Forms.Label();
42 | this.textBox2 = new System.Windows.Forms.TextBox();
43 | this.label4 = new System.Windows.Forms.Label();
44 | this.textBox4 = new System.Windows.Forms.TextBox();
45 | this.label7 = new System.Windows.Forms.Label();
46 | this.textBox5 = new System.Windows.Forms.TextBox();
47 | this.groupBox3 = new System.Windows.Forms.GroupBox();
48 | this.textBox8 = new System.Windows.Forms.TextBox();
49 | this.label10 = new System.Windows.Forms.Label();
50 | this.textBox9 = new System.Windows.Forms.TextBox();
51 | this.label11 = new System.Windows.Forms.Label();
52 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
53 | this.groupBox2.SuspendLayout();
54 | this.groupBox1.SuspendLayout();
55 | this.groupBox3.SuspendLayout();
56 | this.SuspendLayout();
57 | //
58 | // label1
59 | //
60 | this.label1.AutoSize = true;
61 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
62 | this.label1.ForeColor = System.Drawing.Color.Navy;
63 | this.label1.Location = new System.Drawing.Point(35, 35);
64 | this.label1.Name = "label1";
65 | this.label1.Size = new System.Drawing.Size(264, 37);
66 | this.label1.TabIndex = 3;
67 | this.label1.Text = "Calculate Result";
68 | //
69 | // pictureBox1
70 | //
71 | this.pictureBox1.Image = global::Finger_ATM.Properties.Resources.Line;
72 | this.pictureBox1.Location = new System.Drawing.Point(0, 75);
73 | this.pictureBox1.Name = "pictureBox1";
74 | this.pictureBox1.Size = new System.Drawing.Size(1275, 18);
75 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
76 | this.pictureBox1.TabIndex = 2;
77 | this.pictureBox1.TabStop = false;
78 | //
79 | // groupBox2
80 | //
81 | this.groupBox2.Controls.Add(this.comboBox5);
82 | this.groupBox2.Controls.Add(this.textBox3);
83 | this.groupBox2.Controls.Add(this.label6);
84 | this.groupBox2.Controls.Add(this.label5);
85 | this.groupBox2.Location = new System.Drawing.Point(477, 99);
86 | this.groupBox2.Name = "groupBox2";
87 | this.groupBox2.Size = new System.Drawing.Size(417, 237);
88 | this.groupBox2.TabIndex = 39;
89 | this.groupBox2.TabStop = false;
90 | this.groupBox2.Text = "Election";
91 | //
92 | // comboBox5
93 | //
94 | this.comboBox5.FormattingEnabled = true;
95 | this.comboBox5.Location = new System.Drawing.Point(136, 36);
96 | this.comboBox5.Name = "comboBox5";
97 | this.comboBox5.Size = new System.Drawing.Size(254, 28);
98 | this.comboBox5.TabIndex = 39;
99 | this.comboBox5.SelectedIndexChanged += new System.EventHandler(this.comboBox5_SelectedIndexChanged);
100 | //
101 | // textBox3
102 | //
103 | this.textBox3.Location = new System.Drawing.Point(136, 87);
104 | this.textBox3.Multiline = true;
105 | this.textBox3.Name = "textBox3";
106 | this.textBox3.ReadOnly = true;
107 | this.textBox3.Size = new System.Drawing.Size(254, 131);
108 | this.textBox3.TabIndex = 38;
109 | //
110 | // label6
111 | //
112 | this.label6.AutoSize = true;
113 | this.label6.Location = new System.Drawing.Point(26, 39);
114 | this.label6.Name = "label6";
115 | this.label6.Size = new System.Drawing.Size(104, 20);
116 | this.label6.TabIndex = 36;
117 | this.label6.Text = "Election ID :-";
118 | //
119 | // label5
120 | //
121 | this.label5.AutoSize = true;
122 | this.label5.Location = new System.Drawing.Point(66, 90);
123 | this.label5.Name = "label5";
124 | this.label5.Size = new System.Drawing.Size(64, 20);
125 | this.label5.TabIndex = 37;
126 | this.label5.Text = "Topic :-";
127 | //
128 | // groupBox1
129 | //
130 | this.groupBox1.Controls.Add(this.textBox5);
131 | this.groupBox1.Controls.Add(this.label7);
132 | this.groupBox1.Controls.Add(this.textBox4);
133 | this.groupBox1.Controls.Add(this.label4);
134 | this.groupBox1.Controls.Add(this.textBox2);
135 | this.groupBox1.Controls.Add(this.label3);
136 | this.groupBox1.Controls.Add(this.textBox1);
137 | this.groupBox1.Controls.Add(this.label2);
138 | this.groupBox1.Enabled = false;
139 | this.groupBox1.Location = new System.Drawing.Point(196, 348);
140 | this.groupBox1.Name = "groupBox1";
141 | this.groupBox1.Size = new System.Drawing.Size(417, 282);
142 | this.groupBox1.TabIndex = 38;
143 | this.groupBox1.TabStop = false;
144 | this.groupBox1.Text = "Candidates";
145 | //
146 | // label2
147 | //
148 | this.label2.AutoSize = true;
149 | this.label2.Location = new System.Drawing.Point(28, 40);
150 | this.label2.Name = "label2";
151 | this.label2.Size = new System.Drawing.Size(112, 20);
152 | this.label2.TabIndex = 8;
153 | this.label2.Text = "Candidate 1 :-";
154 | //
155 | // textBox1
156 | //
157 | this.textBox1.Location = new System.Drawing.Point(146, 37);
158 | this.textBox1.Name = "textBox1";
159 | this.textBox1.ReadOnly = true;
160 | this.textBox1.Size = new System.Drawing.Size(242, 26);
161 | this.textBox1.TabIndex = 9;
162 | //
163 | // label3
164 | //
165 | this.label3.AutoSize = true;
166 | this.label3.Location = new System.Drawing.Point(28, 101);
167 | this.label3.Name = "label3";
168 | this.label3.Size = new System.Drawing.Size(112, 20);
169 | this.label3.TabIndex = 8;
170 | this.label3.Text = "Candidate 2 :-";
171 | //
172 | // textBox2
173 | //
174 | this.textBox2.Location = new System.Drawing.Point(146, 98);
175 | this.textBox2.Name = "textBox2";
176 | this.textBox2.ReadOnly = true;
177 | this.textBox2.Size = new System.Drawing.Size(242, 26);
178 | this.textBox2.TabIndex = 9;
179 | //
180 | // label4
181 | //
182 | this.label4.AutoSize = true;
183 | this.label4.Location = new System.Drawing.Point(28, 162);
184 | this.label4.Name = "label4";
185 | this.label4.Size = new System.Drawing.Size(112, 20);
186 | this.label4.TabIndex = 8;
187 | this.label4.Text = "Candidate 3 :-";
188 | //
189 | // textBox4
190 | //
191 | this.textBox4.Location = new System.Drawing.Point(146, 159);
192 | this.textBox4.Name = "textBox4";
193 | this.textBox4.ReadOnly = true;
194 | this.textBox4.Size = new System.Drawing.Size(242, 26);
195 | this.textBox4.TabIndex = 9;
196 | //
197 | // label7
198 | //
199 | this.label7.AutoSize = true;
200 | this.label7.Location = new System.Drawing.Point(28, 223);
201 | this.label7.Name = "label7";
202 | this.label7.Size = new System.Drawing.Size(112, 20);
203 | this.label7.TabIndex = 8;
204 | this.label7.Text = "Candidate 4 :-";
205 | //
206 | // textBox5
207 | //
208 | this.textBox5.Location = new System.Drawing.Point(146, 220);
209 | this.textBox5.Name = "textBox5";
210 | this.textBox5.ReadOnly = true;
211 | this.textBox5.Size = new System.Drawing.Size(242, 26);
212 | this.textBox5.TabIndex = 9;
213 | //
214 | // groupBox3
215 | //
216 | this.groupBox3.Controls.Add(this.textBox8);
217 | this.groupBox3.Controls.Add(this.label10);
218 | this.groupBox3.Controls.Add(this.textBox9);
219 | this.groupBox3.Controls.Add(this.label11);
220 | this.groupBox3.Enabled = false;
221 | this.groupBox3.Location = new System.Drawing.Point(758, 348);
222 | this.groupBox3.Name = "groupBox3";
223 | this.groupBox3.Size = new System.Drawing.Size(417, 282);
224 | this.groupBox3.TabIndex = 38;
225 | this.groupBox3.TabStop = false;
226 | this.groupBox3.Text = "Results";
227 | //
228 | // textBox8
229 | //
230 | this.textBox8.Location = new System.Drawing.Point(117, 162);
231 | this.textBox8.Name = "textBox8";
232 | this.textBox8.ReadOnly = true;
233 | this.textBox8.Size = new System.Drawing.Size(265, 26);
234 | this.textBox8.TabIndex = 9;
235 | //
236 | // label10
237 | //
238 | this.label10.AutoSize = true;
239 | this.label10.Location = new System.Drawing.Point(43, 165);
240 | this.label10.Name = "label10";
241 | this.label10.Size = new System.Drawing.Size(68, 20);
242 | this.label10.TabIndex = 8;
243 | this.label10.Text = "Votes :-";
244 | //
245 | // textBox9
246 | //
247 | this.textBox9.Location = new System.Drawing.Point(117, 79);
248 | this.textBox9.Name = "textBox9";
249 | this.textBox9.ReadOnly = true;
250 | this.textBox9.Size = new System.Drawing.Size(265, 26);
251 | this.textBox9.TabIndex = 9;
252 | //
253 | // label11
254 | //
255 | this.label11.AutoSize = true;
256 | this.label11.Location = new System.Drawing.Point(35, 82);
257 | this.label11.Name = "label11";
258 | this.label11.Size = new System.Drawing.Size(76, 20);
259 | this.label11.TabIndex = 8;
260 | this.label11.Text = "Winner :-";
261 | //
262 | // Result
263 | //
264 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
265 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
266 | this.BackColor = System.Drawing.Color.White;
267 | this.ClientSize = new System.Drawing.Size(1370, 750);
268 | this.Controls.Add(this.groupBox2);
269 | this.Controls.Add(this.groupBox3);
270 | this.Controls.Add(this.groupBox1);
271 | this.Controls.Add(this.label1);
272 | this.Controls.Add(this.pictureBox1);
273 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
274 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
275 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
276 | this.Name = "Result";
277 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
278 | this.Text = "Result";
279 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
280 | this.Load += new System.EventHandler(this.Result_Load);
281 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
282 | this.groupBox2.ResumeLayout(false);
283 | this.groupBox2.PerformLayout();
284 | this.groupBox1.ResumeLayout(false);
285 | this.groupBox1.PerformLayout();
286 | this.groupBox3.ResumeLayout(false);
287 | this.groupBox3.PerformLayout();
288 | this.ResumeLayout(false);
289 | this.PerformLayout();
290 |
291 | }
292 |
293 | #endregion
294 |
295 | private System.Windows.Forms.Label label1;
296 | private System.Windows.Forms.PictureBox pictureBox1;
297 | private System.Windows.Forms.GroupBox groupBox2;
298 | private System.Windows.Forms.ComboBox comboBox5;
299 | private System.Windows.Forms.TextBox textBox3;
300 | private System.Windows.Forms.Label label6;
301 | private System.Windows.Forms.Label label5;
302 | private System.Windows.Forms.GroupBox groupBox1;
303 | private System.Windows.Forms.TextBox textBox1;
304 | private System.Windows.Forms.Label label2;
305 | private System.Windows.Forms.TextBox textBox5;
306 | private System.Windows.Forms.Label label7;
307 | private System.Windows.Forms.TextBox textBox4;
308 | private System.Windows.Forms.Label label4;
309 | private System.Windows.Forms.TextBox textBox2;
310 | private System.Windows.Forms.Label label3;
311 | private System.Windows.Forms.GroupBox groupBox3;
312 | private System.Windows.Forms.TextBox textBox8;
313 | private System.Windows.Forms.Label label10;
314 | private System.Windows.Forms.TextBox textBox9;
315 | private System.Windows.Forms.Label label11;
316 | }
317 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/AddVoter.Designer.cs:
--------------------------------------------------------------------------------
1 | namespace Finger_ATM
2 | {
3 | partial class AddVoter
4 | {
5 | ///
6 | /// Required designer variable.
7 | ///
8 | private System.ComponentModel.IContainer components = null;
9 |
10 | ///
11 | /// Clean up any resources being used.
12 | ///
13 | /// true if managed resources should be disposed; otherwise, false.
14 | protected override void Dispose(bool disposing)
15 | {
16 | if (disposing && (components != null))
17 | {
18 | components.Dispose();
19 | }
20 | base.Dispose(disposing);
21 | }
22 |
23 | #region Windows Form Designer generated code
24 |
25 | ///
26 | /// Required method for Designer support - do not modify
27 | /// the contents of this method with the code editor.
28 | ///
29 | private void InitializeComponent()
30 | {
31 | this.label1 = new System.Windows.Forms.Label();
32 | this.pictureBox1 = new System.Windows.Forms.PictureBox();
33 | this.panel1 = new System.Windows.Forms.Panel();
34 | this.comboBoxDeviceName = new System.Windows.Forms.ComboBox();
35 | this.label2 = new System.Windows.Forms.Label();
36 | this.button2 = new System.Windows.Forms.Button();
37 | this.panel2 = new System.Windows.Forms.Panel();
38 | this.pictureBox3 = new System.Windows.Forms.PictureBox();
39 | this.label8 = new System.Windows.Forms.Label();
40 | this.button3 = new System.Windows.Forms.Button();
41 | this.button1 = new System.Windows.Forms.Button();
42 | this.pictureBox2 = new System.Windows.Forms.PictureBox();
43 | this.textBox4 = new System.Windows.Forms.TextBox();
44 | this.textBox3 = new System.Windows.Forms.TextBox();
45 | this.textBox2 = new System.Windows.Forms.TextBox();
46 | this.textBox1 = new System.Windows.Forms.TextBox();
47 | this.label7 = new System.Windows.Forms.Label();
48 | this.label6 = new System.Windows.Forms.Label();
49 | this.label5 = new System.Windows.Forms.Label();
50 | this.label4 = new System.Windows.Forms.Label();
51 | this.label3 = new System.Windows.Forms.Label();
52 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
53 | this.panel1.SuspendLayout();
54 | this.panel2.SuspendLayout();
55 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit();
56 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
57 | this.SuspendLayout();
58 | //
59 | // label1
60 | //
61 | this.label1.AutoSize = true;
62 | this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 24F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
63 | this.label1.ForeColor = System.Drawing.Color.Navy;
64 | this.label1.Location = new System.Drawing.Point(35, 35);
65 | this.label1.Name = "label1";
66 | this.label1.Size = new System.Drawing.Size(187, 37);
67 | this.label1.TabIndex = 3;
68 | this.label1.Text = "Add Voters";
69 | //
70 | // pictureBox1
71 | //
72 | this.pictureBox1.Image = global::Finger_ATM.Properties.Resources.Line;
73 | this.pictureBox1.Location = new System.Drawing.Point(-2, 75);
74 | this.pictureBox1.Name = "pictureBox1";
75 | this.pictureBox1.Size = new System.Drawing.Size(1275, 18);
76 | this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
77 | this.pictureBox1.TabIndex = 2;
78 | this.pictureBox1.TabStop = false;
79 | //
80 | // panel1
81 | //
82 | this.panel1.Controls.Add(this.comboBoxDeviceName);
83 | this.panel1.Controls.Add(this.label2);
84 | this.panel1.Controls.Add(this.button2);
85 | this.panel1.Location = new System.Drawing.Point(42, 139);
86 | this.panel1.Name = "panel1";
87 | this.panel1.Size = new System.Drawing.Size(1150, 544);
88 | this.panel1.TabIndex = 11;
89 | //
90 | // comboBoxDeviceName
91 | //
92 | this.comboBoxDeviceName.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
93 | this.comboBoxDeviceName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
94 | this.comboBoxDeviceName.FormattingEnabled = true;
95 | this.comboBoxDeviceName.Location = new System.Drawing.Point(539, 228);
96 | this.comboBoxDeviceName.Name = "comboBoxDeviceName";
97 | this.comboBoxDeviceName.Size = new System.Drawing.Size(152, 28);
98 | this.comboBoxDeviceName.TabIndex = 2;
99 | //
100 | // label2
101 | //
102 | this.label2.AutoSize = true;
103 | this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
104 | this.label2.Location = new System.Drawing.Point(459, 231);
105 | this.label2.Name = "label2";
106 | this.label2.Size = new System.Drawing.Size(74, 20);
107 | this.label2.TabIndex = 1;
108 | this.label2.Text = "Device :-";
109 | //
110 | // button2
111 | //
112 | this.button2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
113 | this.button2.Location = new System.Drawing.Point(520, 287);
114 | this.button2.Name = "button2";
115 | this.button2.Size = new System.Drawing.Size(85, 30);
116 | this.button2.TabIndex = 0;
117 | this.button2.Text = "Start";
118 | this.button2.UseVisualStyleBackColor = true;
119 | this.button2.Click += new System.EventHandler(this.button2_Click);
120 | //
121 | // panel2
122 | //
123 | this.panel2.Controls.Add(this.pictureBox3);
124 | this.panel2.Controls.Add(this.label8);
125 | this.panel2.Controls.Add(this.button3);
126 | this.panel2.Controls.Add(this.button1);
127 | this.panel2.Controls.Add(this.pictureBox2);
128 | this.panel2.Controls.Add(this.textBox4);
129 | this.panel2.Controls.Add(this.textBox3);
130 | this.panel2.Controls.Add(this.textBox2);
131 | this.panel2.Controls.Add(this.textBox1);
132 | this.panel2.Controls.Add(this.label7);
133 | this.panel2.Controls.Add(this.label6);
134 | this.panel2.Controls.Add(this.label5);
135 | this.panel2.Controls.Add(this.label4);
136 | this.panel2.Controls.Add(this.label3);
137 | this.panel2.Location = new System.Drawing.Point(21, 102);
138 | this.panel2.Name = "panel2";
139 | this.panel2.Size = new System.Drawing.Size(1150, 527);
140 | this.panel2.TabIndex = 12;
141 | this.panel2.Visible = false;
142 | //
143 | // pictureBox3
144 | //
145 | this.pictureBox3.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
146 | this.pictureBox3.Location = new System.Drawing.Point(744, 271);
147 | this.pictureBox3.Name = "pictureBox3";
148 | this.pictureBox3.Size = new System.Drawing.Size(168, 152);
149 | this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
150 | this.pictureBox3.TabIndex = 9;
151 | this.pictureBox3.TabStop = false;
152 | //
153 | // label8
154 | //
155 | this.label8.AutoSize = true;
156 | this.label8.Location = new System.Drawing.Point(631, 338);
157 | this.label8.Name = "label8";
158 | this.label8.Size = new System.Drawing.Size(107, 20);
159 | this.label8.TabIndex = 8;
160 | this.label8.Text = "Finger Print :-";
161 | //
162 | // button3
163 | //
164 | this.button3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
165 | this.button3.Location = new System.Drawing.Point(530, 468);
166 | this.button3.Name = "button3";
167 | this.button3.Size = new System.Drawing.Size(87, 36);
168 | this.button3.TabIndex = 7;
169 | this.button3.Text = "Submit";
170 | this.button3.UseVisualStyleBackColor = true;
171 | this.button3.Click += new System.EventHandler(this.button3_Click);
172 | //
173 | // button1
174 | //
175 | this.button1.Location = new System.Drawing.Point(953, 108);
176 | this.button1.Name = "button1";
177 | this.button1.Size = new System.Drawing.Size(78, 33);
178 | this.button1.TabIndex = 7;
179 | this.button1.Text = "Upload";
180 | this.button1.UseVisualStyleBackColor = true;
181 | this.button1.Click += new System.EventHandler(this.button1_Click);
182 | //
183 | // pictureBox2
184 | //
185 | this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
186 | this.pictureBox2.Location = new System.Drawing.Point(744, 52);
187 | this.pictureBox2.Name = "pictureBox2";
188 | this.pictureBox2.Size = new System.Drawing.Size(168, 152);
189 | this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
190 | this.pictureBox2.TabIndex = 6;
191 | this.pictureBox2.TabStop = false;
192 | //
193 | // textBox4
194 | //
195 | this.textBox4.Location = new System.Drawing.Point(203, 321);
196 | this.textBox4.Multiline = true;
197 | this.textBox4.Name = "textBox4";
198 | this.textBox4.Size = new System.Drawing.Size(265, 102);
199 | this.textBox4.TabIndex = 5;
200 | //
201 | // textBox3
202 | //
203 | this.textBox3.Location = new System.Drawing.Point(203, 237);
204 | this.textBox3.Name = "textBox3";
205 | this.textBox3.Size = new System.Drawing.Size(265, 26);
206 | this.textBox3.TabIndex = 5;
207 | //
208 | // textBox2
209 | //
210 | this.textBox2.Location = new System.Drawing.Point(203, 135);
211 | this.textBox2.Name = "textBox2";
212 | this.textBox2.Size = new System.Drawing.Size(265, 26);
213 | this.textBox2.TabIndex = 5;
214 | //
215 | // textBox1
216 | //
217 | this.textBox1.Location = new System.Drawing.Point(203, 52);
218 | this.textBox1.Name = "textBox1";
219 | this.textBox1.Size = new System.Drawing.Size(265, 26);
220 | this.textBox1.TabIndex = 5;
221 | //
222 | // label7
223 | //
224 | this.label7.AutoSize = true;
225 | this.label7.Location = new System.Drawing.Point(616, 114);
226 | this.label7.Name = "label7";
227 | this.label7.Size = new System.Drawing.Size(122, 20);
228 | this.label7.TabIndex = 4;
229 | this.label7.Text = "Voter\'s Photo :-";
230 | //
231 | // label6
232 | //
233 | this.label6.AutoSize = true;
234 | this.label6.Location = new System.Drawing.Point(111, 324);
235 | this.label6.Name = "label6";
236 | this.label6.Size = new System.Drawing.Size(89, 20);
237 | this.label6.TabIndex = 3;
238 | this.label6.Text = "Address :-";
239 | //
240 | // label5
241 | //
242 | this.label5.AutoSize = true;
243 | this.label5.Location = new System.Drawing.Point(101, 240);
244 | this.label5.Name = "label5";
245 | this.label5.Size = new System.Drawing.Size(96, 20);
246 | this.label5.TabIndex = 2;
247 | this.label5.Text = "Mobile No :-";
248 | //
249 | // label4
250 | //
251 | this.label4.AutoSize = true;
252 | this.label4.Location = new System.Drawing.Point(129, 138);
253 | this.label4.Name = "label4";
254 | this.label4.Size = new System.Drawing.Size(68, 20);
255 | this.label4.TabIndex = 1;
256 | this.label4.Text = "Name :-";
257 | //
258 | // label3
259 | //
260 | this.label3.AutoSize = true;
261 | this.label3.Location = new System.Drawing.Point(111, 55);
262 | this.label3.Name = "label3";
263 | this.label3.Size = new System.Drawing.Size(86, 20);
264 | this.label3.TabIndex = 0;
265 | this.label3.Text = "Voter ID :-";
266 | //
267 | // AddVoter
268 | //
269 | this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 20F);
270 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
271 | this.BackColor = System.Drawing.Color.White;
272 | this.ClientSize = new System.Drawing.Size(1370, 750);
273 | this.Controls.Add(this.panel2);
274 | this.Controls.Add(this.panel1);
275 | this.Controls.Add(this.label1);
276 | this.Controls.Add(this.pictureBox1);
277 | this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
278 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
279 | this.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
280 | this.Name = "AddVoter";
281 | this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
282 | this.Text = "AddVoter";
283 | this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
284 | this.Load += new System.EventHandler(this.AddVoter_Load);
285 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
286 | this.panel1.ResumeLayout(false);
287 | this.panel1.PerformLayout();
288 | this.panel2.ResumeLayout(false);
289 | this.panel2.PerformLayout();
290 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit();
291 | ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
292 | this.ResumeLayout(false);
293 | this.PerformLayout();
294 |
295 | }
296 |
297 | #endregion
298 |
299 | private System.Windows.Forms.Label label1;
300 | private System.Windows.Forms.PictureBox pictureBox1;
301 | private System.Windows.Forms.Panel panel1;
302 | private System.Windows.Forms.ComboBox comboBoxDeviceName;
303 | private System.Windows.Forms.Label label2;
304 | private System.Windows.Forms.Button button2;
305 | private System.Windows.Forms.Panel panel2;
306 | private System.Windows.Forms.Label label7;
307 | private System.Windows.Forms.Label label6;
308 | private System.Windows.Forms.Label label5;
309 | private System.Windows.Forms.Label label4;
310 | private System.Windows.Forms.Label label3;
311 | private System.Windows.Forms.TextBox textBox4;
312 | private System.Windows.Forms.TextBox textBox3;
313 | private System.Windows.Forms.TextBox textBox2;
314 | private System.Windows.Forms.TextBox textBox1;
315 | private System.Windows.Forms.PictureBox pictureBox2;
316 | private System.Windows.Forms.Button button1;
317 | private System.Windows.Forms.PictureBox pictureBox3;
318 | private System.Windows.Forms.Label label8;
319 | private System.Windows.Forms.Button button3;
320 | }
321 | }
--------------------------------------------------------------------------------
/Project/Finger Vote/TakeElection.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Data;
5 | using System.Drawing;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Windows.Forms;
9 | using System.Data.SqlClient;
10 | using SecuGen.FDxSDKPro.Windows;
11 | using System.IO;
12 |
13 | namespace Finger_ATM
14 | {
15 | public partial class TakeElection : Form
16 | {
17 | private SGFingerPrintManager m_FPM;
18 | SqlConnection con = new SqlConnection(@"Data Source=ADMIN-PC;Initial Catalog=FingerVote;Integrated Security=True");
19 | private bool m_LedOn = false;
20 | private Int32 m_ImageWidth;
21 | private Int32 m_ImageHeight;
22 | private Byte[] m_RegMin1;
23 | private Byte[] m_RegMin2;
24 | private Byte[] m_VrfMin;
25 | private SGFPMDeviceList[] m_DevList; // Used for EnumerateDevice
26 |
27 | public TakeElection()
28 | {
29 | InitializeComponent();
30 | }
31 |
32 | private void TakeElection_Load(object sender, EventArgs e)
33 | {
34 | m_LedOn = false;
35 |
36 | m_RegMin1 = new Byte[400];
37 | m_RegMin2 = new Byte[400];
38 | m_VrfMin = new Byte[400];
39 | m_FPM = new SGFingerPrintManager();
40 | EnumerateBtn_Click(sender, e);
41 | }
42 |
43 | private void EnumerateBtn_Click(object sender, System.EventArgs e)
44 | {
45 | Int32 iError;
46 | string enum_device;
47 |
48 | comboBoxDeviceName.Items.Clear();
49 |
50 | // Enumerate Device
51 | iError = m_FPM.EnumerateDevice();
52 |
53 | // Get enumeration info into SGFPMDeviceList
54 | m_DevList = new SGFPMDeviceList[m_FPM.NumberOfDevice];
55 |
56 | for (int i = 0; i < m_FPM.NumberOfDevice; i++)
57 | {
58 | m_DevList[i] = new SGFPMDeviceList();
59 | m_FPM.GetEnumDeviceInfo(i, m_DevList[i]);
60 | enum_device = m_DevList[i].DevName.ToString() + " : " + m_DevList[i].DevID;
61 | comboBoxDeviceName.Items.Add(enum_device);
62 | }
63 |
64 | if (comboBoxDeviceName.Items.Count > 0)
65 | {
66 | // Add Auto Selection
67 | enum_device = "Auto Selection";
68 | comboBoxDeviceName.Items.Add(enum_device);
69 |
70 | comboBoxDeviceName.SelectedIndex = 0; //First selected one
71 | }
72 |
73 | }
74 |
75 | private void GetBtn_Click(object sender, System.EventArgs e)
76 | {
77 | SGFPMDeviceInfoParam pInfo = new SGFPMDeviceInfoParam();
78 | Int32 iError = m_FPM.GetDeviceInfo(pInfo);
79 |
80 | if (iError == (Int32)SGFPMError.ERROR_NONE)
81 | {
82 | m_ImageWidth = pInfo.ImageWidth;
83 | m_ImageHeight = pInfo.ImageHeight;
84 | ASCIIEncoding encoding = new ASCIIEncoding();
85 | }
86 | }
87 |
88 |
89 | void DisplayError(string funcName, int iError)
90 | {
91 | string text = "";
92 |
93 | switch (iError)
94 | {
95 | case 0: //SGFDX_ERROR_NONE = 0,
96 | text = "Error none";
97 | break;
98 |
99 | case 1: //SGFDX_ERROR_CREATION_FAILED = 1,
100 | text = "Can not create object";
101 | break;
102 |
103 | case 2: // SGFDX_ERROR_FUNCTION_FAILED = 2,
104 | text = "Function Failed";
105 | break;
106 |
107 | case 3: // SGFDX_ERROR_INVALID_PARAM = 3,
108 | text = "Invalid Parameter";
109 | break;
110 |
111 | case 4: // SGFDX_ERROR_NOT_USED = 4,
112 | text = "Not used function";
113 | break;
114 |
115 | case 5: //SGFDX_ERROR_DLLLOAD_FAILED = 5,
116 | text = "Can not create object";
117 | break;
118 |
119 | case 6: //SGFDX_ERROR_DLLLOAD_FAILED_DRV = 6,
120 | text = "Can not load device driver";
121 | break;
122 | case 7: //SGFDX_ERROR_DLLLOAD_FAILED_ALGO = 7,
123 | text = "Can not load sgfpamx.dll";
124 | break;
125 |
126 | case 51: //SGFDX_ERROR_SYSLOAD_FAILED = 51, // system file load fail
127 | text = "Can not load driver kernel file";
128 | break;
129 |
130 | case 52: //SGFDX_ERROR_INITIALIZE_FAILED = 52, // chip initialize fail
131 | text = "Failed to initialize the device";
132 | break;
133 |
134 | case 53: //SGFDX_ERROR_LINE_DROPPED = 53, // image data drop
135 | text = "Data transmission is not good";
136 | break;
137 |
138 | case 54: //SGFDX_ERROR_TIME_OUT = 54, // getliveimage timeout error
139 | text = "Time out";
140 | break;
141 |
142 | case 55: //SGFDX_ERROR_DEVICE_NOT_FOUND = 55, // device not found
143 | text = "Device not found";
144 | break;
145 |
146 | case 56: //SGFDX_ERROR_DRVLOAD_FAILED = 56, // dll file load fail
147 | text = "Can not load driver file";
148 | break;
149 |
150 | case 57: //SGFDX_ERROR_WRONG_IMAGE = 57, // wrong image
151 | text = "Wrong Image";
152 | break;
153 |
154 | case 58: //SGFDX_ERROR_LACK_OF_BANDWIDTH = 58, // USB Bandwith Lack Error
155 | text = "Lack of USB Bandwith";
156 | break;
157 |
158 | case 59: //SGFDX_ERROR_DEV_ALREADY_OPEN = 59, // Device Exclusive access Error
159 | text = "Device is already opened";
160 | break;
161 |
162 | case 60: //SGFDX_ERROR_GETSN_FAILED = 60, // Fail to get Device Serial Number
163 | text = "Device serial number error";
164 | break;
165 |
166 | case 61: //SGFDX_ERROR_UNSUPPORTED_DEV = 61, // Unsupported device
167 | text = "Unsupported device";
168 | break;
169 |
170 | // Extract & Verification error
171 | case 101: //SGFDX_ERROR_FEAT_NUMBER = 101, // utoo small number of minutiae
172 | text = "The number of minutiae is too small";
173 | break;
174 |
175 | case 102: //SGFDX_ERROR_INVALID_TEMPLATE_TYPE = 102, // wrong template type
176 | text = "Template is invalid";
177 | break;
178 |
179 | case 103: //SGFDX_ERROR_INVALID_TEMPLATE1 = 103, // wrong template type
180 | text = "1st template is invalid";
181 | break;
182 |
183 | case 104: //SGFDX_ERROR_INVALID_TEMPLATE2 = 104, // vwrong template type
184 | text = "2nd template is invalid";
185 | break;
186 |
187 | case 105: //SGFDX_ERROR_EXTRACT_FAIL = 105, // extraction fail
188 | text = "Minutiae extraction failed";
189 | break;
190 |
191 | case 106: //SGFDX_ERROR_MATCH_FAIL = 106, // matching fail
192 | text = "Matching failed";
193 | break;
194 |
195 | }
196 |
197 | text = funcName + " Error # " + iError + " :" + text;
198 | MessageBox.Show(text, "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
199 | }
200 |
201 | private void button2_Click(object sender, EventArgs e)
202 | {
203 | if (m_FPM.NumberOfDevice == 0)
204 | return;
205 |
206 | Int32 iError;
207 | SGFPMDeviceName device_name;
208 | Int32 device_id;
209 |
210 | Int32 numberOfDevices = comboBoxDeviceName.Items.Count;
211 | Int32 deviceSelected = comboBoxDeviceName.SelectedIndex;
212 | Boolean autoSelection = (deviceSelected == (numberOfDevices - 1)); // Last index
213 |
214 | if (autoSelection)
215 | {
216 | // Order of search: Hamster IV(HFDU04) -> Plus(HFDU03) -> III (HFDU02)
217 | device_name = SGFPMDeviceName.DEV_AUTO;
218 |
219 | device_id = (Int32)(SGFPMPortAddr.USB_AUTO_DETECT);
220 | }
221 | else
222 | {
223 | device_name = m_DevList[deviceSelected].DevName;
224 | device_id = m_DevList[deviceSelected].DevID;
225 | }
226 |
227 | iError = m_FPM.Init(device_name);
228 | iError = m_FPM.OpenDevice(device_id);
229 |
230 | if (iError == (Int32)SGFPMError.ERROR_NONE)
231 | {
232 | GetBtn_Click(sender, e);
233 | panel1.Visible = false;
234 | panel2.Visible = true;
235 |
236 | string date = DateTime.Now.ToString("yyyy-MM-dd");
237 |
238 | SqlDataAdapter da = new SqlDataAdapter("Select EId from Election where EndDate >= '" + date + "' ", con);
239 | DataSet ds = new DataSet();
240 | da.Fill(ds);
241 |
242 | int count = ds.Tables[0].Rows.Count;
243 | for (int i = 0; i < count; i++)
244 | {
245 | comboBox5.Items.Add(ds.Tables[0].Rows[i][0].ToString());
246 | }
247 | }
248 | else
249 | DisplayError("OpenDevice()", iError);
250 |
251 | }
252 |
253 | private void button3_Click(object sender, EventArgs e)
254 | {
255 |
256 | SqlDataAdapter da = new SqlDataAdapter("Select UserID,Name,Image,Template from Voter", con);
257 | DataSet ds = new DataSet();
258 | da.Fill(ds);
259 | if (ds.Tables[0].Rows.Count <= 0)
260 | {
261 | con.Close();
262 | MessageBox.Show("No Data Present", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
263 | }
264 | else
265 | {
266 | Int32 iError;
267 | Byte[] fp_image;
268 | Int32 img_qlty;
269 | string id = "";
270 |
271 | fp_image = new Byte[m_ImageWidth * m_ImageHeight];
272 | img_qlty = 0;
273 |
274 | iError = m_FPM.GetImage(fp_image);
275 |
276 | m_FPM.GetImageQuality(m_ImageWidth, m_ImageHeight, fp_image, ref img_qlty);
277 |
278 |
279 | if (iError == (Int32)SGFPMError.ERROR_NONE)
280 | {
281 | DrawImage(fp_image, pictureBox3);
282 | iError = m_FPM.CreateTemplate(fp_image, m_RegMin1);
283 |
284 | if (iError == (Int32)SGFPMError.ERROR_NONE)
285 | {
286 | for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
287 | {
288 |
289 | fp_image = (byte[])(ds.Tables[0].Rows[i][3]);
290 |
291 | iError = m_FPM.CreateTemplate(fp_image, m_VrfMin);
292 |
293 | MemoryStream ms = new MemoryStream();
294 | bool matched1 = false;
295 | SGFPMSecurityLevel secu_level;
296 |
297 | secu_level = (SGFPMSecurityLevel)5;
298 |
299 | iError = m_FPM.MatchTemplate(m_RegMin1, m_VrfMin, secu_level, ref matched1);
300 |
301 | if (iError == (Int32)SGFPMError.ERROR_NONE)
302 | {
303 | if (matched1)
304 | {
305 | id = ds.Tables[0].Rows[i][0].ToString();
306 | }
307 | }
308 | else
309 | {
310 | DisplayError("MatchTemplate()", iError);
311 | }
312 | }
313 | }
314 | }
315 | if (id != "")
316 | {
317 | SqlCommand cmd = new SqlCommand("Select Name,Image from Voter where UserId='" + id + "'", con);
318 | con.Open();
319 | SqlDataReader dr = cmd.ExecuteReader();
320 | dr.Read();
321 | textBox1.Text = id;
322 | textBox2.Text = dr[0].ToString();
323 | pictureBox2.ImageLocation = dr[1].ToString();
324 | con.Close();
325 | panel4.Enabled = false;
326 | groupBox1.Enabled = true;
327 | }
328 | else
329 | {
330 | MessageBox.Show("Sorry No Match Found Please Re-Scan the Finger", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
331 | }
332 | }
333 |
334 |
335 |
336 |
337 | /*
338 | if (textBox1.Text != "")
339 | {
340 | SqlCommand cmd = new SqlCommand("Select Name,Image,Template from Voter where UserId='" + textBox1.Text + "'", con);
341 | con.Open();
342 | SqlDataReader dr = cmd.ExecuteReader();
343 | if (!dr.HasRows)
344 | {
345 | con.Close();
346 | MessageBox.Show("invalid User ID", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
347 | }
348 | else
349 | {
350 | dr.Read();
351 | textBox2.Text = dr[0].ToString();
352 | con.Close();
353 | Int32 iError;
354 | Byte[] fp_image;
355 | Int32 img_qlty;
356 |
357 | fp_image = new Byte[m_ImageWidth * m_ImageHeight];
358 | img_qlty = 0;
359 |
360 | iError = m_FPM.GetImage(fp_image);
361 |
362 | m_FPM.GetImageQuality(m_ImageWidth, m_ImageHeight, fp_image, ref img_qlty);
363 |
364 |
365 | if (iError == (Int32)SGFPMError.ERROR_NONE)
366 | {
367 | DrawImage(fp_image, pictureBox3);
368 | iError = m_FPM.CreateTemplate(fp_image, m_RegMin1);
369 |
370 | if (iError == (Int32)SGFPMError.ERROR_NONE)
371 | {
372 | cmd = new SqlCommand("Select Image,Template from Voter where UserId='" + textBox1.Text + "'", con);
373 | con.Open();
374 | dr = cmd.ExecuteReader();
375 | if (dr.HasRows)
376 | {
377 | dr.Read();
378 | string s = dr[0].ToString();
379 |
380 | fp_image = (byte[])(dr[1]);
381 |
382 | iError = m_FPM.CreateTemplate(fp_image, m_VrfMin);
383 |
384 | pictureBox2.ImageLocation = s;
385 | con.Close();
386 |
387 |
388 | MemoryStream ms = new MemoryStream();
389 | //pictureBox4.Image.Save(ms, pictureBox4.Image.RawFormat);
390 | //ms.Position = 0;
391 | //byte[] m_VrfMin = ms.ToArray();
392 |
393 | bool matched1 = false;
394 | SGFPMSecurityLevel secu_level;
395 |
396 | secu_level = (SGFPMSecurityLevel)5;
397 |
398 | iError = m_FPM.MatchTemplate(m_RegMin1, m_VrfMin, secu_level, ref matched1);
399 |
400 | if (iError == (Int32)SGFPMError.ERROR_NONE)
401 | {
402 | if (matched1)
403 | {
404 | panel4.Enabled = false;
405 | groupBox1.Enabled = true;
406 | }
407 | else
408 | {
409 | MessageBox.Show("Login Failed", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
410 | }
411 | }
412 | else
413 | DisplayError("MatchTemplate()", iError);
414 | }
415 | else
416 | {
417 | con.Close();
418 | MessageBox.Show("Invalid UserId", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
419 | }
420 | }
421 | else
422 | DisplayError("CreateTemplate()", iError);
423 | }
424 | else
425 | {
426 | MessageBox.Show("Finger Capturing Failed", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
427 | }
428 | }
429 | }
430 | else
431 | {
432 | MessageBox.Show("Please Enter User ID/Pin", "Error !!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
433 | }
434 | */
435 | }
436 |
437 | private void DrawImage(Byte[] imgData, PictureBox picBox)
438 | {
439 | int colorval;
440 | Bitmap bmp = new Bitmap(m_ImageWidth, m_ImageHeight);
441 | picBox.Image = (Image)bmp;
442 |
443 | for (int i = 0; i < bmp.Width; i++)
444 | {
445 | for (int j = 0; j < bmp.Height; j++)
446 | {
447 | colorval = (int)imgData[(j * m_ImageWidth) + i];
448 | bmp.SetPixel(i, j, Color.FromArgb(colorval, colorval, colorval));
449 | }
450 | }
451 | picBox.Refresh();
452 | }
453 |
454 | private void comboBox5_SelectedIndexChanged(object sender, EventArgs e)
455 | {
456 | SqlCommand cmd = new SqlCommand("Select * from Election where EId = '"+comboBox5.Text+"'",con);
457 | con.Open();
458 | SqlDataReader dr = cmd.ExecuteReader();
459 | dr.Read();
460 | textBox3.Text = dr[1].ToString();
461 | string cou = dr[2].ToString();
462 |
463 | if (cou == "2")
464 | {
465 | radioButton1.Text = dr[3].ToString();
466 | radioButton2.Text = dr[4].ToString();
467 | radioButton1.Visible = true;
468 | radioButton2.Visible = true;
469 | linkLabel1.Visible = true;
470 | linkLabel2.Visible = true;
471 |
472 | }
473 | else if (cou == "3")
474 | {
475 | radioButton1.Text = dr[3].ToString();
476 | radioButton2.Text = dr[4].ToString();
477 | radioButton3.Text = dr[5].ToString();
478 | radioButton1.Visible = true;
479 | radioButton2.Visible = true;
480 | radioButton3.Visible = true;
481 | linkLabel1.Visible = true;
482 | linkLabel2.Visible = true;
483 | linkLabel3.Visible = true;
484 | }
485 | else if (cou == "4")
486 | {
487 | radioButton1.Text = dr[3].ToString();
488 | radioButton2.Text = dr[4].ToString();
489 | radioButton3.Text = dr[5].ToString();
490 | radioButton4.Text = dr[6].ToString();
491 | radioButton1.Visible = true;
492 | radioButton2.Visible = true;
493 | radioButton3.Visible = true;
494 | radioButton4.Visible = true;
495 | linkLabel1.Visible = true;
496 | linkLabel2.Visible = true;
497 | linkLabel3.Visible = true;
498 | linkLabel4.Visible = true;
499 | }
500 | con.Close();
501 | panel4.Enabled = true;
502 | groupBox2.Enabled = false;
503 | }
504 |
505 | private void button1_Click(object sender, EventArgs e)
506 | {
507 | SqlCommand cmd = new SqlCommand("Select * from Vote where EId = '"+comboBox5.Text+"' AND UId = '"+textBox1.Text+"'",con);
508 | con.Open();
509 | SqlDataReader dr = cmd.ExecuteReader();
510 | if (dr.HasRows)
511 | {
512 | con.Close();
513 | MessageBox.Show("You have already casted the Vote for this Election","Re-Voting is not Allowed",MessageBoxButtons.OK,MessageBoxIcon.Error);
514 | }
515 | else
516 | {
517 | string vote = ",'0','0','0','0'";
518 | if (radioButton1.Checked == true)
519 | {
520 | vote = ",'1','0','0','0'";
521 | }
522 | else if (radioButton2.Checked == true)
523 | {
524 | vote = ",'0','1','0','0'";
525 | }
526 | else if (radioButton3.Checked == true)
527 | {
528 | vote = ",'0','0','1','0'";
529 | }
530 | else if (radioButton4.Checked == true)
531 | {
532 | vote = ",'0','0','0','1'";
533 | }
534 |
535 | con.Close();
536 | cmd = new SqlCommand("Insert into Vote Values ('" + comboBox5.Text + "','" + textBox3.Text + "'"+vote+",'" + textBox1.Text + "')", con);
537 | con.Open();
538 | cmd.ExecuteNonQuery();
539 | con.Close();
540 | MessageBox.Show("Your vote has Casted Successfully", "Successfull", MessageBoxButtons.OK, MessageBoxIcon.Information);
541 | }
542 | radioButton1.Checked = false;
543 | radioButton2.Checked = false;
544 | radioButton3.Checked = false;
545 | radioButton4.Checked = false;
546 | groupBox1.Enabled = false;
547 | panel4.Enabled = true;
548 | pictureBox2.Image = null;
549 | pictureBox3.Image = null;
550 | textBox1.Text = null;
551 | textBox2.Text = null;
552 | }
553 |
554 | private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
555 | {
556 | ViewCandidate vc = new ViewCandidate(radioButton1.Text);
557 | vc.Show();
558 | }
559 |
560 | private void linkLabel2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
561 | {
562 | ViewCandidate vc = new ViewCandidate(radioButton2.Text);
563 | vc.Show();
564 | }
565 |
566 | private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
567 | {
568 | ViewCandidate vc = new ViewCandidate(radioButton3.Text);
569 | vc.Show();
570 | }
571 |
572 | private void linkLabel4_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
573 | {
574 | ViewCandidate vc = new ViewCandidate(radioButton4.Text);
575 | vc.Show();
576 | }
577 | }
578 | }
579 |
--------------------------------------------------------------------------------