Professional Documents
Culture Documents
A Research Paper
Lyceum of Alabang
In Partial Fulfillment
of the Requirements of
Research Project
By:
Panaligan, Kyfer
Tablada, Johnrol
June 2023
i
APPROVAL SHEET
The Senior High School Department approved and accepted this paper in partial
fulfillment of the requirements for RESEARCH PROJECT
ii
SHS Principal
ACKNOWLEDGEMENTS
We would like to thank God above all else for allowing us to carry out our
research study. It would not be possible for us to accomplish our goals if God
had not blessed us, and if he had not provided us with the needed strength,
energy, and determination for the ordeal. We are forever grateful for His love and
Your expertise, patience, and unwavering belief in our potential have been
panelists and ICT teachers who graciously shared their time, expertise, and
valuable insights during the evaluation of our research study. Your expert
Our deepest gratitude goes to our family for their unconditional love,
understanding, and sacrifices have been the bedrock of our research journey.
Your belief in us has been our constant motivation, and we are forever grateful
iii
ABSTRACT
Government Voting System for Lyceum of Alabang, that can be used to provide a
more convenient election for both the election administrators.and the voters
The researchers used surveys for the system evaluation, which had 2 sets: End
users and Professionals. The software evaluation involved feedback from end
users and professionals. The majority of end user respondents were female,
accounting for 54.5% of the total, while male respondents accounted for 45.5%.
The strand ICT had the highest number of respondents, while STEM and HE had
professional evaluation, the majority of respondents were male (80%), and all
The positive feedback from both end users and professionals indicates that the
system is highly regarded and meets the required standards. However, some
improvement.
iv
TABLE OF CONTENTS
Preliminary Pages………………………………………………………………………i
Title Page……………………………………………………………………........i
Approval Sheet............................................................................................ii
Acknowledgements.....................................................................................iii
Abstract......................................................................................................iv
Table of Contents........................................................................................v
List of Tables.............................................................................................vii
List of Figures...........................................................................................viii
Project Context............................................................................................1
Conceptual Framework...............................................................................3
Definition of Terms......................................................................................5
Local Literature...........................................................................................9
Foreign Literature......................................................................................11
Local Studies.............................................................................................13
Foreign Studies.........................................................................................14
v
Research Design………………………………………………………………17
Project Design…………………………………………………………….……17
User Interface……………………………………………………..……………21
Hardware Interface…………………………………………………………….26
Communication interface……………………………………………………..26
Evaluation Procedure…………………………………………………………26
Sampling Technique…………………………………………………………..27
Research Instrument…………………………………………………………..27
Statistical Treatment…………………………………………………………..28
Demographics...........................................................................................29
Summary of Findings................................................................................48
Conclusion................................................................................................51
Recommendations....................................................................................53
References..........................................................................................................55
Appendices... .....................................................................................................57
vi
LIST OF TABLES
Demographics....................................................................................................26
vii
LIST OF FIGURES
User Interface.....................................................................................................18
viii
CHAPTER 1
Project Context
representing the students and implementing new things that are in their best
classroom discussing and explaining the plans they have when they are elected
to a position in the SSG. Students can decide who to vote for depending on
which candidate has the plan that suits their preferences the best.
A voting system is a software that students can use to cast their votes.The
voting system will have the list of candidates that voters can choose from, and
removes the difficulties of voting such as voters waiting in long lines for hours,
the unforgiving weather, and so on. Electronic voting may also reduce the
amount of cheating that happens in traditional voting, since the vote counting is
instantaneous. A voting system like this can be used for the SSG elections to
The SSG Department voting method has an issue since it uses a Google
Form, which may be troublesome for the students in charge of it. Many students
can impact the vote because they can establish accounts that allow them to vote
several times.
1
Background of the Study
The researchers noticed a lack of a voting system used for SSG elections
in Senior High School at Lyceum of Alabang. This has inspired the researchers
connected to the Internet. Its functionality may vary from merely transmitting
be considered fully functional, it must have the following important features. The
voting system must have a way for ballots to be inputted and recorded. The
database, so that the data can be later tabulated for election results (Wikipedia
contributors, 2022).
cast their votes with the help of a computer, usually connected to the Internet–
including their own personal computers inside their homes. Due to the
There are many benefits in using our voting method. It can provide
accessibility and ease to the voters by removing the need to be present at the
voting venue and waiting in long lines. It is more secure than traditional voting
where paper ballots are used, because it is safely stored on a database instead
of physical storage. It offers accuracy because a computer will keep count of the
votes, rather than a human, removing all chances of human error to occur.
engagement rate of voters will increase because voting is easier to do. Finally, it
2
is cheaper than a paper ballot voting method, because you wouldn’t need to print
Conceptual Framework
2. What will be the level of satisfaction of the users of the voting system in
terms of:
a. Accessibility
b. Accuracy
3
c. Security
d. Reliability
e. Convenience
f. Cost-Efficiency
3. What other improvements can be made on the voting system in terms of:
a. Registration
b. Vote-counting system
c. Vote-count database
The coverage of this research study consists of developing and evaluating the
use of a voting system. It only covers the elections of officers in the Supreme
students in Lyceum of Alabang. This study does not cover the use of the voting
system for other elections other than the SSG elections. Elementary, junior
The study only covers the use of VB.NET to create the product output of
the study, inside the Visual Studio environment. It, however, does not include the
use of other programming languages (i.e. Java, C#, HTML, etc) to create the
product output, and does not include the use of other programming environments
4
Significance of the Study
voting process that will benefit voters, particularly students, and ensure fair and
secure voting. We want to give adequate information and a voting method that is
both helpful and convenient for the users through this research.
Voters. The students who will participate in the election as votes will
benefit from the product output of this study because it helps them vote more
elections will benefit from the product output of this study because it makes their
School Administration. The output of this research study can benefit the
voting system.
Definition of Terms
Ballots: Ballots refer to the official voting papers or documents that contain
decision-making process.
5
Candidates: Individuals who are running for a position in an election, in
this case, the candidates would be students vying for positions in the
eliminates the need for traditional paper ballots and manual vote counting.
6
editor, debugger, compiler, and other tools to streamline the coding
computers. They provide a set of rules and syntax for writing code,
voting process.
desired outcome.
7
allowing developers to create desktop, web, and mobile applications using
applications.
Vote counting: The process of tabulating and tallying the votes cast in an
candidate or option and declaring the results based on the counted votes.
They are the key participants in the voting process, and their votes
8
CHAPTER 2
This chapter presents the relevant literature and studies for the
researcher. It also presents the synthesis of the art to fully understand the
Local Literature
Region in Muslim Mindanao general election, the voters in the Philippines have
to shade the oval that was indicated before the candidate's name, and a voting
fed into it. The results are then printed as the election return and sent
In 2016, for the third time in a row, the Philippines automated their elections
machines was the largest in the world. Brazil and India, countries which also use
count.
For the 2019 elections, the COMELEC presented its source code for review by
accredited U.S. software testing company Pro V&V in an effort to make the
The Philippines stands today with Brazil, Estonia, Belgium and Venezuela at the
9
According to Smartmatic(2010), in May 2010, the Republic of the
Philippines carried out the first automated elections in Southeast Asia, the largest
election a private company has ever undertaken. 50.7 million voters spread over
7,107 islands used 82,200 optical scanner voting machines to cast over 800
million votes to whittle 85,000 candidates down to 17,000 posts. For the first
time, Filipinos got to learn results on Election Day. In just one and a half hours
after the polls closed, 40% of results had been transmitted and tallied. Not only
did we deliver results quickly. We also delivered results that were accepted by all
electronic technologies in the Philippines’ elections was the product of a long and
arduous process that started in 1992, but was not fully implemented until 2010. It
plan, which called for the modernization of the electoral process. Subsequent
technologies was to reduce the time for counting and tabulation. In previous
tabulation could take up to 40 days. This caused anxiety among the public and
10
confidence in the electoral process. Other reasons for the change were an
Within one year from the adoption of its strategic plan, the commission
optical mark recognition (OMR), punch card and direct recording electronic
(DRE) systems. In 1995, the first election automation law was passed,
electronic election system and to pilot-test it in the March 1996 regional elections
mandated the COMELEC to use an automated election system (AES) for the
For various reasons ranging from late allotment of funds and time constraints, to
the invalidation of contracts to supply the machines, the 1998, 2001, 2004 and
2007 national elections remained manual. The COMELEC, however, was able to
automate the 2008 regional polls in the ARMM using DRE machines in some
locations and OMR technology in others, for the purpose of determining the most
Foreign Literature
make voting easier and to boost voters’ confidence in the election process. Using
11
three new approaches to studying electronic voting systems—focusing on a
demonstrate that voters view these systems favorably but that design differences
have a substantial impact on voters’ satisfaction with the voting process and on
the need to request help. Factors associated with the digital divide played only a
small role with respect to overall satisfaction but they were strongly associated
with feeling the need for help. Results suggest numerous possible improvements
in electronic voting systems as well as the need for continued analysis that
electronic systems.
and carry out elections. The IEC was established in 2012 as an unbiased
interference or pressure from any party, with the aim of ensuring the holding of
main objective for the 21st century is a need felt by the IEC to prepare to reach
the levels of technological development required to face the new century full of
challenges and expectations. This means that the IEC should act promptly,
keeping up with the progress and demands of this modern world that requires
12
According to Boldin(2005), the present invention is a computerized
collect and tally votes. In one embodiment, the voting system includes a voting
server (12, 52, 62) coupled to a voter security card station (24, 56, 66) and a
plurality of voting stations (28, 70). Alternatively, the voting system may include a
voting server that is connected to an existing computer network (50) and coupled
or voting stations and a voter security card station, forming a computer network.
The system software installed on the voting server preferably includes a voting
voting process. Important aspects of the invention include the ability to print a
voter security card for each registered voter at the polling places, the functionality
Local Studies
elections have been manual, making the process very slow and tiresome.
13
(AES). Based on this pool of database management algorithms, programming
tools, and user friendliness methods and metrics, the researchers developed a
DRE voting ballot that aims to keep the DLSU vote count integral during student
electronics. The system implemented contains three (3) modules, the login,
Ballot and Summary modules, to facilitate the vote gathering portion of the DLSU
student elections. This DRE voting ballot was put through a summative usability
test consisting of 100 DLSU student respondents and found to meet the
software development, the DRE voting ballot now embodies the system goals set
Foreign Studies
that voter errors vary by location according to whether traditional paper ballot
optical scan voting systems, mechanical lever systems, or DREs were used (e.g.,
Caltech/MIT, 2001; Ansolabehere & Stewart, 2005). More recent studies relying
on the residual vote have explored the effects of precinct-based versus central
optical scan systems and various aspects of ballot formats (Bullock & Hood,
2002; Kimball & Kropf, 2005, 2006). Another focus has been on the effects of
education, race, and other demographic factors on voter errors. Most of the
14
research 582 American Politics Research Downloaded from apr.sagepub.com by
do others (Ansolabehere & Stewart, 2005; Brady, Buchler, Jarvis, & McNulty,
2001; Kimball & Kropf, 2005; Tomz & Van Houweling, 2003), although Herron
and Sekhon (2005) find that some undervoting on the part of Blacks may be
ballot.
limited by their reliance on a common methodology: They are all based on the
residual vote (or some portion of that measure), which captures only a portion of
the kinds of problems voters can have. Most gloss over significant differences
among voting interfaces that affect how citizens actually cast their ballots, and
because most rely on aggregate data, they cannot measure some aspects of
individual behavior that could be the source of the voting errors they report.
Moreover, studies using aggregate residual vote data must take special care to
separate polling place votes from absentee votes as the voting systems used for
set of rules that determine how elections and referendums are conducted and
15
how their results are determined. Electoral systems are used in politics to elect
organizations and informal organizations. These rules govern all aspects of the
voting process: when elections occur, who is allowed to vote, who can stand as a
candidate, how ballots are marked and cast, how the ballots are counted, how
votes translate into the election outcome, limits on campaign spending, and other
factors that can affect the result. Political electoral systems are defined by
16
CHAPTER 3
Research Design
Method. A quantitative research design means the research uses numerical data
research design that records change throughout time. In the case of this
Project Design
The Voting System focuses on being used to facilitate elections for the
Supreme Student Government. The system can be used by the voters to cast
their votes, which will be securely stored inside a database.The voting system
can also tabulate and present the votes gathered from the election. The design of
the voting system was also simplified to be minimalistic to appear cleaner and
promote ease-of-use. The primary color used is similar to the Lyceum of Alabang
palette, and the Lyceum of Alabang logo is shown to the right, while the login
system is located on the left. The background also indicates the color of the
school. In the Home, Election, Information, and Admin pages, contains text etc.
17
Software Development Methodology
During this phase will the researchers determine the objective of the
study, and the requirements of the system and the user, as well as everything
Designing
During this phase the researchers will begin to develop key ideas on how
their system will operate, as well as creating the graphical interfaces to be coded
later.
Programming
objectives and creating the designs, the programmers are tasked to add
18
Testing
shows satisfactory results to move to the next phase or return to the Designing
Implementation
During this phase, the researchers prepare the research output to support
Maintenance
Even after the system is deployed, errors can come up anytime. This
phase focuses on fixing errors and improving the system to adapt to its new
environment.
19
Unified Modelling Language Program User Interface
20
Figure 4: Use-Case Diagram
User Interface
21
Figure 5: Login Page
The login page is where the user inputs his or her username and
The main page shows where you can vote which candidate you want.
22
Figure 7: Account Settings
The account settings where you can change username and password.
The admin page shows where you can create a new election or end election, edit
candidates, view the current vote, add user account and view archived users.
23
This is where you can name the election you will start.
Add a candidate where you can add all the candidates and if it is president, vice
president etc.
24
Figure 11: Graph Result page
Graph result shows all the current vote results of the election.
Voters can input their information and create a user account to access the
25
Hardware Interface
Communication interface
Evaluation Procedure
In This phase, we will start giving the Google form and in the google form you will
see the links that show how our system works so they can have an idea on what
26
Respondents of the Study
There were two sets of the study: End user and Professional evaluation.
The end users were students who will participate as voters using the system,
while the Professionals are IT Experts. There were 11 end user respondents and
5 professional respondents.
Sampling Technique
geographical proximity, and existing contact with persons of interest. Often called
The researchers used the survey questionnaire method for gathering data
Research Instrument
For the end user evaluation, the researchers used Google Forms as a
questionnaire for their survey medium to collect the data. For the professional
27
researchers used Google Sheets to store their collected data and perform
Statistical Treatment
f
for formula: %= ∗100 where f is the frequency and n is the sample
n
population.
some numbers hold more weight than others. For the research, this is the
formula used: W =
∑ wX , where W is the weighted mean, w is the weight
∑w
of the X value, and X is the data values to be averaged.
28
CHAPTER 4
This chapter represents the results of the study that was statistically
Demographics
Male 5 45.5%
Female 6 54.5%
Other 0 0%
Total 11 100%
The table above shows that there are 11 respondents for the end user
evaluation. Most of the respondents are female, with six (6) covering 54.5% total
respondents while male have five (5) respondents covering 45.5% of the overall
respondents.
Male 4 80%
Female 1 20%
29
Other 0 0%
Total 5 100%
The table above shows that there are 5 respondents. Most of the
respondents are male, with six (6) covering 80% total respondents while there
STEM 2 18%
HUMSS 0 0%
ABM 0 80%
ICT 6 54%
HE 3 27%
GAS 0 0%
AI 0 0%
Total 11 100%
The table above shows the total number of respondents of the end user
evaluation and the percentage for the strand. Most of the respondents are ICT,
with six (6) respondents covering 54% of overall total. The number of
30
respondents For HE has three (3) covering 27% of the overall total and STEM
with two (2) covering 18% of overall total. Meanwhile the other strand are zero
(0) respondents.
Company/Institution
Total 5 100%
respondents were affiliated with. All of them are under Lyceum of Alabang.
needed degree of
31
precision.
The table above displays the weighted mean for Sustainability with 3.36,
Accurateness with 3.27 and Compliance with 3.63, with the total mean for
by the user.
user.
32
operated by the user, and
control.
error etc.
appears as aesthetic or
eye-pleasing.
addresses the
discriminatory aspects
disabilities.
33
Table 6 : End-User Usability
The table above shows how weighted mean for Recognizability with 3.36,
learnability with 3.18, Operability with 3.18, User-error protection with 3.27, User-
interface aesthetics with 3.18, and accessibility with 3.18 and the total avg in
measurement of
Availability is driven by
measurement of Reliability
remain operational
mission
34
interruption or a failure, a
system.
The table above displays that the weighted mean for Availability is 3.27
and the weighted mean for Fault Tolerance is 3.18 and Recoverability with 3.27
weighted mean, this means that the total weighted mean for Reliability is 3.24
35
The table above displays all total average weighted mean for Functionality
with 3.42, Usability with 3.22, Reliability with 3.24 and the Total weighted mean is
needed degree of
precision.
The table above displays all total average weighted mean for Functionality
for the professional interview. Sustainability with 3.8, Accurateness with 3.4,
36
Compliance with 3.4 and the Total weighted mean for Functionality is 3.5 with “
by the user.
user.
control.
error etc.
37
User-Interface aesthetics. 3.8 Good
appears as aesthetic or
eye-pleasing.
addresses the
discriminatory aspects
disabilities.
The table above displays all total average weighted mean for Usability for
aesthetics with the same Weighted mean 3.8, Learnability with 3.4, User-error
protection with 2.8 and Accessibility with 3.2 and the Total weighted mean for
38
which the system
measurement of
Availability is driven by
measurement of Reliability
remain operational
mission
interruption or a failure, a
system.
39
The table above displays all total average weighted mean for Reliability for
the professional interview. Availability with 3.4, Fault Tolerance with 2.8,
Recoverability with 2.6 and the Total weighted mean for Reliability is 2.93 with
a product or system
functions.
members work.
Specifically, it measures
what percentage of a
40
they spend on tasks that
Capacity is a
measurement of the
amount of performance
The table above displays all total average weighted mean for Efficiency for
the professional interview. Time behavior with 4, Resource Utilization with 3.8,
Capacity with 3.6 and the Total weighted mean for Efficiency is 3.8 with
problems.
41
Interoperability. Degree 3 Good
systems.
The table above displays all total average weighted mean for Compatibility
for the professional interview. Co-existence with 3.2, Interoperability with 3, and
users.
in an unimpaired manner,
42
manipulation of the system,
whether intentional or
accidental.
others.
and trusted.
The table above displays all total average weighted mean for Security for
the professional interview. Confidentiality with 2.6, Integrity with 3.4, and
Accountability and Authenticity are both with 3.4, And the Total weighted mean
43
which the system can
systems.
product to be diagnosed
for deficiencies or
to be modified to be
identified.
uses.
44
tested for maintenance.
The table above displays all total average weighted mean for
3.4, and Modifiability with 2.4, and Testability with 2.8, And the Total weighted
installed on various
be easily replaced by
better innovative
45
systems.
The table above displays all total average weighted mean for Portability
Replaceability with 3.8,, And the Total weighted mean for Portability is 3.93 with
46
Table 17: Overall Software Evaluation Characteristics for Professionals
The table above displays all total average weighted mean for Functionality
with 3.5, Usability with 3.47, Reliability with 2.93, Efficiency with 3.8,
Compatibility with 2.06, Security with 3.2, Maintainability with 2.9, Portability with
3.93, and the Total weighted mean is 3,22 with “ Good “ verbal interpretation.
47
CHAPTER 5
Summary of Findings
1. There were 11 respondents for the end user evaluation and there were 5
the other gender option. While Six (6) were female, accounting for 54.5%
of the overall respondents. And five (5) were male, accounting for 45.5%
respondents and only 1 was female which consisted of 20% of the total
professional respondents.
respondents for strand STEM accounting for 18% of the total, three (3)
respondents for strand HE accounting for 27% of the total, Six (6)
48
respondents for strand ICT accounting for 54% of the total, and the other
the weighted mean for Sustainability with 3.36, Accurateness with 3.27
and Compliance with 3.63, with the total mean for Functionality is 3.42
mean for Recognizability with 3.36, learnability with 3.18, Operability with
and accessibility with 3.18 and the total avg in Usability is 3.22 with
weighted mean for Availability is 3.27 and the weighted mean for Fault
Tolerance is 3.18 and Recoverability with 3.27 weighted mean, this means
that the total weighted mean for Reliability is 3.24 with the Verbal
Interpretation of “Excellent”.
the data reveals that the total average weighted mean for Functionality
with 3.42, Usability with 3.22, Reliability with 3.24 and the Total weighted
49
9. In terms of Functionality evaluated by Professionals , the data reveals
that all total average weighted mean for Functionality for the professional
3.4 and the Total weighted mean for Functionality is 3.5 with “ Excellent “
verbal interpretation.
10. In terms of Usability evaluated by Professionals, the data reveals that all
total average weighted mean for Usability for the professional interview.
Weighted mean 3.8, Learnability with 3.4, User-error protection with 2.8
and Accessibility with 3.2 and the Total weighted mean for Usability is
all total average weighted mean for Reliability for the professional
with 2.6 and the Total weighted mean for Reliability is 2.93 with
12. For the Efficiency evaluated by Professionals, the data reveals that the
total average weighted mean for Efficiency for the professional interview.
Time behavior with 4, Resource Utilization with 3.8, Capacity with 3.6 and
13. For the Compatibility evaluated by Professionals, the data reveals that
50
interview. Co-existence with 3.2, Interoperability with 3, and the Total
14. For the Security evaluated by Professionals, the data reveals that the
total average weighted mean for Security for the professional interview.
Authenticity are both with 3.4, And the Total weighted mean for Security
15. For the Portability evaluated by Professionals, the data reveals that the
total average weighted mean for Portability for the professional interview.
the Total weighted mean for Portability is 3.93 with “ Excellent“ verbal
interpretation.
the data reveals that the total average weighted mean for Functionality
with 3.5, Usability with 3.47, Reliability with 2.93, Efficiency with 3.8,
Portability with 3.93, and the Total weighted mean is 3,22 with “ Good “
verbal interpretation.
Conclusion
1. The software evaluation included feedback from both end users and
51
were female, accounting for 54.5% of the total, while male respondents
accounted for 45.5%. The strand ICT received the highest number of
respondents, the strands STEM and HE had few respondents, and the
evaluation, the majority of the respondents were male making up for 80%
of the total professional respondents, while there were only 20% female
2. The Functionality of the software was rated as excellent by end users, with
and Accessibility receiving positive ratings. The end user evaluation found
and Reliability.
and compliance receiving high scores. Usability was also rated excellent,
52
and security were rated excellent, while Compatibility received a fair
positively assessed.
feedback from both end users and professionals indicates that the system
improvement.
Recommendations
program.
53
3. For the Business Owners to choose the Right Technology: Select a
team. Consider factors like performance, security, and compatibility with existing
systems.
4. For the Future Researchers to clearly define the research goals and
the research questions you're aiming to answer. This clarity will guide your
activities.
54
References
10.1177/1532673X08316667.
https://doi.org/10.1177/1532673X08316667
https://en.wikipedia.org/w/index.php?
title=Electoral_system&oldid=1152798146
https://www.freepatentsonline.com/y2005/0218224.html
https://www.smartmatic.com/case-studies/article/the-philippines-
the-first-ever-automated-elections-in-southeast-asia/
title=Vote_counting_in_the_Philippines&oldid=1123356136
55
Miranda, M., Sy, E., & Verceles, C. (2012). A direct recording electronic
https://animorepository.dlsu.edu.ph/etd_bachelors/11289
guide/philippines-CS/choosing-to-adopt-electronic-technologies
www.scribbr.com/methodology/sampling-methods.
56
Appendices
57
B. Evaluation Instrument for end-users
58
C. Evaluation Instrument for professionals
59
60
D. Tally of Responses
4 3 2 1 Total
Sustainabili 9 6 1 0 16
ty
Accuratene 7 7 2 0 16
ss
Complianc 10 5 1 0 16
Recognizab 9 6 1 0 16
ility
Learnability 6 8 2 0 16
User-error 6 6 4 0 16
protection.
User- 7 8 1 0 16
Interface
aesthetics
Accessibilit 5 9 2 0 16
Availability 8 7 1 0 16
61
Fault 4 8 4 0 16
Tolerance
Recoverabi 6 6 2 2 16
lity
Time 5 0 0 0 5
behavior
Resource 4 1 0 0 5
Utilization
Capacity 3 2 0 0 5
Co- 1 4 0 0 5
existence
Interopera 0 5 0 0 5
bility
Confidenti 0 3 2 0 5
ality
Integrity 2 3 0 0 5
Accounta 2 3 0 0 5
bility
62
Authentici 2 3 0 0 5
ty
Reusabilit 0 5 0 0 5
Analyzabil 2 3 0 0 5
ity
Modifiabili 0 2 3 0 5
ty
Testability 1 2 2 0 5
Adaptabili 5 0 0 0 5
ty
Installabili 5 0 0 0 5
ty
Replaceab 4 1 0 0 5
ility
63
E. Gantt Chart
64
F. Documentation of Evaluation Procedure
G. Researcher’s Profile
65
H. Codes
MistakeCounter = 0
MistakeTicker.Visible = True
MistakeTimer.Enabled = True Admin_Page.vb
timerTick = 0
MistakeTicker.Text = Imports System.Data.OleDb
timerTick Imports
Submit.Enabled = False System.Windows.Forms.VisualStyle
MessageBox.Show("You s.VisualStyleElement.StartPanel
have failed 3 attempts! Please wait
for 30 seconds before you try Public Class Admin_Page
again.", "Failed 3 attempts")
End If Private CurrentUser As User
End Sub Public Sub setUser(newuser As
User)
Private Sub Clear_Click() Handles CurrentUser = newuser
Clear.Click End Sub
Username.Clear()
Password.Clear() Dim rs As New Resizer
End Sub Public Sub Admin_Page_Load()
Handles MyBase.Load
Public MistakeCounter As Integer
=0 StatsUpdate.Start()
Private timerTick As Integer = 0
rs.FindAllControls(BodyPanel)
66
da.Fill(dt)
Dim userData = Dim totalVotersVoted As
CurrentUser.AccessUserInformation( Integer = dt.Rows.Count
) dt.Clear()
67
EndElectionButton.Enabled = [C_POSITION] = 'President' ORDER
True BY VOTE DESC")
Else cmd = New
NewElectionButton.Enabled OleDbCommand(sql, cn)
= True dr = cmd.ExecuteReader()
EditCandidateButton.Enabled If dr.Read Then
= True Dim Winner As String =
EndElectionButton.Enabled = dr("C_Firstname") + " " +
False dr("C_Lastname")
End If sql =
End Sub String.Format("UPDATE [Election]
SET [PresidentWinner] = '{0}'
Private Sub Resize() Handles WHERE Ongoing=True", Winner)
BodyPanel.Resize cmd = New
OleDbCommand(sql, cn)
rs.ResizeAllControls(BodyPanel)
End Sub cmd.ExecuteNonQuery()
End If
Public Sub ExitForm() Handles
Me.Closed 'Vice President
Login_Page.Show() sql =
End Sub String.Format("SELECT TOP 1 *
FROM CANDIDATES WHERE
Private Sub [C_POSITION] = 'Vice President'
NewElectionButton_Click(sender As ORDER BY VOTE DESC")
Object, e As EventArgs) Handles cmd = New
NewElectionButton.Click OleDbCommand(sql, cn)
NewElection.ShowDialog() dr = cmd.ExecuteReader()
refreshControl() If dr.Read Then
End Sub Dim Winner As String =
Private Sub dr("C_Firstname") + " " +
EndElectionButton_Click(sender As dr("C_Lastname")
Object, e As EventArgs) Handles sql =
EndElectionButton.Click String.Format("UPDATE [Election]
Dim result As DialogResult = SET [VPresidentWinner] = '{0}'
MessageBox.Show("Are you sure WHERE Ongoing=True", Winner)
you want to end the election?", "End cmd = New
Election?", OleDbCommand(sql, cn)
MessageBoxButtons.YesNo)
Select Case result cmd.ExecuteNonQuery()
Case DialogResult.Yes End If
'President 'Secretary
sql = sql =
String.Format("SELECT TOP 1 * String.Format("SELECT TOP 1 *
FROM CANDIDATES WHERE FROM CANDIDATES WHERE
68
[C_POSITION] = 'Secretary' ORDER [C_POSITION] = 'Auditor' ORDER
BY VOTE DESC") BY VOTE DESC")
cmd = New cmd = New
OleDbCommand(sql, cn) OleDbCommand(sql, cn)
dr = cmd.ExecuteReader() dr = cmd.ExecuteReader()
If dr.Read Then If dr.Read Then
Dim Winner As String = Dim Winner As String =
dr("C_Firstname") + " " + dr("C_Firstname") + " " +
dr("C_Lastname") dr("C_Lastname")
sql = sql =
String.Format("UPDATE [Election] String.Format("UPDATE [Election]
SET [SecretaryWinner] = '{0}' SET [AuditorWinner] = '{0}' WHERE
WHERE Ongoing=True", Winner) Ongoing=True", Winner)
cmd = New cmd = New
OleDbCommand(sql, cn) OleDbCommand(sql, cn)
cmd.ExecuteNonQuery() cmd.ExecuteNonQuery()
End If End If
cmd.ExecuteNonQuery() cmd.ExecuteNonQuery()
End If End If
69
[C_POSITION] = 'Peace Officer' [C_POSITION] = 'Grade 11
ORDER BY VOTE DESC") Representative' ORDER BY VOTE
cmd = New DESC")
OleDbCommand(sql, cn) cmd = New
dr = cmd.ExecuteReader() OleDbCommand(sql, cn)
If dr.Read Then dr = cmd.ExecuteReader()
Dim Winner As String = If dr.Read Then
dr("C_Firstname") + " " + Dim Winner As String =
dr("C_Lastname") dr("C_Firstname") + " " +
sql = dr("C_Lastname")
String.Format("UPDATE [Election] sql =
SET [POWinner] = '{0}' WHERE String.Format("UPDATE [Election]
Ongoing=True", Winner) SET [G11RepWinner] = '{0}' WHERE
cmd = New Ongoing=True", Winner)
OleDbCommand(sql, cn) cmd = New
OleDbCommand(sql, cn)
cmd.ExecuteNonQuery()
End If cmd.ExecuteNonQuery()
End If
'Grade 12 Representative
sql = sql =
String.Format("SELECT TOP 1 * String.Format("UPDATE
FROM CANDIDATES WHERE [ELECTION] SET [ElectionEnd]='{0}'
[C_POSITION] = 'Grade 12 WHERE Ongoing=True", Date.Now)
Representative' ORDER BY VOTE cmd = New
DESC") OleDbCommand(sql, cn)
cmd = New cmd.ExecuteNonQuery()
OleDbCommand(sql, cn)
dr = cmd.ExecuteReader() sql =
If dr.Read Then String.Format("UPDATE [Election]
Dim Winner As String = SET Ongoing=False")
dr("C_Firstname") + " " + cmd = New
dr("C_Lastname") OleDbCommand(sql, cn)
sql = cmd.ExecuteNonQuery()
String.Format("UPDATE [Election]
SET [G12RepWinner] = '{0}' WHERE sql =
Ongoing=True", Winner) String.Format("DELETE FROM
cmd = New [CandidateResults]")
OleDbCommand(sql, cn) cmd = New
OleDbCommand(sql, cn)
cmd.ExecuteNonQuery() cmd.ExecuteNonQuery()
End If
sql =
'Grade 11 Representative String.Format("INSERT INTO
sql = [CandidateResults] SELECT *
String.Format("SELECT TOP 1 * FROM [Candidates]")
FROM CANDIDATES WHERE
70
cmd = New ManageUsers.ShowDialog()
OleDbCommand(sql, cn) End Sub
cmd.ExecuteNonQuery() End Class
Case DialogResult.No
71
"Zacchaeus",
"Zacharias", Section.Items.AddRange({"Igdaliah",
"Zechariah", "Illyricum",
"Iphediah",
"Zephaniah"}) "Irijiah",
ElseIf Strand.Text = "HUMSS" "Israel",
Then "Ithiel",
"Zaanan",
Section.Items.AddRange({"Babylon", "Chronicles",
"Beersheba",
"Beirut", "Ecclesiastes",
"Berea", "Ezra",
"Bethany", "Luke",
"Bethel", "Nehemiah",
"Bethlehem", "Proverbs",
"Bethsaida", "Titus"})
"Ephesians", ElseIf Strand.Text = "HE" Then
"Ezekiel",
"Jeremiah", Section.Items.AddRange({"Jayser",
"Job", "Jerahmeel",
"Jericho",
"Lamentation", "Jerusalem",
"Letters", "Jordan",
"Obadiah", "Jubilee",
"Samuel"}) "Zanoah",
ElseIf Strand.Text = "ABM" "Acts",
Then "Exodus",
"Genesis",
Section.Items.AddRange({"Adoram", "Jonah",
"Akkad", "Judges",
"Antioch", "Numbers",
"Aphek",
"Attalia", "Revelations",
"Amana", "Ruth"})
"Ashur", ElseIf Strand.Text = "GAS"
"Assyria", Then
"Amaziah",
"Adonai", Section.Items.AddRange({"Cana",
"Amos", "Canaan",
"Colossians",
"Daniel", "Capernaum",
"Hosea", "Chenania",
"James", "Esther",
"James", "Peter",
"Leviticus", "Romans"})
"Matthew"}) ElseIf Strand.Text = "IA" Then
ElseIf Strand.Text = "ICT" Then
72
Section.Items.AddRange({"Magdalas Private Sub EditCandidate_Load()
", Handles MyBase.Load
"Kings"})
End If Dim dt As DataTable
End Sub Dim da As OleDbDataAdapter
73
Strand.SelectedIndex < 0 Or Private Sub
Section.SelectedIndex < 0 Then RemoveAllButton_Click(sender As
Object, e As EventArgs) Handles
AddCandidateButton.Enabled = RemoveAllButton.Click
False Dim result As DialogResult =
Else MessageBox.Show("Are you sure
you want to remove all the
AddCandidateButton.Enabled = True Candidate?", "Removal
End If Confirmation",
End Sub MessageBoxButtons.YesNo,
MessageBoxIcon.Error)
Private Sub
RemoveCandidateButton_Click(send If result = DialogResult.Yes
er As Object, e As EventArgs) Then
Handles
RemoveCandidateButton.Click sql = String.Format("DELETE
Try FROM [Candidates] WHERE NOT
Dim test As Double = [C_Firstname] = 'novote' AND NOT
CDbl(RemoveCandidateByIDButton. [C_Lastname] = 'novote'")
Text) cmd = New
Catch ex As Exception OleDbCommand(sql, cn)
MessageBox.Show("Please cmd.ExecuteNonQuery()
only include numbers inside the ID
input.", "Error: Data Type Mismatch", MessageBox.Show("Successfully
MessageBoxButtons.OK, deleted all Candidate.", "Candidate
MessageBoxIcon.Error) Remove.", MessageBoxButtons.OK,
Return MessageBoxIcon.Asterisk)
End Try EditCandidate_Load()
End If
sql = String.Format("DELETE
FROM [Candidates] WHERE ID = {0} End Sub
AND NOT [C_Firstname] = 'novote' End Class
AND NOT [C_Lastname] = 'novote'",
RemoveCandidateByIDButton.Text)
cmd = New
OleDbCommand(sql, cn) ManageUser.vb
cmd.ExecuteNonQuery()
Imports System.Data.OleDb
MessageBox.Show("Successfully Imports
deleted candidate.", "Candidate System.Security.Cryptography
Remove.", MessageBoxButtons.OK, Imports System.Text
MessageBoxIcon.Asterisk)
Public Class ManageUsers
EditCandidate_Load()
End Sub Private Sub EnterButtonChecker()
Handles Firstname.TextChanged,
Lastname.TextChanged,
74
LRN.TextChanged,
Grade.TextChanged, Private Sub ManageUsers_Load()
Section.SelectedIndexChanged, Handles MyBase.Load
Strand.SelectedIndexChanged
LoadUsers()
If Firstname.Text = "" Or
Lastname.Text = "" Or LRN.Text = "" End Sub
Or Grade.Text = "" Or
Strand.SelectedIndex < 0 Or Private Sub
Section.SelectedIndex < 0 Then Strand_SelectedIndexChanged(send
AddUserButton.Enabled = er As Object, e As EventArgs)
False Handles
Else Strand.SelectedIndexChanged
AddUserButton.Enabled = Dim obj = Section
True obj.Items.Clear()
End If obj.SelectedIndex = -1
End Sub If sender.Text = "STEM" Then
75
ElseIf sender.Text = "HUMSS" "Israel",
Then "Ithiel",
"Zaanan",
obj.Items.AddRange({"Babylon", "Chronicles",
"Beersheba",
"Beirut", "Ecclesiastes",
"Berea", "Ezra",
"Bethany", "Luke",
"Bethel", "Nehemiah",
"Bethlehem", "Proverbs",
"Bethsaida", "Titus"})
"Ephesians", ElseIf sender.Text = "HE" Then
"Ezekiel",
"Jeremiah", obj.Items.AddRange({"Jayser",
"Job", "Jerahmeel",
"Jericho",
"Lamentation", "Jerusalem",
"Letters", "Jordan",
"Obadiah", "Jubilee",
"Samuel"}) "Zanoah",
ElseIf sender.Text = "ABM" "Acts",
Then "Exodus",
"Genesis",
obj.Items.AddRange({"Adoram", "Jonah",
"Akkad", "Judges",
"Antioch", "Numbers",
"Aphek",
"Attalia", "Revelations",
"Amana", "Ruth"})
"Ashur", ElseIf sender.Text = "GAS"
"Assyria", Then
"Amaziah", obj.Items.AddRange({"Cana",
"Adonai", "Canaan",
"Amos",
"Colossians", "Capernaum",
"Daniel", "Chenania",
"Hosea", "Esther",
"James", "Peter",
"James", "Romans"})
"Leviticus", ElseIf sender.Text = "IA" Then
"Matthew"})
ElseIf sender.Text = "ICT" Then obj.Items.AddRange({"Magdalas",
"Kings"})
obj.Items.AddRange({"Igdaliah", End If
"Illyricum", End Sub
"Iphediah",
"Irijiah", Private rand As New Random
76
Private Sub generatedUsername,
AddUserButton_Click(sender As generatedPassword,
Object, e As EventArgs) Handles generatedPassword, Firstname.Text,
AddUserButton.Click Lastname.Text, Grade.Text,
Try Section.Text, Strand.Text, LRN.Text)
Dim test As Double = cmd = New
CDbl(Grade.Text) OleDbCommand(sql, cn)
Dim test2 As Double = cmd.ExecuteReader()
CDbl(LRN.Text)
Catch ex As Exception MessageBox.Show("Successfully
MessageBox.Show("Please created user.", "Create user",
only include numbers for the Grade MessageBoxButtons.OK,
or LRN.", "Error: Data Type MessageBoxIcon.Information)
Mismatch", MessageBoxButtons.OK, ManageUsers_Load()
MessageBoxIcon.Error) End Sub
Return
End Try Private Function
generateRandomString(r As
If Not LRN.Text.Length = 12 Random, len As Integer)
Then Dim s As String =
MessageBox.Show("LRN "ABCDEFGHIJKLMNOPQRSTUVW
only can have 12 digits.", "Error: XYZabcdefghijklmnopqrstuvwxyz012
Invalid LRN", 3456789"
MessageBoxButtons.OK, Dim sb As New StringBuilder
MessageBoxIcon.Error)
Return For i As Integer = 1 To len
End If
Dim generatedUsername As sb.Append(s.Substring(r.Next(0,
String s.Length), 1))
Dim generatedPassword As Next
String
Return sb.ToString
generatedUsername = End Function
LRN.Text & "-" &
generateRandomString(rand, 5) Private Sub
generatedPassword = RemoveUserButton_Click(sender As
generateRandomString(rand, 15) Object, e As EventArgs) Handles
RemoveUserButton.Click
sql = String.Format( Try
"INSERT INTO Dim test As Double =
users([Username],[Password], CDbl(RemoveUserByIDButton.Text)
[GeneratedPassword],[Firstname], Catch ex As Exception
[Lastname],[Grade],[Section], MessageBox.Show("Please
[Strand],[LRN],[PickedCandidates]) only include numbers inside the ID
input.", "Error: Data Type Mismatch",
VALUES('{0}','{1}','{2}','{3}','{4}','{5}','{ MessageBoxButtons.OK,
6}','{7}',{8},'-')", MessageBoxIcon.Error)
77
Return
End Try MessageBox.Show("Successfully
deleted user.", "User Remove.",
Dim result As DialogResult = MessageBoxButtons.OK,
MessageBox.Show( MessageBoxIcon.Asterisk)
"Are you sure you want to
remove this user? This account will ManageUsers_Load()
be permanently archived.", End Sub
"Remove User?", End Class
MessageBoxButtons.YesNo,
MessageBoxIcon.Error)
If result = DialogResult.No Then
Return NewElection.vb
End If
Imports
sql = String.Format("SELECT * System.Collections.Specialized.BitV
FROM [Users] WHERE [ID] = {0} ector32
AND [Admin] = False", Imports System.Data.OleDb
RemoveUserByIDButton.Text) Imports
cmd = New System.Security.Cryptography.X509
OleDbCommand(sql, cn) Certificates
dr = cmd.ExecuteReader Imports
If Not dr.Read Then System.Windows.Forms.DataVisuali
MessageBox.Show("User zation.Charting
does not exist.", "User Remove.",
MessageBoxButtons.OK, Public Class NewElection
MessageBoxIcon.Error)
Return Private Sub
End If CreateButton_Click(sender As
Object, e As EventArgs) Handles
sql = String.Format("INSERT CreateButton.Click
INTO [ArchivedUsers] SELECT * con()
FROM [Users] WHERE [ID] = {0}",
RemoveUserByIDButton.Text) sql = String.Format("INSERT
cmd = New INTO Election([ElectionName],
OleDbCommand(sql, cn) [Ongoing],[ElectionStart])
cmd.ExecuteNonQuery() VALUES('{0}',{1},'{2}')",
ElectionName.Text, True, Date.Now)
sql = String.Format("DELETE cmd = New
FROM [Users] WHERE [ID] = {0} OleDbCommand(sql, cn)
AND [Admin] = False", cmd.ExecuteNonQuery()
RemoveUserByIDButton.Text)
cmd = New sql = String.Format("UPDATE
OleDbCommand(sql, cn) [Users] SET [Voted] = False")
cmd.ExecuteNonQuery() cmd = New
OleDbCommand(sql, cn)
cmd.ExecuteNonQuery()
78
Object, e As EventArgs) Handles
sql = String.Format("UPDATE MyBase.Load
[Users] SET [PickedCandidates] = ''") Dim dt As New DataTable
cmd = New
Dim da As OleDbDataAdapter
OleDbCommand(sql, cn)
cmd.ExecuteNonQuery()
sql = String.Format("SELECT *
sql = String.Format("UPDATE FROM [ArchivedUsers]")
[Candidates] SET [Vote] = 0") da = New
cmd = New OleDbDataAdapter(sql, cn)
OleDbCommand(sql, cn) da.Fill(dt)
cmd.ExecuteNonQuery()
79
Login_Page.Show() AND NOT [C_Firstname] = 'novote'
End Sub AND NOT [C_Lastname] = 'novote'"
Private Sub da = New
LogOutLabel_Click(sender As OleDbDataAdapter(sql, cn)
Object, e As EventArgs) Handles da.Fill(dt)
LogOutLabel.Click PList.DataSource = dt.Copy
Me.Close() PList.DisplayMember =
End Sub "Fullname"
dt.Clear()
Dim PageLoading As Boolean
'Vice President
Private Sub Main_Page_Load() sql = "SELECT
Handles MyBase.Load [C_Firstname] + ' ' + [C_Lastname]
AS [Fullname] FROM [Candidates]
PageLoading = True WHERE [C_Position] = 'Vice
President' AND NOT [C_Firstname]
NameLabel.Text = = 'novote' AND NOT [C_Lastname] =
CurrentUser.AccessUserInformation( 'novote'"
"Firstname") + " " + da = New
CurrentUser.AccessUserInformation( OleDbDataAdapter(sql, cn)
"Lastname") da.Fill(dt)
VPList.DataSource = dt.Copy
sql = String.Format("SELECT * VPList.DisplayMember =
FROM [Election] WHERE "Fullname"
Ongoing=True") dt.Clear()
cmd = New
OleDbCommand(sql, cn) 'Secretary
dr = cmd.ExecuteReader sql = "SELECT
If dr.Read Then [C_Firstname] + ' ' + [C_Lastname]
ElectionName.Text = AS [Fullname] FROM [Candidates]
dr("ElectionName") WHERE [C_Position] = 'Secretary'
AND NOT [C_Firstname] = 'novote'
Dim dt As New DataTable AND NOT [C_Lastname] = 'novote'"
Dim da As New da = New
OleDbDataAdapter OleDbDataAdapter(sql, cn)
da.Fill(dt)
'President SList.DataSource = dt.Copy
sql = "SELECT SList.DisplayMember =
[C_Firstname] + ' ' + [C_Lastname] "Fullname"
AS [Fullname] FROM [Candidates] dt.Clear()
WHERE [C_Position] = 'President'
80
'Treasurer PIOList.DataSource =
sql = "SELECT dt.Copy
[C_Firstname] + ' ' + [C_Lastname] PIOList.DisplayMember =
AS [Fullname] FROM [Candidates] "Fullname"
WHERE [C_Position] = 'Treasurer' dt.Clear()
AND NOT [C_Firstname] = 'novote'
AND NOT [C_Lastname] = 'novote'" 'Peace Officer
da = New sql = "SELECT
OleDbDataAdapter(sql, cn) [C_Firstname] + ' ' + [C_Lastname]
da.Fill(dt) AS [Fullname] FROM [Candidates]
TList.DataSource = dt.Copy WHERE [C_Position] = 'Peace
TList.DisplayMember = Officer' AND NOT [C_Firstname] =
"Fullname" 'novote' AND NOT [C_Lastname] =
dt.Clear() 'novote'"
da = New
'Auditor OleDbDataAdapter(sql, cn)
sql = "SELECT da.Fill(dt)
[C_Firstname] + ' ' + [C_Lastname] POList.DataSource = dt.Copy
AS [Fullname] FROM [Candidates] POList.DisplayMember =
WHERE [C_Position] = 'Auditor' AND "Fullname"
NOT [C_Firstname] = 'novote' AND dt.Clear()
NOT [C_Lastname] = 'novote'"
da = New 'Grade 12 Representative
OleDbDataAdapter(sql, cn) sql = "SELECT
da.Fill(dt) [C_Firstname] + ' ' + [C_Lastname]
AList.DataSource = dt.Copy AS [Fullname] FROM [Candidates]
AList.DisplayMember = WHERE [C_Position] = 'Grade 12
"Fullname" Representative' AND NOT
dt.Clear() [C_Firstname] = 'novote' AND NOT
[C_Lastname] = 'novote'"
'Public Information Officer da = New
sql = "SELECT OleDbDataAdapter(sql, cn)
[C_Firstname] + ' ' + [C_Lastname] da.Fill(dt)
AS [Fullname] FROM [Candidates] G12RList.DataSource =
WHERE [C_Position] = 'Public dt.Copy
Information Officer' AND NOT G12RList.DisplayMember =
[C_Firstname] = 'novote' AND NOT "Fullname"
[C_Lastname] = 'novote'" dt.Clear()
da = New
OleDbDataAdapter(sql, cn) 'Grade 11 Representative
da.Fill(dt)
81
sql = "SELECT
[C_Firstname] + ' ' + [C_Lastname] If
AS [Fullname] FROM [Candidates] CurrentUser.AccessUserInformation(
WHERE [C_Position] = 'Grade 11 "Grade") = 11 Then
Representative' AND NOT G12RTab.Enabled = False
[C_Firstname] = 'novote' AND NOT End If
[C_Lastname] = 'novote'" End Sub
da = New
OleDbDataAdapter(sql, cn) Public Sub CheckIfUserVoted()
da.Fill(dt) sql = String.Format("SELECT *
G11RList.DataSource = FROM [Users] WHERE [ID] = {0}",
dt.Copy CurrentUser.AccessUserInformation(
G11RList.DisplayMember = "ID"))
"Fullname" cmd = New
dt.Clear() OleDbCommand(sql, cn)
dr = cmd.ExecuteReader
VotePicker.Enabled = True Dim userVoted As Boolean
Dim pickedCandidates As
ClearVoteButton_Click() String
If dr.Read Then
CheckIfUserVoted() Try
Else userVoted = dr("Voted")
ElectionName.Text = "No Catch ex As Exception
ongoing elections."
SubmitVoteButton.Enabled = End Try
False
SubmitVoteButton.Text = "No Try
Election" pickedCandidates =
VotePicker.Enabled = False dr("PickedCandidates")
End If Catch ex As Exception
GRBHeight = End If
GroupBox1.Height
If userVoted Then
If SubmitVoteButton.Text =
CurrentUser.AccessUserInformation( "See Ballot Receipt"
"Grade") = 12 Then VotePicker.Enabled = False
G11RTab.Enabled = False ClearVoteButton.Enabled =
End If False
82
PIOList.SelectedIndexChanged,
POList.SelectedIndexChanged,
G12RList.SelectedIndexChanged,
Dim extractNames As G11RList.SelectedIndexChanged
String() =
pickedCandidates.Split("#") If PageLoading Then
PDisplay.Text = Return
extractNames(0) End If
VPDisplay.Text =
extractNames(1) PDisplay.Text = PList.Text
SDisplay.Text = VPDisplay.Text = VPList.Text
extractNames(2) SDisplay.Text = SList.Text
TDisplay.Text = TDisplay.Text = TList.Text
extractNames(3) ADisplay.Text = AList.Text
ADisplay.Text = PIODisplay.Text = PIOList.Text
extractNames(4) PODisplay.Text = POList.Text
PIODisplay.Text = G12RDisplay.Text =
extractNames(5) G12RList.Text
PODisplay.Text = G11RDisplay.Text =
extractNames(6) G11RList.Text
G12RDisplay.Text =
extractNames(7) End Sub
G11RDisplay.Text =
extractNames(8) Public conf As Boolean = False
Private Sub
Else SubmitVoteButton_Click(sender As
SubmitVoteButton.Text = Object, e As EventArgs) Handles
"Submit Ballot" SubmitVoteButton.Click
VotePicker.Enabled = True
ClearVoteButton.Enabled =
True If SubmitVoteButton.Text =
End If "Submit Ballot" Then
End Sub
83
sb.Append(PDisplay.Text & Dim tb As TextBox() =
"#") {PDisplay, VPDisplay, SDisplay,
sb.Append(VPDisplay.Text & TDisplay, ADisplay, PIODisplay,
"#") PODisplay, G12RDisplay,
sb.Append(SDisplay.Text & G11RDisplay}
"#") Dim pos As String() =
sb.Append(TDisplay.Text & {"President", "Vice President",
"#") "Secretary", "Treasurer", "Auditor",
sb.Append(ADisplay.Text & "Public Information Officer", "Peace
"#") Officer", "Grade 12 Representative",
sb.Append(PIODisplay.Text "Grade 11 Representative"}
& "#") For i As Integer = 0 To 8
sb.Append(PODisplay.Text & Dim CandidateName As
"#") String
If tb(i).Text = "" Then
sb.Append(G12RDisplay.Text & "#") CandidateName =
"novote novote"
sb.Append(G11RDisplay.Text) Else
Dim namesVoted As String = CandidateName =
sb.ToString tb(i).Text
End If
sql =
String.Format("UPDATE [Users] SET sql =
[PickedCandidates] = '{0}' WHERE String.Format("UPDATE
[ID] = {1}", namesVoted, [Candidates] SET [Vote] = [Vote] + 1
CurrentUser.AccessUserInformation( WHERE [C_Firstname] + ' ' +
"ID")) [C_Lastname] = '{0}' AND
cmd = New [C_Position] = '{1}'",
OleDbCommand(sql, cn) CandidateName, pos(i))
cmd.ExecuteNonQuery() cmd = New
OleDbCommand(sql, cn)
sql = "UPDATE [Users] SET cmd.ExecuteNonQuery()
[Voted] = True WHERE [ID] = " & Next
CurrentUser.AccessUserInformation(
"ID") CheckIfUserVoted()
cmd = New
OleDbCommand(sql, cn) Else
cmd.ExecuteNonQuery()
sql = "SELECT * FROM
[Users] WHERE [ID] = " &
84
CurrentUser.AccessUserInformation(
"ID") Private Sub
cmd = New ViewElectionResultButton_Click(sen
OleDbCommand(sql, cn) der As Object, e As EventArgs)
dr = cmd.ExecuteReader() ElectionResults.ShowDialog()
dr.Read() End Sub
Dim Ballot As New
BallotMaker(dr("PickedCandidates")) Private Sub
Ballot.CreateBallot() ClearVoteButton_Click() Handles
ClearVoteButton.Click
End If PList.SelectedIndex = -1
VPList.SelectedIndex = -1
End Sub SList.SelectedIndex = -1
TList.SelectedIndex = -1
Private Sub AList.SelectedIndex = -1
AccountSettingsButtons_Click(sende PIOList.SelectedIndex = -1
r As Object, e As EventArgs) POList.SelectedIndex = -1
Handles G12RList.SelectedIndex = -1
AccountSettingsButtons.Click G11RList.SelectedIndex = -1
AccountSettings.Fullname.Text End Sub
=
CurrentUser.AccessUserInformation( Dim GRBHeight As Integer
"Firstname") & " " & Private Sub
CurrentUser.AccessUserInformation( GroupBox1_Resize(sender As
"Lastname") Object, e As EventArgs) Handles
GroupBox1.Resize
AccountSettings.GradeAndSection.T If Not GroupBox1.Height =
ext = GRBHeight Then
CurrentUser.AccessUserInformation( GRBHeight =
"Strand") & " " & GroupBox1.Height
CurrentUser.AccessUserInformation( Dim controlArr As TextBox()
"Grade") & " - " & = {PDisplay, VPDisplay, SDisplay,
CurrentUser.AccessUserInformation( TDisplay, ADisplay, PIODisplay,
"Section") PODisplay, G12RDisplay,
G11RDisplay}
AccountSettings.UsernameBox.Text For Each tb As TextBox In
= controlArr
CurrentUser.AccessUserInformation( tb.Height =
"Username") CDbl(GroupBox1.Height) * 0.0631
AccountSettings.ShowDialog() 'tb.Text =
End Sub GroupBox1.Height
85
Dim tbAbove As New tb.Font = New
TextBox Font("Candara", CSng(tb.Height *
Dim labBeside As New 0.51), FontStyle.Bold)
Label labBeside.Location = New
Select Case tb.Name Point(labBeside.Location.X,
Case "PDisplay" (tb.Location.Y + tb.Height / 2) -
labBeside = PLabel labBeside.Height / 2)
Case "VPDisplay"
tbAbove = PDisplay Next
labBeside = VPLabel End If
Case "SDisplay" End Sub
tbAbove = VPDisplay
labBeside = SLabel End Class
Case "TDisplay"
tbAbove = SDisplay
labBeside = TLabel
Case "ADisplay" AccountSettings.vb
tbAbove = TDisplay
labBeside = ALabel Public Class AccountSettings
Case "PIODisplay"
tbAbove = ADisplay Private Sub
labBeside = PIOLabel ChangeUsernameButton_Click(send
Case "PODisplay" er As Object, e As EventArgs)
tbAbove = PIODisplay Handles
labBeside = POLabel ChangeUsernameButton.Click
Case "G12RDisplay"
tbAbove = PODisplay ChangeUsername.ShowDialog()
labBeside = End Sub
G12RLabel
Case "G11RDisplay" Private Sub
tbAbove = ChangePasswordButton_Click(send
G12RDisplay er As Object, e As EventArgs)
labBeside = Handles
G11RLabel ChangePasswordButton.Click
End Select ChangePassword.ShowDialog()
If Not tb Is PDisplay Then End Sub
tb.Location = New End Class
Point(tb.Location.X,
tbAbove.Location.Y + ChangeUsername.vb
tbAbove.Height + 6)
End If Imports System.Data.OleDb
86
Imports Private Sub Enter_Click(sender
System.Windows.Forms.VisualStyle As Object, e As EventArgs) Handles
s.VisualStyleElement.StartPanel Enter.Click
If NewPasswordBox.Text =
Public Class ChangeUsername ConfirmPasswordBox.Text Then
Private Sub Enter_Click(sender Else
As Object, e As EventArgs) Handles
Enter.Click MessageBox.Show("Passwords do
not match", "Password match")
sql = String.Format("SELECT * Return
FROM [Users] WHERE ID = {0}", End If
Main_Page.CurrentUser.AccessUser
Information("ID")) sql = String.Format("SELECT *
cmd = New FROM [Users] WHERE ID = {0}",
OleDbCommand(sql, cn) Main_Page.CurrentUser.AccessUser
dr = cmd.ExecuteReader Information("ID"))
If dr.Read Then cmd = New
sql = OleDbCommand(sql, cn)
String.Format("UPDATE [Users] SET dr = cmd.ExecuteReader
[Username] = '{0}' WHERE [ID] = If dr.Read Then
{1}", NewUsernameBox.Text, sql =
Main_Page.CurrentUser.AccessUser String.Format("UPDATE [Users] SET
Information("ID")) [Password] = '{0}' WHERE [ID] =
cmd = New {1}", NewPasswordBox.Text,
OleDbCommand(sql, cn) Main_Page.CurrentUser.AccessUser
cmd.ExecuteNonQuery() Information("ID"))
cmd = New
MessageBox.Show("Successfully OleDbCommand(sql, cn)
changed username", "Username cmd.ExecuteNonQuery()
Change")
End If MessageBox.Show("Successfully
End Sub changed password", "Password
End Class Change")
End If
End Sub
End Class
ChangePassword.vb
Imports System.Data.OleDb
ConfirmationBox.vb
Public Class ChangePassword
87
Imports System.Data.OleDb VPDisplay.Text =
Imports System.Text Main_Page.VPDisplay.Text
SDisplay.Text =
Public Class ConfirmationBox Main_Page.SDisplay.Text
Private Sub TDisplay.Text =
ConfirmButton_Click(sender As Main_Page.TDisplay.Text
Object, e As EventArgs) Handles ADisplay.Text =
ConfirmButton.Click Main_Page.ADisplay.Text
PIODisplay.Text =
Dim result As DialogResult = Main_Page.PIODisplay.Text
MessageBox.Show("Are you sure PODisplay.Text =
you want to submit your vote?", Main_Page.PODisplay.Text
"Confirm vote", G12RDisplay.Text =
MessageBoxButtons.YesNo, Main_Page.G12RDisplay.Text
MessageBoxIcon.Asterisk) G11RDisplay.Text =
If result = DialogResult.No Then Main_Page.G11RDisplay.Text
Return End Sub
ElseIf result = DialogResult.Yes End Class
Then
Main_Page.conf = True
End If
ElectionsResult.vb
Me.Close()
End Sub Imports System.Data.OleDb
Imports
Private Sub System.Windows.Forms.DataVisuali
NevermindButton_Click(sender As zation.Charting
Object, e As EventArgs) Handles
NevermindButton.Click Public Class ElectionResults
Me.Close()
End Sub Dim rs As New Resizer
Private Sub
Private Sub ElectionResults_Load(sender As
ConfirmationBox_Load(sender As Object, e As EventArgs) Handles
Object, e As EventArgs) Handles MyBase.Load
MyBase.Load
ElectionName.Text = rs.FindAllControls(BodyPanel)
Main_Page.ElectionName.Text Populator()
PDisplay.Text = Updater.Start()
Main_Page.PDisplay.Text
End Sub
88
Case "PIOChart"
Private Sub Populator() pos = "Public Information
For Each chartControl As Chart Officer"
In Me.BodyPanel.Controls Case "POChart"
pos = "Peace Officer"
chartControl.Series(0).LabelBackCol Case "G12RChart"
or = Color.PowderBlue pos = "Grade 12
Representative"
chartControl.Series(0).LabelBorderC Case "G11RChart"
olor = Color.Black pos = "Grade 11
Representative"
chartControl.Series(0).Points.Clear() Case Else
PopulateChart(chartControl) pos = ""
Next End Select
End Sub
con()
sql = String.Format("SELECT *
rs.ResizeAllControls(BodyPanel) FROM [Candidates] WHERE
[C_Position] = '{0}'", pos)
End Sub If pos = "Grade 12
Representative" Or pos = "Grade 11
Private Sub PopulateChart(chartIn Representative" Then
As Chart) If pos = "Grade 12
Representative" Then
Dim pos As String pos = "Grade 12 Rep"
Else
Select Case chartIn.Name pos = "Grade 11 Rep"
Case "PChart" End If
pos = "President" End If
Case "VPChart" da = New
pos = "Vice President" OleDbDataAdapter(sql, cn)
Case "SChart" da.Fill(dt)
pos = "Secretary" For Each row As DataRow In
Case "TChart" dt.Rows
pos = "Treasurer" Dim nameOfPerson As String
Case "AChart" = row("C_Firstname") & " " &
pos = "Auditor" row("C_Lastname")
89
If nameOfPerson = "novote
novote" Then Imports System.Data.OleDb
nameOfPerson = "No Module db
Vote"
End If Public cn As New
Dim voteOfPerson As Integer OleDbConnection
= row("Vote") Public cmd As OleDbCommand
Public sql As String
chartIn.Series(String.Format("{0} Public dr As OleDbDataReader
Votes",
pos)).Points.AddXY(nameOfPerson, Public Sub con()
voteOfPerson)
Next Dim providerVersion As String =
dt.Clear() "ACE.OLEDB.12.0" 'jet.OLEDB.4.0
sql = String.Format("SELECT *
FROM [Users] WHERE
db.vb Username='{0}'", Username)
90
cmd = New
OleDbCommand(sql, cn) 'UserMaker.AccessUserInformation("
dr = cmd.ExecuteReader Admin")
Dim UsernameExists As If dr("Admin") Then
Boolean = dr.Read
Admin_Page.setUser(UserMaker)
sql = String.Format("SELECT * Admin_Page.Show()
FROM (SELECT * FROM [Users] Else
WHERE Username='{0}') WHERE
Password='{1}'", Username, Main_Page.setUser(UserMaker)
Password) Main_Page.Show()
cmd = New End If
OleDbCommand(sql, cn) Else
dr = cmd.ExecuteReader Dim txt As String = "Sign in
Dim PassowrdExists As not successful."
Boolean = dr.Read Dim tit As String = "User Sign
In"
'sql = String.Format("SELECT * MessageBox.Show(txt, tit,
FROM [Users] WHERE MessageBoxButtons.OK,
Username='{0}' AND MessageBoxIcon.Error)
Password='{1}'", Username, Login_Page.MistakeCounter
Password) = Login_Page.MistakeCounter + 1
'cmd = New End If
OleDbCommand(sql, cn) End Sub
'dr = cmd.ExecuteReader
End Module
If UsernameExists And
PassowrdExists Then
Dim txt As String =
"Successfully signed in." User.vb
Dim tit As String = "User Sign
In" Imports System.Data.OleDb
'MessageBox.Show(txt, tit, Imports
MessageBoxButtons.OK, System.Windows.Forms.VisualStyle
MessageBoxIcon.Asterisk) s.VisualStyleElement.StartPanel
91
Public Sub New(drIn As Dim extractNames As String()
OleDbDataReader) Dim StartDate As Date
userID = dr("ID") Dim EndDate As Date
End Sub Dim StartDateDisplay As String
Dim returnDR As Dim EndDateDisplay As String
OleDbDataReader Dim NameOfVoter As String
Public Function Dim Grade As String
AccessUserInformation() As Dim Strand As String
OleDbDataReader Dim Section As String
Dim LRN As String
Dim returnDR As
OleDbDataReader Public Sub New(names As String)
sql = String.Format("SELECT *
BallotMaker.vb FROM [Election] WHERE
Ongoing=True")
Imports System.Data.OleDb cmd = New
Imports System.Drawing.Printing OleDbCommand(sql, cn)
dr = cmd.ExecuteReader
Public Class BallotMaker If dr.Read Then
ElectionName =
Dim WithEvents Ballot As New dr("ElectionName")
PrintDocument
Dim BallotPreview As New Try
PrintPreviewDialog StartDate =
Dim ElectionName As String dr("ElectionStart")
Dim VotedFor As String
92
StartDateDisplay = Next
StartDate.ToString.Split(" ")(0)
Dim datearray As String() '
= StartDate.ToString.Split(" ") sql = String.Format("SELECT *
(0).Split("/") FROM [Users] WHERE [ID]={0}",
Dim month As String Main_Page.CurrentUser.AccessUser
month = Information("ID"))
DetermineMonth(datearray(1)) cmd = New
StartDateDisplay = month OleDbCommand(sql, cn)
& " " & datearray(1) & ", " & dr = cmd.ExecuteReader
datearray(2) If dr.Read Then
Catch ex As Exception NameOfVoter =
StartDateDisplay = "N/A" dr("Firstname") + dr("Lastname")
End Try Grade = dr("Grade")
Strand = dr("Strand")
Try Section = dr("Section")
EndDate = LRN = dr("LRN")
dr("ElectionEnd") End If
Dim datearray As String()
= EndDate.ToString.Split(" ") BallotPreview.ShowDialog()
(0).Split("/") End Sub
Dim month As String Private Sub
month = Ballot_PrintPage(sender As Object,
DetermineMonth(datearray(1)) e As PrintPageEventArgs) Handles
EndDateDisplay = month & Ballot.PrintPage
" " & datearray(1) & ", " &
datearray(2) 'FONTS
Catch ex As Exception Dim TitleFont As New
EndDateDisplay = "Yet To Font("Candara", 22, FontStyle.Bold)
End" Dim SubtitleFont As New
End Try Font("Candara", 16, FontStyle.Bold)
Dim BodyFont As New
End If Font("Candara", 12, FontStyle.Bold)
93
Dim RightPosition As Integer =
Ballot.DefaultPageSettings.PaperSiz e.Graphics.DrawString(StartDateDis
e.Width - 10 play, BodyFont, Brushes.Black,
RightPosition, 210, RightAlignment)
'TEXT ALIGNMENT
Dim RightAlignment As New e.Graphics.DrawString(EndDateDisp
StringFormat lay, BodyFont, Brushes.Black,
Dim CenterAlignment As New RightPosition, 240, RightAlignment)
StringFormat
RightAlignment.Alignment =
StringAlignment.Far e.Graphics.DrawString("__________
CenterAlignment.Alignment = _____________________________
StringAlignment.Center ________________", BodyFont,
Brushes.Black, CenterPosition, 260,
e.Graphics.DrawString("Official CenterAlignment)
Ballot Receipt of the " & vbCrLf &
"Supreme Student Government" & e.Graphics.DrawString("I
vbCrLf & "Election", TitleFont, VOTED FOR:", SubtitleFont,
Brushes.Black, CenterPosition, 15, Brushes.Black, CenterPosition, 290,
CenterAlignment) CenterAlignment)
e.Graphics.DrawString(ElectionNam
e, SubtitleFont, Brushes.Black, e.Graphics.DrawString("President:",
CenterPosition, 140, BodyFont, Brushes.Black,
CenterAlignment) LeftPosition, 330)
e.Graphics.DrawString("Vice
President:", BodyFont,
e.Graphics.DrawString("__________ Brushes.Black, LeftPosition, 360)
_____________________________
________________", BodyFont, e.Graphics.DrawString("Secretary:",
Brushes.Black, CenterPosition, 170, BodyFont, Brushes.Black,
CenterAlignment) LeftPosition, 390)
e.Graphics.DrawString("Date e.Graphics.DrawString("Treasurer:",
Started:", BodyFont, Brushes.Black, BodyFont, Brushes.Black,
LeftPosition, 210) LeftPosition, 420)
e.Graphics.DrawString("Date
Ended:", BodyFont, Brushes.Black, e.Graphics.DrawString("Auditor:",
LeftPosition, 240) BodyFont, Brushes.Black,
LeftPosition, 450)
94
e.Graphics.DrawString("Public
Information Officer:", BodyFont, e.Graphics.DrawString(extractName
Brushes.Black, LeftPosition, 480) s(7), BodyFont, Brushes.Black,
e.Graphics.DrawString("Peace RightPosition, 540, RightAlignment)
Officer:", BodyFont, Brushes.Black,
LeftPosition, 510) e.Graphics.DrawString(extractName
e.Graphics.DrawString("Grade s(8), BodyFont, Brushes.Black,
12 Representative:", BodyFont, RightPosition, 570, RightAlignment)
Brushes.Black, LeftPosition, 540)
e.Graphics.DrawString("Grade
11 Representative:", BodyFont, e.Graphics.DrawString("__________
Brushes.Black, LeftPosition, 570) _____________________________
________________", BodyFont,
Brushes.Black, CenterPosition, 600,
e.Graphics.DrawString(extractName CenterAlignment)
s(0), BodyFont, Brushes.Black,
RightPosition, 330, RightAlignment) e.Graphics.DrawString("Name
of voter:", BodyFont, Brushes.Black,
e.Graphics.DrawString(extractName LeftPosition, 630)
s(1), BodyFont, Brushes.Black, e.Graphics.DrawString("LRN:",
RightPosition, 360, RightAlignment) BodyFont, Brushes.Black,
LeftPosition, 660)
e.Graphics.DrawString(extractName
s(2), BodyFont, Brushes.Black, e.Graphics.DrawString("Strand:",
RightPosition, 390, RightAlignment) BodyFont, Brushes.Black,
LeftPosition, 690)
e.Graphics.DrawString(extractName e.Graphics.DrawString("Grade
s(3), BodyFont, Brushes.Black, and Section:", BodyFont,
RightPosition, 420, RightAlignment) Brushes.Black, LeftPosition, 720)
e.Graphics.DrawString(extractName
s(4), BodyFont, Brushes.Black, e.Graphics.DrawString(NameOfVote
RightPosition, 450, RightAlignment) r, BodyFont, Brushes.Black,
RightPosition, 630, RightAlignment)
e.Graphics.DrawString(extractName e.Graphics.DrawString(LRN,
s(5), BodyFont, Brushes.Black, BodyFont, Brushes.Black,
RightPosition, 480, RightAlignment) RightPosition, 660, RightAlignment)
e.Graphics.DrawString(Strand,
e.Graphics.DrawString(extractName BodyFont, Brushes.Black,
s(6), BodyFont, Brushes.Black, RightPosition, 690, RightAlignment)
RightPosition, 510, RightAlignment)
95
e.Graphics.DrawString(Grade &
" + " & Section, BodyFont,
Brushes.Black, RightPosition, 720, ElectionResultMaker.vb
RightAlignment)
Imports System.Data.OleDb
Imports System.Drawing.Printing
End Sub Imports
System.Runtime.InteropServices.Co
Private Function mTypes
DetermineMonth(number As String) Imports System.Text
Select Case number Imports
Case "01" System.Windows.Forms.VisualStyle
Return "January" s.VisualStyleElement.ToolTip
Case "02" Imports
Return "February" Microsoft.VisualBasic.Devices
Case "03"
Return "March" Public Class ElectionResultMaker
Case "04"
Return "April" Dim WithEvents ElectionResult As
Case "05" New PrintDocument
Return "May" Dim ElectionResultPreview As
Case "06" New PrintPreviewDialog
Return "June" Dim ElectionName As String
Case "07" Dim StartDate As String
Return "July" Dim EndDate As String
Case "08" Dim StartDateDisplay As String
Return "August" Dim EndDateDisplay As String
Case "09"
Return "September" Dim Candidate As ArrayList =
Case "10" New ArrayList()
Return "October"
Case "11" 'FONT
Return "November" Dim TitleFont As New Font("Arial",
Case "12" 18, FontStyle.Bold)
Return "December" Dim SubtitleFont As New
Case Else Font("Arial", 13, FontStyle.Underline)
Return "MonthName" Dim BodyFont As New
End Select Font("Arial", 11, FontStyle.Regular)
End Function Dim BodyFontB As New
End Class Font("Arial", 10, FontStyle.Bold)
96
'TEXT POSITION
Dim Width As Integer = Public Sub CreateElectionResult()
(ElectionResult.DefaultPageSettings.
PaperSize.Width) 'GET THE ELECTION DATA
Dim Height As Integer = sql = String.Format("SELECT *
(ElectionResult.DefaultPageSettings. FROM [Election] WHERE
PaperSize.Height) Ongoing=True")
Dim LeftPosition As Integer = 30 cmd = New
Dim CenterPosition As Integer = OleDbCommand(sql, cn)
ElectionResult.DefaultPageSettings. dr = cmd.ExecuteReader
PaperSize.Width / 2 If dr.Read Then
Dim RightPosition As Integer = ElectionName =
ElectionResult.DefaultPageSettings. dr("ElectionName")
PaperSize.Width - 40 Try
Dim LeftColumnPosition As StartDate =
Integer = LeftPosition dr("ElectionStart")
Dim CenterColumnPosition As StartDateDisplay =
Integer = Width / 3 + 25 StartDate.ToString.Split(" ")(0)
Dim RightColumnPosition As Dim datearray As String()
Integer = (Width * 2) / 3 + 10 = StartDate.ToString.Split(" ")
(0).Split("/")
'TEXT ALIGNMENT Dim month As String
Dim LeftAlignment As New month =
StringFormat DetermineMonth(datearray(1))
Dim RightAlignment As New StartDateDisplay = month
StringFormat & " " & datearray(1) & ", " &
Dim CenterAlignment As New datearray(2)
StringFormat Catch ex As Exception
StartDateDisplay = "N/A"
End Try
Public Sub New()
Try
EndDate =
ElectionResult.DefaultPageSettings. dr("ElectionEnd")
PaperSize = New Dim datearray As String()
PaperSize("Letter", 850, 1100) = EndDate.ToString.Split(" ")
(0).Split("/")
ElectionResultPreview.Document = Dim month As String
ElectionResult month =
DetermineMonth(datearray(1))
End Sub
97
EndDateDisplay = month & dr("C_Firstname") & " " &
" " & datearray(1) & ", " & dr("C_Lastname")
datearray(2) If
Catch ex As Exception candidate_fullname.Split("#")(1) =
EndDateDisplay = "Yet To "novote novote" Then
End" names.Add(dr("Vote")
End Try & "#" & "Did Not Vote")
Else
End If
names.Add(candidate_fullname)
'GET THE NAMES OF ALL End If
CANDIDATES
Dim positions As String() = { End While
"President", Candidate.Add(names)
"Vice President", End If
"Secretary",
"Treasurer", i=i+1
"Auditor", Next
"Public Information Officer",
"Peace Officer", For Each SubArrayList As
"Grade 12 Representative", ArrayList In Candidate
"Grade 11 Representative"} SubArrayList.Sort()
SubArrayList.Reverse()
Dim i As Integer = 0 Next
For Each position As String In
positions ' Set the alignment
LeftAlignment.Alignment =
Dim names As New StringAlignment.Near
ArrayList() RightAlignment.Alignment =
StringAlignment.Far
sql = String.Format("SELECT CenterAlignment.Alignment =
* FROM [Candidates] WHERE StringAlignment.Center
[C_Position]='{0}'", position)
cmd = New
OleDbCommand(sql, cn)
dr = cmd.ExecuteReader ElectionResultPreview.ShowDialog()
If dr.HasRows Then
While dr.Read() End Sub
Dim candidate_fullname
As String = dr("Vote") & "#" & Private Sub
ElectionResult_PrintPage(sender As
98
Object, e As PrintPageEventArgs)
Handles ElectionResult.PrintPage e.Graphics.DrawString("President",
BodyFontB, Brushes.Black,
Dim x As Integer = 50 LeftColumnPosition, x,
Dim y = x LeftAlignment)
Dim z = x e.Graphics.DrawString("Vice
Dim inc = 25 'Increment per line President", BodyFontB,
Brushes.Black,
'MsgBox(Width & " " & Height) CenterColumnPosition, x,
LeftAlignment)
e.Graphics.DrawRectangle(Pens.Bla
ck, 10, 10, 790, 1050) e.Graphics.DrawString("Secretary",
BodyFontB, Brushes.Black,
'e.Graphics.DrawRectangle(Pens.Blu RightColumnPosition, x,
e, 2, 2, 800, 1100) LeftAlignment)
e.Graphics.DrawString("Votes",
e.Graphics.DrawString("Official BodyFontB, Brushes.Black,
Election Results of " & vbCrLf & LeftColumnPosition + (Width / 3) -
ElectionName, TitleFont, 25, x, RightAlignment)
Brushes.Black, CenterPosition, x, e.Graphics.DrawString("Votes",
CenterAlignment) BodyFontB, Brushes.Black,
CenterColumnPosition + (Width / 3) -
e.Graphics.DrawString("Election 25, x, RightAlignment)
Start Date: " & vbCrLf & e.Graphics.DrawString("Votes",
StartDateDisplay, SubtitleFont, BodyFontB, Brushes.Black,
Brushes.Black, LeftPosition, x, RightPosition, x, RightAlignment)
LeftAlignment) x = x + inc - 10
DrawHorizontalColumnLine(e,
e.Graphics.DrawString("Election End x, "LCR")
Date: " & vbCrLf & EndDateDisplay, y=x
SubtitleFont, Brushes.Black, z=x
RightPosition, x, RightAlignment)
For Each name As String In
x = x + 75 Candidate(0)
99
")(0), BodyFont, Brushes.Black, DrawVeritcalColumnLine(e,
LeftColumnPosition + (Width / 3) - x, inc, "LCR")
25, x, RightAlignment) x = x + inc
DrawVeritcalColumnLine(e, Next
x, inc, "LCR") If x > z Then z = x
x = x + inc DrawHorizontalColumnLine(e,
Next z, "LCR")
If x > z Then z = x
x = z + inc
x=y
For Each name As String In ' Treasurer, Auditor, Public
Candidate(1) Information Officer
DrawHorizontalColumnLine(e,
e.Graphics.DrawString(name.Split("# x, "LCR")
")(1), BodyFont, Brushes.Black, DrawVeritcalColumnLine(e, x,
CenterColumnPosition, x, inc, "LCR")
LeftAlignment)
e.Graphics.DrawString("Treasurer",
e.Graphics.DrawString(name.Split("# BodyFontB, Brushes.Black,
")(0), BodyFont, Brushes.Black, LeftColumnPosition, x,
CenterColumnPosition + (Width / 3) - LeftAlignment)
25, x, RightAlignment)
DrawVeritcalColumnLine(e, e.Graphics.DrawString("Auditor",
x, inc, "LCR") BodyFontB, Brushes.Black,
x = x + inc CenterColumnPosition, x,
Next LeftAlignment)
If x > z Then z = x e.Graphics.DrawString("Public
Information Officer", BodyFontB,
x=y Brushes.Black,
For Each name As String In RightColumnPosition, x,
Candidate(2) LeftAlignment)
e.Graphics.DrawString("Votes",
e.Graphics.DrawString(name.Split("# BodyFontB, Brushes.Black,
")(1), BodyFont, Brushes.Black, LeftColumnPosition + (Width / 3) -
RightColumnPosition, x, 25, x, RightAlignment)
LeftAlignment) e.Graphics.DrawString("Votes",
BodyFontB, Brushes.Black,
e.Graphics.DrawString(name.Split("# CenterColumnPosition + (Width / 3) -
")(0), BodyFont, Brushes.Black, 25, x, RightAlignment)
RightPosition, x, RightAlignment)
100
e.Graphics.DrawString("Votes", DrawVeritcalColumnLine(e,
BodyFontB, Brushes.Black, x, inc, "LCR")
RightPosition, x, RightAlignment) x = x + inc
x = x + inc - 10 Next
DrawHorizontalColumnLine(e, If x > z Then z = x
x, "LCR")
y=x x=y
z=x For Each name As String In
x=x+5 Candidate(5)
101
CenterColumnPosition, x, If x > z Then z = x
LeftAlignment)
e.Graphics.DrawString("Gr.11 x=y
Representative", BodyFontB, For Each name As String In
Brushes.Black, Candidate(7)
RightColumnPosition, x,
LeftAlignment) e.Graphics.DrawString(name.Split("#
e.Graphics.DrawString("Votes", ")(1), BodyFont, Brushes.Black,
BodyFontB, Brushes.Black, CenterColumnPosition, x,
LeftColumnPosition + (Width / 3) - LeftAlignment)
25, x, RightAlignment)
e.Graphics.DrawString("Votes", e.Graphics.DrawString(name.Split("#
BodyFontB, Brushes.Black, ")(0), BodyFont, Brushes.Black,
CenterColumnPosition + (Width / 3) - CenterColumnPosition + (Width / 3) -
25, x, RightAlignment) 25, x, RightAlignment)
e.Graphics.DrawString("Votes", DrawVeritcalColumnLine(e,
BodyFontB, Brushes.Black, x, inc, "LCR")
RightPosition, x, RightAlignment) x = x + inc
x = x + inc - 10 Next
DrawHorizontalColumnLine(e, If x > z Then z = x
x, "LCR")
y=x x=y
z=x For Each name As String In
x=x+5 Candidate(8)
102
New Point(LeftColumnPosition, x),
Private Sub New Point(LeftColumnPosition, x +
DrawHorizontalColumnLine(e As y))
PrintPageEventArgs, x As Integer,
column As String) e.Graphics.DrawLine(Pens.Black,
New Point(LeftColumnPosition +
If column.Contains("L") Then (Width / 3) - 25, x), New
Point(LeftColumnPosition + (Width /
e.Graphics.DrawLine(Pens.Black, 3) - 25, x + y))
New Point(LeftColumnPosition, x), End If
New Point(LeftColumnPosition +
(Width / 3) - 25, x)) If column.Contains("C") Then
End If 'DRAW SECOND COLUMN
VERTICAL BORDER
If column.Contains("C") Then
e.Graphics.DrawLine(Pens.Black,
e.Graphics.DrawLine(Pens.Black, New Point(CenterColumnPosition,
New Point(CenterColumnPosition, x), New
x), New Point(CenterColumnPosition Point(CenterColumnPosition, x + y))
+ (Width / 3) - 25, x))
End If e.Graphics.DrawLine(Pens.Black,
New Point(CenterColumnPosition +
If column.Contains("R") Then (Width / 3) - 25, x), New
Point(CenterColumnPosition +
e.Graphics.DrawLine(Pens.Black, (Width / 3) - 25, x + y))
New Point(RightColumnPosition, x), End If
New Point(RightPosition, x))
End If If column.Contains("R") Then
'DRAW THIRD COLUMN
End Sub VERTICAL BORDER
103
End Sub
Private Structure ControlInfo
Private Function Public name As String
DetermineMonth(number As String) Public parentName As String
Select Case number Public leftOffsetPercent As
Case "01" Double
Return "January" Public topOffsetPercent As
Case "02" Double
Return "February" Public heightPercent As Double
Case "03" Public originalHeight As Integer
Return "March" Public originalWidth As Integer
Case "04" Public widthPercent As Double
Return "April" Public originalFontSize As
Case "05" Single
Return "May" End Structure
Case "06"
Return "June" Private ctrlDict As Dictionary(Of
Case "07" String, ControlInfo) = New
Return "July" Dictionary(Of String, ControlInfo)
Case "08"
Return "August" Public Sub FindAllControls(thisCtrl
Case "09" As Control)
Return "September"
Case "10" For Each ctl As Control In
Return "October" thisCtrl.Controls
Case "11" Try
Return "November" If Not IsNothing(ctl.Parent)
Case "12" Then
Return "December" Dim parentHeight =
Case Else ctl.Parent.Height
Return "MonthName" Dim parentWidth =
End Select ctl.Parent.Width
End Function
End Class Dim c As New
ControlInfo
c.name = ctl.Name
c.parentName =
Resizer.vb ctl.Parent.Name
c.topOffsetPercent =
Public Class Resizer Convert.ToDouble(ctl.Top) /
Convert.ToDouble(parentHeight)
104
c.leftOffsetPercent = Try
Convert.ToDouble(ctl.Left) / If Not IsNothing(ctl.Parent)
Convert.ToDouble(parentWidth) Then
c.heightPercent = Dim parentHeight =
Convert.ToDouble(ctl.Height) / ctl.Parent.Height
Convert.ToDouble(parentHeight) Dim parentWidth =
c.widthPercent = ctl.Parent.Width
Convert.ToDouble(ctl.Width) /
Convert.ToDouble(parentWidth) Dim c As New
c.originalFontSize = ControlInfo
ctl.Font.Size
c.originalHeight = Dim ret As Boolean =
ctl.Height False
c.originalWidth = Try
ctl.Width ret =
ctrlDict.Add(c.name, c) ctrlDict.TryGetValue(ctl.Name, c)
End If
If (ret) Then
Catch ex As Exception ctl.Width =
Debug.Print(ex.Message) Int(parentWidth * c.widthPercent)
End Try ctl.Height =
Int(parentHeight * c.heightPercent)
If ctl.Controls.Count > 0 Then
FindAllControls(ctl) ctl.Top =
End If Int(parentHeight *
c.topOffsetPercent)
Next ctl.Left =
Int(parentWidth * c.leftOffsetPercent)
End Sub
f = ctl.Font
Public Sub fontRatioW =
ResizeAllControls(thisCtrl As ctl.Width / c.originalWidth
Control) fontRatioH =
ctl.Height / c.originalHeight
Dim fontRatioW As Single fontRatio =
Dim fontRatioH As Single (fontRatioW +
Dim fontRatio As Single fontRatioH) / 2
Dim f As Font ctl.Font = New
Font(f.FontFamily,
For Each ctl As Control In c.originalFontSize *
thisCtrl.Controls fontRatio, f.Style)
105
End If
End If
Catch Next
End Try End Sub
End If
Catch ex As Exception End Class
End Try
106
I. User Manual
Table of Contents
Introduction
System Requirements
Contacting Support
Introduction
Welcome to the user manual for Voting System This document is intended to
provide you with all the information you need to get started with and use the
software effectively.
System Requirements
Before installing Voting system, please make sure your computer meets the
following requirements:
Processor: Intel or AMD processor with 64-bit support; Recommended: 2.8 GHz
or faster processor
RAM: 2 GB.
107
Figure 5: Login Page
The login page is where the user inputs his or her username and
108
Figure 6: Main Page
The main page shows where you can vote which candidate you want.
The account settings where you can change username and password.
109
Figure 8: Admin page
The admin page shows where you can create a new election or end election, edit
candidates, view the current vote, add user account and view archived users.
This is where you can name the election you will start.
110
Figure 10: Add candidate page
Add a candidate where you can add all the candidates and if it is president, vice
president etc.
Graph result shows all the current vote results of the election.
111
Figure 12: add account page
Voters can input their information and create a user account to access the
Contacting Support
If you need further assistance with Voting System, please contact our support
team at benok.loslos@gmail.com .
112
J. Researcher’s Profile
113
114
115
116
117
118
119