Documente Academic
Documente Profesional
Documente Cultură
CHAPTER I
THE PROBLEM AND ITS BACKGROUND
Introduction
local leagues, teams score two points for baskets made by players shooting from the
three-point arc and three points for baskets made from beyond the three-point arc. A
basket scored can count as one, two or three points, depending on your shooting
location. A free throw remains the only way to score outside of gameplay, as it occurs
after a whistle. Basketball rules determine when you will have an uncontested free
throw worth one point. The dimensions of the basketball court determine where a shot
must originate for it to count as three points. Scoring of these statistical references (such
as Field Goals, Fouls and Timeouts) is recorded in a specified score sheet. The
bookkeeper and the game statistician are tabulating this score sheet.
set of data, depending on the type of analysis performed. In the case of basketball
games, statistical analysis involve of how many Field Goals, Fouls, Timeouts, etc., that
each team had made in a period, a half-time, a game or a season. Basketball statistical
evaluation ranges from basic to advance, depending if the game is a local (such as
Scores and statistical analysis of the game are just two of the most important
elements of each sports events. Committing errors on performing these tasks will surely
ruin the credibility of the game and of the organization who organized the sports events.
1
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Most of the errors, if it is not human errors, are sole because of the manual system used
in gathering the scores and computing the statistics of the game. These errors vary from
Lucena City Sports Office is the organization focused on the recreational and
sports activities such as basketball leagues in the City of Lucena. Mr. Arnold R. Riego
professional basketball official as a referee since 1999, that is when the first Basketball
Governor‟s Cup in Quezon was held. The organization used the traditional pen-and-
paper system of recording scores and computing statistical evaluation of teams and
players. They use a modified score sheet designed for the annual inter-barangay
competitions. Two of these problems are: (1) the accuracy and reliability of the score
sheet. The official score sheet is more superior to the digital scoreboard. If the scorer is
not attentive on recording the scores or if the digital scoreboard does not match what the
records in the official score sheet, then the problem arises; and (2) they do not have a
permanent office for almost a year already and some of their records of the past inter-
barangay basketball games are missing. Thus, these problems will diminish the
The researchers‟ aim is to take the scoring and statistical evaluation of every
inter-barangay games to the higher level: organized, more efficient, quick, less error,
less time- and cost-consuming. It will also give the sports committee the statistical
computation in just a few clicks. The system will organize all the records in a secured
2
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
database, generates reports of every important stats of the game. Lucena City Sports
Office is looking for better ways to provide greater and higher quality basketball
Statistical Evaluation System for Lucena City Sports Office that will improve and
enhance the ability in giving faster and accurate recording of scores and computing of
1. What are the needs of Lucena City Sports Office in scoring and statistical
evaluation?
2. What is the most feasible (that is, best and possible) program to replace the
manual scoring and statistical evaluation system of Lucena City Sports Office in
terms of:
a. Scoring
c. Security of records
Scoring and Statistical Evaluation System for Lucena City Sports Office based on
a. Usability
3
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
b. Efficiency
c. Functionality
d. Reliability
Statistical Evaluation System that will improve the scoring and statistical evaluation of
1. To analyze the existing problems of the manual scoring and statistical evaluation
a. Scoring
c. Security of records
2. To develop the most viable program to replace the existing system of the Lucena
Evaluation System to Lucena City Sports Office based on ISO 9126 Software
a. Usability
b. Efficiency
c. Functionality
d. Reliability
4
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
allows the users to record the Field Goals and add other basketball stats such as Fouls
and Timeouts. Computations of the statistical evaluation of each team and players will
show automatically after all the inputs are filled up. The system provides an auto-
generated print of all records of score sheets and computed statistical of each team. The
system will also provide digital registration forms of every team, players, coaches and
officials who will be involved in every game. This will be stored electronically in the
database of the proposed system for future use. According to FIBA Official Basketball
Rules 2014, the registration of line-up players must be held at least 20 minutes before
the game begins and at least 10 minutes before the game, coaches must give the names
Furthermore, this study is limited to the Lucena City Sports Office and its staff
only. This is also limited to basketball scoring and statistical evaluating of each team
and their players per game and per season only of the inter-barangay basketball games
and in Senior and Junior division. Other features, such as running score-game clock
features, score sheet and digital scoreboard connection and higher stats (Assists,
The proposed system‟s Time Outs, Fouls and Scoring processes are based on
FIBA Official Basketball Rules 2014. Other rules that are not directly related to the
features of the proposed system are not or least considered by the researchers.
5
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Definition of Terms
The following terms are operationally defined terms for a better understanding
of the readers:
applied and diminishes time and cost spent on the task. This system includes a database
system.
Efficiency - this characteristic is concerned with the system resources used when
Free-Throw Shot – shooting the ball to the basket outside of gameplay, as it occurs
after a whistle.
Field Goal – a point earned when the ball shot on the basket on running time. Scores
depend on the location where he released the ball from his hand.
FIBA Official Basketball Rules 2014 – is the most recent international rules of
of the year.
Fouls - an infraction of the rules concerning illegal personal contact with an opponent
evaluation of software. The standard is divided into four parts which address,
6
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
respectively, the following subjects: quality model; external metrics; internal metrics;
Maintainability – is the ability to identify and fix a fault within a software component is
Manual System – is the use of pen and paper in performing a certain task.
Record – is the information stored in the system that is needed when they were making
reports.
Reliability – the capability of the system to maintain its service provision under defined
scrutinizing every data sample (such as Field Goals) in a set of items from which
Three-point Field Goals - score gain after shooting the basketball to the basket made
Two-point Field Goals – score gain after shooting the basketball to the basket within
7
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
CHAPTER II
REVIEW OF THE RELATED LITERATURE AND STUDIES
This part focuses on related literature and study in the foreign and local setting.
The researchers gathered information through the help of internet, books, dissertations
and other forms of the medium that are available on their surroundings.
From America to the Philippines, from Miami to Manila, computers are swiftly
becoming a part of the world of sports competition in the joy of triumph and the agony
of loss. Almost all sports official will say that computers are adding to the enjoyment of
both eyewitness and player alike. The use of these machines to score and time the
Technology is indeed growing as the researchers speak not only globally but
also locally; not only in the offices and industries but also in sports. Things that are
traditional are now being made virtually obsolete and replaced by digital ones,
Anyayahan (2011) wrote. The Philippines, with the influence of her neighbor countries,
are now adopting a new age: from manual systems of everything into computerized
systems. Examples of this, the National Automated Elections made the voting
mechanisms of the past years much faster and mass-broadcast and PBA‟s live streaming
8
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
activities managing system. Gardner (2013) wrote that innovation has made possible for
the operation of the computer easy enough in processing record systems such as the
creation of data records, storing, filing, and retrieval of data. Basketball scoring
processes in the same way: scores made by players is gestured by the referee and the
score booker will record it to the scorebook. The score will also display to the digital
committee is to keep each team‟s score data secured for their records and purposes.
resulting in college and pro football predictions. Basketball predictions have also been
premeditated. This system requires only past scores and opponents and precedes
directly from classical least squares, no learning of algorithm factors being required.
Accuracy is highly viable with all calculations to which evaluations have been made.
Because the automated scheme has become essential to small and big
organizations, they are expected to give the best services possible. Nevertheless, some
still prefer sticking with the system that is not integrated with technology. Probable
causes are computer illiterate staff and lack of funds. Companies, especially the big
ones are recommended to switch from manual to automated systems because this will
9
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
improve the efficiency and productivity of the business which will uplift the industry‟s
system in which information technology plays a main part. It makes the works easier,
The rudimentary gains of the automated system are to make the course
proficient and fast which means they can process information much more swiftly than
humans (Navales, 2015). Scoring in basketball and its statistical evaluation done in a
manual way cannot compete globally because it consumes much time and much effort
and cost are used to maintain and store the data. The recovery of data is very sluggish
that it has to be sought in heaps of registers and these waste lots of time. In the current
system, scorebooks are logged manually that causes records to be not always
dependable as it is handwritten and some human errors might have happened. Most
records are saved and kept in filing cabinets and this consumes a lot of space.
makes every game more amusing and electronically prophesies the result of the
upcoming games. Virtually everyone, wrote Stefani (2010), has attempted to predict the
that automated sports ratings, such as basketball, football and alike, predate both high-
commentators, there is no boundary for error, Advincula (2011) wrote in her blog.
10
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
who gilts 4,657th in a marathon of 7,000, let only how distant in advance of the next
runner this individual is. A computer can. The sharpest arithmetician cannot promptly
can. The most trustworthy statistician cannot immediately output a statistical evaluation
of 12 to 30 basketball players who roam the court in just a jiffy. A computer can. A
thousand cabinets full of scorebooks of the past games and leagues cannot fit in the
Synthesis
Thus, the researchers gave the significance of the studying the related literature
to be able to justify the relevance, validity, and feasibility of the reviewed studies. The
researchers had managed to adopt some goals of related literature for the development
of the Computer-based Basketball Scoring and Statistical Evaluation System for Lucena
The literature stated above shows that a computerized scoring and statistical
sports. Lucena City Sports Office will be able to modernize as well as to improve their
literature stated above namely discussed the similarities and differences for the study of
the researchers‟ proposed system. The review of related literature serves as evidence
that a proposed system is an effective tool in a better way of managing the different
activities that are connected in recording, scoring and computing statistical evaluation
of basketball games.
11
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
(FIBA) nowadays are not just pure ball shootings and dribbles but also an incredible
show off technology. These ranges from superb and high-definition live streaming of
Zigbee (Barroquillo et. al., 2012), made by the students of Mapua Institute of
wireless Private Area Network (PAN). It is created for radio-frequency purposes that
need little data speed, extended battery life shelves, and locked networking. A
scoreboard is a big panel that holds connected facts on a specific game such as
basketball. It customarily shows the existing scores and time of a sport. Cords and
cables to its rheostat typically link scoreboards but with their scheme, the necessity for
cables is removed. They built a model scoreboard and formed a system with C# that
computer for the comfort of usage. The computer shows the records through a
transceiver and obtained by the scoreboard recipient. There are insignificant intervals
that will not be seen by a person, the limit of the signal scopes up to 100 meters, and is
not hindered by obstacles. The model can be operated on street or barangay association
12
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
basketball competitions. The system is encoded for basketball but with a minor
NRF24L01 (Chua & Maranan, 2013) proves that sports and computer technology's
development fit in time in the competition, the existence of electronic timer with LED
display impacts the basketball competition. The tapped operation affects the mechanism
unit (MCU) and wireless nRF24L01 unit to recompense for the present difficulties,
which has LED digital cylinder of huge dimension for the section digit show and
medium dimensions for game display and 24s display. The operator is tranquil to
convey and manage the clock wirelessly at whichever location on the basketball court
by means of directing mechanism device. The assessment outcomes display that the
wireless data.
The design of Timing and Score Device for Basketball Competitions (Carlos, et.
ZLG7289B peripheral display handling chip and with seven- part digital cylinder
organized with LED dot matrix to display the clock and score of the competitions. The
scheme can display the existing segment, the remaining time and the score, concurring
13
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The Control System in Basketball Scoreboard built in 89C51 SCM (Navarro, et.
main control unit, to 16 × 16 dot matrix LED display unit for the scoreboard of the
storage, display, and simulation managing cycle. The scheme can be disconnected and
nonstop lasting process, is modest in structure, low price at the same moment can
display a limitless increase of the size, this is additional identical level products is
unparalleled.
means of 89C51, the program not only has the capability that the entire period is fixed
via software and the entire countdown is attained, and concurring to the guidelines,
offensive team had better create a shooting action in 24 seconds, else be considered as
illegal, so a 24 second countdown scheme is desired, nonetheless also the scores of two
sides are documented on the scoreboard. The clock button process and LED display are
operated in this scheme. The part of the software is modified and repaired. In the end,
software and hardware are joint well. The modular scheme, straightforward procedure
edifice, strong command and easy to organize, repair and alter are utilized.
Williamson (2012) published a system which used such factors as the hardness
of schedule, gameness, and a "guts" factor combined by calculus and least squares. An
intricate filing system implemented by a clerical staff and mini computers allowed him
14
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
to rate 400 college teams. This study tries to measure basketball players‟ strength and
weaknesses on the court in a computerized way – faster, less error and informative.
computer-aided high school football and basketball ratings for the Nashville Banner,
resulting in a state championship trophy. His study and the outcome support that
carried by more than 20 teams. The factors were generated by trial and error using
several hundred past game results. Compusport claims 75 percent accuracy in college
football, 71-72 percent accuracy in pro-football, and 55-58 percent correctness against
the point spread. Such system increased the every team‟s competitiveness.
association Administrator application are both unified with the R2sports status
software and create it stress-free for recording game outcomes to recalculate the
standings after every event. Afterward, the Administrator has registered all game
outcomes they click the last link to conduct results to the ranking software. The sports
association ranking system has shifter selections that permit handlers to narrow
standing searches down by a particular extent or age group. You can also examine for a
competitor's name to get their bout account. Players are recorded with the maximum
ranked one in the search showing first, and then it carries on recording players by
standing spot. After an event acquiesces for outcomes and a competitor's spot in the
15
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
standing software has altered, the standing order also alters spontaneously on the
standings sheet on the website and bout history is enhanced to their sketch.
published by downloadroute (2012) was created to permit the user to input statistics for
basketball competitions publically. The scheme permits for access of attempt position,
fouls, assists, steals, blocked shots, time out info and others. News present is shooting
one hundredth free throws, field goals and three-point shots for every player on
folder can be joined with packed competition archives for numerous competition bout.
Pictures can be kept and showed alongside with competitor sketches. This system
contains clear graphs that display where all players made and missed shots. This
shareware platform was aimed to handle regeneration group running clock playoffs or
playoffs played in pro setups. Operate quarters or halves - Change of shot hues to select
from - Display competition bouts by quarters, halves or for finalized playoffs. Furnish
statistics to your preferred player to display how their performance is moving ahead.
Synthesis
The studies mentioned above, however, are to some extent related to the
researchers‟ study. Fundamentally, these studies will aid to build a new form of
managing the scoring system and statistical evaluation for basketball, which eliminates
the manual work of computing and analyzing data. The researchers‟ study gave
16
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
importance on studying some relative literature and studies to be able to justify the
relevance and feasibility of the proposed system. These studies help the researchers
understand the topic better because it clarifies vague points about the problems arising
during the development of the study. It also guides the researchers in making
comparisons between their findings with findings of other similar studies. Therefore, it
The system helps the officials to record and analyze easily the data. It stated
fingertip. The researchers collected data and information come from the related local
and foreign studies that helped the proponent in conceptualizing and visualizing the
The literature and studies mention previously have similarities with the
developed system they have similarities in terms of goals and objectives that they
wanted to attain and to achieve, for better work of the staffs and officials. The related
literature and studies would serve as a proof that the developed system is yet effective
as its implementation.
This proves that the developed system will be an as effective tool in providing
17
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
CHAPTER III
RESEARCH METHODOLOGY
This chapter presents the methods used by the researchers in conducting the
study. It involved the research design of the said study, the sampling technique used,
the locale and instrumentation utilized, as well as brief discussion of the statistical
The researchers used the descriptive and developmental research with the
observations, surveys, and interviews for the development of the said system. This type
of research may be used to reveal summary statistics by showing all respondents to all
possible questionnaire items. This method was employed because this type of research
method can be useful for the collection of data on phenomena that cannot be directly
(SDLC) since it has the inability to handle programs with complex needs.
System Planning
This is the first phase of the SDLC. The researchers looked for a client for
whom the system will be a help in specific tasks of their organization. The client
allowed the researchers to conduct studies about their existing system. This is when the
researchers decided a title for the study. After the title has been decided, the researchers
asked for the organization‟s permission and approval for the participation of the
18
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
researchers. After the title has been approved, the researchers found some related
studies and literature for the feasibility, using books, the Internet, and other theses. The
researchers observed that the organization has a problem in the manual system that is
used for the operation of the organization. This includes how they record manually the
score of each team using tally score sheet, which is printed on paper, and pencil,
evaluating the each statistical of the team and each player and how they keep the
records about the activity that they made. After the researchers analyzed the problem of
the company, the researchers planned a system and objectives of the study that will help
the organization.
conducted an interview with the people in charged in that organization. After the
interview and observation, the researchers found out that the association needs an
efficient, reliable, and inexpensive system that can help to the officials and staffs to
To make the study more accurate and reliable, the researchers conducted a
survey in the organization. The researchers also used browse the Internet and some
libraries to gather more information. The researchers used the descriptive method to
The researchers identified the requirements in organizing all the data and
information needed to achieve the goals needed by the client. After analyzing the
problems and difficulties that the organization encountered, the scope and constraints
have been planned. The objectives of the study have been reviewed and finalized.
19
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The researchers then designed a program that will solve the Office‟s problems
using Microsoft Visual Studios‟ Visual C# as the platform and SQLite for the database.
Basketball Rules of 2014. The program underwent consistent consultation with the
client as well with the researcher‟s adviser. The developed system was pre-tested by the
client and made finalized. Then, the program was presented to the client after it was
finalized.
System Analysis
This is the second phase of the SDLC. System analysis phase‟s purpose is to
understand the office requirements and build a logical model of the system. This
includes the process of studying the procedure to identify the researchers‟ purposes and
the use of identifying problems and also recommend feasible suggestions for improving
the system function. The result of this process is a logical design of a system.
The existing system that the Lucena City Sports Office is manual, especially in
terms of record management, scoring and statistical analysis that did not meet the needs
of continuous changes brought by the innovation of the new technologies that caused
the poor processing of the said activities. The Registration Staff encodes the details
about the players and teams manually in the paper. They manually record the score in
20
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
the score sheets that are provided by the by the Registration Staff. The Book Scorer
records all Field Goals, Fouls and Timeouts each team made all throughout the game.
After the activity was done, they keep all the records in the cabinet. Nevertheless,
because they do not have a permanent office to keep a cabinet for record keeping, they
Figure 3.1 shows the existing system‟s data flow diagram of scoring and
record/encodes, calculates, analyze the scores and statistics of each team and player
21
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The Registration Staff records the information about the teams and players and
keeps it. He/she will prepare the official score sheet based on his/her information
gathered. When the game has started, as each team trying their best to earn points, the
Book Scorer records the stats in the score sheet manually. When the activity has done
Figure 3.2 illustrates the entity relationship of the current scoring and statistical
evaluation system of Lucena City Sports Office has a many-to-many relationship. This
shows that the officials are the one in charge of the process of the scoring and
22
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Figure 3.3 shows the current process of the existing system Lucena City Sports
Office with more on the manual process. The officials are the one who accesses and
23
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The existing system manages the encoding, recording and evaluating the
statistical standards of each team and player. Since they are doing it manually, there are
times that they commit errors in encoding scores. In addition, keeping the records in a
cabinet is prone to be lost and may be damaged by disaster and paper-infesting pest.
Manual operation only uses the traditional operations, which usually lead to
consumption of too much time, sometimes they commit errors in encoding and
Comparing the two systems, the existing system is less expensive than the
proposed system about equipment and materials because it just uses ordinary score
sheets, pencil, and calculator, while the proposed system is more expensive because this
needs a computer system and printer. On the other hand, a little more expensive as it is,
the proposed system had the great advantage over the existing system because in the
long run the association will save time and money since the cost of labor for recording
will be minimized and eliminated plus an added features that are very much
24
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
In understanding the existing system, the researchers analyze the process and the
flow of the existing basketball scoring and statistical system of the organization.
the people involved in Lucena City Sports Office. The respondents consist of the City
This study‟s interviews all ten (10) officials of the organization that gave proofs
that the organization was truly having problems with the existing system and the
proposed system was feasible for Lucena City Sports Office in terms of scoring and
statistical evaluation of the players. The researchers used a cluster sampling method.
The data gathered by the researchers were analyzed, computed, and presented in tabular
form. The researchers used statistical treatment in data analysis is the Weighted Mean
Weighted Mean =
Where: ∑ = summation
w = weight
25
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. The system functions as the way 0 2 6
2 2 Disagree
it must. (6) (12)
2. The system design/interface is
1 3 5
user-friendly and guides the user 1 2.4 Disagree
(4) (9) (10)
throughout software operation.
3. The system is easy to understand
2 6
as it was explained to the staffs 0 2 2.2 Disagree
(8) (12)
of Lucena City Sports Office
4. The system can be navigated 8
0 0 2 1.8 Disagree
easily without much effort. (16)
5. The system can be used even if
1 1 5
the users do not have technical 3 2 Disagree
(4) (3) (10)
proficiency.
Grand Weighted Mean 2.6 Disagree
Table 3.1 shows the result from the respondents based on what they experienced
in terms of usability of the existing system. The respondents assessed that the existing
26
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
Table 3.2 shows the results of the respondents based on what they experienced
in terms of efficiency of the existing system. The respondents assessed that the existing
system with a Grand Weighted Mean of 1.84 which is interpreted as a Strongly Disagree.
27
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. The system prevents
2 5 Strongly
unauthorized users to utilize the 0 3 1.9
(6) (10) Disagree
system
2. The system records correct scores 1 4 Strongly
0 5 1.7
and other stats. (4) (8) Disagree
Table 3.3 shows the results of the respondents based on what they experienced
in terms of functionality of the existing system. The respondents assessed that the
existing system with a Grand Weighted Mean of 1.8 which is interpreted as a Strongly
28
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. All records are included in the
1 3 3
system and serve as a reliable 3 2.2 Disagree
(4) (9) (6)
source of information.
2. The system provides a reliable 2 6 Strongly
0 1 1.9
way of securing records. (6) (12) Disagree
3. The system has the ability to
withstand (fault tolerance) from 2 2 4
2 2.4 Disagree
the component, or environmental (8) (6) (8)
failure.
4. The system is able to recover a 1 3 3
3 2.2 Disagree
failed operation. (4) (9) (6)
5. The system provides consistent
1 2 3
and trustworthy behavior and 4 2.0 Disagree
(4) (6) (6)
processes.
Grand Weighted Mean 2.68 Disagree
Table 3.4 shows the results of the respondents based on what they experienced
in terms of reliability of the existing system. The respondents assessed that the existing
Evaluation System for Lucena City Sports Office was developed to improve the
29
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
This part of the chapter shows the clear presentation of the proposed system for
the Lucena City Sports Office in terms of operations of their association particularly
scoring and evaluating the statistical standards of each team and player.
The proposed system is easy to operate and very useful. The system operation
will also be more manageable and detailed. It is also inexpensive compared to the
existing system because they do not need to hire a game statistician anymore. The
proposed system will automatically generate statistical evaluations after the user input
Lucena City Sports Office like computer unit, which is essential for the implementation
of the developed system. By means of this proposed system, the monitoring of the
records and data will not cost much since facilities are available in the organization.
Through the proposed system, the office will be more consistent service using modern
technologies.
30
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Figure 3.5 shows the proposed system data flow diagram of scoring and
statistical evaluation system in computerized form. The diagram shows how the
The officials record the details about the players and team, second when the
game has started each team trying their best to earn points and the officials record the
scores in the computerized score sheet, and the system is the one who evaluates and
calculates the result. The system allows the user to view and print the reports.
31
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Figure 3.6 shows the one-to-many and many-to-one relationships of the system.
It means that the owner entity is connected to many entities which are a menu, home
The official has a many-to-one relationship to the login. The login has a one-to-
32
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
In the proposed system, the officials are the one who operates the system. They
record first the details about the players. Once, the game has started the records the
points of each team, while the other officials calculate and evaluate the statistical
standings of the players and team. Then once the activity is done, they can easily print
33
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Evaluation System for Lucena City Sports Office would be a very effective method for
all the activities and also procedures will be systemized to the Office by just adding all
reliability and record management it allows each activity in association to become easy
to all.
adoption of the improved automated system of the Office. The use of a computer is
popular in different ways and may provide greater benefits. To be able to control all the
activities, the system needs to be connected to the databases for the collected data.
Economically, since it uses minimal requirements, the Office can use the system
as long as they have the specific operating system and the peripherals needed to use the
system. Lucena City Sports Office can install it on the desktop computers or even
laptops as long as they meet the desired and required requirements to work the system.
34
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
researchers provided a framework for the evaluation that would be ISO 9126 Software
functionality, and reliability. ISO 9126 Software Quality Characteristics is the software
(ISO). It provides the definition of the characteristics and evaluating the quality
The researchers conducted a survey using a cluster sampling. Their ten (10)
respondents, who are the officials of the Lucena City Sports Office, participate
willingly. The data gathered by the researchers were analyzed, computed, and presented
in tabular form.
35
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. The system functions as the way 10
0 0 0 4 Strongly Agree
it must. (40)
2. The system design/interface is
9 1
user-friendly and guides the user 0 0 3.9 Strongly Agree
(36) (3)
throughout software operation.
3. The system is easy to understand
9 1
as it was explained to the staffs 0 0 3.9 Strongly Agree
(36) (3)
of Lucena City Sports Office.
4. The system can be navigated 8 2
0 0 3.8 Strongly Agree
easily without much effort. (32) (6)
5. The system can be used even if
8 2
the users do not have technical 0 0 3.8 Strongly Agree
(32) (6)
proficiency.
Strongly
Grand Weighted Mean 3.88
Agree
Table 3.5 shows the respondents assessed that the proposed system with a Grand
36
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. The system saves time and 9 1
0 0 3.9 Strongly Agree
money. (36) (3)
2. The system has the fastest 10
0 0 0 4 Strongly Agree
ways of locating records. (40)
3. The scoring and statistical
9 1
evaluation functionality of 0 0 3.9 Strongly Agree
(36) (3)
the system process efficiently
4. The system responds quickly. 10
0 0 0 4 Strongly Agree
(40)
5. The system operates in real 10
0 0 0 4 Strongly Agree
time. (40)
Strongly
Grand Weighted Mean 3.96 Agree
Table 3.6 shows the respondents assessed that the proposed system with a Grand
37
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. The system prevents
10
unauthorized users to utilize 0 0 0 4 Strongly Agree
(40)
the system
2. The system records correct 10
0 0 0 4 Strongly Agree
scores and other stats. (40)
3. The system produces 10
0 0 0 4 Strongly Agree
accurate statistical result. (40)
4. The system can secure data 10
0 0 0 4 Strongly Agree
and information. (40)
5. The system can print the 9 1
0 0 3.9 Strongly Agree
records correctly. (36) (3)
Strongly
Grand Weighted Mean 3.98 Agree
Table 3.7 shows the respondents assessed that the proposed system with a Grand
38
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SA A D SD
Statement (4) (3) (2) (1) Mean Evaluation
1. All records are included in
the system and serve as a 8 2
0 0 3.8 Strongly Agree
reliable source of (32) (6)
information.
2. The system provides a
7 3
reliable way of securing 0 0 3.7 Strongly Agree
(28) (99)
records.
3. The system has the ability to
withstand (fault tolerance) 9 1
0 0 3.9 Strongly Agree
from the component, or (36) (3)
environmental failure.
4. The system is able to recover 7 3
0 0 3.7 Strongly Agree
a failed operation. (28) (99)
5. The system provides
10
consistent and trustworthy 0 0 0 4 Strongly Agree
(40)
behavior and processes.
Strongly
Grand Weighted Mean 3.82 Agree
Table 3.8 shows the respondents assessed that the proposed system with a Grand
System Design
The researchers have made the system analysis and system planning. The
design of the system is to create and manage the process of the scoring and evaluating
the statistical standards of each player and team and to record files electronically in a
database.
39
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The researchers used the C# as the programming language for the system and
coding while SQLite for its database of the user. They used Microsoft Word for the
On the other hand, SQLite is a unified visual tool for database architects,
Administration tools for server configuration, user Administration, backups and much
more.
released in 1983 under the name Multi-tool Word for Xenix system. Commercial
Word are Microsoft Word Viewer and Office Online, both of which have limited
features.
40
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
CHAPTER IV
ANALYSIS AND DISCUSSION
A. Current Situation
recording scores and computing statistical evaluation of teams and players. They use a
modified score sheet designed for the annual inter-barangay basketball league of
Lucena City.
competitions. Two of these problems are: (1) the accuracy and reliability of the score
sheet. The official score sheet is more superior to the digital scoreboard. If the scorer is
not attentive on recording the scores or if the digital scoreboard does not match what the
records in the official score sheet, then the problem arises; and (2) they do not have a
permanent office for almost a year already and some of their records of the past inter-
barangay basketball games are missing. Thus, these problems will diminish the
The researchers‟ aim is to take the scoring and statistical evaluation of every
inter-barangay games to the higher level: organized, more efficient, quick, less error,
less time- and cost-consuming. It will also give the sports committee the statistical
computation in just a few clicks. The system will organize all the records in a secured
Lucena City Sports Office is looking for better ways to provide greater and
41
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
B. System Output
Under this part of this chapeter is the screenshots of the interface of the
proposed system.
Screen Number: 1
Screen Title: Login Form of the Computerized Basketball Scoring and Statistical
System
the user logged in as an Administrator, he/she will be able to manage the Registration,
Game Logs, Game Report and Users tabs. On the other hand, if the user logged in as
Staff, he/she will be able to use the Game, Officials, and Game Report tabs. If wrong
42
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
username or password is entered, the system will display an error message. (For the
Screen Number: 2
Screen Title: Team Registration Form of the Computerized Basketball Scoring and
Statistical System
Narrative Overview: Once the user logged in as an Administrator, he/she will be able
to register basketball teams. The Administrator will provide the Team Name, Division
(either Junior or Senior), the name of their Coach and Assistant Coach. The
Administrator will also be able to add, edit and delete the said information. (For the
43
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 3
Statistical System
Narrative Overview: The Administrator will also be able to input Players‟ information
such as Last Name, First Name, Middle Name, Age, Division (either Junior or Senior),
their respective Team, and their Jersey Number. The Administrator will also be able to
add, edit and delete the said inputted data. (For the codes, see page 127.)
44
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 4
Screen Title: Officials Game Logs of the Computerized Basketball Scoring and
Statistical System
Narrative Overview: This is the Officials Game Logs in which all the game officials
inputted by the Staff and only can be seen and manipulated by the Administrator. The
records contain the names of City Sports Coordinator, Board Scorer, Computer Scorer,
Timer, Announcer, Twenty-four Clock Operator, and Utility in every Game. (For the
45
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 5
Screen Title: Team Game Logs of the Computerized Basketball Scoring and Statistical
System
Narrative Overview: This is the Team Game Logs of the proposed system. In this
window, the Administrator will be able to see the Teams‟ Information as well as their
recent Games. Team Information includes their Division, name of their Coach and
Assistant Coach, their Wins and Loses. (For the codes, see page 140.)
46
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 6
Screen Title: Players Game Logs of the Computerized Basketball Scoring and
Statistical System
Narrative Overview: The Administrator will also be able to see the Players Game
Logs in which he/she will be able to see the Player‟s information and their recent
Games. Player Information includes Player‟s name, their respective Team, Division,
Jersey Number, and Season. (For the codes, see page 143.)
47
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 7
Screen Title: User Registration Form of the Computerized Basketball Scoring and
Statistical System
Narrative Overview: The Administrator will also be able to register other users.
He/she will be able to add another Administrator or input another Staff. (For the codes,
48
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 8
Screen Title: Officials Input Form of the Computerized Basketball Scoring and
Statistical System
Narrative Overview: On the other hand, if the user logged in as a Staff, he/she will be
able to input Officials‟ name before he/she will be able to go to the Scoresheet form.
The Staff must input the name of the City Sports Coordinator, Board Scorer, Computer
Scorer, Timer, and Announcer, 24-Clock Operator, Utility, Head Technical, Referee,
49
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 9
Screen Title: Score sheet Form of the Computerized Basketball Scoring and Statistical
System
Narrative Overview: This shows the official score sheet of the proposed system. The
Staff must first choose the Division, either Junior or Senior. (For the codes, see page
166.)
50
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 10
Narrative Overview: The staff must then choose the scheduled teams to play that day.
The Scoresheet is divided into two panels for each team. After choosing the two teams
he/she must click the Lock buttons of both teams to activate the entire Scoresheet.
Name of the players for each team will automatically appear after each panel is locked.
Each panel has two tabs: Score and Foul. Score tabs are where the Staff will be able to
add, edit and delete Field Goals of the players while the Foul tabs are where the Staff
will be able to record the fouls of the players throughout the game. The total score of
each team will be displayed to each respective panel. Time outs are also in the Staff‟s
control. He/she will only be able to use two Timeouts each Team in the First Half, 3 in
51
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
the Second Half and 1 in every Extra Period; otherwise, an error message will display.
After a Period is ended, the Staff must click the next Period. If the Game ends, the Staff
must press the End Game button to save information in the Scoresheet. (For the codes,
Screen Number: 11
Narrative Overview: The user must enter the Game Number of the game he/she
52
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 12
Narrative Overview: This shows the statistical summary of the game that is ready-to-
print and saved in the database. (For the codes, see pages 149 and 294.)
53
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Screen Number: 13
Narrative Overview: The user, after he/she use the system, should click the Logout in
the Menu. This screen shows the Logout confirmation message. (For the codes, see
page 139.)
54
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Login/Register. The Game Official must log in to the system to have an access to it. If
he/she does not have an account yet, it means he/she is not yet registered. Then, he/she
must ask the registered Computer Scorer to add an account for him/her.
Encode data/scores. Computer Scorer must input the details of the teams, players, and
Add, Edit, and Delete Records. Computer Scorer can add, edit, and delete records.
Print reports. Computer Scorer can print and view the reports.
Log out. Computer Scorer must always close the system after use.
55
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
56
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Figure 4.1 shows the one-to-one and one-to-many relationships of the database
This table shows the field names, data types and description of the tbl_users. It
contains the No_ID, User type, Username and Password of the users to access the
system.
57
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Table 4.2 above shows the tbl_gameofficials of the proposed system. It contains
the No_ID, Game number, Date of Game, and the names of the Basketball officials.
58
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Table 4.3 shows the field names, data types, and description of the
different function.
59
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Table 4.4 shows the field names, data types and description of tbl_playersgame
of the proposed system. This contains No_ID, Date of Game, Game Number, Name of
Teams, Division, Last, First, and Middle Initial of players, Jersey Number, In-or-out
status of the player, First, Second, Third, Fourth, and Overtime Period scores, and Team
Fouls.
60
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
61
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Table 4.6 shows the tbl_playersinfo of the proposed system. This contains
No_ID, Last, First, and Middle Initial, Age, Team, Division and Jersey Number of
players.
62
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Table 4.7 shows the tbl_teamsgame of the proposed system. This contains
63
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
64
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Table 4.9 shows the tbl_teamsgame. This table contains information about
teams, which are No_ID, Team_Name, Division, Coach, Assistant_Coach, Win, and
Lose.
System Implementation
organization. Then the researchers will introduce it to the officials and staffs followed
by giving the demonstration on how to use it. This system will be implemented through
the availability of the computer in the association. Testing of the system is needed for
the researchers to identify if there are still some errors and design to be improved.
The system shall be implemented to prove that it will be beneficial and can solve
all the problems that may be encountered. This will also be done to test the accuracy of
the proposed system and to determine if it will meet all the expectations that will
65
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
improve the existing system of the organization. This will also be done to check for
errors of the proposed system so that possible solution may be did too.
Based on the flow chart, the system can be implemented. The researchers
ensure that the codes of each form are correction order for the system to run properly to
This diagram also depicts the implementation process of the researchers of the
proposed system. The researchers prepared the location and hardware for the
installation of the system. The user of the system must be aware of the system so the
researchers provide a user‟s manual. Once the user is knowledgeable enough, the
66
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Basketball Scoring and Statistical Evaluation System for Lucena City Sports Office”.
Hardware Description
Memory 2.30 GHz
RAM 2.0 GB (minimum); 4.0 GB (suggested)
HDD 500 GB
Software Description
Operating System Windows XP or higher
Before the system is finally done, there is still a need for software evaluation
and testing of the system to make sure that the system to be installed in the
establishment is precise so that the organization will never encounter a code error
during the implementation of the system. The researchers used static testing at first
wherein the researchers gives a walkthrough, inspection and review, then dynamic
method wherein the codes are executed to see the result of the system coding. During
the testing of the system, the researchers encountered debugs regarding the code and the
connection established between the user of the database. The researchers handled the
problems through re-building of the connection and debugging some code errors.
In evaluating the system, the proponent used ISO 9126 as the quality standard
for the software. The fundamental objective of this standard is to address some of the
well-known human preferences that can adversely affect the delivery and perception of
67
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
“black box”. The selection of test cases for functional testing is based on the
requirement or design specification of the software entity under test. Functional testing
error in a software) can often be found before they cause trouble. We can shortly define
this method as testing software with the knowledge of the internal structure and coding
inside the program. White box testing is also called white-box analysis, clear box
testing or clear box analysis. It is a strategy for software debugging (it is the process of
locating and fixing bugs in computer program code or the engineering of a hardware
device) in which the tester has excellent knowledge of how the program components
interact.
The researchers, to see if there are errors during the run time of the system, did
the trial and error testing. Through this, the researchers will see if there would be some
recording scores, it only takes few efforts and time to operate by just using it. In
managing record, it takes one click to add data and it will easily be identified by the
system.
68
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
System Installation
The proposed system is to be set up for use. The system was tested and
evaluated to be able to find out the errors of the proposed system so that the system will
be further augmented. Lucena City Sports Office will adopt the proposed system and
The researchers will use the direct scheme because they will replace the current
system, which is the manual scoring system, for Lucena City Sports Office. The
After all the process that the researchers have done, the Computer-based
Basketball Scoring and Statistical Evaluation System for Lucena City Sports Office is
now ready to be used by the organization are available to be used by the staffs and
officials.
The system operation and support involve the installation, evaluation, and
testing of the system after the implementation. When the system has been approved and
used by the organization, it will be evaluated if there is a user‟s manual provided by the
researchers for those who will use the system. The researchers will provide a backup
system in case of an unexpected problem that may occur or when the installation
69
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
In order to support the system, the researchers will conduct training and provide
training manuals for those who will use the proposed system. The researchers may also
manage the maintenance and support of the proposed system if in case the organization
User’s Training
Upon implementing the system, the researchers will have an orientation about
the system and about the flow of the system so the users can really understand the
system. After the training, the future users or the staffs of the organization will be
70
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
CHAPTER V
SUMMARY, CONCLUSION, AND RECOMMENDATION
This chapter covers the summary, conclusion, and recommendation made by the
Summary
and Statistical Evaluation System for Lucena City Sports Office. The researchers found
out the status of the existing system used by the Lucena City Sports Office in terms of
scoring, statistical evaluation of the players and teams, and security of records.
Evaluation System is to manage the records and information of players and teams, as
well as to provide an easy way of locating or access of the information of every inter-
barangay basketball games, to have fast and easy way of recording stats (such as Field
Goals, Fouls, and Timeouts) and to have centralized database storage for all the
The researchers used the descriptive and developmental research with the
System to the existing manual process use by the Lucena City Sports Office. By using
this method, the researchers expected to construct significance of the proposed system.
Lucena City Sports Office were created to answer the problems encountered by the
71
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
organization. The proposed system emphasized the more secured score sheets,
immediate process of releasing of the reports and retrieving records of every inter-
barangay basketball games. The system provided the system that is accurate, effective,
security, reliable, and user-friendly for the office, coaches, and players.
Conclusion
1. The manual system is used by the Lucena City Sports Office was analyzed in
terms of scoring, statistical evaluation of the players and teams, and security of
records. They found out that the existing system‟s records may not be easily
located and could have a risk of lost or misplaced of the records and the scoring
and statistical evaluation system is not in line with the latest technology
available;
2. After the completion of the proposed system, the researchers concluded that
Evaluation System for Lucena City Sports Office” would provide an easier
process of scoring and providing statistical reports. The system being developed
by the researchers provides an easy way of creating and accessing of the data yet
in a secured manner. The records are made secured since the collected data of
the players and teams are in a centralized database system. The proposed system
solved the problem in scoring and storing the records. Furthermore, the system
will ease the evaluating statistics of every player and searching past games‟
72
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
3. The proposed system is assessed based on the ISO 9126 Software Quality
it is easy to use and easy to learn. It is also efficient because it saves time and
cost in doing the tasks. The proposed system is also functional because all of the
function, main or minor, are running and it will benefit the organization in terms
of scoring and statistical evaluation every players and team. The system is also
reliable because all records and the system itself are secured. Therefore, the
Recommendations
further enhance the efficiency of the proposed “Computer-based Basketball Scoring and
Statistical Evaluation System for Lucena City Sports Office.” This includes the
following:
1. There should be not only the information of players and teams but also the
information of the coaches and officials so that the organization can see their
credibility.
2. The researchers also recommend that widening the scope of the statistical
basketball stats such as Turnovers, Rebounds, and Assists and so on, thus, it will
make the system a LAN-based system and will be able to use not only to inter-
barangay basketball leagues but also to intercollegiate and national ones; and
73
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
3. The researchers also highly recommend that upgrading the proposed system by
74
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
APPENDICES
75
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
BIBLIOGRAPHY
76
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
A. ELECTRONIC REFERENCES
https://www.scribd.com/doc/204165317/201435715
http://fs.mapua.edu.ph/MapuaLibrary/Thesis/Portable%20Touch%20Screen%20
PC-Based%20Basketball%20Scoreboard%20Synchronizer%20via%20Zigbee.pdf
Carlos, G., et. al (2015). The Design of Timing and Score Device for Basketball
http://en.cnki.com.cn/Article_en/CJFDTOTAL-DLXZ201005015.htm
Chua, C. & Maranan, J. J. (2013). The System Design of Wireless Basketball Timer-
http://www.maxwellsci.com/print/rjaset/v5-4909-4913.pdf
bookitbasketballscoringsystem.download23362567.datapicks.com
https://www.scribd.com/doc/201589317/891405715
77
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
http://www.studymode.com/subjects/online-reservation-system-related-
literature-chapter-2-page1.html
Retrieved from
http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=4309667
http://www.studymode.com/essays/Computer-Based-Inventory-System-
401903.html
en.cnki.com.cn/Article_en/CJFDTOTALSJKF200804023.htm
http://basketball-scoreboard-deluxe.software.informer.com/
78
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
http://www.r2sports.com/ranking-software.asp
https://everymatrix.com/blog/introduction-world-virtual-sports.html
http://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=4309667
http://dl.acm.org/citation.cfm?id=1500529
www.google.co.in/patents/US5721913
www.answers.com/Q/Disadvantages_of_manual_based_information_systems
79
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
USER’S MANUAL
80
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
ACTIVITY PAGE
A. Logging in as an Administrator 82 - 83
B. Registering Teams 83 - 84
C. Searching Teams 85
C. 1. Searching Teams by Team Name 85
C. 2. Searching Teams by Division 86
D. Registering Players 87 - 88
E. Searching Players 89
E. 1. Searching Players by Player Name 89
E. 2. Searching Players by Team Name 90
E. 3. Searching Players by Division 91
F. Game Logs 92
F. 1. Game Logs – Teams 93
F. 2. Game Logs – Players 93
F. 3. Game Logs – Officials 94
G. Adding Another User 95 - 96
H. Logging in as a Staff 96 - 97
I. Filling up the Game Official Form 98
J. The Computerized Basketball Score Sheet 99
J. 1. Setting the Team versus Team 100
J. 2. Assigning the First Five 101 - 102
J. 3. Locking the Score Sheet 103 - 104
J. 4. Recording Field Goals (Score) 104 - 105
J. 5. Recording Fouls 105
J. 5. 1 Dealing with Multiple Personal/Team Fouls 106
J. 5. 2 Dealing with a Fouled Out Player 107
J. 6. Substitution of Players (Putting Players In/Out of the Court) 108
J. 7. Recording Timeouts 109
J. 8. Periods 110
J. 9. End Game 111 - 112
J. 10. Keyboard Shortcuts 112
K.The Statistical Report 113 - 114
L. Logging Out 115
81
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
A. Logging in as an Administrator
Administrators will be
as an Administrator, must:
1. Press the combo box on the right of User Type. The combo box will show
choose “Admin”.
82
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
4. After filling up the information, the user must press “Login” button to direct
B. Registering Teams
“Team”:
83
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Then, it will show the Team Information fill-up form. To add a team:
1. Press the “Add” button. The textboxes and combo boxes will be ready to receive
data.
one.
8. Press “Delete” if you want to erase the team‟s information from the database.
84
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
C. Searching Teams
Administrators may search team‟s information by its Team Name or by its Division.
1. Press the combo box on the right side of “Search”, and then choose Team Name.
2. Type the name of the team you want to see on the textbox on the right side of
“Team”.
85
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
1. Choose “Division”.
86
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
D. Registering Players
5. Fill up “Age” of the player. Player‟s age will determine his/her respective
division.
87
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
automatically pop-up an error message if the “Age” and the “Division” chosen
9. Press “Save” button to save information to the database. The system will
window:
11. Press “Delete” if you want to delete player‟s information from the database.
88
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
E. Searching Players
Administrators can search players by its Player Name, by his/her Team Name or by
Division.
89
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
90
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
1. Choose “Division”.
2. Press the combo box to filter your searching whether by All, Junior, or Senior
division.
91
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
F. Game Logs
A Game Log shows the collection of records of the recent game. To view Game
2. “Team Information” panel will show all recent games. To view a specific game,
press the game. “Team Games” panel will show the selected game (##).
92
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
2. “Player Information” panel will show all recent games. To view a specific game,
press the game. “Player Games” panel will show the selected game (##).
93
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
2. You can filter the games showed in the “Officials Information” panel by “Game
4. “Officials Information” panel will show all game officials of the recent games.
94
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
An Administrator also has the capacity to add another user, whether another
Administrator can view, add, edit, and delete information about players, teams,
game officials, and users. A Staff is capable of using the Official Score Sheet.
Both types of user can view reports, as well as Game Logs. To choose, press the
combo box on the right side of “User Type” and then choose between “Admin”
and “Staff”.
95
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
3. Type “Username”.
4. Type your own unique password. The user must remember this password.
H. Logging in as a Staff
A Staff is capable of using the Official Score Sheet. They can also see recent
games‟ statistical evaluations and reports (Game Logs and Reports). The user, if
96
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
1. Press the combo box on the right of User Type. The combo box will show
4. After filling up the information, the user must press “Login” button to direct
97
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The user will be directed to the Game Officials Form. It is a must to fill up every
name of the Game Officials before the game begin. To fill up:
2. The textboxes will be ready to accept inputs. Type all the corresponding names
3. Click “Save” to save the information to the database. A pop-up window will
saved. If the user pressed the “OK” button or the exit button of the pop-up
98
DALUBHASAAN NG LUNGSOD NG LUCENA
J. The Computerized Basketball Score Sheet:
The Score Sheet is composed of tables, combo boxes, buttons, pop-up windows, and display features. To sum up all
these:
99
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
1. Click the combo box on the right side of “Division” and then choose one.
This is necessary because the “Team A” and “Team B” combo boxes will
only show the teams under the selected divisions. You cannot match two
2. Click the combo box on the right side of the “Team A” and “Team B”.
100
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
After you chose a team, a window will pop-up. This to assign the team‟s first
1. Choose five (5) players from the table by clicking “Out” text. After you do
this, “Out” will be “In”, indicating that that player is already noted inside the
court.
2. This will display how many players are already inside the court. The Staff
must only “In” exactly five (5) players. Otherwise, an error message will
pop-up.
101
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
3. Click the “OK” button. The “Team A” and/or ”Team B” panel will display
the first five players on its table. The result will be similar to this:
102
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Meaning, this assures the Staff in assuring him whether if he/she is sure if the teams
he/she had chosen are the teams that will play at the moment. This feature is what the
1. Press the “Lock” buttons located on the right side of the “Team A”/”Team
B” combo boxes. This will activate all the necessary buttons for stats
recording. The Staff will know if the score sheet is activated if the Score
Display (the 2 in the picture above) if it turned white; similar to this one:
103
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
The Activity Log will also display a message to notify the Staff:
Selected” (**).
2. Press the button which corresponds to the number of the point made by the
player (i. e. press “+2” for a two-point score). The Score Display (##) will
show the total score a team already has. The Activity Log (&&) will display
all the recent activities, which will only last for five (5) seconds.
104
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
3. If the Staff made a mistake (i. e. wrong Score buttons are clicked), he/she
J. 5. Recording Foals
1. Press the name that corresponds the name of the player who got fouled. The
player selected will display on the right side of the “Player Selected” (##).
2. Press the “F” button. The Activity Log (&&) will display the action for 5
seconds. The Team Fouls Counter (%%) will show the fouls made by the
105
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
A player who is marked with multiple personal fouls will have changes in the
Score Sheet. A player is only limited to get up to four (4) fouls in a game. To further
1. Players who got none up to two fouls will have no change in color (their
2. If the player got 3 fouls, the color of his/her name and stats in the Score
Sheet will turn into orange. This means, he/she got only 2 more fouls and
he/she will be fouled out. By rules, the Announcer must warn the player.
106
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
3. If the player got 4 fouls that his/her name and stats in the Score Sheet will be
turned into color indigo. This means that he/she only got one more foul and
he/she will be fouled out. By rules, the Announcer must warn the player.
4. The Team Fouls Counter will show how many fouls a team already made in
every period.
5. “Penalty” will show if the team already reach the maximum Team Fouls
allowed.
that game.
107
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Substitution of players (as well as adding other players in the court due to a fouled
To do so:
1. Go to the “All
Players” tab.
be displayed.
3. Press “In” button to indicate the selected player is inside the court and “Out”
button for outside the court. The Activity Log (&&) will show that the action
108
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
J. 7. Recording Timeouts
The proposed
Timeouts. To do so, A
Staff must:
1. Go to “All
Players” tab.
Players” tab will also display all the Timeout a team had in its panel (##). The
system will display an error message if a team reached its maximum number of
109
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
J. 8. Periods
If the period is over, the Staff must press the corresponding/next period to ready
the Score Sheet in recording stats for that next period. The Staff must keep in mind that:
1. The Score Sheet is recording stats in the highlighted (color orange) Period.
2. By clicking the next period, the system will pop-up a confirmation message
Staff that he/she clicked the next period. Clicking “Yes” will give him/her a
ready Score Sheet for the particular period. Clicking “No” will make you go
J. 9. End Game
110
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
If the game is already over, the Staff must click the “End Game” button.
By pressing this button, a pop-up window will appear. The Staff has two options
A. Press the radio button that corresponds to “Game Finished” if the game
ended in a not default decision. Meaning, their score will be the basis.
B. On the other hand, if the game needs a default decision, the Staff must
choose “Default” radio button. If chose it, the combo box below the radio buttons will
A confirmation message will pop up, asking the Staff if he/she is sure to end the
game by Default.
111
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Clicking either “Game Finished” or “Default” will prompt a report of the game‟s
stats to show.
Team A panel:
Z – Lock Team B panel:
X – Unlock , – Lock
A – Timeout . – Unlock
E – In B – Timeout
R – Out P – In
S – Foul and Score Tab {– Out
D – All Players Tab L – Foul and Score Tab
1 – 1-point score : – All Players Tab
2 – Two-point score 7 – 1-point score
3 – Three-point score 8 – Two-point score
4 – Minus 1-point score 9 – Three-point score
5 – Minus two-point score 0 – Minus 1-point score
6 – Minus three-point score - – Minus two-point score
Q – Foul + – Minus three-point score
W – Minus Foul I – Foul
O – Minus Foul
Periods:
F2 – 1st Period Other keyboard shortcuts:
F3 – 2nd Period F10 – End Game
F4 – 3rd Period F11 – Clear Game
F5 – Overtime Period
112
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
113
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
1. “Game Report” in the menu bar. This will show the Statistical evaluation report
2. “Export Report” button. Press this button if you want a copy of the Statistical
3. “Print Report” button. Press this if you want a printed copy of the Statistical
4. “Refresh” button.
114
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
L. Logging Out
Users, whether Administrator or Staff, must always log out the system after or
not in use. This is to make sure that the records are only accessible to the authorized
“Yes” button.
115
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
PROGRAM
LISTING
116
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Administrator.cs ACGLSPlayer();
cmbGLPSearch.Text =
using System; "Player Name";
using System.Collections.Generic;
using System.ComponentModel; LoadGLOInfo();
using System.Data; ACGLOffials();
using System.Drawing; cmbGLOSearch.Text = "Game
using System.Linq; Number";
using System.Text;
using System.Windows.Forms; LoadUser();
using System.Data.SQLite; ACUser();
using cmbUSearch.Text =
CrystalDecisions.CrystalReports.Engin "Username";
e; }
using CrystalDecisions.Shared;
private void
namespace Administrator_Activated(object
Lucena_Sports_Office_BSSE_System sender, EventArgs e)
{ {
public partial class ACRTeam();
Administrator : Form ACRPlayer();
{ ACGLSTeam();
DataTable myDatasetRT, ACGLSPlayer();
myDatasetRP, myDatasetGLT, ACGLOffials();
myDatasetGLTG, myDatasetGLP, ACUser();
myDatasetGLPG, myDatasetGLO,
myDatasetU; GameReport();
public static string }
sRTAddEdit = "", sRPAddEdit = "",
sTID = "", sPID = "", sGNum = "x", #region Navigation
sUAddEdit = "", sUID = ""; void ClearNav()
{
public Administrator() tsRegister.ForeColor =
{ Color.White;
InitializeComponent(); tsRPlayer.ForeColor =
Color.White;
LoadRT(); tsRTeam.ForeColor =
RTSearch(); Color.White;
ACRTeam(); tsGLogs.ForeColor =
cmbRTSearch.Text = "Team Color.White;
Name"; tsGTeams.ForeColor =
Color.White;
LoadRP(); tsGPlayers.ForeColor =
RPSearch(); Color.White;
ACRPlayer(); tsGOfficials.ForeColor =
cmbRPSearch.Text = Color.White;
"Player Name"; tsGReport.ForeColor =
Color.White;
LoadGLTInfo(); tsUser.ForeColor =
LoadGLTGames(); Color.White;
ACGLSTeam();
cmbGLTSearch.Text = "Team pnlMRPlayer.Visible =
Name"; false;
pnlMRTeam.Visible =
LoadGLPInfo(); false;
LoadGLPGames();
117
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
pnlMGLTeams.Visible = ClearNav();
false; tsGLogs.ForeColor =
pnlMGLPlayers.Visible = Color.FromArgb(236, 189, 0);
false; tsGPlayers.ForeColor =
pnlMGLOfficials.Visible = Color.FromArgb(236, 189, 0);
false;
pnlMGReport.Visible = pnlMGLPlayers.Visible =
false; true;
pnlMUser.Visible = false; }
}
private void
private void tsGOfficials_Click(object sender,
tsRPlayer_Click(object sender, EventArgs e)
EventArgs e) {
{ ClearNav();
ClearNav(); tsGLogs.ForeColor =
tsRegister.ForeColor = Color.FromArgb(236, 189, 0);
Color.FromArgb(236, 189, 0); tsGOfficials.ForeColor =
tsRPlayer.ForeColor = Color.FromArgb(236, 189, 0);
Color.FromArgb(236, 189, 0);
pnlMGLOfficials.Visible =
pnlMRPlayer.Visible = true;
true; }
}
private void
private void tsGReport_Click(object sender,
tsRTeam_Click(object sender, EventArgs e)
EventArgs e) {
{ Administrator_Game_Report
ClearNav(); w = new Administrator_Game_Report();
tsRegister.ForeColor = w.ShowDialog();
Color.FromArgb(236, 189, 0); }
tsRTeam.ForeColor =
Color.FromArgb(236, 189, 0); private void
tsUser_Click(object sender, EventArgs
pnlMRTeam.Visible = true; e)
} {
ClearNav();
private void tsUser.ForeColor =
tsGTeams_Click(object sender, Color.FromArgb(236, 189, 0);
EventArgs e)
{ pnlMUser.Visible = true;
ClearNav(); }
tsGLogs.ForeColor = #endregion
Color.FromArgb(236, 189, 0);
tsGTeams.ForeColor = #region Dropdown Menu
Color.FromArgb(236, 189, 0); private void
tsGLogs_DropDownOpened(object sender,
pnlMGLTeams.Visible = EventArgs e)
true; {
} if
(pnlMGLOfficials.Visible == false &&
private void pnlMGLPlayers.Visible == false &&
tsGPlayers_Click(object sender, pnlMGLTeams.Visible == false)
EventArgs e) {
{
118
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
tsGLogs.ForeColor = SQLiteCommand myCommand =
Color.FromArgb(236, 189, 0); new SQLiteCommand("SELECT No_ID,
} Team_Name AS 'Team Name', Division,
} Coach, Assistant_Coach AS 'Assistant
Coach' FROM tbl_teamsinfo ORDER BY
private void Team_Name;", myConn);
tsGLogs_DropDownClosed(object sender,
EventArgs e) try
{ {
if SQLiteDataAdapter
(pnlMGLOfficials.Visible == false && myAdapter = new SQLiteDataAdapter();
pnlMGLPlayers.Visible == false &&
pnlMGLTeams.Visible == false) myAdapter.SelectCommand = myCommand;
{ myDatasetRT = new
tsGLogs.ForeColor = DataTable();
Color.White;
} myAdapter.Fill(myDatasetRT);
} BindingSource
bdSource = new BindingSource();
private void bdSource.DataSource =
tsRegister_DropDownOpened(object myDatasetRT;
sender, EventArgs e) dgvRTTeams.DataSource
{ = bdSource;
if (pnlMRPlayer.Visible
== false && pnlMRTeam.Visible == myAdapter.Update(myDatasetRT);
false) }
{
tsRegister.ForeColor catch (Exception ex)
= Color.FromArgb(236, 189, 0); {
}
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
private void MessageBoxIcon.Error);
tsRegister_DropDownClosed(object }
sender, EventArgs e)
{
if (pnlMRPlayer.Visible dgvRTTeams.Columns[0].Visible =
== false && pnlMRTeam.Visible == false;
false)
{ }
tsRegister.ForeColor #endregion
= Color.White;
} #region Search
} void RTSearch()
#endregion {
if (cmbRTSearch.Text ==
//------------------------// "Team Name")
Registration : Team {
lblRTTeam.Visible =
#region Load Tables true;
void LoadRT() txtRTTeam.Visible =
{ true;
SQLiteConnection myConn = lblRTDivision.Visible
new = false;
SQLiteConnection(Conn.ConnString); cmbRTDivision.Visible
= false;
119
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{
txtRTTeam.Clear(); string tname =
cmbRTDivision.Text = myReader.GetValue(0).ToString();
"All"; acs.Add(tname);
} }
}
else if (cmbRTSearch.Text
== "Division") catch (SQLiteException
{ ex)
lblRTTeam.Visible = {
false;
txtRTTeam.Visible = MessageBox.Show(ex.Message, "Error",
false; MessageBoxButtons.OK,
lblRTDivision.Visible MessageBoxIcon.Error);
= true; }
cmbRTDivision.Visible
= true; finally
{
cmbRTDivision.Text = myConnection.Close();
"All"; }
txtRTTeam.Clear();
}
} txtRTTeam.AutoCompleteCustomSource =
#endregion acs;
}
#region AC and Filter Search
void ACRTeam() private void
{ txtRTTeam_TextChanged(object sender,
EventArgs e)
txtRTTeam.AutoCompleteMode = {
AutoCompleteMode.SuggestAppend; DataView myDV = new
DataView(myDatasetRT);
txtRTTeam.AutoCompleteSource = myDV.RowFilter =
AutoCompleteSource.CustomSource; string.Format("[Team Name] LIKE
'%{0}%'",
AutoCompleteStringCollection acs = EscapeLikeValue(txtRTTeam.Text));
new AutoCompleteStringCollection(); dgvRTTeams.DataSource =
myDV;
string myQuery = "SELECT
Team_Name FROM tbl_teamsinfo;"; if (dgvRTTeams.Rows.Count
SQLiteConnection == 0)
myConnection = new {
SQLiteConnection(Conn.ConnString); txtRTName.Clear();
SQLiteCommand myCommand =
new SQLiteCommand(myQuery, if
myConnection); (!cmbRTDiv.Items.Contains("-Select-
SQLiteDataReader "))
myReader; {
120
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
txtRTACoach.Clear();
} public static string
} EscapeLikeValue(string
valueWithoutWildcards)
private void {
cmbRTSearch_SelectedIndexChanged(obje StringBuilder sb = new
ct sender, EventArgs e) StringBuilder();
{ for (int i = 0; i <
RTSearch(); valueWithoutWildcards.Length; i++)
} {
char c =
private void valueWithoutWildcards[i];
cmbRTDivision_SelectedIndexChanged(ob if (c == '*' || c ==
ject sender, EventArgs e) '%' || c == '[' || c == ']')
{
if (cmbRTDivision.Text == sb.Append("[").Append(c).Append("]");
"All") else if (c == '\'')
{ sb.Append("''");
LoadRT(); else
} sb.Append(c);
}
else return sb.ToString();
{ }
DataView myDV = new #endregion
DataView(myDatasetRT);
myDV.RowFilter = #region Cell Enter
string.Format("[Division] LIKE private void
'%{0}%'", dgvRTTeams_CellEnter(object sender,
EscapeLikeValue(cmbRTDivision.Text)); DataGridViewCellEventArgs e)
dgvRTTeams.DataSource {
= myDV; if (e.RowIndex >= 0)
{
if DataGridViewRow row =
(dgvRTTeams.Rows.Count == 0) this.dgvRTTeams.Rows[e.RowIndex];
{
txtRTName.Text =
txtRTName.Clear(); row.Cells["Team
Name"].Value.ToString();
if cmbRTDiv.Text =
(!cmbRTDiv.Items.Contains("-Select- row.Cells["Division"].Value.ToString(
")) );
{ txtRTCoach.Text=
row.Cells["Coach"].Value.ToString();
cmbRTDiv.Items.Insert(0, "-Select-"); txtRTACoach.Text =
} row.Cells["Assistant
Coach"].Value.ToString();
cmbRTDiv.Text = sTID =
"-Select-"; row.Cells["No_ID"].Value.ToString();
}
}
txtRTCoach.Clear(); #endregion
121
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ lblRTCoach.Enabled =
cmbRTDiv.Items.Remove("- true;
Select-"); lblRTACoach.Enabled =
} true;
txtRTName.Enabled = true;
private void cmbRTDiv.Enabled = true;
cmbRTDiv_DropDownClosed(object txtRTCoach.Enabled =
sender, EventArgs e) true;
{ txtRTACoach.Enabled =
if (cmbRTDiv.SelectedItem true;
== null)
{ btnRTAdd.Enabled = false;
if btnRTEdit.Enabled =
(!cmbRTDiv.Items.Contains("-Select- false;
")) btnRTDelete.Enabled =
{ false;
cmbRTDiv.Items.Add("-Select-"); btnRTCancel.Enabled =
} true;
btnRTSave.Enabled = true;
cmbRTDiv.Text = "- }
Select-"; #endregion
}
} #region Edit Team
#endregion string tn = "", dv = "", c =
"", ac = "";
#region Add Team private void
private void btnRTEdit_Click(object sender,
btnRTAdd_Click(object sender, EventArgs e)
EventArgs e) {
{ tn = txtRTName.Text;
pnlRTTeams.Enabled = dv = cmbRTDiv.Text;
false; c = txtRTCoach.Text;
txtRTTeam.Clear(); ac = txtRTACoach.Text;
cmbRTDivision.Text =
"All"; pnlRTTeams.Enabled =
sRTAddEdit = "Add"; false;
if if
(!cmbRTDiv.Items.Contains("-Select- (cmbRTDiv.Items.Contains("-Select-"))
")) {
{
cmbRTDiv.Items.Remove("-Select-");
cmbRTDiv.Items.Insert(0, "-Select-"); }
}
lblRTName.Enabled = true;
cmbRTDiv.Text = "-Select- lblRTDiv.Enabled = true;
"; lblRTCoach.Enabled =
txtRTCoach.Clear(); true;
txtRTACoach.Clear(); lblRTACoach.Enabled =
true;
lblRTName.Enabled = true; txtRTName.Enabled = true;
lblRTDiv.Enabled = true; cmbRTDiv.Enabled = true;
122
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
txtRTCoach.Enabled = LoadRT();
true; }
txtRTACoach.Enabled =
true; else if (sRTAddEdit ==
"Edit")
btnRTAdd.Enabled = false; {
btnRTEdit.Enabled = pnlRTTeams.Enabled =
false; true;
btnRTDelete.Enabled =
false; lblRTName.Enabled =
false;
btnRTCancel.Enabled = lblRTDiv.Enabled =
true; false;
btnRTSave.Enabled = true; lblRTCoach.Enabled =
} false;
#endregion lblRTACoach.Enabled =
false;
#region Cancel txtRTName.Enabled =
private void false;
btnRTCancel_Click(object sender, cmbRTDiv.Enabled =
EventArgs e) false;
{ txtRTCoach.Enabled =
if (sRTAddEdit == "Add") false;
{ txtRTACoach.Enabled =
pnlRTTeams.Enabled = false;
true;
btnRTAdd.Enabled =
lblRTName.Enabled = true;
false; btnRTEdit.Enabled =
lblRTDiv.Enabled = true;
false; btnRTDelete.Enabled =
lblRTCoach.Enabled = true;
false;
lblRTACoach.Enabled = btnRTCancel.Enabled =
false; false;
txtRTName.Enabled = btnRTSave.Enabled =
false; false;
cmbRTDiv.Enabled =
false; txtRTName.Text = tn;
txtRTCoach.Enabled = cmbRTDiv.Text = dv;
false; txtRTCoach.Text = c;
txtRTACoach.Enabled = txtRTACoach.Text =
false; ac;
}
btnRTAdd.Enabled = }
true; #endregion
btnRTEdit.Enabled =
true; #region Delete Team
btnRTDelete.Enabled = private void
true; btnRTDelete_Click(object sender,
EventArgs e)
btnRTCancel.Enabled = {
false; dynamic dialog =
btnRTSave.Enabled = MessageBox.Show("Are you sure you
false; want to delete team " +
txtRTName.Text + "?", "Delete Team",
123
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
MessageBoxButtons.YesNo, #endregion
MessageBoxIcon.Question);
if (dialog == #region Save Team
DialogResult.No) private void
{ } btnRTSave_Click(object sender,
EventArgs e)
else if (dialog == {
DialogResult.Yes) if (txtRTName.Text == "")
{ {
string myQuery =
"DELETE FROM tbl_teamsinfo WHERE MessageBox.Show("Please input team
Team_Name = '" + txtRTName.Text + "' name.", "Team Registration",
AND Division = '" + cmbRTDiv.Text + MessageBoxButtons.OK,
"';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else if (cmbRTDiv.Text ==
SQLiteCommand "-Select-")
myCommand = new {
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader MessageBox.Show("Please select
myReader; division.", "Team Registration",
MessageBoxButtons.OK,
try MessageBoxIcon.Error);
{ }
124
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
txtRTName.Text + "' AND Division = '" tn =
+ cmbRTDiv.Text + "';"; txtRTName.Text;
SQLiteConnection dv =
myConnection = new cmbRTDiv.Text;
SQLiteConnection(Conn.ConnString); #region Add
SQLiteCommand string
myCommand = new myQuery1 = "INSERT INTO
SQLiteCommand(myQuery, myConnection); tbl_teamsinfo(Team_Name, Division,
SQLiteDataReader Coach, Assistant_Coach) "
myReader; + "VALUES('"
+ txtRTName.Text + "', '" +
try cmbRTDiv.Text + "', '" +
{ txtRTCoach.Text + "', '" +
txtRTACoach.Text + "');";
myConnection.Open();
myReader = SQLiteConnection myConnection1 = new
myCommand.ExecuteReader(); SQLiteConnection(Conn.ConnString);
while SQLiteCommand
(myReader.Read()) myCommand1 = new
{ SQLiteCommand(myQuery1,
duplicate = myConnection1);
myReader.GetValue(0).ToString();
} SQLiteDataReader myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1
MessageBox.Show(ex.Message, "Error", = myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
if (sRTAddEdit ==
"Add") pnlRTTeams.Enabled = true;
{
if
(Int32.TryParse(duplicate, out d) && lblRTName.Enabled = false;
d >= 1)
{ lblRTDiv.Enabled = false;
125
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{
txtRTCoach.Enabled = false;
MessageBox.Show("There were the same
txtRTACoach.Enabled = false; team saved.", "Team Registration",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
btnRTAdd.Enabled = true; }
else if
(Int32.TryParse(duplicate, out d) && pnlRTTeams.Enabled = true;
d >= 1 && tn == txtRTName.Text && dv
!= cmbRTDiv.Text)
126
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
foreach
lblRTName.Enabled = false; (DataGridViewRow row in
dgvRTTeams.Rows)
lblRTDiv.Enabled = false; {
if
lblRTCoach.Enabled = false; (row.Cells[1].Value.ToString().Equals
(tn) &&
lblRTACoach.Enabled = false; row.Cells[2].Value.ToString().Equals(
dv))
txtRTName.Enabled = false; {
127
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
bdSource.DataSource = else if (cmbRPSearch.Text
myDatasetRP; == "Team Name")
{
dgvRPPlayers.DataSource = bdSource; txtRPPlayer.Visible =
false;
myAdapter.Update(myDatasetRP); lblRPPlayer.Visible =
} false;
txtRPTeam.Visible =
catch (Exception ex) true;
{ lblRPTeam.Visible =
true;
MessageBox.Show(ex.Message, "Error", cmbRPDivision.Visible
MessageBoxButtons.OK, = false;
MessageBoxIcon.Error); lblRPDivision.Visible
} = false;
txtRPPlayer.Clear();
dgvRPPlayers.Columns[0].Visible = txtRPTeam.Clear();
false; cmbRPDivision.Text =
"All";
dgvRPPlayers.Columns[1].Visible = }
false;
else if (cmbRPSearch.Text
dgvRPPlayers.Columns[2].Visible = == "Division")
false; {
txtRPPlayer.Visible =
dgvRPPlayers.Columns[3].Visible = false;
false; lblRPPlayer.Visible =
} false;
#endregion txtRPTeam.Visible =
false;
#region Search lblRPTeam.Visible =
void RPSearch() false;
{ cmbRPDivision.Visible
if (cmbRPSearch.Text == = true;
"Player Name") lblRPDivision.Visible
{ = true;
txtRPPlayer.Visible =
true; txtRPPlayer.Clear();
lblRPPlayer.Visible = txtRPTeam.Clear();
true; cmbRPDivision.Text =
txtRPTeam.Visible = "All";
false; }
lblRPTeam.Visible = }
false; #endregion
cmbRPDivision.Visible
= false; #region AC and Filter Search
lblRPDivision.Visible void ACRPlayer()
= false; {
txtRPPlayer.Clear(); txtRPPlayer.AutoCompleteMode =
txtRPTeam.Clear(); AutoCompleteMode.SuggestAppend;
cmbRPDivision.Text =
"All"; txtRPPlayer.AutoCompleteSource =
} AutoCompleteSource.CustomSource;
128
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
}
AutoCompleteStringCollection acs =
new AutoCompleteStringCollection();
txtRPPlayer.AutoCompleteCustomSource
= acs;
txtRPTeam.AutoCompleteMode =
AutoCompleteMode.SuggestAppend; txtRPTeam.AutoCompleteCustomSource =
acs1;
txtRPTeam.AutoCompleteSource = }
AutoCompleteSource.CustomSource;
private void
AutoCompleteStringCollection acs1 = cmbRPSearch_SelectedIndexChanged(obje
new AutoCompleteStringCollection(); ct sender, EventArgs e)
{
string myQuery = "SELECT RPSearch();
Last_Name || ', ' || First_Name || ' }
' || Middle_Initial, Team_Name FROM
tbl_playersinfo;"; private void
SQLiteConnection cmbRPDivision_SelectedIndexChanged(ob
myConnection = new ject sender, EventArgs e)
SQLiteConnection(Conn.ConnString); {
SQLiteCommand myCommand = if (cmbRPDivision.Text ==
new SQLiteCommand(myQuery, "All")
myConnection); {
SQLiteDataReader LoadRP();
myReader; }
try else
{ {
myConnection.Open(); DataView myDV = new
myReader = DataView(myDatasetRP);
myCommand.ExecuteReader(); myDV.RowFilter =
while string.Format("[Division] LIKE
(myReader.Read()) '%{0}%'",
{ EscapeLikeValue(cmbRPDivision.Text));
string pname =
myReader.GetValue(0).ToString(); dgvRPPlayers.DataSource = myDV;
string tname =
myReader.GetValue(1).ToString(); if
acs.Add(pname); (dgvRPPlayers.Rows.Count == 0)
acs1.Add(tname); {
}
} txtRPLName.Clear();
129
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} {
if if
(dgvRPPlayers.Rows.Count == 0) (!cmbRPDiv.Items.Contains("-Select-
{ "))
txtRPLName.Clear(); {
txtRPFName.Clear();
txtRPMI.Clear(); cmbRPDiv.Items.Insert(0, "-Select-");
txtRPAge.Clear(); }
txtRPJNumber.Clear();
cmbRPDiv.Text = "-
if Select-";
(!cmbRPDiv.Items.Contains("-Select-
")) if
{ (!cmbRPTName.Items.Contains("-Select-
"))
cmbRPDiv.Items.Insert(0, "-Select-"); {
}
cmbRPTName.Items.Insert(0, "-Select-
cmbRPDiv.Text = "- ");
Select-"; }
if cmbRPTName.Text = "-
(!cmbRPTName.Items.Contains("-Select- Select-";
")) }
130
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} DataGridViewRow row =
#endregion this.dgvRPPlayers.Rows[e.RowIndex];
131
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
pdiv = cmbRPDiv.Text; private void
} btnRPAdd_Click(object sender,
} EventArgs e)
#endregion {
sRPAddEdit = "Add";
#region Number Exception pnlRPPlayers.Enabled =
private void false;
txtRPAge_KeyPress(object sender, txtRPPlayer.Clear();
KeyPressEventArgs e) txtRPTeam.Clear();
{ cmbRPDivision.Text =
char c = e.KeyChar; "All";
if (c != '0' && c != if
8 && c != 46) (!cmbRPTName.Items.Contains("-Select-
{ "))
txtRPAge.Text = {
txtRPAge.Text.Remove(0, 1);
} cmbRPTName.Items.Insert(0, "-Select-
} ");
} }
132
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
lblRPLName.Enabled = }
true;
lblRPFName.Enabled = if
true; (cmbRPTName.Items.Contains("-Select-
lblRPMI.Enabled = true; "))
lblRPAge.Enabled = true; {
lblRPDiv.Enabled = true;
lblRPDiv.Enabled = true; cmbRPTName.Items.Remove("-Select-");
lblRPTName.Enabled = }
true;
lblRPJNumber.Enabled = cmbRPTName.Items.Clear();
true; RPPopulateTeams();
cmbRPTName.Text = team;
txtRPLName.Enabled =
true; pnlRPPlayers.Enabled =
txtRPFName.Enabled = false;
true;
txtRPMI.Enabled = true; btnRPAdd.Enabled = false;
txtRPAge.Enabled = true; btnRPEdit.Enabled =
cmbRPDiv.Enabled = true; false;
cmbRPDiv.Enabled = true; btnRPDelete.Enabled =
cmbRPTName.Enabled = false;
true;
txtRPJNumber.Enabled = btnRPCancel.Enabled =
true; true;
} btnRPSave.Enabled = true;
#endregion
lblRPLName.Enabled =
#region Edit Player true;
string ln = "", fn = "", mi = lblRPFName.Enabled =
"", a = "", pd = "", pt = "", jn = true;
"", pn = ""; lblRPMI.Enabled = true;
private void lblRPAge.Enabled = true;
btnRPEdit_Click(object sender, lblRPDiv.Enabled = true;
EventArgs e) lblRPDiv.Enabled = true;
{ lblRPTName.Enabled =
ln = txtRPLName.Text; true;
fn = txtRPFName.Text; lblRPJNumber.Enabled =
mi = txtRPMI.Text; true;
a = txtRPAge.Text;
pd = cmbRPDiv.Text; txtRPLName.Enabled =
pt = cmbRPTName.Text; true;
jn = txtRPJNumber.Text; txtRPFName.Enabled =
pn = txtRPLName.Text + ", true;
" + txtRPFName.Text + " " + txtRPMI.Enabled = true;
txtRPMI.Text; txtRPAge.Enabled = true;
cmbRPDiv.Enabled = true;
sRPAddEdit = "Edit"; cmbRPDiv.Enabled = true;
string team = cmbRPTName.Enabled =
cmbRPTName.Text; true;
txtRPJNumber.Enabled =
if true;
(cmbRPDiv.Items.Contains("-Select-")) }
{ #endregion
133
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void
btnRPCancel_Click(object sender, else if (sRPAddEdit ==
EventArgs e) "Edit")
{ {
if (sRPAddEdit == "Add") pnlRPPlayers.Enabled
{ = true;
pnlRPPlayers.Enabled btnRPAdd.Enabled =
= true; true;
btnRPAdd.Enabled = btnRPEdit.Enabled =
true; true;
btnRPEdit.Enabled = btnRPDelete.Enabled =
true; true;
btnRPDelete.Enabled =
true; btnRPCancel.Enabled =
false;
btnRPCancel.Enabled = btnRPSave.Enabled =
false; false;
btnRPSave.Enabled =
false; lblRPLName.Enabled =
false;
lblRPLName.Enabled = lblRPFName.Enabled =
false; false;
lblRPFName.Enabled = lblRPMI.Enabled =
false; false;
lblRPMI.Enabled = lblRPAge.Enabled =
false; false;
lblRPAge.Enabled = lblRPDiv.Enabled =
false; false;
lblRPDiv.Enabled = lblRPDiv.Enabled =
false; false;
lblRPDiv.Enabled = lblRPTName.Enabled =
false; false;
lblRPTName.Enabled = lblRPJNumber.Enabled
false; = false;
lblRPJNumber.Enabled
= false; txtRPLName.Enabled =
false;
txtRPLName.Enabled = txtRPFName.Enabled =
false; false;
txtRPFName.Enabled = txtRPMI.Enabled =
false; false;
txtRPMI.Enabled = txtRPAge.Enabled =
false; false;
txtRPAge.Enabled = cmbRPDiv.Enabled =
false; false;
cmbRPDiv.Enabled = cmbRPDiv.Enabled =
false; false;
cmbRPDiv.Enabled = cmbRPTName.Enabled =
false; false;
cmbRPTName.Enabled = txtRPJNumber.Enabled
false; = false;
txtRPJNumber.Enabled
= false; txtRPLName.Text = ln;
txtRPFName.Text = fn;
LoadRP(); txtRPMI.Text = mi;
} txtRPAge.Text = a;
134
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
cmbRPDiv.Text = pd;
cmbRPTName.Text = pt; MessageBox.Show(txtRPLName.Text + ",
txtRPJNumber.Text = " + txtRPFName.Text + " " +
jn; txtRPMI.Text + " from team " +
} cmbRPTName.Text + " has been
} deleted", "Delete Player",
#endregion MessageBoxButtons.OK,
MessageBoxIcon.Information);
#region Delete Player LoadRP();
private void }
btnRPDelete_Click(object sender,
EventArgs e) catch
{ (SQLiteException ex)
dynamic dialog = {
MessageBox.Show("Are you sure you
want to delete team " + MessageBox.Show(ex.Message, "Error",
txtRPLName.Text + ", " + MessageBoxButtons.OK,
txtRPFName.Text + " " + txtRPMI.Text MessageBoxIcon.Error);
+ " from team " + cmbRPTName.Text + }
"?", "Delete Player",
MessageBoxButtons.YesNo, finally
MessageBoxIcon.Question); {
if (dialog ==
DialogResult.No) myConnection.Close();
{ } }
}
else if (dialog == }
DialogResult.Yes) #endregion
{
string myQuery = #region Save Player
"DELETE FROM tbl_playersinfo WHERE private void
Last_Name || ', ' || First_Name || ' btnRPSave_Click(object sender,
' || Middle_Initial = '" + EventArgs e)
txtRPLName.Text + ", " + {
txtRPFName.Text + " " + txtRPMI.Text int age = 0;
+ "' AND Team_Name = '" +
cmbRPTName.Text + "' AND Division = if (txtRPLName.Text ==
'" + cmbRPDiv.Text + "';"; "")
SQLiteConnection {
myConnection = new
SQLiteConnection(Conn.ConnString); MessageBox.Show("Please input last
SQLiteCommand name.", "Player Registration",
myCommand = new MessageBoxButtons.OK,
SQLiteCommand(myQuery, myConnection); MessageBoxIcon.Error);
SQLiteDataReader }
myReader;
else if (txtRPFName.Text
try == "")
{ {
135
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
else if (txtRPMI.Text == Registration", MessageBoxButtons.OK,
"") MessageBoxIcon.Error);
{ }
else if try
(Int32.TryParse(txtRPAge.Text, out {
age) && age < 8)
{ myConnection.Open();
MessageBox.Show("The myReader =
player is under age.", "Player myCommand.ExecuteReader();
136
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
while txtRPFName.Text + "', '" +
(myReader.Read()) txtRPMI.Text + "', '" + txtRPAge.Text
{ + "', '" + cmbRPDiv.Text + "', '" +
duplicate = cmbRPTName.Text + "', '" +
myReader.GetValue(0).ToString(); txtRPJNumber.Text + "');";
}
} SQLiteConnection myConnection1 = new
SQLiteConnection(Conn.ConnString);
catch SQLiteCommand
(SQLiteException ex) myCommand1 = new
{ SQLiteCommand(myQuery1,
myConnection1);
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, SQLiteDataReader myReader1;
MessageBoxIcon.Error);
} try
{
finally
{ myConnection1.Open();
myReader1
myConnection.Close(); = myCommand1.ExecuteReader();
} while
(myReader1.Read()) { }
if (sRPAddEdit ==
"Add")
{ MessageBox.Show(" Player " +
if txtRPLName.Text + ", " +
(Int32.TryParse(duplicate, out d) && txtRPFName.Text + " " + txtRPMI.Text
d >= 1) + " for team " + cmbRPTName.Text + "
{ has been saved.", "Player
Registration", MessageBoxButtons.OK,
MessageBox.Show("There were the same MessageBoxIcon.Information);
jersey number saved in this team.",
"Player Registration",
MessageBoxButtons.OK, pnlRPPlayers.Enabled = true;
MessageBoxIcon.Error);
} btnRPAdd.Enabled = true;
137
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
138
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
139
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (dialog == if (e.Alt && e.KeyCode ==
DialogResult.No) Keys.T)
{ } {
tsRTeam_Click(sender,
else if (dialog == e);
DialogResult.Yes) }
{
Login w = new if (e.Alt && e.KeyCode ==
Login(); Keys.M)
this.Hide(); {
w.Show();
} tsGTeams_Click(sender, e);
} }
Application.Exit(); //------------------------//
} Game Logs : Teams
}
} #region Load Tables
#endregion void LoadGLTInfo()
{
#region Shortcuts SQLiteConnection myConn =
private void new
Administrator_KeyDown(object sender, SQLiteConnection(Conn.ConnString);
KeyEventArgs e) SQLiteCommand myCommand =
{ new SQLiteCommand("SELECT i.Team_Name
if (e.Alt && e.KeyCode == || ' ' || i.Division AS 'Team Name
Keys.P) and Division', i.Team_Name AS 'Team
{ Name', i.Division, i.Coach, "
+ "i.Assistant_Coach AS
tsRPlayer_Click(sender, e); 'Assistant Coach', SUM(g.Game_Status
} = 'Win') AS 'Win', "
140
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "SUM(g.Game_Status = + "strftime('%Y-%m-%d',
'Lose') AS 'Lose', SUM(g.Game_Status Game_Date) AS 'Game Date', CASE WHEN
= 'Default') AS 'Default' " CAST(strftime('%H', Game_Date) AS
+ "FROM tbl_teamsinfo i INTEGER) = 00 "
LEFT JOIN tbl_teamsgamelogs g ON + "THEN strftime(12 ||
i.Team_Name || ' ' || i.Division = '%M', Game_Date) || ' AM' WHEN
g.Team_Name || ' ' || g.Division " CAST(strftime('%H', Game_Date) AS
+ "GROUP BY i.Team_Name INTEGER) = 12 "
ORDER BY i.Team_Name || ' ' || + "THEN strftime('%H:%M',
i.Division;", myConn); Game_Date) || ' PM' WHEN
CAST(strftime('%H', Game_Date) AS
try INTEGER) > 12 "
{ + "THEN strftime('%H:%M',
SQLiteDataAdapter Game_Date , '-12 HOURS')|| ' PM' ELSE
myAdapter = new SQLiteDataAdapter(); strftime('%H:%M', Game_Date) || ' AM'
END AS Time, "
myAdapter.SelectCommand = myCommand; + "First_Half_Time_Out AS
myDatasetGLT = new '1st Half Time Out',
DataTable(); Second_Half_Time_Out AS '2nd Half
Time Out', Extra_Time_Out AS 'Extra
myAdapter.Fill(myDatasetGLT); Time Out', "
BindingSource + "FirstP_Team_Foul AS
bdSource = new BindingSource(); '1st Period Team Foul',
bdSource.DataSource = SecondP_Team_Foul AS '2nd Period Team
myDatasetGLT; Foul', ThirdP_Team_Foul AS '3rd
dgvGLTInfo.DataSource Period Team Foul', "
= bdSource; + "Overtime_Team_Foul AS
'Overtime Team Foul', Opponent,
myAdapter.Update(myDatasetGLT); Game_Score AS 'Game Score',
} Game_Status AS 'Game Status' "
+ "FROM tbl_teamsgamelogs
catch (Exception ex) ORDER BY Game_Number;", myConn);
{
try
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK, SQLiteDataAdapter
MessageBoxIcon.Error); myAdapter = new SQLiteDataAdapter();
}
myAdapter.SelectCommand = myCommand;
myDatasetGLTG = new
dgvGLTInfo.Columns[0].Visible = DataTable();
false;
} myAdapter.Fill(myDatasetGLTG);
BindingSource
void LoadGLTGames() bdSource = new BindingSource();
{ bdSource.DataSource =
SQLiteConnection myConn = myDatasetGLTG;
new
SQLiteConnection(Conn.ConnString); dgvGLTGames.DataSource = bdSource;
SQLiteCommand myCommand =
new SQLiteCommand("SELECT Team_Name myAdapter.Update(myDatasetGLTG);
|| ' ' || Division AS 'Team Name and }
Division', Team_Name AS 'Team Name',
Division, Game_Number AS 'Game catch (Exception ex)
Number', " {
141
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
cmbGLSDivision.Text = finally
"All"; {
txtGLSTeam.Clear(); myConnection.Close();
} }
}
#endregion
txtGLSTeam.AutoCompleteCustomSource =
#region AC and Filter Search acs;
void ACGLSTeam() }
{
142
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void DataGridViewRow row =
cmbGLSDivision_SelectedIndexChanged(o this.dgvGLTInfo.Rows[e.RowIndex];
bject sender, EventArgs e)
{ td = row.Cells["Team
if (cmbGLSDivision.Text Name and Division"].Value.ToString();
== "All")
{ DataView myDV = new
LoadGLTInfo(); DataView(myDatasetGLTG);
} myDV.RowFilter =
string.Format("[Team Name and
else Division] LIKE '%{0}%'",
{ EscapeLikeValue(td));
DataView myDV = new
DataView(myDatasetGLT); dgvGLTGames.DataSource = myDV;
myDV.RowFilter = }
string.Format("[Division] LIKE }
'%{0}%'", #endregion
EscapeLikeValue(cmbGLSDivision.Text))
; //------------------------//
dgvGLTInfo.DataSource Game Logs : Players
= myDV;
} #region Load Tables
} void LoadGLPInfo()
{
private void SQLiteConnection myConn =
txtGLSTeam_TextChanged(object sender, new
EventArgs e) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand myCommand =
DataView myDV = new new SQLiteCommand("SELECT i.Last_Name
DataView(myDatasetGLT); || ', ' || i.First_Name || ' ' ||
myDV.RowFilter = i.Middle_Initial || ' ' ||
string.Format("[Team Name] LIKE i.Team_Name || ' ' || i.Division AS
'%{0}%'", 'Player Name, Team Name and
EscapeLikeValue(txtGLSTeam.Text)); Division',"
dgvGLTInfo.DataSource = + "i.Last_Name || ', ' ||
myDV; i.First_Name || ' ' ||
} i.Middle_Initial AS 'Player Name', "
+ "i.Team_Name AS 'Team
private void Name', i.Division AS 'Division',
cmbGLTSearch_SelectedIndexChanged(obj i.Jersey_Number AS 'Jersey Number', "
ect sender, EventArgs e) + "SUM(g.FirstP_Score) +
{ SUM(SecondP_Score) +
GLTSearch(); SUM(g.ThirdP_Score) +
} SUM(g.FourthP_Score) + "
#endregion + "SUM(g.Overtime_Score)
AS 'Season Score' FROM
#region Cell Enter tbl_playersinfo i LEFT JOIN
private void tbl_playersgamelogs g ON "
dgvGLTInfo_CellEnter(object sender, + "i.Last_Name || ', ' ||
DataGridViewCellEventArgs e) i.First_Name || ' ' ||
{ i.Middle_Initial || ' ' ||
string td; i.Team_Name || ' ' || "
+ "i.Division =
if (e.RowIndex >= 0) g.Last_Name || ', ' || g.First_Name
{ || ' ' || g.Middle_Initial || ' ' ||
g.Team_Name "
143
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "|| ' ' || g.Division Number', strftime('%Y-%m-%d',
GROUP BY i.Last_Name || ', ' || Game_Date) AS 'Game Date', "
i.First_Name || ' ' || + "CASE WHEN
i.Middle_Initial " CAST(strftime('%H', Game_Date) AS
+ "|| ' ' || i.Team_Name INTEGER) = 00 THEN strftime(12 ||
|| ' ' || i.Division;", myConn); '%M', Game_Date) || ' AM' "
+ "WHEN
try CAST(strftime('%H', Game_Date) AS
{ INTEGER) = 12 THEN strftime('%H:%M',
SQLiteDataAdapter Game_Date) || ' PM' "
myAdapter = new SQLiteDataAdapter(); + "WHEN
CAST(strftime('%H', Game_Date) AS
myAdapter.SelectCommand = myCommand; INTEGER) > 12 THEN strftime('%H:%M',
myDatasetGLP = new Game_Date , '-12 HOURS')|| ' PM' "
DataTable(); + "ELSE strftime('%H:%M',
Game_Date) || ' AM' END AS
myAdapter.Fill(myDatasetGLP); Time,FirstP_Score AS '1st Period
BindingSource Score', "
bdSource = new BindingSource(); + "SecondP_Score AS '2nd
bdSource.DataSource = Period Score', ThirdP_Score AS '3rd
myDatasetGLP; Period Score', FourthP_Score AS '4th
dgvGLPInfo.DataSource Period Score', "
= bdSource; + "Overtime_Score AS
'Overtime Score', Foul_1 AS 'Foul 1',
myAdapter.Update(myDatasetGLP); Foul_2 AS 'Foul 2', Foul_3 AS 'Foul
} 3', Foul_4 AS 'Foul 4', "
+ "Foul_5 AS 'Foul 5'
catch (Exception ex) FROM tbl_playersgamelogs ORDER BY
{ Last_Name || ', ' || First_Name || '
' || Middle_Initial;", myConn);
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, try
MessageBoxIcon.Error); {
} SQLiteDataAdapter
myAdapter = new SQLiteDataAdapter();
144
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
MessageBoxButtons.OK,
MessageBoxIcon.Error); else if
} (cmbGLPSearch.Text == "Division")
{
txtGLSPlayer.Visible
dgvGLPGames.Columns[0].Visible = = false;
false; lblGLSPlayer.Visible
} = false;
#endregion txtGLPTeam.Visible =
false;
#region Search lblGLPTeam.Visible =
void GLPSearch() false;
{
if (cmbGLPSearch.Text == cmbGLPDivision.Visible = true;
"Player Name")
{ lblGLPDivision.Visible = true;
txtGLSPlayer.Visible
= true; txtGLSPlayer.Clear();
lblGLSPlayer.Visible txtGLPTeam.Clear();
= true; cmbGLPDivision.Text =
txtGLPTeam.Visible = "All";
false; }
lblGLPTeam.Visible = }
false; #endregion
txtGLSPlayer.Clear(); txtGLSPlayer.AutoCompleteMode =
txtGLPTeam.Clear(); AutoCompleteMode.SuggestAppend;
cmbGLPDivision.Text =
"All"; txtGLSPlayer.AutoCompleteSource =
} AutoCompleteSource.CustomSource;
145
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand myCommand = DataView myDV = new
new SQLiteCommand(myQuery, DataView(myDatasetGLP);
myConnection); myDV.RowFilter =
SQLiteDataReader string.Format("[Player Name] LIKE
myReader; '%{0}%'",
EscapeLikeValue(txtGLSPlayer.Text));
try dgvGLPInfo.DataSource =
{ myDV;
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); private void
while txtGLPTeam_TextChanged(object sender,
(myReader.Read()) EventArgs e)
{ {
string pname = DataView myDV = new
myReader.GetValue(0).ToString(); DataView(myDatasetGLP);
string tname = myDV.RowFilter =
myReader.GetValue(1).ToString(); string.Format("[Team Name] LIKE
acs.Add(pname); '%{0}%'",
acs1.Add(tname); EscapeLikeValue(txtGLPTeam.Text));
} dgvGLPInfo.DataSource =
} myDV;
}
catch (SQLiteException
ex) private void
{ cmbGLPDivision_SelectedIndexChanged(o
bject sender, EventArgs e)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK, if (cmbGLPDivision.Text
MessageBoxIcon.Error); == "All")
} {
LoadGLPInfo();
finally }
{
myConnection.Close(); else
} {
DataView myDV = new
DataView(myDatasetGLP);
txtGLSPlayer.AutoCompleteCustomSource myDV.RowFilter =
= acs; string.Format("[Division] LIKE
'%{0}%'",
txtGLPTeam.AutoCompleteCustomSource = EscapeLikeValue(cmbGLPDivision.Text))
acs1; ;
} dgvGLPInfo.DataSource
= myDV;
private void }
cmbGLPSearch_SelectedIndexChanged(obj }
ect sender, EventArgs e) #endregion
{
GLPSearch(); #region Cell Enter
} private void
dgvGLPInfo_CellEnter(object sender,
private void DataGridViewCellEventArgs e)
txtGLSPlayer_TextChanged(object {
sender, EventArgs e) string ptd;
{
146
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (e.RowIndex >= 0) {
{ SQLiteDataAdapter
DataGridViewRow row = myAdapter = new SQLiteDataAdapter();
this.dgvGLPInfo.Rows[e.RowIndex];
myAdapter.SelectCommand = myCommand;
ptd = myDatasetGLO = new
row.Cells["Player Name, Team Name and DataTable();
Division"].Value.ToString();
myAdapter.Fill(myDatasetGLO);
DataView myDV = new BindingSource
DataView(myDatasetGLPG); bdSource = new BindingSource();
myDV.RowFilter = bdSource.DataSource =
string.Format("[Player Name, Team myDatasetGLO;
Name and Division] LIKE '%{0}%'", dgvGLOInfo.DataSource
EscapeLikeValue(ptd)); = bdSource;
147
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
lblGLOVersus.Visible SQLiteConnection
= false; myConnection = new
SQLiteConnection(Conn.ConnString);
txtGLONumber.Clear(); SQLiteCommand myCommand =
txtGLOVersus.Clear(); new SQLiteCommand(myQuery,
} myConnection);
SQLiteDataReader
else if myReader;
(cmbGLOSearch.Text == "Versus")
{ try
txtGLONumber.Visible {
= false; myConnection.Open();
lblGLONumber.Visible myReader =
= false; myCommand.ExecuteReader();
txtGLOVersus.Visible while
= true; (myReader.Read())
lblGLOVersus.Visible {
= true; string gnum =
myReader.GetValue(0).ToString();
txtGLONumber.Clear(); string vs =
txtGLOVersus.Clear(); myReader.GetValue(1).ToString();
} acs.Add(gnum);
} acs1.Add(vs);
#endregion }
}
#region AC and Filter Search
void ACGLOffials() catch (SQLiteException
{ ex)
{
txtGLONumber.AutoCompleteMode =
AutoCompleteMode.SuggestAppend; MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
txtGLONumber.AutoCompleteSource = MessageBoxIcon.Error);
AutoCompleteSource.CustomSource; }
148
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void if (c != '0' && c !=
txtGLONumber_TextChanged(object 8 && c != 46)
sender, EventArgs e) {
{ txtGLONumber.Text
DataView myDV = new = txtGLONumber.Text.Remove(0, 1);
DataView(myDatasetGLO); }
myDV.RowFilter = }
string.Format("[Game Number] LIKE }
'%{0}%'", #endregion
EscapeLikeValue(txtGLONumber.Text));
dgvGLOInfo.DataSource = //------------------------//
myDV; Game Report
}
#region Game Report
private void void GameReport()
txtGLOVersus_TextChanged(object {
sender, EventArgs e) if (sGNum == "")
{ {
DataView myDV = new sGNum = "x";
DataView(myDatasetGLO);
myDV.RowFilter = MessageBox.Show("Please input game
string.Format("[Versus] LIKE number.", "Game Report",
'%{0}%'", MessageBoxButtons.OK,
EscapeLikeValue(txtGLOVersus.Text)); MessageBoxIcon.Error);
dgvGLOInfo.DataSource =
myDV; Administrator_Game_Report w = new
} Administrator_Game_Report();
#endregion w.ShowDialog();
}
#region Number Exception
private void else if (sGNum != "" &&
txtGLONumber_KeyPress(object sender, sGNum != "x")
KeyPressEventArgs e) {
{ string num, count =
char c = e.KeyChar; "";
int ct = 0;
if (!Char.IsDigit(c) && c num = sGNum;
!= 8 && c != 46) sGNum = "x";
{
e.Handled = true; string myQuery =
} "SELECT COUNT(Game_Number) FROM
tbl_teamsgamelogs WHERE Game_Number =
if (c == '.') '" + num + "';";
{ SQLiteConnection
e.Handled = true; myConnection = new
} SQLiteConnection(Conn.ConnString);
SQLiteCommand
if myCommand = new
(txtGLONumber.Text.StartsWith("0")) SQLiteCommand(myQuery, myConnection);
{ SQLiteDataReader
if (c == '0') myReader;
{
e.Handled = true; try
} {
myConnection.Open();
149
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myReader = SQLiteCommand
myCommand.ExecuteReader(); myCommand1 = new
while SQLiteCommand(myQuery1,
(myReader.Read()) myConnection1);
{ SQLiteDataReader
count = myReader1;
myReader.GetValue(0).ToString();
} try
} {
catch myConnection1.Open();
(SQLiteException ex) myReader1 =
{ myCommand1.ExecuteReader();
while
MessageBox.Show(ex.Message, "Error", (myReader1.Read())
MessageBoxButtons.OK, {
MessageBoxIcon.Error); wteam =
} myReader1.GetValue(0).ToString();
wstatus =
finally myReader1.GetValue(1).ToString();
{ }
}
myConnection.Close();
} catch
(SQLiteException ex)
if {
(Int32.TryParse(count, out ct) && ct
== 0) MessageBox.Show(ex.Message, "Error",
{ MessageBoxButtons.OK,
MessageBoxIcon.Error);
MessageBox.Show("No game number " + }
num + " found in the record.", "Game
Report", MessageBoxButtons.OK, finally
MessageBoxIcon.Error); {
150
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myConnection2.Open(); catch
myReader2 = (SQLiteException ex)
myCommand2.ExecuteReader(); {
while
(myReader2.Read()) MessageBox.Show(ex.Message, "Error",
{ MessageBoxButtons.OK,
ldteam = MessageBoxIcon.Error);
myReader2.GetValue(0).ToString(); }
ldstatus
= myReader2.GetValue(1).ToString(); finally
} {
}
myConnection3.Close();
catch }
(SQLiteException ex)
{ string myQuery4 =
"SELECT Team_Name FROM
MessageBox.Show(ex.Message, "Error", tbl_teamsgamelogs WHERE A_or_B = 'B'
MessageBoxButtons.OK, AND Game_Number = '" + num + "';";
MessageBoxIcon.Error); SQLiteConnection
} myConnection4 = new
SQLiteConnection(Conn.ConnString);
finally SQLiteCommand
{ myCommand4 = new
SQLiteCommand(myQuery4,
myConnection2.Close(); myConnection4);
} SQLiteDataReader
myReader4;
string myQuery3 =
"SELECT Team_Name FROM try
tbl_teamsgamelogs WHERE A_or_B = 'A' {
AND Game_Number = '" + num + "';";
SQLiteConnection myConnection4.Open();
myConnection3 = new myReader4 =
SQLiteConnection(Conn.ConnString); myCommand4.ExecuteReader();
SQLiteCommand while
myCommand3 = new (myReader4.Read())
SQLiteCommand(myQuery3, {
myConnection3); teamb =
SQLiteDataReader myReader4.GetValue(0).ToString();
myReader3; }
}
try
{ catch
(SQLiteException ex)
myConnection3.Open(); {
myReader3 =
myCommand3.ExecuteReader(); MessageBox.Show(ex.Message, "Error",
while MessageBoxButtons.OK,
(myReader3.Read()) MessageBoxIcon.Error);
{ }
teama =
myReader3.GetValue(0).ToString(); finally
} {
}
151
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Game_Report r =
myConnection4.Close(); new Game_Report();
} r.Refresh();
152
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
153
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void cmbUType.Text =
cmbSUType_SelectedIndexChanged(object row.Cells["User
sender, EventArgs e) Type"].Value.ToString();
{ txtUsername.Text =
if (cmbSUType.Text == row.Cells["Username"].Value.ToString(
"All") );
{ txtPassword.Text =
LoadUser(); row.Cells["Password"].Value.ToString(
} );
sUID =
else row.Cells["No_ID"].Value.ToString();
{ }
DataView myDV = new }
DataView(myDatasetU); #endregion
myDV.RowFilter =
string.Format("[User Type] LIKE #region Default -Select-
'%{0}%'", private void
EscapeLikeValue(cmbSUType.Text)); cmbUType_DropDown(object sender,
dgvUser.DataSource = EventArgs e)
myDV; {
} cmbUType.Items.Remove("-
} Select-");
}
private void
txtSUsername_TextChanged(object private void
sender, EventArgs e) cmbUType_DropDownClosed(object
{ sender, EventArgs e)
DataView myDV = new {
DataView(myDatasetU); if (cmbUType.SelectedItem
myDV.RowFilter = == null)
string.Format("[Username] LIKE {
'%{0}%'", if
EscapeLikeValue(txtSUsername.Text)); (!cmbUType.Items.Contains("-Select-
dgvUser.DataSource = "))
myDV; {
}
cmbUType.Items.Add("-Select-");
private void }
cmbUSearch_SelectedIndexChanged(objec
t sender, EventArgs e) cmbUType.Text = "-
{ Select-";
USearch(); }
} }
#endregion #endregion
154
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
#endregion
txtPassword.PasswordChar = '\0';
} #region Edit User
string un = "", ut = "", ps =
else "";
{ private void
btnSH.Text = "S&how btnUEdit_Click(object sender,
Password"; EventArgs e)
{
txtPassword.PasswordChar = '*'; ut = cmbUType.Text;
} un = txtUsername.Text;
} ps = txtPassword.Text;
#endregion
pnlUser.Enabled = false;
#region Add User sUAddEdit = "Edit";
private void
btnUAdd_Click(object sender, if
EventArgs e) (cmbUType.Items.Contains("-Select-"))
{ {
pnlUser.Enabled = false;
sUAddEdit = "Add"; cmbUType.Items.Remove("-Select-");
}
if
(!cmbUType.Items.Contains("-Select- lblUType.Enabled = true;
")) lblUsername.Enabled =
{ true;
lblPassword.Enabled =
cmbUType.Items.Insert(0, "-Select-"); true;
}
cmbUType.Enabled = true;
cmbUType.Text = "-Select- txtUsername.Enabled =
"; true;
txtUsername.Clear(); txtPassword.Enabled =
txtPassword.Clear(); true;
155
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
lblUType.Enabled = btnUSave.Enabled =
false; false;
lblUsername.Enabled = btnUCancel.Enabled =
false; false;
lblPassword.Enabled =
false; cmbUType.Text = ut;
txtUsername.Text =
cmbUType.Enabled = un;
false; txtPassword.Text =
txtUsername.Enabled = ps;
false; }
txtPassword.Enabled = }
false; #endregion
156
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
MessageBoxButtons.OK,
MessageBoxIcon.Information); else
LoadUser(); {
} if (sUAddEdit ==
"Add")
catch {
(SQLiteException ex) un =
{ txtUsername.Text;
157
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ txtPassword.Text + "' WHERE No_ID =
btnUAdd.Enabled = true; '" + sUID + "';";
SQLiteConnection
btnUEdit.Enabled = true; myConnection = new
SQLiteConnection(Conn.ConnString);
btnUDelete.Enabled = true; SQLiteCommand
myCommand = new
SQLiteCommand(myQuery, myConnection);
btnUSave.Enabled = false; SQLiteDataReader
myReader;
btnUCancel.Enabled = false;
try
LoadUser(); {
}
myConnection.Open();
catch myReader =
(SQLiteException ex) myCommand.ExecuteReader();
{ while
if (myReader.Read()) { }
(ex.Message.Contains("UNIQUE
constraint failed"))
{ MessageBox.Show("User " +
txtUsername.Text + " has been
MessageBox.Show("User " + edited.", "User",
txtUsername.Text + " is already MessageBoxButtons.OK,
exist.", "User", MessageBoxIcon.Information);
MessageBoxButtons.OK,
MessageBoxIcon.Error);
} pnlUser.Enabled = true;
158
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} using System.Collections.Generic;
using System.ComponentModel;
catch using System.Data;
(SQLiteException ex) using System.Drawing;
{ using System.Linq;
if using System.Text;
(ex.Message.Contains("UNIQUE using System.Windows.Forms;
constraint failed"))
{ namespace
Lucena_Sports_Office_BSSE_System
MessageBox.Show("User " + {
txtUsername.Text + " is already public partial class
exist.", "User", Administrator_Game_Report : Form
MessageBoxButtons.OK, {
MessageBoxIcon.Error); public
} Administrator_Game_Report()
{
else InitializeComponent();
{ }
DrawIconSample(e.Graphics, ref x, y,
Administrator_Game_Report.cs SystemIcons.Question, "");
}
using System; #endregion
159
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (c == '.') namespace
{ Lucena_Sports_Office_BSSE_System
e.Handled = true; {
} class Conn
{
if public static string
(txtGNumber.Text.StartsWith("0")) ConnString = "Data Source = bsse.db;
{ Version = 3; Pooling = True; Max Pool
if (c == '0') Size = 100;";
{ }
e.Handled = true; }
}
160
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
cmbDTeam.Text = "-Select- private void
"; btnCancel_Click(object sender,
EventArgs e)
if (Game.sEGame == "gf") {
{ this.Hide();
rdbGFinished.Checked }
= true; #endregion
}
#region OK
else if (Game.sEGame == private void
"def") btnOk_Click(object sender, EventArgs
{ e)
rdbDefault.Checked = {
true; if (rdbDefault.Checked)
} {
} Game.sEGame = "sdef";
sDTeam =
#region Question Mark Icon cmbDTeam.Text;
private const int }
column_width = 150;
private const int row_height else
= 50; {
Game.sEGame = "sgf";
private void }
DrawIconSample(Graphics gr, ref int
x, int y, Icon ico, string ico_name) this.Hide();
{ }
#endregion
gr.DrawIconUnstretched(ico, new
Rectangle(x, y, ico.Width, #region Default or Game
ico.Height)); Finished
int text_y = y + void DefaultTeam()
(int)(ico.Height - {
gr.MeasureString(ico_name, if (rdbGFinished.Checked)
this.Font).Height) / 2; {
gr.DrawString(ico_name, lblDTeam.Enabled =
this.Font, Brushes.Black, x + false;
ico.Width + 5, text_y); cmbDTeam.Enabled =
x += column_width; false;
} }
161
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private const int row_height
private void = 50;
rdbGFinished_CheckedChanged(object
sender, EventArgs e) private void
{ DrawIconSample(Graphics gr, ref int
DefaultTeam(); x, int y, Icon ico, string ico_name)
} {
#endregion
gr.DrawIconUnstretched(ico, new
#region Read Only ComboBox Rectangle(x, y, ico.Width,
private void ico.Height));
cmbDTeam_KeyPress(object sender, int text_y = y +
KeyPressEventArgs e) (int)(ico.Height -
{ gr.MeasureString(ico_name,
e.KeyChar = this.Font).Height) / 2;
(char)Keys.None; gr.DrawString(ico_name,
} this.Font, Brushes.Black, x +
#endregion ico.Width + 5, text_y);
x += column_width;
} }
}
private void
First_Five_Paint(object sender,
PaintEventArgs e)
First_Five.cs {
int x = 25;
using System; int y = 25;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data; DrawIconSample(e.Graphics, ref x, y,
using System.Drawing; SystemIcons.Question, "");
using System.Linq; }
using System.Text; #endregion
using System.Windows.Forms;
using System.Data.SQLite; #region Load Table
using System.Collections; void LoadFF()
{
namespace SQLiteConnection myConn =
Lucena_Sports_Office_BSSE_System new
{ SQLiteConnection(Conn.ConnString);
public partial class First_Five : SQLiteCommand myCommand =
Form new SQLiteCommand("SELECT No_ID,
{ Last_Name || ', ' || First_Name || '
DataTable myDatasetFF; ' || "
public static string sTeam = + "Middle_Initial AS
"", sTL = "", sIo = "0"; 'Players Name', In_or_Out AS 'In or
Out' FROM tbl_playersgame WHERE
public First_Five() Team_Name = '" + sTeam + "' "
{ + "ORDER BY Last_Name ||
InitializeComponent(); ', ' || First_Name || ' ' ||
Middle_Initial;", myConn);
LoadFF();
} try
{
#region Question Mark Icon SQLiteDataAdapter
private const int myAdapter = new SQLiteDataAdapter();
column_width = 150;
162
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
}
myAdapter.SelectCommand = myCommand; }
myDatasetFF = new
DataTable(); catch (SQLiteException
ex)
myAdapter.Fill(myDatasetFF); {
BindingSource
bdSource = new BindingSource(); MessageBox.Show(ex.Message, "Error",
bdSource.DataSource = MessageBoxButtons.OK,
myDatasetFF; MessageBoxIcon.Error);
dgvFFive.DataSource = }
bdSource;
finally
myAdapter.Update(myDatasetFF); {
} myConnection.Close();
}
catch (Exception ex) }
{ #endregion
163
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
row.DefaultCellStyle.ForeColor = myConnection.Open();
Color.Blue; myReader =
} myCommand.ExecuteReader();
while
else if (rs == (myReader.Read()) { }
"Out")
{ LoadFF();
}
row.DefaultCellStyle.ForeColor =
Color.Black; catch
} (SQLiteException ex)
} {
}
} MessageBox.Show(ex.Message, "Error",
#endregion MessageBoxButtons.OK,
MessageBoxIcon.Error);
#region Cell Click }
private void
dgvFFive_CellClick(object sender, finally
DataGridViewCellEventArgs e) {
{
string id = "", inout = myConnection.Close();
"", pname = ""; }
}
if (e.RowIndex >= 0)
{ if (inout == "In")
DataGridViewRow row = {
this.dgvFFive.Rows[e.RowIndex]; string myQuery =
"UPDATE tbl_playersgame SET In_or_Out
pname = = 'Out' WHERE No_ID = '" + id + "';";
row.Cells["Players SQLiteConnection
Name"].Value.ToString(); myConnection = new
inout = row.Cells["In SQLiteConnection(Conn.ConnString);
or Out"].Value.ToString(); SQLiteCommand
id = myCommand = new
row.Cells["No_ID"].Value.ToString(); SQLiteCommand(myQuery, myConnection);
} SQLiteDataReader
myReader;
if (inout == "Out")
{ try
string myQuery = {
"UPDATE tbl_playersgame SET In_or_Out
= 'In' WHERE No_ID = '" + id + "';"; myConnection.Open();
SQLiteConnection myReader =
myConnection = new myCommand.ExecuteReader();
SQLiteConnection(Conn.ConnString); while
SQLiteCommand (myReader.Read()) { }
myCommand = new
SQLiteCommand(myQuery, myConnection); LoadFF();
SQLiteDataReader }
myReader;
catch
try (SQLiteException ex)
{ {
164
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection
MessageBox.Show(ex.Message, "Error", myConnection = new
MessageBoxButtons.OK, SQLiteConnection(Conn.ConnString);
MessageBoxIcon.Error); SQLiteCommand myCommand =
} new SQLiteCommand(myQuery,
myConnection);
finally SQLiteDataReader
{ myReader;
myConnection.Close(); try
} {
} myConnection.Open();
myReader =
foreach (DataGridViewRow myCommand.ExecuteReader();
row in dgvFFive.Rows) while
{ (myReader.Read())
if {
(row.Cells[1].Value.ToString().Equals sIo =
(pname)) myReader.GetValue(0).ToString();
{ }
165
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
else if (sTL == private void
"B") First_Five_FormClosing(object sender,
{ FormClosingEventArgs e)
Game.sFFive = {
"BOk"; if (e.CloseReason ==
} CloseReason.UserClosing)
{
Game.sFT = sTeam; if (sTL == "A")
Game.sFError = {
"more"; Game.sFFive =
"AC";
this.Hide(); }
}
else if (sTL == "B")
else {
{ Game.sFFive =
if (sTL == "A") "BC";
{ }
Game.sFFive = }
"AOk"; }
} #endregion
else if (sTL == }
"B") }
{
Game.sFFive =
"BOk";
}
Game.cs
166
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
"", sTNameB = "", sLock = "", sFFive MessageBoxButtons.OK,
= "", sFError = "", sFT = ""; MessageBoxIcon.Error);
public static string sFoulA = First_Five.sTeam
"", sQValueA = "", sTeamFoulA = ""; = sFT;
public static string sFoulB = First_Five.sTL =
"", sQValueB = "", sTeamFoulB = ""; "A";
int iTimeoutA = 0, iTimeoutB
= 0, iTO = 0, iDT = 4; First_Five w =
new First_Five();
public Game() w.ShowDialog();
{ }
InitializeComponent();
else if (sFError ==
ClearAllPlayers(); "more")
ClearAllTeams(); {
ClearOfficials(); sFError = "";
cmbDivision.SelectedIndex
= 0; MessageBox.Show("Please select only
tmrDTime.Start(); five players.", "First Five",
GameNumber(); MessageBoxButtons.OK,
cmbTeamA.SelectedIndex = MessageBoxIcon.Error);
0; First_Five.sTeam
cmbTeamB.SelectedIndex = = sFT;
0; First_Five.sTL =
"A";
GameReport();
First_Five w =
LoadTeamA(); new First_Five();
LoadTeamB(); w.ShowDialog();
} }
167
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ #endregion
sFError = "";
#region Navigation
private void
MessageBox.Show("Please select five tsGame_Click(object sender, EventArgs
players.", "First Five", e)
MessageBoxButtons.OK, {
MessageBoxIcon.Error); tsGame.ForeColor =
First_Five.sTeam Color.FromArgb(236, 189, 0);
= sFT; tsOfficials.ForeColor =
First_Five.sTL = Color.White;
"B"; tsGReport.ForeColor =
Color.White;
First_Five w =
new First_Five(); pnlMGame.Visible = true;
w.ShowDialog(); pnlMOfficials.Visible =
} false;
pnlMGReport.Visible =
else if (sFError == false;
"more")
{ btnOCancel_Click(sender,
sFError = ""; e);
}
168
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ cmbDivision.Text = "-
if (sOLogin == "1") Select-";
{ }
tsGame.ForeColor = }
Color.White; #endregion
tsOfficials.ForeColor
= Color.FromArgb(236, 189, 0); #region Selecting Division
tsGReport.ForeColor = string div = "-Select-";
Color.White; private void
cmbDivision_SelectedIndexChanged(obje
txtOGame.Text = ct sender, EventArgs e)
txtGGNumber.Text; {
txtOGame.Text = if (cmbDivision.Text !=
cmbTeamA.Text + " vs. " + div)
cmbTeamB.Text; {
txtODivision.Text = if (cmbDivision.Text
cmbDivision.Text; != "-Select-" && cmbDivision.Text !=
"")
pnlMGame.Visible = {
false; pnlTeamA.Enabled
pnlMOfficials.Visible = true;
= true; pnlTeamB.Enabled
pnlMGReport.Visible = = true;
false;
cmbDivision.Items.Remove("-Select-"); lblNotif.Text =
} cmbDivision.Text + " division has
been selected.";
private void lblNotif.Visible
cmbDivision_DropDownClosed(object = true;
sender, EventArgs e) iDT = 4;
{ tmrNotif.Start();
if }
(cmbDivision.SelectedItem == null)
{ else
if {
(!cmbDivision.Items.Contains("- pnlTeamA.Enabled
Select-")) = false;
{ pnlTeamB.Enabled
= false;
cmbDivision.Items.Add("-Select-"); }
}
TeamASelect();
169
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
TeamBSelect(); }
div =
cmbDivision.Text; catch (SQLiteException
} ex)
} {
#endregion
MessageBox.Show(ex.Message, "Error",
#region System Time MessageBoxButtons.OK,
private void MessageBoxIcon.Error);
tmrDTime_Tick(object sender, }
EventArgs e)
{ finally
string gamedate, {
gametime; myConnection.Close();
}
DateTime datetime = }
DateTime.Now; #endregion
sDateTime =
datetime.ToString("yyyy-MM-dd #region Populate Teams
HH:mm:ss.fff"); void PopulateTeams()
gamedate = {
datetime.ToString("MMMM dd, yyyy"); string myQuery = "SELECT
gametime = Team_Name FROM tbl_teamsinfo WHERE
datetime.ToString("hh:mm tt"); Division = '" + cmbDivision.Text +
"';";
txtDate.Text = gamedate; SQLiteConnection
txtTime.Text = gametime; myConnection = new
} SQLiteConnection(Conn.ConnString);
#endregion SQLiteCommand myCommand =
new SQLiteCommand(myQuery,
#region Game Number myConnection);
void GameNumber() SQLiteDataReader
{ myReader;
string myQuery = "SELECT
IFNULL(MAX(Game_Number + 1), 1) FROM try
tbl_playersgamelogs;"; {
SQLiteConnection myConnection.Open();
myConnection = new myReader =
SQLiteConnection(Conn.ConnString); myCommand.ExecuteReader();
SQLiteCommand myCommand = while
new SQLiteCommand(myQuery, (myReader.Read())
myConnection); {
SQLiteDataReader string category =
myReader; myReader.GetString(0);
try cmbTeamA.Items.Add(category);
{
myConnection.Open(); cmbTeamB.Items.Add(category);
myReader = }
myCommand.ExecuteReader(); }
while
(myReader.Read()) catch (SQLiteException
{ ex)
txtGGNumber.Text {
= myReader.GetInt32(0).ToString();
} MessageBox.Show(ex.Message, "Error",
170
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
MessageBoxButtons.OK, if
MessageBoxIcon.Error); (!cmbTeamB.Items.Contains("-Select-
} "))
{
finally
{ cmbTeamB.Items.Insert(0, "-Select-");
myConnection.Close(); }
}
} cmbTeamB.Text = "-
#endregion Select-";
}
#region Team A and B Default }
-Select- #endregion
private void
cmbTeamA_DropDown(object sender, #region Same Team Error Trap
EventArgs e) void SameTeam()
{ {
cmbTeamA.Items.Remove("- if (cmbTeamA.Text ==
Select-"); cmbTeamB.Text && cmbTeamA.Text != "-
} Select-" && cmbTeamB.Text != "-
Select-")
private void {
cmbTeamA_DropDownClosed(object MessageBox.Show("You
sender, EventArgs e) are trying to match-up the same
{ team.", "Same Team",
if (cmbTeamA.SelectedItem MessageBoxButtons.OK,
== null) MessageBoxIcon.Error);
{ }
if }
(!cmbTeamA.Items.Contains("-Select- #endregion
"))
{ #region Team A Record Default
void TeamARecord()
cmbTeamA.Items.Insert(0, "-Select-"); {
} string myQuery = "UPDATE
tbl_playersgame SET In_or_Out =
cmbTeamA.Text = "- 'Out', FirstP_Score = 0, "
Select-"; + "SecondP_Score = 0,
} ThirdP_Score = 0, FourthP_Score = 0,
} Overtime_Score = 0, Foul_1 = 0, "
+ "Foul_2 = 0, Foul_3 =
private void 0, Foul_4 = 0, Foul_5 = 0 WHERE
cmbTeamB_DropDown(object sender, Team_Name = '" + cmbTeamA.Text +
EventArgs e) "';";
{ SQLiteConnection
cmbTeamB.Items.Remove("- myConnection = new
Select-"); SQLiteConnection(Conn.ConnString);
} SQLiteCommand myCommand =
new SQLiteCommand(myQuery,
private void myConnection);
cmbTeamB_DropDownClosed(object SQLiteDataReader
sender, EventArgs e) myReader;
{
if (cmbTeamB.SelectedItem try
== null) {
{ myConnection.Open();
171
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myReader = MessageBoxButtons.OK,
myCommand.ExecuteReader(); MessageBoxIcon.Error);
while }
(myReader.Read()) { }
} finally
{
catch (SQLiteException
ex) myConnection1.Close();
{ }
}
MessageBox.Show(ex.Message, "Error", #endregion
MessageBoxButtons.OK,
MessageBoxIcon.Error); #region Team B Record Default
} void TeamBRecord()
{
finally string myQuery = "UPDATE
{ tbl_playersgame SET In_or_Out =
myConnection.Close(); 'Out', FirstP_Score = 0, "
} + "SecondP_Score = 0,
ThirdP_Score = 0, FourthP_Score = 0,
string myQuery1 = "UPDATE Overtime_Score = 0, Foul_1 = 0, "
tbl_teamsgame SET First_Half_Time_Out + "Foul_2 = 0, Foul_3 =
= 0, Second_Half_Time_Out = 0, " 0, Foul_4 = 0, Foul_5 = 0 WHERE
+ "Extra_Time_Out = 0, Team_Name = '" + cmbTeamB.Text +
FirstP_Team_Foul = 0, "';";
SecondP_Team_Foul = 0, SQLiteConnection
ThirdP_Team_Foul = 0, " myConnection = new
+ "FourthP_Team_Foul = 0, SQLiteConnection(Conn.ConnString);
Overtime_Team_Foul = 0, Game_Score = SQLiteCommand myCommand =
'0-0', Game_Status = '-' WHERE new SQLiteCommand(myQuery,
Team_Name = '" + cmbTeamA.Text + myConnection);
"';"; SQLiteDataReader
SQLiteConnection myReader;
myConnection1 = new
SQLiteConnection(Conn.ConnString); try
SQLiteCommand myCommand1 {
= new SQLiteCommand(myQuery1, myConnection.Open();
myConnection1); myReader =
SQLiteDataReader myCommand.ExecuteReader();
myReader1; while
(myReader.Read()) { }
try }
{
myConnection1.Open(); catch (SQLiteException
myReader1 = ex)
myCommand1.ExecuteReader(); {
while
(myReader1.Read()) { } MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
catch (SQLiteException }
ex)
{ finally
{
MessageBox.Show(ex.Message, "Error", myConnection.Close();
}
172
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
TeamASelect();
string myQuery1 = "UPDATE
tbl_teamsgame SET First_Half_Time_Out ClearTeamA();
= 0, Second_Half_Time_Out = 0, " FillTeamA();
+ "Extra_Time_Out = 0, TeamARecord();
FirstP_Team_Foul = 0, LoadTeamA();
SecondP_Team_Foul = 0, sTeamA =
ThirdP_Team_Foul = 0, " cmbTeamA.Text;
+ "FourthP_Team_Foul = 0, ta = cmbTeamA.Text;
Overtime_Team_Foul = 0, Game_Score =
'0-0', Game_Status = '-' WHERE SameTeam();
Team_Name = '" + cmbTeamB.Text +
"';"; if (cmbTeamA.Text ==
SQLiteConnection cmbTeamB.Text && cmbTeamA.Text != "-
myConnection1 = new Select-" && cmbTeamB.Text != "-
SQLiteConnection(Conn.ConnString); Select-")
SQLiteCommand myCommand1 {
= new SQLiteCommand(myQuery1,
myConnection1); cmbTeamA.Items.Insert(0, "-Select-");
SQLiteDataReader
myReader1; cmbTeamA.SelectedItem = "-Select-";
}
try
{ else if
myConnection1.Open(); (dgvTeamA.Rows.Count == 0 &&
myReader1 = cmbTeamA.Text != "-Select-")
myCommand1.ExecuteReader(); {
while
(myReader1.Read()) { } MessageBox.Show("Team " +
} cmbTeamA.Text + " has no players to
play.", "No Players",
catch (SQLiteException MessageBoxButtons.OK,
ex) MessageBoxIcon.Error);
{
finally else if
{ (dgvTeamA.Rows.Count < 5 &&
cmbTeamA.Text != "-Select-")
myConnection1.Close(); {
}
} MessageBox.Show("Team " +
#endregion cmbTeamA.Text + " has less than 5
players to play.", "Less Players",
#region Team A Select MessageBoxButtons.OK,
string ta = "-Select-"; MessageBoxIcon.Error);
private void
cmbTeamA_SelectedIndexChanged(object
sender, EventArgs e) cmbTeamA.Items.Insert(0, "-Select-");
{
if (ta != cmbTeamA.Text) cmbTeamA.SelectedItem = "-Select-";
{ }
173
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
btnM1A.Visible = true;
if (cmbTeamA.Text != btnM2A.Visible = true;
"-Select-" && cmbTeamA.Text != "") btnM3A.Visible = true;
{
chkLockA.Enabled btnPFoulA.Visible = true;
= true; btnMFoulA.Visible = true;
174
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
chkLockB.Enabled
MessageBox.Show("Team " + = false;
cmbTeamB.Text + " has no players to }
play.", "No Players", }
MessageBoxButtons.OK, }
MessageBoxIcon.Error);
void TeamBSelect()
{
cmbTeamB.Items.Insert(0, "-Select-"); txtScoreB.Text = "000";
txtPlayerB.Text = "None";
cmbTeamB.SelectedItem = "-Select-"; txtCPlayersB.Text = "0";
} txt1HTOB.Text = "0";
txt2HTOB.Text = "0";
else if txtETOB.Text = "0";
(dgvTeamB.Rows.Count < 5 && txt1TFB.Text = "0";
cmbTeamB.Text != "-Select-") txt2TFB.Text = "0";
{ txt3TFB.Text = "0";
txt4TFB.Text = "0";
MessageBox.Show("Team " + txtOTFB.Text = "0";
cmbTeamB.Text + " has less than 5 txtPenaltyB.Visible =
players to play.", "Less Players", false;
MessageBoxButtons.OK,
MessageBoxIcon.Error); rdbFSB.Checked = true;
pnlFSB.Visible = false;
175
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection
myConnection = new MessageBox.Show(ex.Message, "Error",
SQLiteConnection(Conn.ConnString); MessageBoxButtons.OK,
SQLiteCommand myCommand = MessageBoxIcon.Error);
new SQLiteCommand(myQuery, }
myConnection);
SQLiteDataReader finally
myReader; {
try myConnection1.Close();
{ }
myConnection.Open(); }
myReader = #endregion
myCommand.ExecuteReader();
while #region Clear Team B
(myReader.Read()) { } void ClearTeamB()
} {
string myQuery = "DELETE
catch (SQLiteException FROM tbl_playersgame WHERE Team_Name
ex) = '" + sTeamB + "';";
{ SQLiteConnection
myConnection = new
MessageBox.Show(ex.Message, "Error", SQLiteConnection(Conn.ConnString);
MessageBoxButtons.OK, SQLiteCommand myCommand =
MessageBoxIcon.Error); new SQLiteCommand(myQuery,
} myConnection);
SQLiteDataReader
finally myReader;
{
myConnection.Close(); try
} {
myConnection.Open();
string myQuery1 = "DELETE myReader =
FROM tbl_teamsgame WHERE Team_Name = myCommand.ExecuteReader();
'" + sTeamA + "';"; while
SQLiteConnection (myReader.Read()) { }
myConnection1 = new }
SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand1 catch (SQLiteException
= new SQLiteCommand(myQuery1, ex)
myConnection1); {
SQLiteDataReader
myReader1; MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
try MessageBoxIcon.Error);
{ }
myConnection1.Open();
myReader1 = finally
myCommand1.ExecuteReader(); {
while myConnection.Close();
(myReader1.Read()) { } }
}
string myQuery1 = "DELETE
catch (SQLiteException FROM tbl_teamsgame WHERE Team_Name =
ex) '" + sTeamB + "';";
{
176
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection
myConnection1 = new try
SQLiteConnection(Conn.ConnString); {
SQLiteCommand myCommand1 myConnection.Open();
= new SQLiteCommand(myQuery1, myReader =
myConnection1); myCommand.ExecuteReader();
SQLiteDataReader while
myReader1; (myReader.Read()) { }
}
try
{ catch (SQLiteException
myConnection1.Open(); ex)
myReader1 = {
myCommand1.ExecuteReader();
while MessageBox.Show(ex.Message, "Error",
(myReader1.Read()) { } MessageBoxButtons.OK,
} MessageBoxIcon.Error);
}
catch (SQLiteException
ex) finally
{ {
myConnection.Close();
MessageBox.Show(ex.Message, "Error", }
MessageBoxButtons.OK,
MessageBoxIcon.Error); string myQuery1 = "INSERT
} INTO tbl_teamsgame(Team_Name,
Division) SELECT Team_Name, Division
finally "
{ + "FROM tbl_teamsinfo
WHERE Team_Name = '" + cmbTeamA.Text
myConnection1.Close(); + "';";
} SQLiteConnection
} myConnection1 = new
#endregion SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand1
#region Fill Team A = new SQLiteCommand(myQuery1,
void FillTeamA() myConnection1);
{ SQLiteDataReader
string myQuery = "INSERT myReader1;
INTO tbl_playersgame(Team_Name,
Division, Last_Name, First_Name, " try
+ "Middle_Initial, {
Jersey_Number) SELECT Team_Name, myConnection1.Open();
Division, Last_Name, First_Name, " myReader1 =
+ "Middle_Initial, myCommand1.ExecuteReader();
Jersey_Number FROM tbl_playersinfo while
WHERE Team_Name = '" + cmbTeamA.Text (myReader1.Read()) { }
+ "';"; }
SQLiteConnection
myConnection = new catch (SQLiteException
SQLiteConnection(Conn.ConnString); ex)
SQLiteCommand myCommand = {
new SQLiteCommand(myQuery,
myConnection); MessageBox.Show(ex.Message, "Error",
SQLiteDataReader MessageBoxButtons.OK,
myReader; MessageBoxIcon.Error);
177
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} + "Middle_Initial,
Jersey_Number FROM tbl_playersinfo
finally WHERE Team_Name = '" + cmbTeamB.Text
{ + "';";
SQLiteConnection
myConnection1.Close(); myConnection = new
} SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand =
string myQuery2 = "UPDATE new SQLiteCommand(myQuery,
tbl_teamsgame SET A_or_B = 'A' WHERE myConnection);
Team_Name = '" + cmbTeamA.Text + SQLiteDataReader
"';"; myReader;
SQLiteConnection
myConnection2 = new try
SQLiteConnection(Conn.ConnString); {
SQLiteCommand myCommand2 myConnection.Open();
= new SQLiteCommand(myQuery2, myReader =
myConnection2); myCommand.ExecuteReader();
SQLiteDataReader while
myReader2; (myReader.Read()) { }
}
try
{ catch (SQLiteException
myConnection2.Open(); ex)
myReader2 = {
myCommand2.ExecuteReader();
while MessageBox.Show(ex.Message, "Error",
(myReader2.Read()) { } MessageBoxButtons.OK,
} MessageBoxIcon.Error);
}
catch (SQLiteException
ex) finally
{ {
myConnection.Close();
MessageBox.Show(ex.Message, "Error", }
MessageBoxButtons.OK,
MessageBoxIcon.Error); string myQuery1 = "INSERT
} INTO tbl_teamsgame(Team_Name,
Division) SELECT Team_Name, Division
finally "
{ + "FROM tbl_teamsinfo
WHERE Team_Name = '" + cmbTeamB.Text
myConnection2.Close(); + "';";
} SQLiteConnection
} myConnection1 = new
#endregion SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand1
#region Fill Team B = new SQLiteCommand(myQuery1,
void FillTeamB() myConnection1);
{ SQLiteDataReader
string myQuery = "INSERT myReader1;
INTO tbl_playersgame(Team_Name,
Division, Last_Name, First_Name, " try
+ "Middle_Initial, {
Jersey_Number) SELECT Team_Name, myConnection1.Open();
Division, Last_Name, First_Name, "
178
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myReader1 = }
myCommand1.ExecuteReader(); }
while #endregion
(myReader1.Read()) { }
} #region Clear All Players
void ClearAllPlayers()
catch (SQLiteException {
ex) string myQuery = "DROP
{ TABLE IF EXISTS tbl_playersgame;";
SQLiteConnection
MessageBox.Show(ex.Message, "Error", myConnection = new
MessageBoxButtons.OK, SQLiteConnection(Conn.ConnString);
MessageBoxIcon.Error); SQLiteCommand myCommand =
} new SQLiteCommand(myQuery,
myConnection);
finally SQLiteDataReader
{ myReader;
myConnection1.Close(); try
} {
myConnection.Open();
string myQuery2 = "UPDATE myReader =
tbl_teamsgame SET A_or_B = 'B' WHERE myCommand.ExecuteReader();
Team_Name = '" + cmbTeamB.Text + while
"';"; (myReader.Read()) { }
SQLiteConnection }
myConnection2 = new
SQLiteConnection(Conn.ConnString); catch (SQLiteException
SQLiteCommand myCommand2 ex)
= new SQLiteCommand(myQuery2, {
myConnection2);
SQLiteDataReader MessageBox.Show(ex.Message, "Error",
myReader2; MessageBoxButtons.OK,
MessageBoxIcon.Error);
try }
{
myConnection2.Open(); finally
myReader2 = {
myCommand2.ExecuteReader(); myConnection.Close();
while }
(myReader2.Read()) { }
} string myQuery1 = "CREATE
TABLE IF NOT EXISTS
catch (SQLiteException `tbl_playersgame`"
ex) + "(`No_ID` INTEGER
{ PRIMARY KEY AUTOINCREMENT,"
+ "`Game_Date`
MessageBox.Show(ex.Message, "Error", DATETIME,"
MessageBoxButtons.OK, + "`Game_Number`
MessageBoxIcon.Error); INTEGER,"
} + "`Team_Name`
VARCHAR,"
finally + "`Division`
{ VARCHAR,"
+ "`Last_Name`
myConnection2.Close(); VARCHAR,"
179
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "`First_Name` }
VARCHAR," #endregion
+ "`Middle_Initial`
VARCHAR," #region Clear All Teams
+ "`Jersey_Number` void ClearAllTeams()
INTEGER," {
+ "`In_or_Out` string myQuery = "DROP
VARCHAR," TABLE IF EXISTS tbl_teamsgame;";
+ "`FirstP_Score` SQLiteConnection
INTEGER," myConnection = new
+ "`SecondP_Score` SQLiteConnection(Conn.ConnString);
INTEGER," SQLiteCommand myCommand =
+ "`ThirdP_Score` new SQLiteCommand(myQuery,
INTEGER," myConnection);
+ "`FourthP_Score` SQLiteDataReader
INTEGER," myReader;
+ "`Overtime_Score`
INTEGER," try
+ "`Foul_1` VARCHAR," {
+ "`Foul_2` VARCHAR," myConnection.Open();
+ "`Foul_3` VARCHAR," myReader =
+ "`Foul_4` VARCHAR," myCommand.ExecuteReader();
+ "`Foul_5` while
VARCHAR);"; (myReader.Read()) { }
SQLiteConnection }
myConnection1 = new
SQLiteConnection(Conn.ConnString); catch (SQLiteException
SQLiteCommand myCommand1 ex)
= new SQLiteCommand(myQuery1, {
myConnection1);
SQLiteDataReader MessageBox.Show(ex.Message, "Error",
myReader1; MessageBoxButtons.OK,
MessageBoxIcon.Error);
try }
{
myConnection1.Open(); finally
myReader1 = {
myCommand1.ExecuteReader(); myConnection.Close();
while }
(myReader1.Read()) { }
} string myQuery1 = "CREATE
TABLE IF NOT EXISTS `tbl_teamsgame` (
catch (SQLiteException "
ex) + "`No_ID` INTEGER
{ PRIMARY KEY AUTOINCREMENT, "
+ "`Game_Date`
MessageBox.Show(ex.Message, "Error", DATETIME, "
MessageBoxButtons.OK, + "`Game_Number`
MessageBoxIcon.Error); INTEGER, "
} + "`Team_Name`
VARCHAR, "
finally + "`Division`
{ VARCHAR, "
+
myConnection1.Close(); "`First_Half_Time_Out` INTEGER,
} "
180
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+
"`Second_Half_Time_Out` INTEGER, #region Clear Officials
" void ClearOfficials()
+ "`Extra_Time_Out` {
INTEGER, " string myQuery = "DROP
+ "`FirstP_Team_Foul` TABLE IF EXISTS tbl_gameofficials;";
INTEGER, " SQLiteConnection
+ "`SecondP_Team_Foul` myConnection = new
INTEGER, " SQLiteConnection(Conn.ConnString);
+ "`ThirdP_Team_Foul` SQLiteCommand myCommand =
INTEGER, " new SQLiteCommand(myQuery,
+ "`FourthP_Team_Foul` myConnection);
INTEGER, " SQLiteDataReader
+ "`Overtime_Team_Foul` myReader;
INTEGER, "
+ "`Opponent` try
VARCHAR, " {
+ "`Game_Score` myConnection.Open();
VARCHAR, " myReader =
+ "`Game_Status` myCommand.ExecuteReader();
VARCHAR, " while
+ "`A_or_B` VARCHAR);"; (myReader.Read()) { }
SQLiteConnection }
myConnection1 = new
SQLiteConnection(Conn.ConnString); catch (SQLiteException
SQLiteCommand myCommand1 ex)
= new SQLiteCommand(myQuery1, {
myConnection1);
SQLiteDataReader MessageBox.Show(ex.Message, "Error",
myReader1; MessageBoxButtons.OK,
MessageBoxIcon.Error);
try }
{
myConnection1.Open(); finally
myReader1 = {
myCommand1.ExecuteReader(); myConnection.Close();
while }
(myReader1.Read()) { }
} string myQuery1 = "CREATE
TABLE IF NOT EXISTS
catch (SQLiteException `tbl_gameofficials` ( "
ex) + "`No_ID` INTEGER
{ PRIMARY KEY AUTOINCREMENT, "
+ "`Game_Number`
MessageBox.Show(ex.Message, "Error", INTEGER, "
MessageBoxButtons.OK, +
MessageBoxIcon.Error); "`City_Sports_Coordinator` VARCHAR,
} "
+ "`Board_Scorer`
finally VARCHAR, "
{ + "`Computer_Scorer`
VARCHAR, "
myConnection1.Close(); + "`Timer` VARCHAR,
} "
} + "`Announcer`
#endregion VARCHAR, "
181
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ SQLiteConnection myConn =
"`Twentyfour_Clock_Operator` new
VARCHAR, " SQLiteConnection(Conn.ConnString);
+ "`Utility` VARCHAR, SQLiteCommand myCommand =
" new SQLiteCommand("SELECT Last_Name
+ "`Head_Technical` || ', ' || First_Name || ' ' || "
VARCHAR, " + "Middle_Initial AS
+ "`Referee` VARCHAR, 'Players Name', Jersey_Number AS
" 'Jersey Number', In_or_Out AS 'In or
+ "`Umpire_1` VARCHAR, Out', "
" + "FirstP_Score AS '1st
+ "`Umpire_2` P. Score', SecondP_Score AS '2nd P.
VARCHAR);"; Score', ThirdP_Score AS '3rd P.
SQLiteConnection Score', "
myConnection1 = new + "FourthP_Score AS '4th
SQLiteConnection(Conn.ConnString); P. Score', Overtime_Score AS
SQLiteCommand myCommand1 'Overtime Score', CASE WHEN Foul_1 =
= new SQLiteCommand(myQuery1, 0 THEN '-' WHEN Foul_1 = 5 THEN 'OP'
myConnection1); ELSE Foul_1 || 'P' END AS 'Foul 1', "
SQLiteDataReader + "CASE WHEN Foul_2 = 0
myReader1; THEN '-' WHEN Foul_2 = 5 THEN 'OP'
ELSE Foul_2 || 'P' END AS 'Foul 2',
try CASE WHEN Foul_3 = 0 THEN '-' WHEN
{ Foul_3 = 5 THEN 'OP' ELSE Foul_3 ||
myConnection1.Open(); 'P' END AS 'Foul 3', "
myReader1 = + "CASE WHEN Foul_4 = 0
myCommand1.ExecuteReader(); THEN '-' WHEN Foul_4 = 5 THEN 'OP'
while ELSE Foul_4 || 'P' END AS 'Foul 4',
(myReader1.Read()) { } CASE WHEN Foul_5 = 0 THEN '-' WHEN
} Foul_5 = 5 THEN 'OP' ELSE Foul_5 ||
'P' END AS 'Foul 5', "
catch (SQLiteException + "CASE WHEN Foul_1 != 0
ex) THEN 1 ELSE Foul_1 END + CASE WHEN
{ Foul_2 != 0 THEN 1 ELSE Foul_2 END "
+ "+ CASE WHEN Foul_3 !=
MessageBox.Show(ex.Message, "Error", 0 THEN 1 ELSE Foul_3 END + CASE WHEN
MessageBoxButtons.OK, Foul_4 != 0 THEN 1 ELSE Foul_4 END "
MessageBoxIcon.Error); + "+ CASE WHEN Foul_5 !=
} 0 THEN 1 ELSE Foul_5 END AS 'Total
Foul' FROM tbl_playersgame "
finally + "WHERE Team_Name = '" +
{ cmbTeamA.Text + "' ORDER BY
In_or_Out, Jersey_Number;", myConn);
myConnection1.Close();
} try
} {
#endregion SQLiteDataAdapter
myAdapter = new SQLiteDataAdapter();
#region Load Teams
void LoadTeamA() myAdapter.SelectCommand = myCommand;
{ myDatasetTA = new
string p; DataTable();
p = txtPlayerA.Text; myAdapter.Fill(myDatasetTA);
BindingSource
bdSource = new BindingSource();
182
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
bdSource.DataSource = Alignment =
myDatasetTA; DataGridViewContentAlignment.MiddleRi
dgvTeamA.DataSource = ght;
bdSource;
dgvTeamA.Columns[9].DefaultCellStyle.
myAdapter.Update(myDatasetTA); Alignment =
} DataGridViewContentAlignment.MiddleRi
ght;
catch (Exception ex)
{ dgvTeamA.Columns[10].DefaultCellStyle
.Alignment =
MessageBox.Show(ex.Message, "Error", DataGridViewContentAlignment.MiddleRi
MessageBoxButtons.OK, ght;
MessageBoxIcon.Error);
} dgvTeamA.Columns[11].DefaultCellStyle
.Alignment =
DataGridViewContentAlignment.MiddleRi
dgvTeamA.Columns[0].Frozen = true; ght;
dgvTeamA.Columns[12].DefaultCellStyle
dgvTeamA.Columns[1].DefaultCellStyle. .Alignment =
Alignment = DataGridViewContentAlignment.MiddleRi
DataGridViewContentAlignment.MiddleRi ght;
ght;
dgvTeamA.Columns[13].DefaultCellStyle
dgvTeamA.Columns[2].DefaultCellStyle. .Alignment =
Alignment = DataGridViewContentAlignment.MiddleRi
DataGridViewContentAlignment.MiddleRi ght;
ght;
try
dgvTeamA.Columns[3].DefaultCellStyle. {
Alignment = foreach
DataGridViewContentAlignment.MiddleRi (DataGridViewRow row in
ght; dgvTeamA.Rows)
{
dgvTeamA.Columns[4].DefaultCellStyle. if
Alignment = (row.Cells[0].Value.ToString().Equals
DataGridViewContentAlignment.MiddleRi (p))
ght; {
183
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
184
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
btnMFoulA.Visible =
true; dgvTeamA.Columns[3].Visible = true;
pnlFSA.Visible =
dgvTeamA.Columns[0].Frozen = false; false;
pnlAPA.Visible =
dgvTeamA.AutoSizeColumnsMode = true;
DataGridViewAutoSizeColumnsMode.Fill;
btnP1A.Visible =
CurrencyManager cm = false;
(CurrencyManager)BindingContext[dgvTe btnP2A.Visible =
amA.DataSource]; false;
cm.SuspendBinding(); btnP3A.Visible =
false;
foreach
(DataGridViewRow row in btnM1A.Visible =
dgvTeamA.Rows) false;
{ btnM2A.Visible =
if false;
(row.Cells[2].Value.ToString() == btnM3A.Visible =
"Out") false;
{
row.Visible = btnPFoulA.Visible =
false; false;
} btnMFoulA.Visible =
} false;
cm.ResumeBinding();
} dgvTeamA.Columns[0].Frozen = true;
185
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
void ScoreFoulAPB()
{ dgvTeamB.Columns[5].Visible = true;
if (rdbFSB.Checked)
{ dgvTeamB.Columns[6].Visible = false;
186
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
foreach btnM1B.Visible =
(DataGridViewRow row in false;
dgvTeamB.Rows) btnM2B.Visible =
{ false;
if btnM3B.Visible =
(row.Cells[2].Value.ToString() == false;
"Out")
{ btnPFoulB.Visible =
row.Visible = false;
false; btnMFoulB.Visible =
} false;
}
187
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
}
myAdapter.SelectCommand = myCommand;
void LoadTeamB() myDatasetTB = new
{ DataTable();
string p;
myAdapter.Fill(myDatasetTB);
p = txtPlayerB.Text; BindingSource
bdSource = new BindingSource();
SQLiteConnection myConn = bdSource.DataSource =
new myDatasetTB;
SQLiteConnection(Conn.ConnString); dgvTeamB.DataSource =
SQLiteCommand myCommand = bdSource;
new SQLiteCommand("SELECT Last_Name
|| ', ' || First_Name || ' ' || " myAdapter.Update(myDatasetTB);
+ "Middle_Initial AS }
'Players Name', Jersey_Number AS
'Jersey Number', In_or_Out AS 'In or catch (Exception ex)
Out', " {
+ "FirstP_Score AS '1st
P. Score', SecondP_Score AS '2nd P. MessageBox.Show(ex.Message, "Error",
Score', ThirdP_Score AS '3rd P. MessageBoxButtons.OK,
Score', " MessageBoxIcon.Error);
+ "FourthP_Score AS '4th }
P. Score', Overtime_Score AS
'Overtime Score', CASE WHEN Foul_1 =
0 THEN '-' WHEN Foul_1 = 5 THEN 'OP' dgvTeamB.Columns[0].Frozen = true;
ELSE Foul_1 || 'P' END AS 'Foul 1', "
+ "CASE WHEN Foul_2 = 0
THEN '-' WHEN Foul_2 = 5 THEN 'OP' dgvTeamB.Columns[1].DefaultCellStyle.
ELSE Foul_2 || 'P' END AS 'Foul 2', Alignment =
CASE WHEN Foul_3 = 0 THEN '-' WHEN DataGridViewContentAlignment.MiddleRi
Foul_3 = 5 THEN 'OP' ELSE Foul_3 || ght;
'P' END AS 'Foul 3', "
+ "CASE WHEN Foul_4 = 0 dgvTeamB.Columns[2].DefaultCellStyle.
THEN '-' WHEN Foul_4 = 5 THEN 'OP' Alignment =
ELSE Foul_4 || 'P' END AS 'Foul 4', DataGridViewContentAlignment.MiddleRi
CASE WHEN Foul_5 = 0 THEN '-' WHEN ght;
Foul_5 = 5 THEN 'OP' ELSE Foul_5 ||
'P' END AS 'Foul 5', " dgvTeamB.Columns[3].DefaultCellStyle.
+ "CASE WHEN Foul_1 != 0 Alignment =
THEN 1 ELSE Foul_1 END + CASE WHEN DataGridViewContentAlignment.MiddleRi
Foul_2 != 0 THEN 1 ELSE Foul_2 END " ght;
+ "+ CASE WHEN Foul_3 !=
0 THEN 1 ELSE Foul_3 END + CASE WHEN dgvTeamB.Columns[4].DefaultCellStyle.
Foul_4 != 0 THEN 1 ELSE Foul_4 END " Alignment =
+ "+ CASE WHEN Foul_5 != DataGridViewContentAlignment.MiddleRi
0 THEN 1 ELSE Foul_5 END AS 'Total ght;
Foul' FROM tbl_playersgame "
+ "WHERE Team_Name = '" + dgvTeamB.Columns[5].DefaultCellStyle.
cmbTeamB.Text + "' ORDER BY Alignment =
In_or_Out, Jersey_Number;", myConn); DataGridViewContentAlignment.MiddleRi
try ght;
{
SQLiteDataAdapter dgvTeamB.Columns[6].DefaultCellStyle.
myAdapter = new SQLiteDataAdapter(); Alignment =
188
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
DataGridViewContentAlignment.MiddleRi catch (Exception ex) { }
ght;
ScoreFoulAPB();
dgvTeamB.Columns[7].DefaultCellStyle. }
Alignment = #endregion
DataGridViewContentAlignment.MiddleRi
ght; #region Row Coloring A
private void
dgvTeamB.Columns[8].DefaultCellStyle. dgvTeamA_CellFormatting(object
Alignment = sender,
DataGridViewContentAlignment.MiddleRi DataGridViewCellFormattingEventArgs
ght; e)
{
dgvTeamB.Columns[9].DefaultCellStyle. foreach (DataGridViewRow
Alignment = row in dgvTeamA.Rows)
DataGridViewContentAlignment.MiddleRi {
ght; string rs =
row.Cells[13].Value.ToString();
dgvTeamB.Columns[10].DefaultCellStyle
.Alignment = if (rs == "3")
DataGridViewContentAlignment.MiddleRi {
ght;
row.DefaultCellStyle.ForeColor =
dgvTeamB.Columns[11].DefaultCellStyle Color.Orange;
.Alignment = }
DataGridViewContentAlignment.MiddleRi
ght; else if (rs == "4")
{
dgvTeamB.Columns[12].DefaultCellStyle
.Alignment = row.DefaultCellStyle.ForeColor =
DataGridViewContentAlignment.MiddleRi Color.BlueViolet;
ght; }
189
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ pnlPeriods.Enabled =
foreach (DataGridViewRow false;
row in dgvTeamB.Rows) tmrDTime.Stop();
{ }
string rs =
row.Cells[13].Value.ToString(); else if
(!chkLockA.Checked &&
if (rs == "3") chkLockB.Checked)
{ {
cmbDivision.Enabled =
row.DefaultCellStyle.ForeColor = false;
Color.Orange; cmbTeamB.Enabled =
} false;
cmbTeamA.Enabled =
else if (rs == "4") true;
{
pnlTeamSA.Enabled =
row.DefaultCellStyle.ForeColor = false;
Color.BlueViolet; pnlTeamSB.Enabled =
} false;
pnlPeriods.Enabled =
else if (rs == "5") false;
{ tmrDTime.Stop();
}
row.DefaultCellStyle.ForeColor =
Color.Red; else if
} (!chkLockA.Checked &&
!chkLockB.Checked)
else {
{ cmbDivision.Enabled =
true;
row.DefaultCellStyle.ForeColor = cmbTeamB.Enabled =
Color.Black; true;
} cmbTeamA.Enabled =
} true;
}
#endregion pnlTeamSA.Enabled =
false;
#region Lock pnlTeamSB.Enabled =
void Lock() false;
{ pnlPeriods.Enabled =
if (chkLockA.Checked && false;
!chkLockB.Checked) tmrDTime.Start();
{ }
cmbDivision.Enabled =
false; else if (chkLockA.Checked
cmbTeamA.Enabled = && chkLockB.Checked)
false; {
cmbTeamB.Enabled = cmbDivision.Enabled =
true; false;
cmbTeamB.Enabled =
pnlTeamSA.Enabled = false;
false; cmbTeamA.Enabled =
pnlTeamSB.Enabled = false;
false;
190
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
pnlTeamSA.Enabled = }
true; }
pnlTeamSB.Enabled =
true; private void
pnlPeriods.Enabled = chkLockB_CheckedChanged(object
true; sender, EventArgs e)
tmrDTime.Stop(); {
GameDTNO(); Lock();
sLock = "Lock";
} if (chkLockA.Checked &&
} !chkLockB.Checked && sLock == "Lock")
{
private void dynamic dialog =
chkLockA_CheckedChanged(object MessageBox.Show("If this message
sender, EventArgs e) shows, two teams are already lock in.
{ "
Lock(); + "If the team you
are trying to unlock has already
if (!chkLockA.Checked && records, it will be clear when you
chkLockB.Checked && sLock == "Lock") try "
{ + "to change the
dynamic dialog = team.\n\n Are you sure you want to
MessageBox.Show("If this message Unlock?", "Unlock Teams",
shows, two teams are already lock in. MessageBoxButtons.YesNo,
" MessageBoxIcon.Warning);
+ "If the team you if (dialog ==
are trying to unlock has already DialogResult.No)
records, it will be clear when you {
try " chkLockB.Checked
+ "to change the = true;
team.\n\n Are you sure you want to }
Unlock?", "Unlock Teams",
MessageBoxButtons.YesNo, else if (dialog ==
MessageBoxIcon.Warning); DialogResult.Yes)
if (dialog == {
DialogResult.No) sLock = "";
{ }
chkLockA.Checked }
= true;
} if (chkLockB.Checked)
{
else if (dialog == lblNotif.Text = "Team
DialogResult.Yes) B has been locked.";
{ lblNotif.Visible =
sLock = ""; true;
} iDT = 4;
} tmrNotif.Start();
}
if (chkLockA.Checked) }
{ #endregion
lblNotif.Text = "Team
A has been locked."; #region Input of Game Date,
lblNotif.Visible = Time, Date and Opponent
true; void GameDTNO()
iDT = 4; {
tmrNotif.Start();
191
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
string myQuery = "UPDATE }
tbl_playersgame SET Game_Date = '" +
sDateTime + "', Game_Number = '" + catch (SQLiteException
txtGGNumber.Text + "';"; ex)
SQLiteConnection {
myConnection = new
SQLiteConnection(Conn.ConnString); MessageBox.Show(ex.Message, "Error",
SQLiteCommand myCommand = MessageBoxButtons.OK,
new SQLiteCommand(myQuery, MessageBoxIcon.Error);
myConnection); }
SQLiteDataReader
myReader; finally
{
try
{ myConnection1.Close();
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); string myQuery2 = "UPDATE
while tbl_teamsgame SET Opponent = '" +
(myReader.Read()) { } cmbTeamB.Text + "' WHERE Team_Name =
} '" + cmbTeamA.Text + "';";
SQLiteConnection
catch (SQLiteException myConnection2 = new
ex) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand myCommand2
= new SQLiteCommand(myQuery2,
MessageBox.Show(ex.Message, "Error", myConnection2);
MessageBoxButtons.OK, SQLiteDataReader
MessageBoxIcon.Error); myReader2;
}
try
finally {
{ myConnection2.Open();
myConnection.Close(); myReader2 =
} myCommand2.ExecuteReader();
while
string myQuery1 = "UPDATE (myReader2.Read()) { }
tbl_teamsgame SET Game_Date = '" + }
sDateTime + "', Game_Number = '" +
txtGGNumber.Text + "';"; catch (SQLiteException
SQLiteConnection ex)
myConnection1 = new {
SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand1 MessageBox.Show(ex.Message, "Error",
= new SQLiteCommand(myQuery1, MessageBoxButtons.OK,
myConnection1); MessageBoxIcon.Error);
SQLiteDataReader }
myReader1;
finally
try {
{
myConnection1.Open(); myConnection2.Close();
myReader1 = }
myCommand1.ExecuteReader();
while string myQuery3 = "UPDATE
(myReader1.Read()) { } tbl_teamsgame SET Opponent = '" +
192
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
cmbTeamA.Text + "' WHERE Team_Name =
'" + cmbTeamB.Text + "';"; MessageBox.Show(txtPlayerA.Text + "
SQLiteConnection is already in.", "Player to Set In",
myConnection3 = new MessageBoxButtons.OK,
SQLiteConnection(Conn.ConnString); MessageBoxIcon.Error);
SQLiteCommand myCommand3 }
= new SQLiteCommand(myQuery3,
myConnection3); else if
SQLiteDataReader (txtCPlayersA.Text == "5")
myReader3; {
MessageBox.Show("You
try can only set 5 players per team.",
{ "Player to Set In",
myConnection3.Open(); MessageBoxButtons.OK,
myReader3 = MessageBoxIcon.Error);
myCommand3.ExecuteReader(); }
while
(myReader3.Read()) { } else if(sFoulA == "5")
} {
193
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
lblNotif.Text = else if
"Team A : " + txtPlayerA.Text + " has (txtCPlayersB.Text == "5")
been set in."; {
lblNotif.Visible MessageBox.Show("You
= true; can only set 5 players per team.",
iDT = 4; "Player to Set In",
tmrNotif.Start(); MessageBoxButtons.OK,
MessageBoxIcon.Error);
LoadTeamA(); }
}
else if (sFoulB == "5")
catch {
(SQLiteException ex)
{ MessageBox.Show(txtPlayerB.Text + "
is already fouled out.", "Player to
MessageBox.Show(ex.Message, "Error", Set In", MessageBoxButtons.OK,
MessageBoxButtons.OK, MessageBoxIcon.Error);
MessageBoxIcon.Error); }
}
else
finally {
{ string myQuery =
"UPDATE tbl_playersgame SET In_or_Out
myConnection.Close(); = 'In' WHERE Last_Name || ', ' ||
} First_Name || ' ' || Middle_Initial =
} '" + txtPlayerB.Text + "' "
+ "AND Jersey_Number
CountTeamA(); = '" + sJerseyB + "' AND Team_Name =
} '" + cmbTeamB.Text + "';";
#endregion SQLiteConnection
myConnection = new
#region Team B Substitution SQLiteConnection(Conn.ConnString);
In SQLiteCommand
private void myCommand = new
btnInB_Click(object sender, EventArgs SQLiteCommand(myQuery, myConnection);
e) SQLiteDataReader
{ myReader;
if (txtPlayerB.Text ==
"None") try
{ {
194
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number
LoadTeamB(); = '" + sJerseyA + "' AND Team_Name =
} '" + cmbTeamA.Text + "';";
SQLiteConnection
catch myConnection = new
(SQLiteException ex) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
myCommand = new
MessageBox.Show(ex.Message, "Error", SQLiteCommand(myQuery, myConnection);
MessageBoxButtons.OK, SQLiteDataReader
MessageBoxIcon.Error); myReader;
}
try
finally {
{
myConnection.Open();
myConnection.Close(); myReader =
} myCommand.ExecuteReader();
} while
(myReader.Read()) { }
CountTeamB();
} sInA = "Out";
#endregion
lblNotif.Text =
#region Team A Substitution "Team A : " + txtPlayerA.Text + " has
Out been set out.";
private void lblNotif.Visible
btnOutA_Click(object sender, = true;
EventArgs e) iDT = 4;
{ tmrNotif.Start();
if (txtPlayerA.Text ==
"None") LoadTeamA();
{ }
195
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void lblNotif.Visible
btnOutB_Click(object sender, = true;
EventArgs e) iDT = 4;
{ tmrNotif.Start();
if (txtPlayerB.Text ==
"None") LoadTeamB();
{ }
196
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (e.RowIndex >= 0)
{ finally
DataGridViewRow row = {
this.dgvTeamB.Rows[e.RowIndex]; myConnection.Close();
}
txtPlayerB.Text = }
row.Cells["Players #endregion
Name"].Value.ToString();
sJerseyB = #region Team B Count Current
row.Cells["Jersey Players
Number"].Value.ToString(); void CountTeamB()
sInB = row.Cells["In {
or Out"].Value.ToString(); string myQuery = "SELECT
CountFoulB(); COUNT(In_or_Out) FROM tbl_playersgame
} WHERE In_or_Out = 'In' AND Team_Name
} = '" + cmbTeamB.Text + "';";
#endregion SQLiteConnection
myConnection = new
#region Team A Count Current SQLiteConnection(Conn.ConnString);
Players SQLiteCommand myCommand =
void CountTeamA() new SQLiteCommand(myQuery,
{ myConnection);
string myQuery = "SELECT SQLiteDataReader
COUNT(In_or_Out) FROM tbl_playersgame myReader;
WHERE In_or_Out = 'In' AND Team_Name
= '" + cmbTeamA.Text + "';"; try
SQLiteConnection {
myConnection = new myConnection.Open();
SQLiteConnection(Conn.ConnString); myReader =
SQLiteCommand myCommand = myCommand.ExecuteReader();
new SQLiteCommand(myQuery, while
myConnection); (myReader.Read())
SQLiteDataReader {
myReader; txtCPlayersB.Text
= myReader.GetValue(0).ToString();
try }
{ }
myConnection.Open();
myReader = catch (SQLiteException
myCommand.ExecuteReader(); ex)
while {
(myReader.Read())
{ MessageBox.Show(ex.Message, "Error",
txtCPlayersA.Text MessageBoxButtons.OK,
= myReader.GetValue(0).ToString(); MessageBoxIcon.Error);
} }
}
finally
catch (SQLiteException {
ex) myConnection.Close();
{ }
}
MessageBox.Show(ex.Message, "Error", #endregion
MessageBoxButtons.OK,
MessageBoxIcon.Error); #region Enable Disable Score
} Board A
197
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void if (tsa >= tsb)
txtCPlayersA_TextChanged(object {
sender, EventArgs e) string myQuery =
{ "UPDATE tbl_teamsgame SET Game_Score
int p = 0; = '" + tsa + "-" + tsb + "';";
SQLiteConnection
if myConnection = new
(Int32.TryParse(txtCPlayersA.Text, SQLiteConnection(Conn.ConnString);
out p) && p >= 2) SQLiteCommand
{ myCommand = new
pnlTeamSSA.Enabled = SQLiteCommand(myQuery, myConnection);
true; SQLiteDataReader
} myReader;
else try
{ {
pnlTeamSSA.Enabled =
false; myConnection.Open();
} myReader =
} myCommand.ExecuteReader();
#endregion while
(myReader.Read()) { }
#region Enable Disable Score }
Board B
private void catch
txtCPlayersB_TextChanged(object (SQLiteException ex)
sender, EventArgs e) {
{
int p = 0; MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
if MessageBoxIcon.Error);
(Int32.TryParse(txtCPlayersB.Text, }
out p) && p >= 2)
{ finally
pnlTeamSSB.Enabled = {
true;
} myConnection.Close();
}
else }
{
pnlTeamSSB.Enabled = else if (tsa < tsb)
false; {
} string myQuery =
} "UPDATE tbl_teamsgame SET Game_Score
#endregion = '" + tsb + "-" + tsa + "';";
SQLiteConnection
#region Teams Score myConnection = new
void TeamScore() SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
int tsa, tsb; myCommand = new
SQLiteCommand(myQuery, myConnection);
tsa = SQLiteDataReader
Convert.ToInt32(txtScoreA.Text); myReader;
tsb =
Convert.ToInt32(txtScoreB.Text); try
{
198
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
string myQuery =
myConnection.Open(); "UPDATE tbl_teamsgame SET
myReader = First_Half_Time_Out =
myCommand.ExecuteReader(); First_Half_Time_Out + 1 WHERE
while Team_Name = '" + cmbTeamA.Text +
(myReader.Read()) { } "';";
} SQLiteConnection
myConnection = new
catch SQLiteConnection(Conn.ConnString);
(SQLiteException ex) SQLiteCommand
{ myCommand = new
SQLiteCommand(myQuery, myConnection);
MessageBox.Show(ex.Message, "Error", SQLiteDataReader
MessageBoxButtons.OK, myReader;
MessageBoxIcon.Error);
} try
{
finally
{ myConnection.Open();
myReader =
myConnection.Close(); myCommand.ExecuteReader();
} while
} (myReader.Read()) { }
} }
#endregion
catch
#region Time-Out A (SQLiteException ex)
void NTOutA() {
{
lblNotif.Text = " Team A MessageBox.Show(ex.Message, "Error",
: Call for a time-out."; MessageBoxButtons.OK,
lblNotif.Visible = true; MessageBoxIcon.Error);
iDT = 4; }
tmrNotif.Start();
} finally
{
private void
btnTOutA_Click(object sender, myConnection.Close();
EventArgs e) }
{
if (rdb1stP.Checked || NTOutA();
rdb2ndP.Checked) }
{ }
if (txt1HTOA.Text ==
"2") else if (rdb3rdP.Checked
{ || rdb4thP.Checked)
{
MessageBox.Show(cmbTeamA.Text + " has if (txt2HTOA.Text ==
already taken their alotted time-out "3")
for the 1st half.", "No Time-Out", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(cmbTeamA.Text + " has
} already taken their alotted time-out
for the 2nd half.", "No Time-Out",
else MessageBoxButtons.OK,
{ MessageBoxIcon.Error);
199
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} for the over time.", "No Time-Out",
MessageBoxButtons.OK,
else MessageBoxIcon.Error);
{ }
string myQuery =
"UPDATE tbl_teamsgame SET else
Second_Half_Time_Out = {
Second_Half_Time_Out + 1 WHERE string myQuery =
Team_Name = '" + cmbTeamA.Text + "UPDATE tbl_teamsgame SET
"';"; Extra_Time_Out = Extra_Time_Out + 1
SQLiteConnection WHERE Team_Name = '" + cmbTeamA.Text
myConnection = new + "';";
SQLiteConnection(Conn.ConnString); SQLiteConnection
SQLiteCommand myConnection = new
myCommand = new SQLiteConnection(Conn.ConnString);
SQLiteCommand(myQuery, myConnection); SQLiteCommand
SQLiteDataReader myCommand = new
myReader; SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
try myReader;
{
try
myConnection.Open(); {
myReader =
myCommand.ExecuteReader(); myConnection.Open();
while myReader =
(myReader.Read()) { } myCommand.ExecuteReader();
} while
(myReader.Read()) { }
catch
(SQLiteException ex) iTimeoutA =
{ 1;
}
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, catch
MessageBoxIcon.Error); (SQLiteException ex)
} {
200
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
FROM tbl_teamsgame WHERE Team_Name = private void
'" + cmbTeamA.Text + "';"; btnTOutB_Click(object sender,
SQLiteConnection EventArgs e)
myConnection1 = new {
SQLiteConnection(Conn.ConnString); if (rdb1stP.Checked ||
SQLiteCommand myCommand1 rdb2ndP.Checked)
= new SQLiteCommand(myQuery1, {
myConnection1); if (txt1HTOB.Text ==
SQLiteDataReader "2")
myReader1; {
201
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
}
myConnection.Close();
} finally
{
NTOutB();
} myConnection.Close();
} }
202
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{
finally
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); myConnection1.Close();
} }
}
finally #endregion
{
#region A and B Score Foul AP
myConnection.Close(); Transition
} private void
dgvTeamA_ColumnHeaderMouseClick(objec
NTOutB(); t sender,
} DataGridViewCellMouseEventArgs e)
} {
ScoreFoulAPA();
string myQuery1 = "SELECT }
First_Half_Time_Out, private void
Second_Half_Time_Out, Extra_Time_Out rdbScoreA_Click(object sender,
FROM tbl_teamsgame WHERE Team_Name = EventArgs e)
'" + cmbTeamB.Text + "';"; {
SQLiteConnection ScoreFoulAPA();
myConnection1 = new }
SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand1 private void
= new SQLiteCommand(myQuery1, rdbFoulA_CheckedChanged(object
myConnection1); sender, EventArgs e)
SQLiteDataReader {
myReader1; ScoreFoulAPA();
}
try
{ private void
myConnection1.Open(); rdbAPA_Click(object sender, EventArgs
myReader1 = e)
myCommand1.ExecuteReader(); {
while ScoreFoulAPA();
(myReader1.Read()) }
{
txt1HTOB.Text = private void
myReader1.GetValue(0).ToString(); dgvTeamB_ColumnHeaderMouseClick(objec
txt2HTOB.Text = t sender,
myReader1.GetValue(1).ToString(); DataGridViewCellMouseEventArgs e)
txtETOB.Text = {
myReader1.GetValue(2).ToString(); ScoreFoulAPB();
} }
}
private void
catch (SQLiteException rdbScoreB_CheckedChanged(object
ex) sender, EventArgs e)
{ {
ScoreFoulAPB();
MessageBox.Show(ex.Message, "Error", }
MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
203
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
private void private void
rdbFoulB_CheckedChanged(object dgvTeamB_CellDoubleClick(object
sender, EventArgs e) sender, DataGridViewCellEventArgs e)
{ {
ScoreFoulAPB(); if (rdbAPB.Checked)
} {
if (sInB == "Out")
private void {
rdbAPB_Click(object sender, EventArgs
e) btnInB_Click(sender, e);
{ sInA = "In";
ScoreFoulAPB(); }
}
#endregion else if (sInB == "In")
{
#region Notification
private void btnOutB_Click(sender, e);
tmrNotif_Tick(object sender, sInA = "Out";
EventArgs e) }
{ }
iDT--; }
if (iDT == 0) #endregion
{
tmrNotif.Stop(); //------------------------//
lblNotif.Visible = Team A Scoring
false;
} #region Team A Score
} void TeamAScore()
#endregion {
string myQuery = "SELECT
#region Cell D-Cick A SUM(FirstP_Score) +
private void SUM(SecondP_Score) +
dgvTeamA_CellDoubleClick(object SUM(ThirdP_Score) +
sender, DataGridViewCellEventArgs e) SUM(FourthP_Score) +
{ SUM(Overtime_Score) FROM
if (rdbAPA.Checked) tbl_playersgame WHERE Team_Name = '"
{ + cmbTeamA.Text + "';";
if (sInA == "Out") SQLiteConnection
{ myConnection = new
SQLiteConnection(Conn.ConnString);
btnInA_Click(sender, e); SQLiteCommand myCommand =
sInA = "In"; new SQLiteCommand(myQuery,
} myConnection);
SQLiteDataReader
else if (sInA == myReader;
"In")
{ try
{
btnOutA_Click(sender, e); myConnection.Open();
sInA = "Out"; myReader =
} myCommand.ExecuteReader();
} while
} (myReader.Read())
#endregion {
txtScoreA.Text =
#region Cell D-Click B myReader.GetInt32(0).ToString("D3");
204
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} + "AND Jersey_Number
} = '" + sJerseyA + "' AND Team_Name =
'" + cmbTeamA.Text + "';";
catch (SQLiteException SQLiteConnection
ex) myConnection = new
{ SQLiteConnection(Conn.ConnString);
SQLiteCommand
MessageBox.Show(ex.Message, "Error", myCommand = new
MessageBoxButtons.OK, SQLiteCommand(myQuery, myConnection);
MessageBoxIcon.Error); SQLiteDataReader
} myReader;
finally try
{ {
myConnection.Close();
} myConnection.Open();
myReader =
TeamScore(); myCommand.ExecuteReader();
} while
#endregion (myReader.Read()) { }
205
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+1";
(myReader.Read()) { } ScoreNotifA();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if (rdb4thP.Checked)
} {
string myQuery =
else if (rdb3rdP.Checked) "UPDATE tbl_playersgame SET
{ FourthP_Score = FourthP_Score + 1
string myQuery = WHERE Last_Name || ', ' || First_Name
"UPDATE tbl_playersgame SET || ' ' || Middle_Initial = '" +
ThirdP_Score = ThirdP_Score + 1 WHERE txtPlayerA.Text + "' "
Last_Name || ', ' || First_Name || ' + "AND Jersey_Number
' || Middle_Initial = '" + = '" + sJerseyA + "' AND Team_Name =
txtPlayerA.Text + "' " '" + cmbTeamA.Text + "';";
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyA + "' AND Team_Name = myConnection = new
'" + cmbTeamA.Text + "';"; SQLiteConnection(Conn.ConnString);
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
206
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+1";
(myReader.Read()) { } ScoreNotifA();
finally myConnection.Close();
{ }
}
myConnection.Close(); }
} #endregion
}
#region Team A +2 Score
else if private void
(rdbOTime.Checked) btnP2A_Click(object sender, EventArgs
{ e)
string myQuery = {
"UPDATE tbl_playersgame SET if (sInA == "Out")
Overtime_Score = Overtime_Score + 1 {
WHERE Last_Name || ', ' || First_Name MessageBox.Show("You
|| ' ' || Middle_Initial = '" + are trying to score an out playing
txtPlayerA.Text + "' " player.", "Out of Score",
+ "AND Jersey_Number MessageBoxButtons.OK,
= '" + sJerseyA + "' AND Team_Name = MessageBoxIcon.Error);
'" + cmbTeamA.Text + "';"; }
SQLiteConnection
myConnection = new else if (rdb1stP.Checked)
SQLiteConnection(Conn.ConnString); {
SQLiteCommand string myQuery =
myCommand = new "UPDATE tbl_playersgame SET
SQLiteCommand(myQuery, myConnection); FirstP_Score = FirstP_Score + 2 WHERE
SQLiteDataReader Last_Name || ', ' || First_Name || '
myReader; ' || Middle_Initial = '" +
txtPlayerA.Text + "' "
207
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyA + "' AND Team_Name = myConnection = new
'" + cmbTeamA.Text + "';"; SQLiteConnection(Conn.ConnString);
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+2";
(myReader.Read()) { } ScoreNotifA();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if (rdb3rdP.Checked)
} {
string myQuery =
else if (rdb2ndP.Checked) "UPDATE tbl_playersgame SET
{ ThirdP_Score = ThirdP_Score + 2 WHERE
string myQuery = Last_Name || ', ' || First_Name || '
"UPDATE tbl_playersgame SET ' || Middle_Initial = '" +
SecondP_Score = SecondP_Score + 2 txtPlayerA.Text + "' "
WHERE Last_Name || ', ' || First_Name + "AND Jersey_Number
|| ' ' || Middle_Initial = '" + = '" + sJerseyA + "' AND Team_Name =
txtPlayerA.Text + "' " '" + cmbTeamA.Text + "';";
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyA + "' AND Team_Name = myConnection = new
'" + cmbTeamA.Text + "';"; SQLiteConnection(Conn.ConnString);
208
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+2";
(myReader.Read()) { } ScoreNotifA();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if
} (rdbOTime.Checked)
{
else if (rdb4thP.Checked) string myQuery =
{ "UPDATE tbl_playersgame SET
string myQuery = Overtime_Score = Overtime_Score + 2
"UPDATE tbl_playersgame SET WHERE Last_Name || ', ' || First_Name
FourthP_Score = FourthP_Score + 2 || ' ' || Middle_Initial = '" +
WHERE Last_Name || ', ' || First_Name txtPlayerA.Text + "' "
|| ' ' || Middle_Initial = '" + + "AND Jersey_Number
txtPlayerA.Text + "' " = '" + sJerseyA + "' AND Team_Name =
+ "AND Jersey_Number '" + cmbTeamA.Text + "';";
= '" + sJerseyA + "' AND Team_Name = SQLiteConnection
'" + cmbTeamA.Text + "';"; myConnection = new
SQLiteConnection SQLiteConnection(Conn.ConnString);
myConnection = new SQLiteCommand
SQLiteConnection(Conn.ConnString); myCommand = new
SQLiteCommand SQLiteCommand(myQuery, myConnection);
myCommand = new SQLiteDataReader
SQLiteCommand(myQuery, myConnection); myReader;
209
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
try + "AND Jersey_Number
{ = '" + sJerseyA + "' AND Team_Name =
'" + cmbTeamA.Text + "';";
myConnection.Open(); SQLiteConnection
myReader = myConnection = new
myCommand.ExecuteReader(); SQLiteConnection(Conn.ConnString);
while SQLiteCommand
(myReader.Read()) { } myCommand = new
SQLiteCommand(myQuery, myConnection);
sSNotif = "+2"; SQLiteDataReader
ScoreNotifA(); myReader;
TeamAScore(); try
LoadTeamA(); {
}
myConnection.Open();
catch myReader =
(SQLiteException ex) myCommand.ExecuteReader();
{ while
(myReader.Read()) { }
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, sSNotif = "+3";
MessageBoxIcon.Error); ScoreNotifA();
}
TeamAScore();
finally LoadTeamA();
{ }
myConnection.Close(); catch
} (SQLiteException ex)
} {
}
#endregion MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
#region Team A +3 Score MessageBoxIcon.Error);
private void }
btnP3A_Click(object sender, EventArgs
e) finally
{ {
if (sInA == "Out")
{ myConnection.Close();
MessageBox.Show("You }
are trying to score an out playing }
player.", "Out of Score",
MessageBoxButtons.OK, else if (rdb2ndP.Checked)
MessageBoxIcon.Error); {
} string myQuery =
"UPDATE tbl_playersgame SET
else if (rdb1stP.Checked) SecondP_Score = SecondP_Score + 3
{ WHERE Last_Name || ', ' || First_Name
string myQuery = || ' ' || Middle_Initial = '" +
"UPDATE tbl_playersgame SET txtPlayerA.Text + "' "
FirstP_Score = FirstP_Score + 3 WHERE + "AND Jersey_Number
Last_Name || ', ' || First_Name || ' = '" + sJerseyA + "' AND Team_Name =
' || Middle_Initial = '" + '" + cmbTeamA.Text + "';";
txtPlayerA.Text + "' "
210
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+3";
(myReader.Read()) { } ScoreNotifA();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if (rdb4thP.Checked)
} {
string myQuery =
else if (rdb3rdP.Checked) "UPDATE tbl_playersgame SET
{ FourthP_Score = FourthP_Score + 3
string myQuery = WHERE Last_Name || ', ' || First_Name
"UPDATE tbl_playersgame SET || ' ' || Middle_Initial = '" +
ThirdP_Score = ThirdP_Score + 3 WHERE txtPlayerA.Text + "' "
Last_Name || ', ' || First_Name || ' + "AND Jersey_Number
' || Middle_Initial = '" + = '" + sJerseyA + "' AND Team_Name =
txtPlayerA.Text + "' " '" + cmbTeamA.Text + "';";
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyA + "' AND Team_Name = myConnection = new
'" + cmbTeamA.Text + "';"; SQLiteConnection(Conn.ConnString);
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
211
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+3";
(myReader.Read()) { } ScoreNotifA();
finally myConnection.Close();
{ }
}
myConnection.Close(); }
} #endregion
}
#region Team A -1 Score
else if private void
(rdbOTime.Checked) btnM1A_Click(object sender, EventArgs
{ e)
string myQuery = {
"UPDATE tbl_playersgame SET if (sInA == "Out")
Overtime_Score = Overtime_Score + 3 {
WHERE Last_Name || ', ' || First_Name MessageBox.Show("You
|| ' ' || Middle_Initial = '" + are trying to score an out playing
txtPlayerA.Text + "' " player.", "Out of Score",
+ "AND Jersey_Number MessageBoxButtons.OK,
= '" + sJerseyA + "' AND Team_Name = MessageBoxIcon.Error);
'" + cmbTeamA.Text + "';"; }
SQLiteConnection
myConnection = new else if (txtScoreA.Text
SQLiteConnection(Conn.ConnString); == "000")
SQLiteCommand {
myCommand = new MessageBox.Show("Team
SQLiteCommand(myQuery, myConnection); score is already 0.", "Out of Score",
SQLiteDataReader MessageBoxButtons.OK,
myReader; MessageBoxIcon.Error);
}
212
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (s == 0)
else if (rdb1stP.Checked) {
{
#region 1st MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT FirstP_Score FROM
tbl_playersgame WHERE Last_Name || ', else
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text string myQuery1 =
+ "' " "UPDATE tbl_playersgame SET
+ "AND Jersey_Number FirstP_Score = FirstP_Score - 1 WHERE
= '" + sJerseyA + "' AND Team_Name = Last_Name || ', ' || First_Name || '
'" + cmbTeamA.Text + "';"; ' || Middle_Initial = '" +
SQLiteConnection txtPlayerA.Text + "' "
myConnection = new + "AND
SQLiteConnection(Conn.ConnString); Jersey_Number = '" + sJerseyA + "'
SQLiteCommand AND Team_Name = '" + cmbTeamA.Text +
myCommand = new "';";
SQLiteCommand(myQuery, myConnection); SQLiteConnection
SQLiteDataReader myConnection1 = new
myReader; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand1 = new
{ SQLiteCommand(myQuery1,
myConnection1);
myConnection.Open(); SQLiteDataReader
myReader = myReader1;
myCommand.ExecuteReader();
while try
(myReader.Read()) {
{
q = myConnection1.Open();
myReader.GetValue(0).ToString(); myReader1 =
s = myCommand1.ExecuteReader();
Convert.ToInt32(q); while
} (myReader1.Read()) { }
}
sSNotif = "-
catch 1";
(SQLiteException ex)
{ ScoreNotifA();
213
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb2ndP.Checked) {
{
#region 2nd MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT SecondP_Score FROM
tbl_playersgame WHERE Last_Name || ', else
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text string myQuery1 =
+ "' " "UPDATE tbl_playersgame SET
+ "AND Jersey_Number SecondP_Score = SecondP_Score - 1
= '" + sJerseyA + "' AND Team_Name = WHERE Last_Name || ', ' || First_Name
'" + cmbTeamA.Text + "';"; || ' ' || Middle_Initial = '" +
SQLiteConnection txtPlayerA.Text + "' "
myConnection = new + "AND
SQLiteConnection(Conn.ConnString); Jersey_Number = '" + sJerseyA + "'
SQLiteCommand AND Team_Name = '" + cmbTeamA.Text +
myCommand = new "';";
SQLiteCommand(myQuery, myConnection); SQLiteConnection
SQLiteDataReader myConnection1 = new
myReader; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand1 = new
{ SQLiteCommand(myQuery1,
myConnection1);
myConnection.Open(); SQLiteDataReader
myReader = myReader1;
myCommand.ExecuteReader();
while try
(myReader.Read()) {
{
q = myConnection1.Open();
myReader.GetValue(0).ToString(); myReader1 =
s = myCommand1.ExecuteReader();
Convert.ToInt32(q); while
} (myReader1.Read()) { }
}
sSNotif = "-
catch 1";
(SQLiteException ex)
{ ScoreNotifA();
214
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
LoadTeamA(); s =
} Convert.ToInt32(q);
}
catch }
(SQLiteException ex)
{ catch
(SQLiteException ex)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb3rdP.Checked) {
{
#region 3rd MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT ThirdP_Score FROM
tbl_playersgame WHERE Last_Name || ', else
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text string myQuery1 =
+ "' " "UPDATE tbl_playersgame SET
+ "AND Jersey_Number ThirdP_Score = ThirdP_Score - 1 WHERE
= '" + sJerseyA + "' AND Team_Name = Last_Name || ', ' || First_Name || '
'" + cmbTeamA.Text + "';"; ' || Middle_Initial = '" +
SQLiteConnection txtPlayerA.Text + "' "
myConnection = new + "AND
SQLiteConnection(Conn.ConnString); Jersey_Number = '" + sJerseyA + "'
SQLiteCommand AND Team_Name = '" + cmbTeamA.Text +
myCommand = new "';";
SQLiteCommand(myQuery, myConnection); SQLiteConnection
SQLiteDataReader myConnection1 = new
myReader; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand1 = new
{ SQLiteCommand(myQuery1,
myConnection1);
myConnection.Open(); SQLiteDataReader
myReader = myReader1;
myCommand.ExecuteReader();
while try
(myReader.Read()) {
{
q = myConnection1.Open();
myReader.GetValue(0).ToString();
215
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myReader1 = try
myCommand1.ExecuteReader(); {
while
(myReader1.Read()) { } myConnection.Open();
myReader =
sSNotif = "- myCommand.ExecuteReader();
1"; while
(myReader.Read())
ScoreNotifA(); {
q =
TeamAScore(); myReader.GetValue(0).ToString();
LoadTeamA(); s =
} Convert.ToInt32(q);
}
catch }
(SQLiteException ex)
{ catch
(SQLiteException ex)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb4thP.Checked) {
{
#region 4th MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT FourthP_Score FROM
tbl_playersgame WHERE Last_Name || ', else
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text string myQuery1 =
+ "' " "UPDATE tbl_playersgame SET
+ "AND Jersey_Number FourthP_Score = FourthP_Score - 1
= '" + sJerseyA + "' AND Team_Name = WHERE Last_Name || ', ' || First_Name
'" + cmbTeamA.Text + "';"; || ' ' || Middle_Initial = '" +
SQLiteConnection txtPlayerA.Text + "' "
myConnection = new + "AND
SQLiteConnection(Conn.ConnString); Jersey_Number = '" + sJerseyA + "'
SQLiteCommand AND Team_Name = '" + cmbTeamA.Text +
myCommand = new "';";
SQLiteCommand(myQuery, myConnection); SQLiteConnection
SQLiteDataReader myConnection1 = new
myReader; SQLiteConnection(Conn.ConnString);
216
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand + "AND Jersey_Number
myCommand1 = new = '" + sJerseyA + "' AND Team_Name =
SQLiteCommand(myQuery1, '" + cmbTeamA.Text + "';";
myConnection1); SQLiteConnection
SQLiteDataReader myConnection = new
myReader1; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand = new
{ SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
myConnection1.Open(); myReader;
myReader1 =
myCommand1.ExecuteReader(); try
while {
(myReader1.Read()) { }
myConnection.Open();
sSNotif = "- myReader =
1"; myCommand.ExecuteReader();
while
ScoreNotifA(); (myReader.Read())
{
TeamAScore(); q =
LoadTeamA(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if if (s == 0)
(rdbOTime.Checked) {
{
#region Overtime MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT Overtime_Score FROM
tbl_playersgame WHERE Last_Name || ', else
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text string myQuery1 =
+ "' " "UPDATE tbl_playersgame SET
217
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Overtime_Score = Overtime_Score - 1 #region Team A -2 Score
WHERE Last_Name || ', ' || First_Name private void
|| ' ' || Middle_Initial = '" + btnM2A_Click(object sender, EventArgs
txtPlayerA.Text + "' " e)
+ "AND {
Jersey_Number = '" + sJerseyA + "' if (sInA == "Out")
AND Team_Name = '" + cmbTeamA.Text + {
"';"; MessageBox.Show("You
SQLiteConnection are trying to score an out playing
myConnection1 = new player.", "Out of Score",
SQLiteConnection(Conn.ConnString); MessageBoxButtons.OK,
SQLiteCommand MessageBoxIcon.Error);
myCommand1 = new }
SQLiteCommand(myQuery1,
myConnection1); else if (txtScoreA.Text
SQLiteDataReader == "000")
myReader1; {
MessageBox.Show("Team
try score is already 0.", "Out of Score",
{ MessageBoxButtons.OK,
MessageBoxIcon.Error);
myConnection1.Open(); }
myReader1 =
myCommand1.ExecuteReader(); else if (rdb1stP.Checked)
while {
(myReader1.Read()) { } #region 1st
string q;
sSNotif = "- int s = 0;
1";
string myQuery =
ScoreNotifA(); "SELECT FirstP_Score FROM
tbl_playersgame WHERE Last_Name || ',
TeamAScore(); ' || First_Name || ' ' ||
LoadTeamA(); Middle_Initial = '" + txtPlayerA.Text
} + "' "
+ "AND Jersey_Number
catch = '" + sJerseyA + "' AND Team_Name =
(SQLiteException ex) '" + cmbTeamA.Text + "';";
{ SQLiteConnection
myConnection = new
MessageBox.Show(ex.Message, "Error", SQLiteConnection(Conn.ConnString);
MessageBoxButtons.OK, SQLiteCommand
MessageBoxIcon.Error); myCommand = new
} SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
finally myReader;
{
try
myConnection1.Close(); {
}
} myConnection.Open();
#endregion myReader =
} myCommand.ExecuteReader();
} while
#endregion (myReader.Read())
{
218
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
q = SQLiteCommand
myReader.GetValue(0).ToString(); myCommand1 = new
s = SQLiteCommand(myQuery1,
Convert.ToInt32(q); myConnection1);
} SQLiteDataReader
} myReader1;
catch try
(SQLiteException ex) {
{
myConnection1.Open();
MessageBox.Show(ex.Message, "Error", myReader1 =
MessageBoxButtons.OK, myCommand1.ExecuteReader();
MessageBoxIcon.Error); while
} (myReader1.Read()) { }
myConnection.Close(); ScoreNotifA();
}
TeamAScore();
if (s == 0) LoadTeamA();
{ }
219
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyA + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamA.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader SecondP_Score = SecondP_Score - 2
myReader; WHERE Last_Name || ', ' || First_Name
|| ' ' || Middle_Initial = '" +
try txtPlayerA.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyA + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamA.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
sSNotif = "-
finally 2";
{
ScoreNotifA();
myConnection.Close();
} TeamAScore();
LoadTeamA();
if (s == 0) }
{
catch
MessageBox.Show(txtPlayerA.Text + " (SQLiteException ex)
score is already 0.", "Out of Score", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (s < 2) }
{
finally
MessageBox.Show(txtPlayerA.Text + " {
220
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb3rdP.Checked) {
{
#region 3rd MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT ThirdP_Score FROM
tbl_playersgame WHERE Last_Name || ', else if (s < 2)
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text
+ "' " MessageBox.Show(txtPlayerA.Text + "
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyA + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamA.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader ThirdP_Score = ThirdP_Score - 2 WHERE
myReader; Last_Name || ', ' || First_Name || '
' || Middle_Initial = '" +
try txtPlayerA.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyA + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamA.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
221
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
sSNotif = "- myReader =
2"; myCommand.ExecuteReader();
while
ScoreNotifA(); (myReader.Read())
{
TeamAScore(); q =
LoadTeamA(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if (rdb4thP.Checked) if (s == 0)
{ {
#region 4th
string q; MessageBox.Show(txtPlayerA.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT FourthP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else if (s < 2)
Middle_Initial = '" + txtPlayerA.Text {
+ "' "
+ "AND Jersey_Number MessageBox.Show(txtPlayerA.Text + "
= '" + sJerseyA + "' AND Team_Name = score cannot be negative.", "Out of
'" + cmbTeamA.Text + "';"; Score", MessageBoxButtons.OK,
SQLiteConnection MessageBoxIcon.Error);
myConnection = new }
SQLiteConnection(Conn.ConnString);
SQLiteCommand else
myCommand = new {
SQLiteCommand(myQuery, myConnection); string myQuery1 =
SQLiteDataReader "UPDATE tbl_playersgame SET
myReader; FourthP_Score = FourthP_Score - 2
WHERE Last_Name || ', ' || First_Name
try || ' ' || Middle_Initial = '" +
{ txtPlayerA.Text + "' "
+ "AND
myConnection.Open(); Jersey_Number = '" + sJerseyA + "'
222
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
AND Team_Name = '" + cmbTeamA.Text + string myQuery =
"';"; "SELECT Overtime_Score FROM
SQLiteConnection tbl_playersgame WHERE Last_Name || ',
myConnection1 = new ' || First_Name || ' ' ||
SQLiteConnection(Conn.ConnString); Middle_Initial = '" + txtPlayerA.Text
SQLiteCommand + "' "
myCommand1 = new + "AND Jersey_Number
SQLiteCommand(myQuery1, = '" + sJerseyA + "' AND Team_Name =
myConnection1); '" + cmbTeamA.Text + "';";
SQLiteDataReader SQLiteConnection
myReader1; myConnection = new
SQLiteConnection(Conn.ConnString);
try SQLiteCommand
{ myCommand = new
SQLiteCommand(myQuery, myConnection);
myConnection1.Open(); SQLiteDataReader
myReader1 = myReader;
myCommand1.ExecuteReader();
while try
(myReader1.Read()) { } {
223
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (s < 2) }
{
finally
MessageBox.Show(txtPlayerA.Text + " {
score cannot be negative.", "Out of
Score", MessageBoxButtons.OK, myConnection1.Close();
MessageBoxIcon.Error); }
} }
#endregion
else }
{ }
string myQuery1 = #endregion
"UPDATE tbl_playersgame SET
Overtime_Score = Overtime_Score - 2 #region Team A -3 Score
WHERE Last_Name || ', ' || First_Name private void
|| ' ' || Middle_Initial = '" + btnM3A_Click(object sender, EventArgs
txtPlayerA.Text + "' " e)
+ "AND {
Jersey_Number = '" + sJerseyA + "' if (sInA == "Out")
AND Team_Name = '" + cmbTeamA.Text + {
"';"; MessageBox.Show("You
SQLiteConnection are trying to score an out playing
myConnection1 = new player.", "Out of Score",
SQLiteConnection(Conn.ConnString); MessageBoxButtons.OK,
SQLiteCommand MessageBoxIcon.Error);
myCommand1 = new }
SQLiteCommand(myQuery1,
myConnection1); else if (txtScoreA.Text
SQLiteDataReader == "000")
myReader1; {
MessageBox.Show("Team
try score is already 0.", "Out of Score",
{ MessageBoxButtons.OK,
MessageBoxIcon.Error);
myConnection1.Open(); }
myReader1 =
myCommand1.ExecuteReader(); else if (rdb1stP.Checked)
while {
(myReader1.Read()) { } #region 1st
string q;
sSNotif = "- int s = 0;
2";
string myQuery =
ScoreNotifA(); "SELECT FirstP_Score FROM
tbl_playersgame WHERE Last_Name || ',
TeamAScore(); ' || First_Name || ' ' ||
LoadTeamA(); Middle_Initial = '" + txtPlayerA.Text
} + "' "
+ "AND Jersey_Number
catch = '" + sJerseyA + "' AND Team_Name =
(SQLiteException ex) '" + cmbTeamA.Text + "';";
{ SQLiteConnection
myConnection = new
MessageBox.Show(ex.Message, "Error", SQLiteConnection(Conn.ConnString);
224
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader FirstP_Score = FirstP_Score - 3 WHERE
myReader; Last_Name || ', ' || First_Name || '
' || Middle_Initial = '" +
try txtPlayerA.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyA + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamA.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
sSNotif = "-
finally 3";
{
ScoreNotifA();
myConnection.Close();
} TeamAScore();
LoadTeamA();
if (s == 0) }
{
catch
MessageBox.Show(txtPlayerA.Text + " (SQLiteException ex)
score is already 0.", "Out of Score", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (s < 3) }
{
finally
MessageBox.Show(txtPlayerA.Text + " {
score cannot be negative.", "Out of
Score", MessageBoxButtons.OK, myConnection1.Close();
MessageBoxIcon.Error); }
} }
#endregion
else }
225
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (s == 0)
else if (rdb2ndP.Checked) {
{
#region 2nd MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT SecondP_Score FROM
tbl_playersgame WHERE Last_Name || ', else if (s < 3)
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text
+ "' " MessageBox.Show(txtPlayerA.Text + "
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyA + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamA.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader SecondP_Score = SecondP_Score - 3
myReader; WHERE Last_Name || ', ' || First_Name
|| ' ' || Middle_Initial = '" +
try txtPlayerA.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyA + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamA.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
sSNotif = "-
finally 3";
{
ScoreNotifA();
myConnection.Close();
} TeamAScore();
LoadTeamA();
226
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if (rdb3rdP.Checked) if (s == 0)
{ {
#region 3rd
string q; MessageBox.Show(txtPlayerA.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT ThirdP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else if (s < 3)
Middle_Initial = '" + txtPlayerA.Text {
+ "' "
+ "AND Jersey_Number MessageBox.Show(txtPlayerA.Text + "
= '" + sJerseyA + "' AND Team_Name = score cannot be negative.", "Out of
'" + cmbTeamA.Text + "';"; Score", MessageBoxButtons.OK,
SQLiteConnection MessageBoxIcon.Error);
myConnection = new }
SQLiteConnection(Conn.ConnString);
SQLiteCommand else
myCommand = new {
SQLiteCommand(myQuery, myConnection); string myQuery1 =
SQLiteDataReader "UPDATE tbl_playersgame SET
myReader; ThirdP_Score = ThirdP_Score - 3 WHERE
Last_Name || ', ' || First_Name || '
try ' || Middle_Initial = '" +
{ txtPlayerA.Text + "' "
+ "AND
myConnection.Open(); Jersey_Number = '" + sJerseyA + "'
myReader = AND Team_Name = '" + cmbTeamA.Text +
myCommand.ExecuteReader(); "';";
while SQLiteConnection
(myReader.Read()) myConnection1 = new
{ SQLiteConnection(Conn.ConnString);
q = SQLiteCommand
myReader.GetValue(0).ToString(); myCommand1 = new
227
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand(myQuery1, SQLiteConnection
myConnection1); myConnection = new
SQLiteDataReader SQLiteConnection(Conn.ConnString);
myReader1; SQLiteCommand
myCommand = new
try SQLiteCommand(myQuery, myConnection);
{ SQLiteDataReader
myReader;
myConnection1.Open();
myReader1 = try
myCommand1.ExecuteReader(); {
while
(myReader1.Read()) { } myConnection.Open();
myReader =
sSNotif = "- myCommand.ExecuteReader();
3"; while
(myReader.Read())
ScoreNotifA(); {
q =
TeamAScore(); myReader.GetValue(0).ToString();
LoadTeamA(); s =
} Convert.ToInt32(q);
}
catch }
(SQLiteException ex)
{ catch
(SQLiteException ex)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb4thP.Checked) {
{
#region 4th MessageBox.Show(txtPlayerA.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT FourthP_Score FROM
tbl_playersgame WHERE Last_Name || ', else if (s < 3)
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerA.Text
+ "' " MessageBox.Show(txtPlayerA.Text + "
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyA + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamA.Text + "';"; MessageBoxIcon.Error);
228
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} }
#endregion
else }
{
string myQuery1 = else if
"UPDATE tbl_playersgame SET (rdbOTime.Checked)
FourthP_Score = FourthP_Score - 3 {
WHERE Last_Name || ', ' || First_Name #region Overtime
|| ' ' || Middle_Initial = '" + string q;
txtPlayerA.Text + "' " int s = 0;
+ "AND
Jersey_Number = '" + sJerseyA + "' string myQuery =
AND Team_Name = '" + cmbTeamA.Text + "SELECT Overtime_Score FROM
"';"; tbl_playersgame WHERE Last_Name || ',
SQLiteConnection ' || First_Name || ' ' ||
myConnection1 = new Middle_Initial = '" + txtPlayerA.Text
SQLiteConnection(Conn.ConnString); + "' "
SQLiteCommand + "AND Jersey_Number
myCommand1 = new = '" + sJerseyA + "' AND Team_Name =
SQLiteCommand(myQuery1, '" + cmbTeamA.Text + "';";
myConnection1); SQLiteConnection
SQLiteDataReader myConnection = new
myReader1; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand = new
{ SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
myConnection1.Open(); myReader;
myReader1 =
myCommand1.ExecuteReader(); try
while {
(myReader1.Read()) { }
myConnection.Open();
sSNotif = "- myReader =
3"; myCommand.ExecuteReader();
while
ScoreNotifA(); (myReader.Read())
{
TeamAScore(); q =
LoadTeamA(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
229
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myConnection.Close(); ScoreNotifA();
}
TeamAScore();
if (s == 0) LoadTeamA();
{ }
230
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
while FirstP_Score = FirstP_Score + 1 WHERE
(myReader.Read()) Last_Name || ', ' || First_Name || '
{ ' || Middle_Initial = '" +
txtScoreB.Text = txtPlayerB.Text + "' "
myReader.GetInt32(0).ToString("D3"); + "AND Jersey_Number
} = '" + sJerseyB + "' AND Team_Name =
} '" + cmbTeamB.Text + "';";
SQLiteConnection
catch (SQLiteException myConnection = new
ex) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
myCommand = new
MessageBox.Show(ex.Message, "Error", SQLiteCommand(myQuery, myConnection);
MessageBoxButtons.OK, SQLiteDataReader
MessageBoxIcon.Error); myReader;
}
try
finally {
{
myConnection.Close(); myConnection.Open();
} myReader =
myCommand.ExecuteReader();
TeamScore(); while
} (myReader.Read()) { }
#endregion
sSNotif = "+1";
#region Score Notification ScoreNotifB();
void ScoreNotifB()
{ TeamBScore();
lblNotif.Text = "Team B : LoadTeamB();
" + txtPlayerB.Text + " got " + }
sSNotif + " points.";
lblNotif.Visible = true; catch
iDT = 4; (SQLiteException ex)
tmrNotif.Start(); {
}
#endregion MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
#region Team B +1 Score MessageBoxIcon.Error);
private void }
btnP1B_Click(object sender, EventArgs
e) finally
{ {
if (sInB == "Out")
{ myConnection.Close();
MessageBox.Show("You }
are trying to score an out playing }
player.", "Out of Score",
MessageBoxButtons.OK, else if (rdb2ndP.Checked)
MessageBoxIcon.Error); {
} string myQuery =
"UPDATE tbl_playersgame SET
else if (rdb1stP.Checked) SecondP_Score = SecondP_Score + 1
{ WHERE Last_Name || ', ' || First_Name
string myQuery = || ' ' || Middle_Initial = '" +
"UPDATE tbl_playersgame SET txtPlayerB.Text + "' "
231
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyB + "' AND Team_Name = myConnection = new
'" + cmbTeamB.Text + "';"; SQLiteConnection(Conn.ConnString);
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+1";
(myReader.Read()) { } ScoreNotifB();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if (rdb4thP.Checked)
} {
string myQuery =
else if (rdb3rdP.Checked) "UPDATE tbl_playersgame SET
{ FourthP_Score = FourthP_Score + 1
string myQuery = WHERE Last_Name || ', ' || First_Name
"UPDATE tbl_playersgame SET || ' ' || Middle_Initial = '" +
ThirdP_Score = ThirdP_Score + 1 WHERE txtPlayerB.Text + "' "
Last_Name || ', ' || First_Name || ' + "AND Jersey_Number
' || Middle_Initial = '" + = '" + sJerseyB + "' AND Team_Name =
txtPlayerB.Text + "' " '" + cmbTeamB.Text + "';";
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyB + "' AND Team_Name = myConnection = new
'" + cmbTeamB.Text + "';"; SQLiteConnection(Conn.ConnString);
232
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+1";
(myReader.Read()) { } ScoreNotifB();
finally myConnection.Close();
{ }
}
myConnection.Close(); }
} #endregion
}
#region Team B +2 Score
else if private void
(rdbOTime.Checked) btnP2B_Click(object sender, EventArgs
{ e)
string myQuery = {
"UPDATE tbl_playersgame SET if (sInB == "Out")
Overtime_Score = Overtime_Score + 1 {
WHERE Last_Name || ', ' || First_Name MessageBox.Show("You
|| ' ' || Middle_Initial = '" + are trying to score an out playing
txtPlayerB.Text + "' " player.", "Out of Score",
+ "AND Jersey_Number MessageBoxButtons.OK,
= '" + sJerseyB + "' AND Team_Name = MessageBoxIcon.Error);
'" + cmbTeamB.Text + "';"; }
SQLiteConnection
myConnection = new else if (rdb1stP.Checked)
SQLiteConnection(Conn.ConnString); {
SQLiteCommand string myQuery =
myCommand = new "UPDATE tbl_playersgame SET
SQLiteCommand(myQuery, myConnection); FirstP_Score = FirstP_Score + 2 WHERE
233
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
Last_Name || ', ' || First_Name || ' + "AND Jersey_Number
' || Middle_Initial = '" + = '" + sJerseyB + "' AND Team_Name =
txtPlayerB.Text + "' " '" + cmbTeamB.Text + "';";
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyB + "' AND Team_Name = myConnection = new
'" + cmbTeamB.Text + "';"; SQLiteConnection(Conn.ConnString);
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+2";
(myReader.Read()) { } ScoreNotifB();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if (rdb3rdP.Checked)
} {
string myQuery =
else if (rdb2ndP.Checked) "UPDATE tbl_playersgame SET
{ ThirdP_Score = ThirdP_Score + 2 WHERE
string myQuery = Last_Name || ', ' || First_Name || '
"UPDATE tbl_playersgame SET ' || Middle_Initial = '" +
SecondP_Score = SecondP_Score + 2 txtPlayerB.Text + "' "
WHERE Last_Name || ', ' || First_Name + "AND Jersey_Number
|| ' ' || Middle_Initial = '" + = '" + sJerseyB + "' AND Team_Name =
txtPlayerB.Text + "' " '" + cmbTeamB.Text + "';";
234
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+2";
(myReader.Read()) { } ScoreNotifB();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if
} (rdbOTime.Checked)
{
else if (rdb4thP.Checked) string myQuery =
{ "UPDATE tbl_playersgame SET
string myQuery = Overtime_Score = Overtime_Score + 2
"UPDATE tbl_playersgame SET WHERE Last_Name || ', ' || First_Name
FourthP_Score = FourthP_Score + 2 || ' ' || Middle_Initial = '" +
WHERE Last_Name || ', ' || First_Name txtPlayerB.Text + "' "
|| ' ' || Middle_Initial = '" + + "AND Jersey_Number
txtPlayerB.Text + "' " = '" + sJerseyB + "' AND Team_Name =
+ "AND Jersey_Number '" + cmbTeamB.Text + "';";
= '" + sJerseyB + "' AND Team_Name = SQLiteConnection
'" + cmbTeamB.Text + "';"; myConnection = new
SQLiteConnection SQLiteConnection(Conn.ConnString);
myConnection = new SQLiteCommand
SQLiteConnection(Conn.ConnString); myCommand = new
SQLiteCommand(myQuery, myConnection);
235
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteDataReader Last_Name || ', ' || First_Name || '
myReader; ' || Middle_Initial = '" +
txtPlayerB.Text + "' "
try + "AND Jersey_Number
{ = '" + sJerseyB + "' AND Team_Name =
'" + cmbTeamB.Text + "';";
myConnection.Open(); SQLiteConnection
myReader = myConnection = new
myCommand.ExecuteReader(); SQLiteConnection(Conn.ConnString);
while SQLiteCommand
(myReader.Read()) { } myCommand = new
SQLiteCommand(myQuery, myConnection);
sSNotif = "+2"; SQLiteDataReader
ScoreNotifB(); myReader;
TeamBScore(); try
LoadTeamB(); {
}
myConnection.Open();
catch myReader =
(SQLiteException ex) myCommand.ExecuteReader();
{ while
(myReader.Read()) { }
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, sSNotif = "+3";
MessageBoxIcon.Error); ScoreNotifB();
}
TeamBScore();
finally LoadTeamB();
{ }
myConnection.Close(); catch
} (SQLiteException ex)
} {
}
#endregion MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
#region Team B +3 Score MessageBoxIcon.Error);
private void }
btnP3B_Click(object sender, EventArgs
e) finally
{ {
if (sInB == "Out")
{ myConnection.Close();
MessageBox.Show("You }
are trying to score an out playing }
player.", "Out of Score",
MessageBoxButtons.OK, else if (rdb2ndP.Checked)
MessageBoxIcon.Error); {
} string myQuery =
"UPDATE tbl_playersgame SET
else if (rdb1stP.Checked) SecondP_Score = SecondP_Score + 3
{ WHERE Last_Name || ', ' || First_Name
string myQuery = || ' ' || Middle_Initial = '" +
"UPDATE tbl_playersgame SET txtPlayerB.Text + "' "
FirstP_Score = FirstP_Score + 3 WHERE
236
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyB + "' AND Team_Name = myConnection = new
'" + cmbTeamB.Text + "';"; SQLiteConnection(Conn.ConnString);
SQLiteConnection SQLiteCommand
myConnection = new myCommand = new
SQLiteConnection(Conn.ConnString); SQLiteCommand(myQuery, myConnection);
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+3";
(myReader.Read()) { } ScoreNotifB();
finally myConnection.Close();
{ }
}
myConnection.Close();
} else if (rdb4thP.Checked)
} {
string myQuery =
else if (rdb3rdP.Checked) "UPDATE tbl_playersgame SET
{ FourthP_Score = FourthP_Score + 3
string myQuery = WHERE Last_Name || ', ' || First_Name
"UPDATE tbl_playersgame SET || ' ' || Middle_Initial = '" +
ThirdP_Score = ThirdP_Score + 3 WHERE txtPlayerB.Text + "' "
Last_Name || ', ' || First_Name || ' + "AND Jersey_Number
' || Middle_Initial = '" + = '" + sJerseyB + "' AND Team_Name =
txtPlayerB.Text + "' " '" + cmbTeamB.Text + "';";
+ "AND Jersey_Number SQLiteConnection
= '" + sJerseyB + "' AND Team_Name = myConnection = new
'" + cmbTeamB.Text + "';"; SQLiteConnection(Conn.ConnString);
237
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand SQLiteDataReader
myCommand = new myReader;
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader try
myReader; {
try myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader();
while sSNotif = "+3";
(myReader.Read()) { } ScoreNotifB();
finally myConnection.Close();
{ }
}
myConnection.Close(); }
} #endregion
}
#region Team B -1 Score
else if private void
(rdbOTime.Checked) btnM1B_Click(object sender, EventArgs
{ e)
string myQuery = {
"UPDATE tbl_playersgame SET if (sInB == "Out")
Overtime_Score = Overtime_Score + 3 {
WHERE Last_Name || ', ' || First_Name MessageBox.Show("You
|| ' ' || Middle_Initial = '" + are trying to score an out playing
txtPlayerB.Text + "' " player.", "Out of Score",
+ "AND Jersey_Number MessageBoxButtons.OK,
= '" + sJerseyB + "' AND Team_Name = MessageBoxIcon.Error);
'" + cmbTeamB.Text + "';"; }
SQLiteConnection
myConnection = new else if (txtScoreB.Text
SQLiteConnection(Conn.ConnString); == "000")
SQLiteCommand {
myCommand = new MessageBox.Show("Team
SQLiteCommand(myQuery, myConnection); score is already 0.", "Out of Score",
238
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
MessageBoxButtons.OK,
MessageBoxIcon.Error); myConnection.Close();
} }
else if (rdb1stP.Checked) if (s == 0)
{ {
#region 1st
string q; MessageBox.Show(txtPlayerB.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT FirstP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else
Middle_Initial = '" + txtPlayerB.Text {
+ "' " string myQuery1 =
+ "AND Jersey_Number "UPDATE tbl_playersgame SET
= '" + sJerseyB + "' AND Team_Name = FirstP_Score = FirstP_Score - 1 WHERE
'" + cmbTeamB.Text + "';"; Last_Name || ', ' || First_Name || '
SQLiteConnection ' || Middle_Initial = '" +
myConnection = new txtPlayerB.Text + "' "
SQLiteConnection(Conn.ConnString); + "AND
SQLiteCommand Jersey_Number = '" + sJerseyB + "'
myCommand = new AND Team_Name = '" + cmbTeamB.Text +
SQLiteCommand(myQuery, myConnection); "';";
SQLiteDataReader SQLiteConnection
myReader; myConnection1 = new
SQLiteConnection(Conn.ConnString);
try SQLiteCommand
{ myCommand1 = new
SQLiteCommand(myQuery1,
myConnection.Open(); myConnection1);
myReader = SQLiteDataReader
myCommand.ExecuteReader(); myReader1;
while
(myReader.Read()) try
{ {
q =
myReader.GetValue(0).ToString(); myConnection1.Open();
s = myReader1 =
Convert.ToInt32(q); myCommand1.ExecuteReader();
} while
} (myReader1.Read()) { }
finally catch
{ (SQLiteException ex)
{
239
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if (rdb2ndP.Checked) if (s == 0)
{ {
#region 2nd
string q; MessageBox.Show(txtPlayerB.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT SecondP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else
Middle_Initial = '" + txtPlayerB.Text {
+ "' " string myQuery1 =
+ "AND Jersey_Number "UPDATE tbl_playersgame SET
= '" + sJerseyB + "' AND Team_Name = SecondP_Score = SecondP_Score - 1
'" + cmbTeamB.Text + "';"; WHERE Last_Name || ', ' || First_Name
SQLiteConnection || ' ' || Middle_Initial = '" +
myConnection = new txtPlayerB.Text + "' "
SQLiteConnection(Conn.ConnString); + "AND
SQLiteCommand Jersey_Number = '" + sJerseyB + "'
myCommand = new AND Team_Name = '" + cmbTeamB.Text +
SQLiteCommand(myQuery, myConnection); "';";
SQLiteDataReader SQLiteConnection
myReader; myConnection1 = new
SQLiteConnection(Conn.ConnString);
try SQLiteCommand
{ myCommand1 = new
SQLiteCommand(myQuery1,
myConnection.Open(); myConnection1);
myReader = SQLiteDataReader
myCommand.ExecuteReader(); myReader1;
while
(myReader.Read()) try
{ {
q =
myReader.GetValue(0).ToString(); myConnection1.Open();
s = myReader1 =
Convert.ToInt32(q); myCommand1.ExecuteReader();
} while
} (myReader1.Read()) { }
240
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
sSNotif = "- myReader =
1"; myCommand.ExecuteReader();
while
ScoreNotifB(); (myReader.Read())
{
TeamBScore(); q =
LoadTeamB(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if (rdb3rdP.Checked) if (s == 0)
{ {
#region 3rd
string q; MessageBox.Show(txtPlayerB.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT ThirdP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else
Middle_Initial = '" + txtPlayerB.Text {
+ "' " string myQuery1 =
+ "AND Jersey_Number "UPDATE tbl_playersgame SET
= '" + sJerseyB + "' AND Team_Name = ThirdP_Score = ThirdP_Score - 1 WHERE
'" + cmbTeamB.Text + "';"; Last_Name || ', ' || First_Name || '
SQLiteConnection ' || Middle_Initial = '" +
myConnection = new txtPlayerB.Text + "' "
SQLiteConnection(Conn.ConnString); + "AND
SQLiteCommand Jersey_Number = '" + sJerseyB + "'
myCommand = new AND Team_Name = '" + cmbTeamB.Text +
SQLiteCommand(myQuery, myConnection); "';";
SQLiteDataReader SQLiteConnection
myReader; myConnection1 = new
SQLiteConnection(Conn.ConnString);
try SQLiteCommand
{ myCommand1 = new
SQLiteCommand(myQuery1,
myConnection.Open(); myConnection1);
241
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteDataReader SQLiteConnection
myReader1; myConnection = new
SQLiteConnection(Conn.ConnString);
try SQLiteCommand
{ myCommand = new
SQLiteCommand(myQuery, myConnection);
myConnection1.Open(); SQLiteDataReader
myReader1 = myReader;
myCommand1.ExecuteReader();
while try
(myReader1.Read()) { } {
242
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
|| ' ' || Middle_Initial = '" + string q;
txtPlayerB.Text + "' " int s = 0;
+ "AND
Jersey_Number = '" + sJerseyB + "' string myQuery =
AND Team_Name = '" + cmbTeamB.Text + "SELECT Overtime_Score FROM
"';"; tbl_playersgame WHERE Last_Name || ',
SQLiteConnection ' || First_Name || ' ' ||
myConnection1 = new Middle_Initial = '" + txtPlayerB.Text
SQLiteConnection(Conn.ConnString); + "' "
SQLiteCommand + "AND Jersey_Number
myCommand1 = new = '" + sJerseyB + "' AND Team_Name =
SQLiteCommand(myQuery1, '" + cmbTeamB.Text + "';";
myConnection1); SQLiteConnection
SQLiteDataReader myConnection = new
myReader1; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand = new
{ SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
myConnection1.Open(); myReader;
myReader1 =
myCommand1.ExecuteReader(); try
while {
(myReader1.Read()) { }
myConnection.Open();
sSNotif = "- myReader =
1"; myCommand.ExecuteReader();
while
ScoreNotifB(); (myReader.Read())
{
TeamBScore(); q =
LoadTeamB(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if if (s == 0)
(rdbOTime.Checked) {
{
#region Overtime MessageBox.Show(txtPlayerB.Text + "
243
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
score is already 0.", "Out of Score",
MessageBoxButtons.OK, myConnection1.Close();
MessageBoxIcon.Error); }
} }
#endregion
else }
{ }
string myQuery1 = #endregion
"UPDATE tbl_playersgame SET
Overtime_Score = Overtime_Score - 1 #region Team B -2 Score
WHERE Last_Name || ', ' || First_Name private void
|| ' ' || Middle_Initial = '" + btnM2B_Click(object sender, EventArgs
txtPlayerB.Text + "' " e)
+ "AND {
Jersey_Number = '" + sJerseyB + "' if (sInB == "Out")
AND Team_Name = '" + cmbTeamB.Text + {
"';"; MessageBox.Show("You
SQLiteConnection are trying to score an out playing
myConnection1 = new player.", "Out of Score",
SQLiteConnection(Conn.ConnString); MessageBoxButtons.OK,
SQLiteCommand MessageBoxIcon.Error);
myCommand1 = new }
SQLiteCommand(myQuery1,
myConnection1); else if (txtScoreB.Text
SQLiteDataReader == "000")
myReader1; {
MessageBox.Show("Team
try score is already 0.", "Out of Score",
{ MessageBoxButtons.OK,
MessageBoxIcon.Error);
myConnection1.Open(); }
myReader1 =
myCommand1.ExecuteReader(); else if (rdb1stP.Checked)
while {
(myReader1.Read()) { } #region 1st
string q;
sSNotif = "- int s = 0;
1";
string myQuery =
ScoreNotifB(); "SELECT FirstP_Score FROM
tbl_playersgame WHERE Last_Name || ',
TeamBScore(); ' || First_Name || ' ' ||
LoadTeamB(); Middle_Initial = '" + txtPlayerB.Text
} + "' "
+ "AND Jersey_Number
catch = '" + sJerseyB + "' AND Team_Name =
(SQLiteException ex) '" + cmbTeamB.Text + "';";
{ SQLiteConnection
myConnection = new
MessageBox.Show(ex.Message, "Error", SQLiteConnection(Conn.ConnString);
MessageBoxButtons.OK, SQLiteCommand
MessageBoxIcon.Error); myCommand = new
} SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
finally myReader;
{
244
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
try ' || Middle_Initial = '" +
{ txtPlayerB.Text + "' "
+ "AND
myConnection.Open(); Jersey_Number = '" + sJerseyB + "'
myReader = AND Team_Name = '" + cmbTeamB.Text +
myCommand.ExecuteReader(); "';";
while SQLiteConnection
(myReader.Read()) myConnection1 = new
{ SQLiteConnection(Conn.ConnString);
q = SQLiteCommand
myReader.GetValue(0).ToString(); myCommand1 = new
s = SQLiteCommand(myQuery1,
Convert.ToInt32(q); myConnection1);
} SQLiteDataReader
} myReader1;
catch try
(SQLiteException ex) {
{
myConnection1.Open();
MessageBox.Show(ex.Message, "Error", myReader1 =
MessageBoxButtons.OK, myCommand1.ExecuteReader();
MessageBoxIcon.Error); while
} (myReader1.Read()) { }
myConnection.Close(); ScoreNotifB();
}
TeamBScore();
if (s == 0) LoadTeamB();
{ }
245
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT SecondP_Score FROM
tbl_playersgame WHERE Last_Name || ', else if (s < 2)
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerB.Text
+ "' " MessageBox.Show(txtPlayerB.Text + "
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyB + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamB.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader SecondP_Score = SecondP_Score - 2
myReader; WHERE Last_Name || ', ' || First_Name
|| ' ' || Middle_Initial = '" +
try txtPlayerB.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyB + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamB.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
sSNotif = "-
finally 2";
{
ScoreNotifB();
myConnection.Close();
} TeamBScore();
LoadTeamB();
if (s == 0) }
{
catch
MessageBox.Show(txtPlayerB.Text + " (SQLiteException ex)
score is already 0.", "Out of Score", {
246
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if (rdb3rdP.Checked) if (s == 0)
{ {
#region 3rd
string q; MessageBox.Show(txtPlayerB.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT ThirdP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else if (s < 2)
Middle_Initial = '" + txtPlayerB.Text {
+ "' "
+ "AND Jersey_Number MessageBox.Show(txtPlayerB.Text + "
= '" + sJerseyB + "' AND Team_Name = score cannot be negative.", "Out of
'" + cmbTeamB.Text + "';"; Score", MessageBoxButtons.OK,
SQLiteConnection MessageBoxIcon.Error);
myConnection = new }
SQLiteConnection(Conn.ConnString);
SQLiteCommand else
myCommand = new {
SQLiteCommand(myQuery, myConnection); string myQuery1 =
SQLiteDataReader "UPDATE tbl_playersgame SET
myReader; ThirdP_Score = ThirdP_Score - 2 WHERE
Last_Name || ', ' || First_Name || '
try ' || Middle_Initial = '" +
{ txtPlayerB.Text + "' "
+ "AND
myConnection.Open(); Jersey_Number = '" + sJerseyB + "'
myReader = AND Team_Name = '" + cmbTeamB.Text +
myCommand.ExecuteReader(); "';";
while SQLiteConnection
(myReader.Read()) myConnection1 = new
{ SQLiteConnection(Conn.ConnString);
q = SQLiteCommand
myReader.GetValue(0).ToString(); myCommand1 = new
s = SQLiteCommand(myQuery1,
Convert.ToInt32(q); myConnection1);
} SQLiteDataReader
} myReader1;
try
247
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ SQLiteDataReader
myReader;
myConnection1.Open();
myReader1 = try
myCommand1.ExecuteReader(); {
while
(myReader1.Read()) { } myConnection.Open();
myReader =
sSNotif = "- myCommand.ExecuteReader();
2"; while
(myReader.Read())
ScoreNotifB(); {
q =
TeamBScore(); myReader.GetValue(0).ToString();
LoadTeamB(); s =
} Convert.ToInt32(q);
}
catch }
(SQLiteException ex)
{ catch
(SQLiteException ex)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb4thP.Checked) {
{
#region 4th MessageBox.Show(txtPlayerB.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT FourthP_Score FROM
tbl_playersgame WHERE Last_Name || ', else if (s < 2)
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerB.Text
+ "' " MessageBox.Show(txtPlayerB.Text + "
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyB + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamB.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
248
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
FourthP_Score = FourthP_Score - 2 {
WHERE Last_Name || ', ' || First_Name #region Overtime
|| ' ' || Middle_Initial = '" + string q;
txtPlayerB.Text + "' " int s = 0;
+ "AND
Jersey_Number = '" + sJerseyB + "' string myQuery =
AND Team_Name = '" + cmbTeamB.Text + "SELECT Overtime_Score FROM
"';"; tbl_playersgame WHERE Last_Name || ',
SQLiteConnection ' || First_Name || ' ' ||
myConnection1 = new Middle_Initial = '" + txtPlayerB.Text
SQLiteConnection(Conn.ConnString); + "' "
SQLiteCommand + "AND Jersey_Number
myCommand1 = new = '" + sJerseyB + "' AND Team_Name =
SQLiteCommand(myQuery1, '" + cmbTeamB.Text + "';";
myConnection1); SQLiteConnection
SQLiteDataReader myConnection = new
myReader1; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand = new
{ SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
myConnection1.Open(); myReader;
myReader1 =
myCommand1.ExecuteReader(); try
while {
(myReader1.Read()) { }
myConnection.Open();
sSNotif = "- myReader =
2"; myCommand.ExecuteReader();
while
ScoreNotifB(); (myReader.Read())
{
TeamBScore(); q =
LoadTeamB(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if if (s == 0)
(rdbOTime.Checked) {
249
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
catch
MessageBox.Show(txtPlayerB.Text + " (SQLiteException ex)
score is already 0.", "Out of Score", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (s < 2) }
{
finally
MessageBox.Show(txtPlayerB.Text + " {
score cannot be negative.", "Out of
Score", MessageBoxButtons.OK, myConnection1.Close();
MessageBoxIcon.Error); }
} }
#endregion
else }
{ }
string myQuery1 = #endregion
"UPDATE tbl_playersgame SET
Overtime_Score = Overtime_Score - 2 #region Team B -3 Score
WHERE Last_Name || ', ' || First_Name private void
|| ' ' || Middle_Initial = '" + btnM3B_Click(object sender, EventArgs
txtPlayerB.Text + "' " e)
+ "AND {
Jersey_Number = '" + sJerseyB + "' if (sInB == "Out")
AND Team_Name = '" + cmbTeamB.Text + {
"';"; MessageBox.Show("You
SQLiteConnection are trying to score an out playing
myConnection1 = new player.", "Out of Score",
SQLiteConnection(Conn.ConnString); MessageBoxButtons.OK,
SQLiteCommand MessageBoxIcon.Error);
myCommand1 = new }
SQLiteCommand(myQuery1,
myConnection1); else if (txtScoreB.Text
SQLiteDataReader == "000")
myReader1; {
MessageBox.Show("Team
try score is already 0.", "Out of Score",
{ MessageBoxButtons.OK,
MessageBoxIcon.Error);
myConnection1.Open(); }
myReader1 =
myCommand1.ExecuteReader(); else if (rdb1stP.Checked)
while {
(myReader1.Read()) { } #region 1st
string q;
sSNotif = "- int s = 0;
2";
string myQuery =
ScoreNotifB(); "SELECT FirstP_Score FROM
tbl_playersgame WHERE Last_Name || ',
TeamBScore(); ' || First_Name || ' ' ||
LoadTeamB(); Middle_Initial = '" + txtPlayerB.Text
} + "' "
250
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyB + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamB.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader FirstP_Score = FirstP_Score - 3 WHERE
myReader; Last_Name || ', ' || First_Name || '
' || Middle_Initial = '" +
try txtPlayerB.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyB + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamB.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
sSNotif = "-
finally 3";
{
ScoreNotifB();
myConnection.Close();
} TeamBScore();
LoadTeamB();
if (s == 0) }
{
catch
MessageBox.Show(txtPlayerB.Text + " (SQLiteException ex)
score is already 0.", "Out of Score", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (s < 3) }
{
finally
MessageBox.Show(txtPlayerB.Text + " {
251
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb2ndP.Checked) {
{
#region 2nd MessageBox.Show(txtPlayerB.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT SecondP_Score FROM
tbl_playersgame WHERE Last_Name || ', else if (s < 3)
' || First_Name || ' ' || {
Middle_Initial = '" + txtPlayerB.Text
+ "' " MessageBox.Show(txtPlayerB.Text + "
+ "AND Jersey_Number score cannot be negative.", "Out of
= '" + sJerseyB + "' AND Team_Name = Score", MessageBoxButtons.OK,
'" + cmbTeamB.Text + "';"; MessageBoxIcon.Error);
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); else
SQLiteCommand {
myCommand = new string myQuery1 =
SQLiteCommand(myQuery, myConnection); "UPDATE tbl_playersgame SET
SQLiteDataReader SecondP_Score = SecondP_Score - 3
myReader; WHERE Last_Name || ', ' || First_Name
|| ' ' || Middle_Initial = '" +
try txtPlayerB.Text + "' "
{ + "AND
Jersey_Number = '" + sJerseyB + "'
myConnection.Open(); AND Team_Name = '" + cmbTeamB.Text +
myReader = "';";
myCommand.ExecuteReader(); SQLiteConnection
while myConnection1 = new
(myReader.Read()) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
q = myCommand1 = new
myReader.GetValue(0).ToString(); SQLiteCommand(myQuery1,
s = myConnection1);
Convert.ToInt32(q); SQLiteDataReader
} myReader1;
}
try
catch {
(SQLiteException ex)
{ myConnection1.Open();
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
252
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
sSNotif = "- myReader =
3"; myCommand.ExecuteReader();
while
ScoreNotifB(); (myReader.Read())
{
TeamBScore(); q =
LoadTeamB(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
} MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
finally MessageBoxIcon.Error);
{ }
myConnection1.Close(); finally
} {
}
#endregion myConnection.Close();
} }
else if (rdb3rdP.Checked) if (s == 0)
{ {
#region 3rd
string q; MessageBox.Show(txtPlayerB.Text + "
int s = 0; score is already 0.", "Out of Score",
MessageBoxButtons.OK,
string myQuery = MessageBoxIcon.Error);
"SELECT ThirdP_Score FROM }
tbl_playersgame WHERE Last_Name || ',
' || First_Name || ' ' || else if (s < 3)
Middle_Initial = '" + txtPlayerB.Text {
+ "' "
+ "AND Jersey_Number MessageBox.Show(txtPlayerB.Text + "
= '" + sJerseyB + "' AND Team_Name = score cannot be negative.", "Out of
'" + cmbTeamB.Text + "';"; Score", MessageBoxButtons.OK,
SQLiteConnection MessageBoxIcon.Error);
myConnection = new }
SQLiteConnection(Conn.ConnString);
SQLiteCommand else
myCommand = new {
SQLiteCommand(myQuery, myConnection); string myQuery1 =
SQLiteDataReader "UPDATE tbl_playersgame SET
myReader; ThirdP_Score = ThirdP_Score - 3 WHERE
Last_Name || ', ' || First_Name || '
try ' || Middle_Initial = '" +
{ txtPlayerB.Text + "' "
+ "AND
myConnection.Open(); Jersey_Number = '" + sJerseyB + "'
253
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
AND Team_Name = '" + cmbTeamB.Text + tbl_playersgame WHERE Last_Name || ',
"';"; ' || First_Name || ' ' ||
SQLiteConnection Middle_Initial = '" + txtPlayerB.Text
myConnection1 = new + "' "
SQLiteConnection(Conn.ConnString); + "AND Jersey_Number
SQLiteCommand = '" + sJerseyB + "' AND Team_Name =
myCommand1 = new '" + cmbTeamB.Text + "';";
SQLiteCommand(myQuery1, SQLiteConnection
myConnection1); myConnection = new
SQLiteDataReader SQLiteConnection(Conn.ConnString);
myReader1; SQLiteCommand
myCommand = new
try SQLiteCommand(myQuery, myConnection);
{ SQLiteDataReader
myReader;
myConnection1.Open();
myReader1 = try
myCommand1.ExecuteReader(); {
while
(myReader1.Read()) { } myConnection.Open();
myReader =
sSNotif = "- myCommand.ExecuteReader();
3"; while
(myReader.Read())
ScoreNotifB(); {
q =
TeamBScore(); myReader.GetValue(0).ToString();
LoadTeamB(); s =
} Convert.ToInt32(q);
}
catch }
(SQLiteException ex)
{ catch
(SQLiteException ex)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
finally
myConnection1.Close(); {
}
} myConnection.Close();
#endregion }
}
if (s == 0)
else if (rdb4thP.Checked) {
{
#region 4th MessageBox.Show(txtPlayerB.Text + "
string q; score is already 0.", "Out of Score",
int s = 0; MessageBoxButtons.OK,
MessageBoxIcon.Error);
string myQuery = }
"SELECT FourthP_Score FROM
254
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
else if (s < 3) }
{
finally
MessageBox.Show(txtPlayerB.Text + " {
score cannot be negative.", "Out of
Score", MessageBoxButtons.OK, myConnection1.Close();
MessageBoxIcon.Error); }
} }
#endregion
else }
{
string myQuery1 = else if
"UPDATE tbl_playersgame SET (rdbOTime.Checked)
FourthP_Score = FourthP_Score - 3 {
WHERE Last_Name || ', ' || First_Name #region Overtime
|| ' ' || Middle_Initial = '" + string q;
txtPlayerB.Text + "' " int s = 0;
+ "AND
Jersey_Number = '" + sJerseyB + "' string myQuery =
AND Team_Name = '" + cmbTeamB.Text + "SELECT Overtime_Score FROM
"';"; tbl_playersgame WHERE Last_Name || ',
SQLiteConnection ' || First_Name || ' ' ||
myConnection1 = new Middle_Initial = '" + txtPlayerB.Text
SQLiteConnection(Conn.ConnString); + "' "
SQLiteCommand + "AND Jersey_Number
myCommand1 = new = '" + sJerseyB + "' AND Team_Name =
SQLiteCommand(myQuery1, '" + cmbTeamB.Text + "';";
myConnection1); SQLiteConnection
SQLiteDataReader myConnection = new
myReader1; SQLiteConnection(Conn.ConnString);
SQLiteCommand
try myCommand = new
{ SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
myConnection1.Open(); myReader;
myReader1 =
myCommand1.ExecuteReader(); try
while {
(myReader1.Read()) { }
myConnection.Open();
sSNotif = "- myReader =
3"; myCommand.ExecuteReader();
while
ScoreNotifB(); (myReader.Read())
{
TeamBScore(); q =
LoadTeamB(); myReader.GetValue(0).ToString();
} s =
Convert.ToInt32(q);
catch }
(SQLiteException ex) }
{
catch
MessageBox.Show(ex.Message, "Error", (SQLiteException ex)
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
255
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myReader1 =
MessageBox.Show(ex.Message, "Error", myCommand1.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader1.Read()) { }
}
sSNotif = "-
finally 3";
{
ScoreNotifB();
myConnection.Close();
} TeamBScore();
LoadTeamB();
if (s == 0) }
{
catch
MessageBox.Show(txtPlayerB.Text + " (SQLiteException ex)
score is already 0.", "Out of Score", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (s < 3) }
{
finally
MessageBox.Show(txtPlayerB.Text + " {
score cannot be negative.", "Out of
Score", MessageBoxButtons.OK, myConnection1.Close();
MessageBoxIcon.Error); }
} }
#endregion
else }
{ }
string myQuery1 = #endregion
"UPDATE tbl_playersgame SET
Overtime_Score = Overtime_Score - 3 //------------------------//
WHERE Last_Name || ', ' || First_Name Team A Foul
|| ' ' || Middle_Initial = '" +
txtPlayerB.Text + "' " #region Count Foul A
+ "AND void CountFoulA()
Jersey_Number = '" + sJerseyB + "' {
AND Team_Name = '" + cmbTeamB.Text + string myQuery = "SELECT
"';"; SUM(CASE WHEN Foul_1 != 0 THEN 1 ELSE
SQLiteConnection Foul_1 END) + SUM(CASE WHEN Foul_2 !=
myConnection1 = new 0 THEN 1 ELSE Foul_2 END) "
SQLiteConnection(Conn.ConnString); + "+ SUM(CASE WHEN Foul_3
SQLiteCommand != 0 THEN 1 ELSE Foul_3 END)+
myCommand1 = new SUM(CASE WHEN Foul_4 != 0 THEN 1 ELSE
SQLiteCommand(myQuery1, Foul_4 END) "
myConnection1); + "+ SUM(CASE WHEN Foul_5
SQLiteDataReader != 0 THEN 1 ELSE Foul_5 END) FROM
myReader1; tbl_playersgame "
+ "WHERE Last_Name || ',
try ' || First_Name || ' ' ||
{ Middle_Initial = '" + txtPlayerA.Text
+ "' "
myConnection1.Open();
256
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number = '" sQValueA = "3";
+ sJerseyA + "' AND Team_Name = '" + }
cmbTeamA.Text + "';";
SQLiteConnection else if (rdb4thP.Checked)
myConnection = new {
SQLiteConnection(Conn.ConnString); sQValueA = "4";
SQLiteCommand myCommand = }
new SQLiteCommand(myQuery,
myConnection); else if
SQLiteDataReader (rdbOTime.Checked)
myReader; {
sQValueA = "5";
try }
{ }
myConnection.Open(); #endregion
myReader =
myCommand.ExecuteReader(); #region Count Team Foul per
while Quarter A
(myReader.Read()) void CountFoulQuarterA()
{ {
sFoulA = string myQuery = "SELECT
myReader.GetValue(0).ToString(); SUM(CASE WHEN Foul_1 = " + sQValueA +
} " THEN 1 ELSE 0 END) + SUM(CASE WHEN
} Foul_2 = " + sQValueA + " THEN 1 ELSE
0 END) + "
catch (SQLiteException + "SUM(CASE WHEN Foul_3 =
ex) " + sQValueA + " THEN 1 ELSE 0 END) +
{ SUM(CASE WHEN Foul_4 = " + sQValueA +
" THEN 1 ELSE 0 END) + "
MessageBox.Show(ex.Message, "Error", + "SUM(CASE WHEN Foul_5 =
MessageBoxButtons.OK, " + sQValueA + " THEN 1 ELSE 0 END)
MessageBoxIcon.Error); FROM tbl_playersgame WHERE Team_Name
} = '" + cmbTeamA.Text + "';";
SQLiteConnection
finally myConnection = new
{ SQLiteConnection(Conn.ConnString);
myConnection.Close(); SQLiteCommand myCommand =
} new SQLiteCommand(myQuery,
} myConnection);
#endregion SQLiteDataReader
myReader;
#region Quarter Value A
void QuarterValueA() try
{ {
if (rdb1stP.Checked) myConnection.Open();
{ myReader =
sQValueA = "1"; myCommand.ExecuteReader();
} while
(myReader.Read())
else if (rdb2ndP.Checked) {
{ sTeamFoulA =
sQValueA = "2"; myReader.GetValue(0).ToString();
} }
}
else if (rdb3rdP.Checked)
{
257
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
catch (SQLiteException o) && Int32.TryParse(txt4TFA.Text,
ex) out f) && (f + o) >= 5)
{ {
txtPenaltyA.Visible =
MessageBox.Show(ex.Message, "Error", true;
MessageBoxButtons.OK, }
MessageBoxIcon.Error);
} else
{
finally txtPenaltyA.Visible =
{ false;
myConnection.Close(); }
} }
}
#endregion private void
rdb2ndP_Click(object sender,
#region Penalty A EventArgs e)
void PenaltyA() {
{ if (sTQuarter != "2")
int f = 0, o = 0; ; {
dynamic dialog =
if (rdb1stP.Checked && MessageBox.Show("Do you want to
Int32.TryParse(txt1TFA.Text, out f) proceed to 2nd Period?", "Period
&& f >= 5) Change", MessageBoxButtons.YesNo,
{ MessageBoxIcon.Question);
txtPenaltyA.Visible = if (dialog ==
true; DialogResult.No)
} {
rdb1stP.Checked =
else if (rdb2ndP.Checked true;
&& Int32.TryParse(txt2TFA.Text, out }
f) && f >= 5)
{ else if (dialog ==
txtPenaltyA.Visible = DialogResult.Yes)
true; {
} PenaltyA();
PenaltyB();
else if (rdb3rdP.Checked sTQuarter = "2";
&& Int32.TryParse(txt3TFA.Text, out rdb2ndP.Checked =
f) && f >= 5) true;
{ rdb1stP.Enabled =
txtPenaltyA.Visible = false;
true;
} ScoreFoulAPA();
ScoreFoulAPB();
else if (rdb4thP.Checked }
&& Int32.TryParse(txt4TFA.Text, out }
f) && f >= 5) }
{
txtPenaltyA.Visible = private void
true; rdb3rdP_Click(object sender,
} EventArgs e)
{
else if (rdbOTime.Checked if (sTQuarter != "3")
&& Int32.TryParse(txtOTFA.Text, out {
258
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
dynamic dialog = if (sTQuarter ==
MessageBox.Show("Do you want to "")
proceed to 3rd Period?", "Period {
Change", MessageBoxButtons.YesNo,
MessageBoxIcon.Question); rdb1stP.Checked = true;
if (dialog == }
DialogResult.No)
{ else if
if (sTQuarter == (sTQuarter == "2")
"") {
{
rdb2ndP.Checked = true;
rdb1stP.Checked = true; }
}
else if
else if (sTQuarter == "3")
(sTQuarter == "2") {
{
rdb3rdP.Checked = true;
rdb2ndP.Checked = true; }
} }
}
else if (dialog ==
else if (dialog == DialogResult.Yes)
DialogResult.Yes) {
{ PenaltyA();
PenaltyA(); PenaltyB();
PenaltyB(); sTQuarter = "4";
sTQuarter = "3"; rdb4thP.Checked =
rdb3rdP.Checked = true;
true; rdb1stP.Enabled =
rdb1stP.Enabled = false;
false; rdb2ndP.Enabled =
rdb2ndP.Enabled = false;
false; rdb3rdP.Enabled =
false;
ScoreFoulAPA();
ScoreFoulAPB(); ScoreFoulAPA();
} ScoreFoulAPB();
} }
} }
}
private void
rdb4thP_Click(object sender, private void
EventArgs e) rdbOtime_Click(object sender,
{ EventArgs e)
if (sTQuarter != "4") {
{ dynamic dialog =
dynamic dialog = MessageBox.Show("Do you want to
MessageBox.Show("Do you want to proceed to Overtime " + (iTO + 1) +
proceed to 4th Period?", "Period "?", "Period Change",
Change", MessageBoxButtons.YesNo, MessageBoxButtons.YesNo,
MessageBoxIcon.Question); MessageBoxIcon.Question);
if (dialog == if (dialog ==
DialogResult.No) DialogResult.No)
{ {
259
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (sTQuarter == "") }
{ #endregion
rdb1stP.Checked =
true; #region Team Foul A
} void TeamFoulA()
{
else if (sTQuarter == if (rdb1stP.Checked)
"2") {
{ string myQuery =
rdb2ndP.Checked = "UPDATE tbl_teamsgame SET
true; FirstP_Team_Foul = '" + txt1TFA.Text
} + "' WHERE Team_Name = '" +
cmbTeamA.Text + "';";
else if (sTQuarter == SQLiteConnection
"3") myConnection = new
{ SQLiteConnection(Conn.ConnString);
rdb3rdP.Checked = SQLiteCommand
true; myCommand = new
} SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
else if (sTQuarter == myReader;
"4")
{ try
rdb4thP.Checked = {
true;
} myConnection.Open();
} myReader =
myCommand.ExecuteReader();
else if (dialog == while
DialogResult.Yes) (myReader.Read()) { }
{ }
PenaltyA();
PenaltyB(); catch
sTQuarter = "0"; (SQLiteException ex)
rdbOTime.Checked = {
true;
rdb1stP.Enabled = MessageBox.Show(ex.Message, "Error",
false; MessageBoxButtons.OK,
rdb2ndP.Enabled = MessageBoxIcon.Error);
false; }
rdb3rdP.Enabled =
false; finally
rdb4thP.Enabled = {
false;
myConnection.Close();
iTO = iTO + 1; }
}
rdbOTime.Text =
"Overtime " + iTO; else if (rdb2ndP.Checked)
{
iTimeoutA = 0; string myQuery =
iTimeoutB = 0; "UPDATE tbl_teamsgame SET
SecondP_Team_Foul = '" + txt2TFA.Text
ScoreFoulAPA(); + "' WHERE Team_Name = '" +
ScoreFoulAPB(); cmbTeamA.Text + "';";
}
260
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteConnection myReader =
myConnection = new myCommand.ExecuteReader();
SQLiteConnection(Conn.ConnString); while
SQLiteCommand (myReader.Read()) { }
myCommand = new }
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader catch
myReader; (SQLiteException ex)
{
try
{ MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
myConnection.Open(); MessageBoxIcon.Error);
myReader = }
myCommand.ExecuteReader();
while finally
(myReader.Read()) { } {
}
myConnection.Close();
catch }
(SQLiteException ex) }
{
else if (rdb4thP.Checked)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK, string myQuery =
MessageBoxIcon.Error); "UPDATE tbl_teamsgame SET
} FourthP_Team_Foul = '" + txt4TFA.Text
+ "' WHERE Team_Name = '" +
finally cmbTeamA.Text + "';";
{ SQLiteConnection
myConnection = new
myConnection.Close(); SQLiteConnection(Conn.ConnString);
} SQLiteCommand
} myCommand = new
SQLiteCommand(myQuery, myConnection);
else if (rdb3rdP.Checked) SQLiteDataReader
{ myReader;
string myQuery =
"UPDATE tbl_teamsgame SET try
ThirdP_Team_Foul = '" + txt3TFA.Text {
+ "' WHERE Team_Name = '" +
cmbTeamA.Text + "';"; myConnection.Open();
SQLiteConnection myReader =
myConnection = new myCommand.ExecuteReader();
SQLiteConnection(Conn.ConnString); while
SQLiteCommand (myReader.Read()) { }
myCommand = new }
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader catch
myReader; (SQLiteException ex)
{
try
{ MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
myConnection.Open(); MessageBoxIcon.Error);
}
261
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
string ext = "";
finally
{ if (sFoulA == "1")
{
myConnection.Close(); ext = "st";
} }
}
else if (sFoulA == "2")
else if {
(rdbOTime.Checked) ext = "nd";
{ }
string myQuery =
"UPDATE tbl_teamsgame SET else if (sFoulA == "3")
Overtime_Team_Foul = '" + {
txtOTFA.Text + "' WHERE Team_Name = ext = "rd";
'" + cmbTeamA.Text + "';"; }
SQLiteConnection
myConnection = new else if (sFoulA == "4" ||
SQLiteConnection(Conn.ConnString); sFoulA == "5")
SQLiteCommand {
myCommand = new ext = "th";
SQLiteCommand(myQuery, myConnection); }
SQLiteDataReader
myReader; lblNotif.Text = "Team A :
" + txtPlayerA.Text + " got " +
try sFoulA + ext + " personal foul.";
{ lblNotif.Visible = true;
iDT = 4;
myConnection.Open(); tmrNotif.Start();
myReader = }
myCommand.ExecuteReader();
while private void
(myReader.Read()) { } btnPFoulA_Click(object sender,
} EventArgs e)
{
catch QuarterValueA();
(SQLiteException ex)
{ if (sInA == "Out")
{
MessageBox.Show(ex.Message, "Error", MessageBox.Show("You
MessageBoxButtons.OK, are trying to foul an out playing
MessageBoxIcon.Error); player.", "Foul",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
else if (sFoulA == "5")
myConnection.Close(); {
}
} MessageBox.Show(txtPlayerA.Text + "
} is already fouled out.", "Foul",
#endregion MessageBoxButtons.OK,
MessageBoxIcon.Error);
#region Foul A }
void FoulNotifA()
{ else if (rdb1stP.Checked)
262
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{
string myQuery = FoulNotifA();
"UPDATE tbl_playersgame SET Foul_1 =
CASE WHEN Foul_1 = 0 THEN 1 ELSE if (sFoulA ==
Foul_1 END, " "5")
+ "Foul_2 = CASE WHEN {
Foul_1 != 0 AND Foul_2 = 0 THEN 1
ELSE Foul_2 END, " btnOutA_Click(sender, e);
+ "Foul_3 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND lblNotif.Visible = false;
Foul_3 = 0 THEN 1 ELSE Foul_3 END, " lblNotif.Text
+ "Foul_4 = CASE WHEN = "Team A : " + txtPlayerA.Text + "
Foul_1 != 0 AND Foul_2 != 0 AND has been set out due of having 5
Foul_3 != 0 AND Foul_4 = 0 THEN 1 fouls.";
ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN lblNotif.Visible = true;
Foul_1 != 0 AND Foul_2 != 0 AND iDT = 4;
Foul_3 != 0 AND Foul_4 != 0 AND
Foul_5 = 0 THEN 1 ELSE Foul_5 END " tmrNotif.Start();
+ "WHERE Last_Name || }
', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerA.Text LoadTeamA();
+ "' " }
+ "AND Jersey_Number
= '" + sJerseyA + "' AND Team_Name = catch
'" + cmbTeamA.Text + "';"; (SQLiteException ex)
SQLiteConnection {
myConnection = new
SQLiteConnection(Conn.ConnString); MessageBox.Show(ex.Message, "Error",
SQLiteCommand MessageBoxButtons.OK,
myCommand = new MessageBoxIcon.Error);
SQLiteCommand(myQuery, myConnection); }
SQLiteDataReader
myReader; finally
{
try
{ myConnection.Close();
}
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); else if (rdb2ndP.Checked)
while {
(myReader.Read()) { } string myQuery =
"UPDATE tbl_playersgame SET Foul_1 =
int foul = 0; CASE WHEN Foul_1 = 0 THEN 2 ELSE
Foul_1 END, "
foul = + "Foul_2 = CASE WHEN
Convert.ToInt32(sFoulA) + 1; Foul_1 != 0 AND Foul_2 = 0 THEN 2
ELSE Foul_2 END, "
sFoulA = + "Foul_3 = CASE WHEN
Convert.ToString(foul); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 = 0 THEN 2 ELSE Foul_3 END, "
+ "Foul_4 = CASE WHEN
CountFoulQuarterA(); Foul_1 != 0 AND Foul_2 != 0 AND
txt1TFA.Text = Foul_3 != 0 AND Foul_4 = 0 THEN 2
sTeamFoulA; ELSE Foul_4 END, "
263
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "Foul_5 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND lblNotif.Visible = true;
Foul_3 != 0 AND Foul_4 != 0 AND iDT = 4;
Foul_5 = 0 THEN 2 ELSE Foul_5 END "
+ "WHERE Last_Name || tmrNotif.Start();
', ' || First_Name || ' ' || }
Middle_Initial = '" + txtPlayerA.Text
+ "' " LoadTeamA();
+ "AND Jersey_Number }
= '" + sJerseyA + "' AND Team_Name =
'" + cmbTeamA.Text + "';"; catch
SQLiteConnection (SQLiteException ex)
myConnection = new {
SQLiteConnection(Conn.ConnString);
SQLiteCommand MessageBox.Show(ex.Message, "Error",
myCommand = new MessageBoxButtons.OK,
SQLiteCommand(myQuery, myConnection); MessageBoxIcon.Error);
SQLiteDataReader }
myReader;
finally
try {
{
myConnection.Close();
myConnection.Open(); }
myReader = }
myCommand.ExecuteReader();
while else if (rdb3rdP.Checked)
(myReader.Read()) { } {
string myQuery =
int foul = 0; "UPDATE tbl_playersgame SET Foul_1 =
CASE WHEN Foul_1 = 0 THEN 3 ELSE
foul = Foul_1 END, "
Convert.ToInt32(sFoulA) + 1; + "Foul_2 = CASE WHEN
Foul_1 != 0 AND Foul_2 = 0 THEN 3
sFoulA = ELSE Foul_2 END, "
Convert.ToString(foul); + "Foul_3 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 = 0 THEN 3 ELSE Foul_3 END, "
CountFoulQuarterA(); + "Foul_4 = CASE WHEN
txt2TFA.Text = Foul_1 != 0 AND Foul_2 != 0 AND
sTeamFoulA; Foul_3 != 0 AND Foul_4 = 0 THEN 3
ELSE Foul_4 END, "
FoulNotifA(); + "Foul_5 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND
if (sFoulA == Foul_3 != 0 AND Foul_4 != 0 AND
"5") Foul_5 = 0 THEN 3 ELSE Foul_5 END "
{ + "WHERE Last_Name ||
', ' || First_Name || ' ' ||
btnOutA_Click(sender, e); Middle_Initial = '" + txtPlayerA.Text
+ "' "
lblNotif.Visible = false; + "AND Jersey_Number
lblNotif.Text = '" + sJerseyA + "' AND Team_Name =
= "Team A : " + txtPlayerA.Text + " '" + cmbTeamA.Text + "';";
has been set out due of having 5 SQLiteConnection
fouls."; myConnection = new
SQLiteConnection(Conn.ConnString);
264
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteCommand MessageBoxButtons.OK,
myCommand = new MessageBoxIcon.Error);
SQLiteCommand(myQuery, myConnection); }
SQLiteDataReader
myReader; finally
{
try
{ myConnection.Close();
}
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); else if (rdb4thP.Checked)
while {
(myReader.Read()) { } string myQuery =
"UPDATE tbl_playersgame SET Foul_1 =
int foul = 0; CASE WHEN Foul_1 = 0 THEN 4 ELSE
Foul_1 END, "
foul = + "Foul_2 = CASE WHEN
Convert.ToInt32(sFoulA) + 1; Foul_1 != 0 AND Foul_2 = 0 THEN 4
ELSE Foul_2 END, "
sFoulA = + "Foul_3 = CASE WHEN
Convert.ToString(foul); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 = 0 THEN 4 ELSE Foul_3 END, "
+ "Foul_4 = CASE WHEN
CountFoulQuarterA(); Foul_1 != 0 AND Foul_2 != 0 AND
txt3TFA.Text = Foul_3 != 0 AND Foul_4 = 0 THEN 4
sTeamFoulA; ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN
FoulNotifA(); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 != 0 AND Foul_4 != 0 AND
if (sFoulA == Foul_5 = 0 THEN 4 ELSE Foul_5 END "
"5") + "WHERE Last_Name ||
{ ', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerA.Text
btnOutA_Click(sender, e); + "' "
+ "AND Jersey_Number
lblNotif.Visible = false; = '" + sJerseyA + "' AND Team_Name =
lblNotif.Text '" + cmbTeamA.Text + "';";
= "Team A : " + txtPlayerA.Text + " SQLiteConnection
has been set out due of having 5 myConnection = new
fouls."; SQLiteConnection(Conn.ConnString);
SQLiteCommand
lblNotif.Visible = true; myCommand = new
iDT = 4; SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
tmrNotif.Start(); myReader;
}
try
LoadTeamA(); {
}
myConnection.Open();
catch myReader =
(SQLiteException ex) myCommand.ExecuteReader();
{ while
(myReader.Read()) { }
MessageBox.Show(ex.Message, "Error",
265
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
int foul = 0; string myQuery =
"UPDATE tbl_playersgame SET Foul_1 =
foul = CASE WHEN Foul_1 = 0 THEN 5 ELSE
Convert.ToInt32(sFoulA) + 1; Foul_1 END, "
+ "Foul_2 = CASE WHEN
sFoulA = Foul_1 != 0 AND Foul_2 = 0 THEN 5
Convert.ToString(foul); ELSE Foul_2 END, "
+ "Foul_3 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND
CountFoulQuarterA(); Foul_3 = 0 THEN 5 ELSE Foul_3 END, "
txt4TFA.Text = + "Foul_4 = CASE WHEN
sTeamFoulA; Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 != 0 AND Foul_4 = 0 THEN 5
FoulNotifA(); ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN
if (sFoulA == Foul_1 != 0 AND Foul_2 != 0 AND
"5") Foul_3 != 0 AND Foul_4 != 0 AND
{ Foul_5 = 0 THEN 5 ELSE Foul_5 END "
+ "WHERE Last_Name ||
btnOutA_Click(sender, e); ', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerA.Text
lblNotif.Visible = false; + "' "
lblNotif.Text + "AND Jersey_Number
= "Team A : " + txtPlayerA.Text + " = '" + sJerseyA + "' AND Team_Name =
has been set out due of having 5 '" + cmbTeamA.Text + "';";
fouls."; SQLiteConnection
myConnection = new
lblNotif.Visible = true; SQLiteConnection(Conn.ConnString);
iDT = 4; SQLiteCommand
myCommand = new
tmrNotif.Start(); SQLiteCommand(myQuery, myConnection);
} SQLiteDataReader
myReader;
LoadTeamA();
} try
{
catch
(SQLiteException ex) myConnection.Open();
{ myReader =
myCommand.ExecuteReader();
MessageBox.Show(ex.Message, "Error", while
MessageBoxButtons.OK, (myReader.Read()) { }
MessageBoxIcon.Error);
} int foul = 0;
finally foul =
{ Convert.ToInt32(sFoulA) + 1;
myConnection.Close(); sFoulA =
} Convert.ToString(foul);
}
else if CountFoulQuarterA();
(rdbOTime.Checked) txtOTFA.Text =
{ sTeamFoulA;
266
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
FoulNotifA(); }
if (sFoulA == else
"5") {
{ string myQuery =
"UPDATE tbl_playersgame SET Foul_5 =
btnOutA_Click(sender, e); CASE WHEN Foul_5 != 0 THEN 0 ELSE
Foul_5 END, "
lblNotif.Visible = false; + "Foul_4 = CASE WHEN
lblNotif.Text Foul_5 = 0 AND Foul_4 != 0 THEN 0
= "Team A : " + txtPlayerA.Text + " ELSE Foul_4 END, "
has been set out due of having 5 + "Foul_3 = CASE WHEN
fouls."; Foul_5 = 0 AND Foul_4 = 0 AND Foul_3
!= 0 THEN 0 ELSE Foul_3 END, "
lblNotif.Visible = true; + "Foul_2 = CASE WHEN
iDT = 4; Foul_5 = 0 AND Foul_4 = 0 AND Foul_3
= 0 AND Foul_2 != 0 THEN 0 ELSE
tmrNotif.Start(); Foul_2 END, "
} + "Foul_1 = CASE WHEN
Foul_5 = 0 AND Foul_4 = 0 AND Foul_3
LoadTeamA(); = 0 AND Foul_2 = 0 AND Foul_1 != 0
} THEN 0 ELSE Foul_1 END "
+ "WHERE Last_Name ||
catch ', ' || First_Name || ' ' ||
(SQLiteException ex) Middle_Initial = '" + txtPlayerA.Text
{ + "' "
+ "AND Jersey_Number
MessageBox.Show(ex.Message, "Error", = '" + sJerseyA + "' AND Team_Name =
MessageBoxButtons.OK, '" + cmbTeamA.Text + "';";
MessageBoxIcon.Error); SQLiteConnection
} myConnection = new
SQLiteConnection(Conn.ConnString);
finally SQLiteCommand
{ myCommand = new
SQLiteCommand(myQuery, myConnection);
myConnection.Close(); SQLiteDataReader
} myReader;
}
try
PenaltyA(); {
TeamFoulA();
} myConnection.Open();
#endregion myReader =
myCommand.ExecuteReader();
#region -Foul A while
private void (myReader.Read()) { }
btnMFoulA_Click(object sender,
EventArgs e) int foul = 0;
{
if (sFoulA == "0") foul =
{ Convert.ToInt32(sFoulA) - 1;
267
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
}
CountFoulQuarterA();
finally
lblNotif.Text = {
"Team A : " + txtPlayerA.Text + " got
foul deduction."; myConnection.Close();
lblNotif.Visible }
= true; }
iDT = 4;
tmrNotif.Start(); PenaltyA();
TeamFoulA();
if }
(rdb1stP.Checked) #endregion
{
txt1TFA.Text //------------------------//
= sTeamFoulA; Team B Foul
}
#region Count Foul B
else if void CountFoulB()
(rdb2ndP.Checked) {
{ string myQuery = "SELECT
txt2TFA.Text SUM(CASE WHEN Foul_1 != 0 THEN 1 ELSE
= sTeamFoulA; Foul_1 END) + SUM(CASE WHEN Foul_2 !=
} 0 THEN 1 ELSE Foul_2 END) "
+ "+ SUM(CASE WHEN Foul_3
else if != 0 THEN 1 ELSE Foul_3 END)+
(rdb3rdP.Checked) SUM(CASE WHEN Foul_4 != 0 THEN 1 ELSE
{ Foul_4 END) "
txt3TFA.Text + "+ SUM(CASE WHEN Foul_5
= sTeamFoulA; != 0 THEN 1 ELSE Foul_5 END) FROM
} tbl_playersgame "
+ "WHERE Last_Name || ',
else if ' || First_Name || ' ' ||
(rdb4thP.Checked) Middle_Initial = '" + txtPlayerB.Text
{ + "' "
txt4TFA.Text + "AND Jersey_Number = '"
= sTeamFoulA; + sJerseyB + "' AND Team_Name = '" +
} cmbTeamB.Text + "';";
SQLiteConnection
else if myConnection = new
(rdbOTime.Checked) SQLiteConnection(Conn.ConnString);
{ SQLiteCommand myCommand =
txtOTFA.Text new SQLiteCommand(myQuery,
= sTeamFoulA; myConnection);
} SQLiteDataReader
myReader;
LoadTeamA();
} try
{
catch myConnection.Open();
(SQLiteException ex) myReader =
{ myCommand.ExecuteReader();
while
MessageBox.Show(ex.Message, "Error", (myReader.Read())
MessageBoxButtons.OK, {
MessageBoxIcon.Error);
268
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
sFoulB = string myQuery = "SELECT
myReader.GetValue(0).ToString(); SUM(CASE WHEN Foul_1 = " + sQValueB +
} " THEN 1 ELSE 0 END) + SUM(CASE WHEN
} Foul_2 = " + sQValueB + " THEN 1 ELSE
0 END) + "
catch (SQLiteException + "SUM(CASE WHEN Foul_3 =
ex) " + sQValueB + " THEN 1 ELSE 0 END) +
{ SUM(CASE WHEN Foul_4 = " + sQValueB +
" THEN 1 ELSE 0 END) + "
MessageBox.Show(ex.Message, "Error", + "SUM(CASE WHEN Foul_5 =
MessageBoxButtons.OK, " + sQValueB + " THEN 1 ELSE 0 END)
MessageBoxIcon.Error); FROM tbl_playersgame WHERE Team_Name
} = '" + cmbTeamB.Text + "';";
SQLiteConnection
finally myConnection = new
{ SQLiteConnection(Conn.ConnString);
myConnection.Close(); SQLiteCommand myCommand =
} new SQLiteCommand(myQuery,
} myConnection);
#endregion SQLiteDataReader
myReader;
#region Quarter Value B
void QuarterValueB() try
{ {
if (rdb1stP.Checked) myConnection.Open();
{ myReader =
sQValueB = "1"; myCommand.ExecuteReader();
} while
(myReader.Read())
else if (rdb2ndP.Checked) {
{ sTeamFoulB =
sQValueB = "2"; myReader.GetValue(0).ToString();
} }
}
else if (rdb3rdP.Checked)
{ catch (SQLiteException
sQValueB = "3"; ex)
} {
else if finally
(rdbOTime.Checked) {
{ myConnection.Close();
sQValueB = "5"; }
} }
} #endregion
#endregion
#region Penalty B
#region Count Team Foul per void PenaltyB()
Quarter B {
void CountFoulQuarterB() int f = 0, o = 0;
{
269
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if (rdb1stP.Checked && string myQuery =
Int32.TryParse(txt1TFB.Text, out f) "UPDATE tbl_teamsgame SET
&& f >= 5) FirstP_Team_Foul = '" + txt1TFB.Text
{ + "' WHERE Team_Name = '" +
txtPenaltyB.Visible = cmbTeamB.Text + "';";
true; SQLiteConnection
} myConnection = new
SQLiteConnection(Conn.ConnString);
else if (rdb2ndP.Checked SQLiteCommand
&& Int32.TryParse(txt2TFB.Text, out myCommand = new
f) && f >= 5) SQLiteCommand(myQuery, myConnection);
{ SQLiteDataReader
txtPenaltyB.Visible = myReader;
true;
} try
{
else if (rdb3rdP.Checked
&& Int32.TryParse(txt3TFB.Text, out myConnection.Open();
f) && f >= 5) myReader =
{ myCommand.ExecuteReader();
txtPenaltyB.Visible = while
true; (myReader.Read()) { }
} }
else if catch
((rdb4thP.Checked) && (SQLiteException ex)
Int32.TryParse(txt4TFB.Text, out f) {
&& f >= 5)
{ MessageBox.Show(ex.Message, "Error",
txtPenaltyB.Visible = MessageBoxButtons.OK,
true; MessageBoxIcon.Error);
} }
270
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
try
{ MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
myConnection.Open(); MessageBoxIcon.Error);
myReader = }
myCommand.ExecuteReader();
while finally
(myReader.Read()) { } {
}
myConnection.Close();
catch }
(SQLiteException ex) }
{
else if (rdb4thP.Checked)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK, string myQuery =
MessageBoxIcon.Error); "UPDATE tbl_teamsgame SET
} FourthP_Team_Foul = '" + txt4TFB.Text
+ "' WHERE Team_Name = '" +
finally cmbTeamB.Text + "';";
{ SQLiteConnection
myConnection = new
myConnection.Close(); SQLiteConnection(Conn.ConnString);
} SQLiteCommand
} myCommand = new
SQLiteCommand(myQuery, myConnection);
else if (rdb3rdP.Checked) SQLiteDataReader
{ myReader;
string myQuery =
"UPDATE tbl_teamsgame SET try
ThirdP_Team_Foul = '" + txt3TFB.Text {
+ "' WHERE Team_Name = '" +
cmbTeamB.Text + "';"; myConnection.Open();
SQLiteConnection myReader =
myConnection = new myCommand.ExecuteReader();
SQLiteConnection(Conn.ConnString); while
SQLiteCommand (myReader.Read()) { }
myCommand = new }
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader catch
myReader; (SQLiteException ex)
{
try
{ MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK,
myConnection.Open(); MessageBoxIcon.Error);
myReader = }
myCommand.ExecuteReader();
while finally
(myReader.Read()) { } {
}
myConnection.Close();
catch }
(SQLiteException ex) }
{
271
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
else if {
(rdbOTime.Checked) ext = "nd";
{ }
string myQuery =
"UPDATE tbl_teamsgame SET else if (sFoulB == "3")
Overtime_Team_Foul = '" + {
txtOTFB.Text + "' WHERE Team_Name = ext = "rd";
'" + cmbTeamB.Text + "';"; }
SQLiteConnection
myConnection = new else if (sFoulB == "4" ||
SQLiteConnection(Conn.ConnString); sFoulB == "5")
SQLiteCommand {
myCommand = new ext = "th";
SQLiteCommand(myQuery, myConnection); }
SQLiteDataReader
myReader; lblNotif.Text = "Team B :
" + txtPlayerB.Text + " got " +
try sFoulB + ext + " personal foul.";
{ lblNotif.Visible = true;
iDT = 4;
myConnection.Open(); tmrNotif.Start();
myReader = }
myCommand.ExecuteReader();
while private void
(myReader.Read()) { } btnPFoulB_Click(object sender,
} EventArgs e)
{
catch QuarterValueB();
(SQLiteException ex)
{ if (sInB == "Out")
{
MessageBox.Show(ex.Message, "Error", MessageBox.Show("You
MessageBoxButtons.OK, are trying to foul an out playing
MessageBoxIcon.Error); player.", "Foul",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
else if (sFoulB == "5")
myConnection.Close(); {
}
} MessageBox.Show(txtPlayerB.Text + "
} is already fouled out.", "Foul",
#endregion MessageBoxButtons.OK,
MessageBoxIcon.Error);
#region Foul B }
void FoulNotifB()
{ else if (rdb1stP.Checked)
string ext = ""; {
string myQuery =
if (sFoulB == "1") "UPDATE tbl_playersgame SET Foul_1 =
{ CASE WHEN Foul_1 = 0 THEN 1 ELSE
ext = "st"; Foul_1 END, "
} + "Foul_2 = CASE WHEN
Foul_1 != 0 AND Foul_2 = 0 THEN 1
else if (sFoulB == "2") ELSE Foul_2 END, "
272
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "Foul_3 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND lblNotif.Visible = false;
Foul_3 = 0 THEN 1 ELSE Foul_3 END, " lblNotif.Text
+ "Foul_4 = CASE WHEN = "Team B : " + txtPlayerB.Text + "
Foul_1 != 0 AND Foul_2 != 0 AND has been set out due of having 5
Foul_3 != 0 AND Foul_4 = 0 THEN 1 fouls.";
ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN lblNotif.Visible = true;
Foul_1 != 0 AND Foul_2 != 0 AND iDT = 4;
Foul_3 != 0 AND Foul_4 != 0 AND
Foul_5 = 0 THEN 1 ELSE Foul_5 END " tmrNotif.Start();
+ "WHERE Last_Name || }
', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerB.Text LoadTeamB();
+ "' " }
+ "AND Jersey_Number
= '" + sJerseyB + "' AND Team_Name = catch
'" + cmbTeamB.Text + "';"; (SQLiteException ex)
SQLiteConnection {
myConnection = new
SQLiteConnection(Conn.ConnString); MessageBox.Show(ex.Message, "Error",
SQLiteCommand MessageBoxButtons.OK,
myCommand = new MessageBoxIcon.Error);
SQLiteCommand(myQuery, myConnection); }
SQLiteDataReader
myReader; finally
{
try
{ myConnection.Close();
}
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); else if (rdb2ndP.Checked)
while {
(myReader.Read()) { } string myQuery =
"UPDATE tbl_playersgame SET Foul_1 =
int foul = 0; CASE WHEN Foul_1 = 0 THEN 2 ELSE
Foul_1 END, "
foul = + "Foul_2 = CASE WHEN
Convert.ToInt32(sFoulB) + 1; Foul_1 != 0 AND Foul_2 = 0 THEN 2
ELSE Foul_2 END, "
sFoulB = + "Foul_3 = CASE WHEN
Convert.ToString(foul); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 = 0 THEN 2 ELSE Foul_3 END, "
+ "Foul_4 = CASE WHEN
CountFoulQuarterB(); Foul_1 != 0 AND Foul_2 != 0 AND
txt1TFB.Text = Foul_3 != 0 AND Foul_4 = 0 THEN 2
sTeamFoulB; ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN
FoulNotifB(); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 != 0 AND Foul_4 != 0 AND
if (sFoulB == Foul_5 = 0 THEN 2 ELSE Foul_5 END "
"5") + "WHERE Last_Name ||
{ ', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerB.Text
btnOutB_Click(sender, e); + "' "
273
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "AND Jersey_Number
= '" + sJerseyB + "' AND Team_Name = catch
'" + cmbTeamB.Text + "';"; (SQLiteException ex)
SQLiteConnection {
myConnection = new
SQLiteConnection(Conn.ConnString); MessageBox.Show(ex.Message, "Error",
SQLiteCommand MessageBoxButtons.OK,
myCommand = new MessageBoxIcon.Error);
SQLiteCommand(myQuery, myConnection); }
SQLiteDataReader
myReader; finally
{
try
{ myConnection.Close();
}
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); else if (rdb3rdP.Checked)
while {
(myReader.Read()) { } string myQuery =
"UPDATE tbl_playersgame SET Foul_1 =
int foul = 0; CASE WHEN Foul_1 = 0 THEN 3 ELSE
Foul_1 END, "
foul = + "Foul_2 = CASE WHEN
Convert.ToInt32(sFoulB) + 1; Foul_1 != 0 AND Foul_2 = 0 THEN 3
ELSE Foul_2 END, "
sFoulB = + "Foul_3 = CASE WHEN
Convert.ToString(foul); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 = 0 THEN 3 ELSE Foul_3 END, "
+ "Foul_4 = CASE WHEN
CountFoulQuarterB(); Foul_1 != 0 AND Foul_2 != 0 AND
txt2TFB.Text = Foul_3 != 0 AND Foul_4 = 0 THEN 3
sTeamFoulB; ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN
FoulNotifB(); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 != 0 AND Foul_4 != 0 AND
if (sFoulB == Foul_5 = 0 THEN 3 ELSE Foul_5 END "
"5") + "WHERE Last_Name ||
{ ', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerB.Text
btnOutB_Click(sender, e); + "' "
+ "AND Jersey_Number
lblNotif.Visible = false; = '" + sJerseyB + "' AND Team_Name =
lblNotif.Text '" + cmbTeamB.Text + "';";
= "Team B : " + txtPlayerB.Text + " SQLiteConnection
has been set out due of having 5 myConnection = new
fouls."; SQLiteConnection(Conn.ConnString);
SQLiteCommand
lblNotif.Visible = true; myCommand = new
iDT = 4; SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
tmrNotif.Start(); myReader;
}
try
LoadTeamB(); {
}
274
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
}
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); else if (rdb4thP.Checked)
while {
(myReader.Read()) { } string myQuery =
"UPDATE tbl_playersgame SET Foul_1 =
int foul = 0; CASE WHEN Foul_1 = 0 THEN 4 ELSE
Foul_1 END, "
foul = + "Foul_2 = CASE WHEN
Convert.ToInt32(sFoulB) + 1; Foul_1 != 0 AND Foul_2 = 0 THEN 4
ELSE Foul_2 END, "
sFoulB = + "Foul_3 = CASE WHEN
Convert.ToString(foul); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 = 0 THEN 4 ELSE Foul_3 END, "
+ "Foul_4 = CASE WHEN
CountFoulQuarterB(); Foul_1 != 0 AND Foul_2 != 0 AND
txt3TFB.Text = Foul_3 != 0 AND Foul_4 = 0 THEN 4
sTeamFoulB; ELSE Foul_4 END, "
+ "Foul_5 = CASE WHEN
FoulNotifB(); Foul_1 != 0 AND Foul_2 != 0 AND
Foul_3 != 0 AND Foul_4 != 0 AND
if (sFoulB == Foul_5 = 0 THEN 4 ELSE Foul_5 END "
"5") + "WHERE Last_Name ||
{ ', ' || First_Name || ' ' ||
Middle_Initial = '" + txtPlayerB.Text
btnOutB_Click(sender, e); + "' "
+ "AND Jersey_Number
lblNotif.Visible = false; = '" + sJerseyB + "' AND Team_Name =
lblNotif.Text '" + cmbTeamB.Text + "';";
= "Team B : " + txtPlayerB.Text + " SQLiteConnection
has been set out due of having 5 myConnection = new
fouls."; SQLiteConnection(Conn.ConnString);
SQLiteCommand
lblNotif.Visible = true; myCommand = new
iDT = 4; SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
tmrNotif.Start(); myReader;
}
try
LoadTeamB(); {
}
myConnection.Open();
catch myReader =
(SQLiteException ex) myCommand.ExecuteReader();
{ while
(myReader.Read()) { }
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, int foul = 0;
MessageBoxIcon.Error);
} foul =
Convert.ToInt32(sFoulB) + 1;
finally
{ sFoulB =
Convert.ToString(foul);
myConnection.Close();
275
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
+ "Foul_3 = CASE WHEN
CountFoulQuarterB(); Foul_1 != 0 AND Foul_2 != 0 AND
txt4TFB.Text = Foul_3 = 0 THEN 5 ELSE Foul_3 END, "
sTeamFoulB; + "Foul_4 = CASE WHEN
Foul_1 != 0 AND Foul_2 != 0 AND
FoulNotifB(); Foul_3 != 0 AND Foul_4 = 0 THEN 5
ELSE Foul_4 END, "
if (sFoulB == + "Foul_5 = CASE WHEN
"5") Foul_1 != 0 AND Foul_2 != 0 AND
{ Foul_3 != 0 AND Foul_4 != 0 AND
Foul_5 = 0 THEN 5 ELSE Foul_5 END "
btnOutB_Click(sender, e); + "WHERE Last_Name ||
', ' || First_Name || ' ' ||
lblNotif.Visible = false; Middle_Initial = '" + txtPlayerB.Text
lblNotif.Text + "' "
= "Team B : " + txtPlayerB.Text + " + "AND Jersey_Number
has been set out due of having 5 = '" + sJerseyB + "' AND Team_Name =
fouls."; '" + cmbTeamB.Text + "';";
SQLiteConnection
lblNotif.Visible = true; myConnection = new
iDT = 4; SQLiteConnection(Conn.ConnString);
SQLiteCommand
tmrNotif.Start(); myCommand = new
} SQLiteCommand(myQuery, myConnection);
SQLiteDataReader
LoadTeamB(); myReader;
}
try
catch {
(SQLiteException ex)
{ myConnection.Open();
myReader =
MessageBox.Show(ex.Message, "Error", myCommand.ExecuteReader();
MessageBoxButtons.OK, while
MessageBoxIcon.Error); (myReader.Read()) { }
}
int foul = 0;
finally
{ foul =
Convert.ToInt32(sFoulB) + 1;
myConnection.Close();
} sFoulB =
} Convert.ToString(foul);
else if
(rdbOTime.Checked) CountFoulQuarterB();
{ txtOTFB.Text =
string myQuery = sTeamFoulB;
"UPDATE tbl_playersgame SET Foul_1 =
CASE WHEN Foul_1 = 0 THEN 5 ELSE FoulNotifB();
Foul_1 END, "
+ "Foul_2 = CASE WHEN if (sFoulB ==
Foul_1 != 0 AND Foul_2 = 0 THEN 5 "5")
ELSE Foul_2 END, " {
btnOutB_Click(sender, e);
276
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
CASE WHEN Foul_5 != 0 THEN 0 ELSE
lblNotif.Visible = false; Foul_5 END, "
lblNotif.Text + "Foul_4 = CASE WHEN
= "Team B : " + txtPlayerB.Text + " Foul_5 = 0 AND Foul_4 != 0 THEN 0
has been set out due of having 5 ELSE Foul_4 END, "
fouls."; + "Foul_3 = CASE WHEN
Foul_5 = 0 AND Foul_4 = 0 AND Foul_3
lblNotif.Visible = true; != 0 THEN 0 ELSE Foul_3 END, "
iDT = 4; + "Foul_2 = CASE WHEN
Foul_5 = 0 AND Foul_4 = 0 AND Foul_3
tmrNotif.Start(); = 0 AND Foul_2 != 0 THEN 0 ELSE
} Foul_2 END, "
+ "Foul_1 = CASE WHEN
LoadTeamB(); Foul_5 = 0 AND Foul_4 = 0 AND Foul_3
} = 0 AND Foul_2 = 0 AND Foul_1 != 0
THEN 0 ELSE Foul_1 END "
catch + "WHERE Last_Name ||
(SQLiteException ex) ', ' || First_Name || ' ' ||
{ Middle_Initial = '" + txtPlayerB.Text
+ "' "
MessageBox.Show(ex.Message, "Error", + "AND Jersey_Number
MessageBoxButtons.OK, = '" + sJerseyB + "' AND Team_Name =
MessageBoxIcon.Error); '" + cmbTeamB.Text + "';";
} SQLiteConnection
myConnection = new
finally SQLiteConnection(Conn.ConnString);
{ SQLiteCommand
myCommand = new
myConnection.Close(); SQLiteCommand(myQuery, myConnection);
} SQLiteDataReader
} myReader;
PenaltyB(); try
TeamFoulB(); {
}
#endregion myConnection.Open();
myReader =
#region -Foul B myCommand.ExecuteReader();
private void while
btnMFoulB_Click(object sender, (myReader.Read()) { }
EventArgs e)
{ int foul = 0;
if (sFoulB == "0")
{ foul =
Convert.ToInt32(sFoulB) - 1;
MessageBox.Show(txtPlayerB.Text + "
have no foul to deduct.", "Foul", sFoulB =
MessageBoxButtons.OK, Convert.ToString(foul);
MessageBoxIcon.Error);
} QuarterValueB();
else CountFoulQuarterB();
{
string myQuery = lblNotif.Text =
"UPDATE tbl_playersgame SET Foul_5 = "Team B : " + txtPlayerB.Text + " got
foul deduction.";
277
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
lblNotif.Visible }
= true; }
iDT = 4;
tmrNotif.Start(); PenaltyB();
TeamFoulB();
if }
(rdb1stP.Checked) #endregion
{
txt1TFB.Text //------------------------//
= sTeamFoulB; Officials
}
#region Add Officials
else if private void
(rdb2ndP.Checked) btnOAdd_Click(object sender,
{ EventArgs e)
txt2TFB.Text {
= sTeamFoulB; pnlSOfficials.Enabled =
} true;
btnOEdit.Enabled = false;
else if btnOCancel.Enabled =
(rdb3rdP.Checked) true;
{ btnOSave.Enabled = true;
txt3TFB.Text btnOAdd.Enabled = false;
= sTeamFoulB; sTOfficials = "Add";
} }
#endregion
else if
(rdb4thP.Checked) #region Edit Officials
{ private void
txt4TFB.Text btnOEdit_Click(object sender,
= sTeamFoulB; EventArgs e)
} {
pnlSOfficials.Enabled =
else if true;
(rdbOTime.Checked) btnOEdit.Enabled = false;
{ btnOCancel.Enabled =
txtOTFB.Text true;
= sTeamFoulB; btnOSave.Enabled = true;
} btnOAdd.Enabled = false;
sTOfficials = "Edit";
LoadTeamB(); }
} #endregion
278
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
txt24COperator.Clear(); txtAnnouncer.Text =
txtUtility.Clear(); myReader.GetValue(6).ToString();
txtHTechnical.Clear(); txt24COperator.Text =
txtReferee.Clear(); myReader.GetValue(7).ToString();
txtUmpire1.Clear();
txtUmpire2.Clear(); txtUtility.Text =
myReader.GetValue(8).ToString();
pnlSOfficials.Enabled
= false; txtHTechnical.Text =
btnOCancel.Enabled = myReader.GetValue(9).ToString();
false;
btnOSave.Enabled = txtReferee.Text =
false; myReader.GetValue(10).ToString();
btnOAdd.Enabled =
true; txtUmpire1.Text =
sTOfficials = ""; myReader.GetValue(11).ToString();
}
txtUmpire2.Text =
else if (sTOfficials == myReader.GetValue(12).ToString();
"Edit") }
{ }
string myQuery =
"SELECT * FROM tbl_gameofficials"; catch
SQLiteConnection (SQLiteException ex)
myConnection = new {
SQLiteConnection(Conn.ConnString);
SQLiteCommand MessageBox.Show(ex.Message, "Error",
myCommand = new MessageBoxButtons.OK,
SQLiteCommand(myQuery, myConnection); MessageBoxIcon.Error);
SQLiteDataReader }
myReader;
finally
try {
{
myConnection.Close();
myConnection.Open(); }
myReader =
myCommand.ExecuteReader(); pnlSOfficials.Enabled
while = false;
(myReader.Read()) btnOCancel.Enabled =
{ false;
btnOSave.Enabled =
txtCSCoordinator.Text = false;
myReader.GetValue(2).ToString(); btnOEdit.Enabled =
true;
txtBScorer.Text = sTOfficials = "";
myReader.GetValue(3).ToString(); }
}
txtCScorer.Text = #endregion
myReader.GetValue(4).ToString();
txtTimer.Text #region Save Officials
= myReader.GetValue(5).ToString(); private void
btnOSave_Click(object sender,
EventArgs e)
279
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ clock operator.", "Officials",
if (txtCSCoordinator.Text MessageBoxButtons.OK,
== "") MessageBoxIcon.Error);
{ }
MessageBox.Show("Please input 24
280
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
else if (sTOfficials == + "Head_Technical =
"Add" || sTOfficials == "Edit") '" + txtHTechnical.Text + "', Referee
{ = '" + txtReferee.Text + "', "
string myQuery = + "Umpire_1 = '" +
"INSERT INTO txtUmpire1.Text + "', Umpire_2 = '" +
tbl_gameofficials(Game_Number) txtUmpire2.Text + "';";
VALUES('" + txtGGNumber.Text + "');"; SQLiteConnection
SQLiteConnection myConnection1 = new
myConnection = new SQLiteConnection(Conn.ConnString);
SQLiteConnection(Conn.ConnString); SQLiteCommand
SQLiteCommand myCommand1 = new
myCommand = new SQLiteCommand(myQuery1,
SQLiteCommand(myQuery, myConnection); myConnection1);
SQLiteDataReader SQLiteDataReader
myReader; myReader1;
try try
{ {
myConnection.Open(); myConnection1.Open();
myReader = myReader1 =
myCommand.ExecuteReader(); myCommand1.ExecuteReader();
while while
(myReader.Read()) { } (myReader1.Read()) { }
}
if (sTOfficials
catch == "Add")
(SQLiteException ex) {
{
MessageBox.Show("Officials has been
MessageBox.Show(ex.Message, "Error", saved.", "Officials",
MessageBoxButtons.OK, MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBoxIcon.Information);
} pnlG.Visible
= false;
finally
{ tsGame.Enabled = true;
myConnection.Close();
} tsGame.ForeColor =
Color.FromArgb(236, 189, 0);
string myQuery1 =
"UPDATE tbl_gameofficials SET tsOfficials.ForeColor = Color.White;
City_Sports_Coordinator = '" +
txtCSCoordinator.Text + "', " pnlMOfficials.Visible = false;
+ "Board_Scorer = '"
+ txtBScorer.Text + "', pnlMGame.Visible = true;
Computer_Scorer = '" + }
txtCScorer.Text + "', "
+ "Timer = '" + else if
txtTimer.Text + "', Announcer = '" + (sTOfficials == "Edit")
txtAnnouncer.Text + "', " {
+
"Twentyfour_Clock_Operator = '" + MessageBox.Show("Officials has been
txt24COperator.Text + "', Utility = edited.", "Officials",
'" + txtUtility.Text + "', "
281
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
MessageBoxButtons.OK,
MessageBoxIcon.Information); Login w = new
} Login();
this.Hide();
w.Show();
pnlSOfficials.Enabled = false; }
}
btnOCancel.Enabled = false;
btnOSave.Enabled private void
= false; Game_FormClosing(object sender,
btnOEdit.Enabled FormClosingEventArgs e)
= true; {
sTOfficials = ""; if (e.CloseReason ==
} CloseReason.UserClosing)
{
catch dynamic dialog =
(SQLiteException ex) MessageBox.Show("Are you sure you
{ want to exit the program?", "Exit",
MessageBoxButtons.YesNo,
MessageBox.Show(ex.Message, "Error", MessageBoxIcon.Question);
MessageBoxButtons.OK, if (dialog ==
MessageBoxIcon.Error); DialogResult.No)
} {
e.Cancel = true;
finally }
{
else if (dialog ==
myConnection1.Close(); DialogResult.Yes)
} {
} e.Cancel = false;
}
#endregion Application.Exit();
}
//------------------------// }
Logout, Exit and Shortcuts }
#endregion
#region Logout and Exit
private void #region Shortcuts
tsLogout_Click(object sender, private void
EventArgs e) Game_KeyDown(object sender,
{ KeyEventArgs e)
dynamic dialog = {
MessageBox.Show("Are you sure you if (pnlMGame.Visible ==
want to logout?", "Logout", true && btnEGame.Visible == true)
MessageBoxButtons.YesNo, {
MessageBoxIcon.Question); if (!e.Shift &&
if (dialog == !e.Control && !e.Alt)
DialogResult.No) {
{ } #region Lock A
if
else if (dialog == (chkLockA.Enabled == true)
DialogResult.Yes) {
{ if
ClearAllTeams(); (!chkLockA.Checked)
ClearAllPlayers(); {
ClearOfficials();
282
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if {
(e.KeyCode == Keys.Z) if
{ (e.KeyCode == Keys.A)
{
chkLockA.Checked = true;
} btnTOutA_Click(sender, e);
} }
}
else if #endregion
(chkLockA.Checked) }
{
if if
(e.KeyCode == Keys.X) (rdbFSB.Checked)
{ {
#region Time-
chkLockA.Checked = false; out B
} if
} (btnTOutB.Enabled == true)
} {
#endregion if
(e.KeyCode == Keys.K)
#region Lock B {
if
(chkLockB.Enabled == true) btnTOutB_Click(sender, e);
{ }
if }
(!chkLockB.Checked) #endregion
{ }
if
(e.KeyCode == Keys.Oemcomma) if
{ (rdbAPA.Checked)
{
chkLockB.Checked = true; #region In A
} if
} (btnInA.Enabled == true)
{
else if if
(chkLockB.Checked) (e.KeyCode == Keys.E)
{ {
if
(e.KeyCode == Keys.OemPeriod) btnInA_Click(sender, e);
{ }
}
chkLockB.Checked = false; #endregion
}
} #region Out A
} if
#endregion (btnOutA.Enabled == true)
{
if if
(rdbFSA.Checked) (e.KeyCode == Keys.R)
{ {
#region Time-
out A btnOutA_Click(sender, e);
if }
(btnTOutA.Enabled == true) }
283
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
#endregion {
}
rdbFSA.Checked = false;
if
(rdbAPB.Checked) rdbAPA.Checked = true;
{
#region In B
if ScoreFoulAPA();
(btnInB.Enabled == true) }
{ }
if #endregion
(e.KeyCode == Keys.P)
{ #region Score-
Foul-AP B
btnInB_Click(sender, e); if
} (rdbFSB.Enabled == true)
} {
#endregion if (e.KeyCode
== Keys.L)
#region Out B {
if
(btnOutB.Enabled == true) rdbFSB.Checked = true;
{
if rdbAPB.Checked = false;
(e.KeyCode == Keys.OemOpenBrackets)
{
ScoreFoulAPB();
btnOutB_Click(sender, e); }
} }
}
#endregion if
} (rdbAPB.Enabled == true)
{
#region Score- if (e.KeyCode
Foul-AP A == Keys.OemSemicolon)
if {
(rdbFSA.Enabled == true)
{ rdbFSB.Checked = false;
if (e.KeyCode
== Keys.S) rdbAPB.Checked = true;
{
ScoreFoulAPA(); if
} (rdbFSA.Checked)
} {
#region
if Scoring and Foul A
(rdbAPA.Enabled == true) if
{ (pnlTeamSSA.Enabled == true &&
if (e.KeyCode btnP1A.Visible == true)
== Keys.D) {
284
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
if #endregion
(e.KeyCode == Keys.D1) }
{
if
btnP1A_Click(sender, e); (rdbFSB.Checked)
} {
#region
if Scoring and Foul B
(e.KeyCode == Keys.D2) if
{ (pnlTeamSSB.Enabled == true &&
btnP1B.Visible == true)
btnP2A_Click(sender, e); {
} if
(e.KeyCode == Keys.D7)
if {
(e.KeyCode == Keys.D3)
{ btnP1B_Click(sender, e);
}
btnP3A_Click(sender, e);
} if
(e.KeyCode == Keys.D8)
if {
(e.KeyCode == Keys.D4)
{ btnP2B_Click(sender, e);
}
btnM1A_Click(sender, e);
} if
(e.KeyCode == Keys.D9)
if {
(e.KeyCode == Keys.D5)
{ btnP3B_Click(sender, e);
}
btnM2A_Click(sender, e);
} if
(e.KeyCode == Keys.D0)
if {
(e.KeyCode == Keys.D6)
{ btnM1B_Click(sender, e);
}
btnM3A_Click(sender, e);
} if
(e.KeyCode == Keys.OemMinus)
if {
(e.KeyCode == Keys.Q)
{ btnM2B_Click(sender, e);
}
btnPFoulA_Click(sender, e);
} if
(e.KeyCode == Keys.Oemplus)
if {
(e.KeyCode == Keys.W)
{ btnM3B_Click(sender, e);
}
btnMFoulA_Click(sender, e);
} if
} (e.KeyCode == Keys.I)
285
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{
btnEGame_Click(sender, e);
btnPFoulB_Click(sender, e); }
} }
#endregion
if
(e.KeyCode == Keys.O) #region Clear
{ Game
if
btnMFoulB_Click(sender, e); (btnCGame.Enabled == true)
} {
} if (e.KeyCode
#endregion == Keys.F11)
} {
286
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
sTNameA =
cmbTeamA.Text; MessageBox.Show(ex.Message, "Error",
sTNameB = MessageBoxButtons.OK,
cmbTeamB.Text; MessageBoxIcon.Error);
}
End_Game w = new
End_Game(); finally
w.ShowDialog(); {
} myConnection.Close();
} }
#endregion }
#endregion
#region Move to Player Logs
void MovePlayer() #region Move to Team Logs
{ void MoveTeam()
string myQuery = "INSERT {
INTO tbl_playersgamelogs(Game_Date, string myQuery = "INSERT
Game_Number, Team_Name, Division, INTO tbl_teamsgamelogs(Game_Date,
Last_Name, " Game_Number, Team_Name, Division,
+ "First_Name, First_Half_Time_Out, "
Middle_Initial, Jersey_Number, + "Second_Half_Time_Out,
FirstP_Score, SecondP_Score, Extra_Time_Out, FirstP_Team_Foul,
ThirdP_Score, FourthP_Score, " SecondP_Team_Foul, ThirdP_Team_Foul,
+ "Overtime_Score, FourthP_Team_Foul, "
Foul_1, Foul_2, Foul_3, Foul_4, + "Overtime_Team_Foul,
Foul_5) SELECT Game_Date, Opponent, Game_Score, Game_Status,
Game_Number, Team_Name, Division, A_or_B) SELECT Game_Date,
Last_Name, " Game_Number, Team_Name, Division,
+ "First_Name, First_Half_Time_Out, "
Middle_Initial, Jersey_Number, + "Second_Half_Time_Out,
FirstP_Score, SecondP_Score, Extra_Time_Out, FirstP_Team_Foul,
ThirdP_Score, FourthP_Score, " SecondP_Team_Foul, ThirdP_Team_Foul,
+ "Overtime_Score, FourthP_Team_Foul, "
Foul_1, Foul_2, Foul_3, Foul_4, + "Overtime_Team_Foul,
Foul_5 FROM tbl_playersgame;"; Opponent, Game_Score, Game_Status,
SQLiteConnection A_or_B FROM tbl_teamsgame;";
myConnection = new SQLiteConnection
SQLiteConnection(Conn.ConnString); myConnection = new
SQLiteCommand myCommand = SQLiteConnection(Conn.ConnString);
new SQLiteCommand(myQuery, SQLiteCommand myCommand =
myConnection); new SQLiteCommand(myQuery,
SQLiteDataReader myConnection);
myReader; SQLiteDataReader
myReader;
try
{ try
myConnection.Open(); {
myReader = myConnection.Open();
myCommand.ExecuteReader(); myReader =
while myCommand.ExecuteReader();
(myReader.Read()) { } while
} (myReader.Read()) { }
}
catch (SQLiteException
ex) catch (SQLiteException
{ ex)
287
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
{ catch (SQLiteException
ex)
MessageBox.Show(ex.Message, "Error", {
MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
finally }
{
myConnection.Close(); finally
} {
} myConnection.Close();
#endregion }
}
#region Move to Officials #endregion
Logs
void MoveOfficials() #region Win or Lose
{ void WinLose()
string myQuery = "INSERT {
INTO int a, b;
tbl_gameofficialslogs(Game_Number, a =
City_Sports_Coordinator, Convert.ToInt32(txtScoreA.Text);
Board_Scorer, " b =
+ "Computer_Scorer, Convert.ToInt32(txtScoreB.Text);
Timer, Announcer,
Twentyfour_Clock_Operator, Utility, if (a > b)
Head_Technical, Referee, " {
+ "Umpire_1, Umpire_2) #region Team A Win -
SELECT Game_Number, Team B Lose
City_Sports_Coordinator, string myQuery =
Board_Scorer, " "UPDATE tbl_teamsgame SET Game_Status
+ "Computer_Scorer, = 'Win' WHERE Team_Name = '" +
Timer, Announcer, cmbTeamA.Text + "';";
Twentyfour_Clock_Operator, Utility, SQLiteConnection
Head_Technical, Referee, " myConnection = new
+ "Umpire_1, Umpire_2 SQLiteConnection(Conn.ConnString);
FROM tbl_gameofficials;"; SQLiteCommand
SQLiteConnection myCommand = new
myConnection = new SQLiteCommand(myQuery, myConnection);
SQLiteConnection(Conn.ConnString); SQLiteDataReader
SQLiteCommand myCommand = myReader;
new SQLiteCommand(myQuery,
myConnection); try
SQLiteDataReader {
myReader;
myConnection.Open();
try myReader =
{ myCommand.ExecuteReader();
myConnection.Open(); while
myReader = (myReader.Read()) { }
myCommand.ExecuteReader(); }
while
(myReader.Read()) { } catch
} (SQLiteException ex)
{
288
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
#region Team B Win -
MessageBox.Show(ex.Message, "Error", Team A Lose
MessageBoxButtons.OK, string myQuery =
MessageBoxIcon.Error); "UPDATE tbl_teamsgame SET Game_Status
} = 'Win' WHERE Team_Name = '" +
cmbTeamB.Text + "';";
finally SQLiteConnection
{ myConnection = new
SQLiteConnection(Conn.ConnString);
myConnection.Close(); SQLiteCommand
} myCommand = new
SQLiteCommand(myQuery, myConnection);
string myQuery1 = SQLiteDataReader
"UPDATE tbl_teamsgame SET Game_Status myReader;
= 'Lose' WHERE Team_Name = '" +
cmbTeamB.Text + "';"; try
SQLiteConnection {
myConnection1 = new
SQLiteConnection(Conn.ConnString); myConnection.Open();
SQLiteCommand myReader =
myCommand1 = new myCommand.ExecuteReader();
SQLiteCommand(myQuery1, while
myConnection1); (myReader.Read()) { }
SQLiteDataReader }
myReader1;
catch
try (SQLiteException ex)
{ {
289
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
while
myConnection1.Open(); (myReader.Read()) { }
myReader1 = }
myCommand1.ExecuteReader();
while catch
(myReader1.Read()) { } (SQLiteException ex)
} {
myConnection.Open(); finally
myReader = {
myCommand.ExecuteReader();
myConnection1.Close();
290
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} SQLiteCommand(myQuery1,
#endregion myConnection1);
} SQLiteDataReader
myReader1;
else if (End_Game.sDTeam
== cmbTeamB.Text) try
{ {
#region Team A Win -
Team B Default myConnection1.Open();
string myQuery = myReader1 =
"UPDATE tbl_teamsgame SET Game_Status myCommand1.ExecuteReader();
= 'Win' WHERE Team_Name = '" + while
cmbTeamA.Text + "';"; (myReader1.Read()) { }
SQLiteConnection }
myConnection = new
SQLiteConnection(Conn.ConnString); catch
SQLiteCommand (SQLiteException ex)
myCommand = new {
SQLiteCommand(myQuery, myConnection);
SQLiteDataReader MessageBox.Show(ex.Message, "Error",
myReader; MessageBoxButtons.OK,
MessageBoxIcon.Error);
try }
{
finally
myConnection.Open(); {
myReader =
myCommand.ExecuteReader(); myConnection1.Close();
while }
(myReader.Read()) { } #endregion
} }
catch }
(SQLiteException ex) #endregion
{
#region Sure Deafult or Game
MessageBox.Show(ex.Message, "Error", Finished
MessageBoxButtons.OK, void SureDG()
MessageBoxIcon.Error); {
} if (sEGame == "sdef")
{
finally if (End_Game.sDTeam
{ == "-Select-")
{
myConnection.Close(); End_Game.sDTeam =
} "";
sEGame = "def";
string myQuery1 =
"UPDATE tbl_teamsgame SET Game_Status MessageBox.Show("Please select
= 'Default' WHERE Team_Name = '" + default team.", "End Game",
cmbTeamB.Text + "';"; MessageBoxButtons.OK,
SQLiteConnection MessageBoxIcon.Error);
myConnection1 = new End_Game w = new
SQLiteConnection(Conn.ConnString); End_Game();
SQLiteCommand w.ShowDialog();
myCommand1 = new }
291
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
DisableAll();
else if
(End_Game.sDTeam != "" && sEGame != GameReport();
"") pnlMGame.Visible
{ = false;
sEGame = "";
pnlMGReport.Visible = true;
dynamic dialog = }
MessageBox.Show("Are you sure you
want to default the game?", "End End_Game.sDTeam = "";
Game", MessageBoxButtons.YesNo, }
MessageBoxIcon.Question); }
if (dialog == #endregion
DialogResult.No) { }
#region Disable All
else if (dialog void DisableAll()
== DialogResult.Yes) {
{ pnlDDTG.Enabled = false;
WinDefault(); pnlTeamSSA.Enabled =
MoveTeam(); false;
MovePlayer(); pnlTeamSSB.Enabled =
false;
MoveOfficials(); pnlFSA.Enabled = false;
DisableAll(); pnlFSB.Enabled = false;
rdb1stP.Enabled = false;
GameReport(); rdb2ndP.Enabled = false;
rdb3rdP.Enabled = false;
pnlMGame.Visible = false; rdb4thP.Enabled = false;
rdbOTime.Enabled = false;
pnlMGReport.Visible = true;
} lblTeamA.Enabled = false;
lblTeamB.Enabled = false;
End_Game.sDTeam = cmbTeamA.Enabled = false;
""; cmbTeamB.Enabled = false;
} chkLockA.Enabled = false;
} chkLockB.Enabled = false;
lblCPlayersA.Enabled =
else if (sEGame == "sgf") false;
{ lblCPlayersB.Enabled =
sEGame = ""; false;
txtCPlayersA.Enabled =
dynamic dialog = false;
MessageBox.Show("Are you sure you txtCPlayersB.Enabled =
want to finish the game?", "End false;
Game", MessageBoxButtons.YesNo, txtCPlayersA.Text = "0";
MessageBoxIcon.Question); txtCPlayersB.Text = "0";
if (dialog == txtPenaltyA.Visible =
DialogResult.No) { } false;
txtPenaltyB.Visible =
else if (dialog == false;
DialogResult.Yes)
{ btnEGame.Visible = false;
WinLose(); btnCGame.Visible = true;
MoveTeam();
MovePlayer(); pnlDGR.Visible = false;
MoveOfficials();
292
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
tsGReport.Enabled = true; lblTeamB.Enabled = true;
tsGame.ForeColor = lblCPlayersA.Enabled =
Color.White; true;
tsOfficials.ForeColor = lblCPlayersB.Enabled =
Color.White; true;
tsGReport.ForeColor = txtCPlayersA.Enabled =
Color.FromArgb(236, 189, 0); true;
txtCPlayersB.Enabled =
btnOEdit.Enabled = false; true;
sLock = ""; pnlDDTG.Enabled = true;
pnlTeamA.Enabled = false;
string myQuery = "UPDATE pnlTeamB.Enabled = false;
tbl_playersgame SET In_or_Out =
'Out';"; if
SQLiteConnection (!cmbDivision.Items.Contains("-
myConnection = new Select-"))
SQLiteConnection(Conn.ConnString); {
SQLiteCommand myCommand =
new SQLiteCommand(myQuery, cmbDivision.Items.Insert(0, "-Select-
myConnection); ");
SQLiteDataReader }
myReader;
cmbDivision.Text = "-
try Select-";
{ tmrDTime.Start();
myConnection.Open();
myReader = if
myCommand.ExecuteReader(); (!cmbTeamA.Items.Contains("-Select-
while "))
(myReader.Read()) { } {
}
cmbTeamA.Items.Insert(0, "-Select-");
catch (SQLiteException }
ex)
{ cmbTeamA.Text = "-Select-
";
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, if
MessageBoxIcon.Error); (!cmbTeamB.Items.Contains("-Select-
} "))
{
finally
{ cmbTeamB.Items.Insert(0, "-Select-");
myConnection.Close(); }
}
} cmbTeamB.Text = "-Select-
#endregion ";
293
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
txtETOA.Text = "0"; pnlMOfficials.Visible =
txtETOB.Text = "0"; true;
txt1TFA.Text = "0"; pnlMGame.Visible = false;
txt1TFB.Text = "0";
txt2TFA.Text = "0"; ClearGVar();
txt2TFB.Text = "0"; }
txt3TFA.Text = "0"; #endregion
txt3TFB.Text = "0";
txt4TFA.Text = "0"; #region Clear Global
txt4TFB.Text = "0"; Variables
txtOTFA.Text = "0"; void ClearGVar()
txtOTFB.Text = "0"; {
sDateTime = ""; sTeamA =
rdbFSA.Checked = true; ""; sTeamB = ""; sJerseyA = "";
rdbFSB.Checked = true; sJerseyB = ""; sInA = ""; sInB = "";
sTOfficials = "";
rdb1stP.Checked = true; sTQuarter = ""; sOLogin = ""; sSNotif
rdb2ndP.Checked = false; = ""; sEGame = ""; sTNameA = "";
rdb3rdP.Checked = false; sTNameB = ""; sLock = "";
rdb4thP.Checked = false; sFoulA = ""; sQValueA = "";
rdbOTime.Checked = false; sTeamFoulA = ""; sFoulB = "";
sQValueB = ""; sTeamFoulB
btnCGame.Visible = false; = "";
btnEGame.Visible = true;
iTimeoutA = 0; iTimeoutB
pnlDGR.Visible = true; = 0; iTO = 0; iDT = 4;
tsGReport.Enabled = }
false; #endregion
ClearAllPlayers(); //------------------------//
ClearAllTeams(); Game Report
ClearOfficials();
#region Game Report
GameNumber(); void GameReport()
{
txtCSCoordinator.Clear(); string wteam = "", ldteam
txtBScorer.Clear(); = "", wstatus = "", ldstatus = "";
txtCScorer.Clear();
txtTimer.Clear(); string myQuery = "SELECT
txtAnnouncer.Clear(); Team_Name, Game_Status FROM
txt24COperator.Clear(); tbl_teamsgamelogs WHERE Game_Status =
txtUtility.Clear(); 'Win' AND Game_Number = '" +
txtHTechnical.Clear(); txtGGNumber.Text + "';";
txtReferee.Clear(); SQLiteConnection
txtUmpire1.Clear(); myConnection = new
txtUmpire2.Clear(); SQLiteConnection(Conn.ConnString);
SQLiteCommand myCommand =
btnOAdd.Enabled = true; new SQLiteCommand(myQuery,
myConnection);
pnlG.Visible = true; SQLiteDataReader
tsGame.Enabled = false; myReader;
tsGame.ForeColor = try
Color.White; {
tsOfficials.ForeColor = myConnection.Open();
Color.FromArgb(236, 189, 0);
294
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
myReader = catch (SQLiteException
myCommand.ExecuteReader(); ex)
while {
(myReader.Read())
{ MessageBox.Show(ex.Message, "Error",
wteam = MessageBoxButtons.OK,
myReader.GetValue(0).ToString(); MessageBoxIcon.Error);
wstatus = }
myReader.GetValue(1).ToString();
} finally
} {
finally string mr =
{ "{Officials.Game Number} = '" +
myConnection.Close(); txtGGNumber.Text + "';";
}
string tar =
string myQuery1 = "SELECT "{TeamGameA.Team Name} = '" +
Team_Name, Game_Status FROM cmbTeamA.Text + "' AND {TeamA.Game
tbl_teamsgamelogs WHERE Game_Status Number} = '" + txtGGNumber.Text +
!= 'Win' AND Game_Number = '" + "';";
txtGGNumber.Text + "';"; string tbr =
SQLiteConnection "{TeamGameB.Team Name} = '" +
myConnection1 = new cmbTeamB.Text + "' AND {TeamB.Game
SQLiteConnection(Conn.ConnString); Number} = '" + txtGGNumber.Text +
SQLiteCommand myCommand1 "';";
= new SQLiteCommand(myQuery1,
myConnection1);
SQLiteDataReader crGViewer.SelectionFormula = mr;
myReader1;
game.Subreports[0].RecordSelectionFor
try mula = tar;
{
myConnection1.Open(); game.Subreports[1].RecordSelectionFor
myReader1 = mula = tbr;
myCommand1.ExecuteReader();
while TextObject win =
(myReader1.Read()) (TextObject)game.ReportDefinition.Sec
{ tions["ReportHeaderSection2"].ReportO
ldteam = bjects["txtTWin"];
myReader1.GetValue(0).ToString(); win.Text = wteam;
ldstatus = TextObject ws =
myReader1.GetValue(1).ToString(); (TextObject)game.ReportDefinition.Sec
} tions["ReportHeaderSection2"].ReportO
} bjects["txtGSWin"];
ws.Text = wstatus;
295
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
TextObject ld = cmbUType.Items.Remove("-
(TextObject)game.ReportDefinition.Sec Select-");
tions["ReportHeaderSection2"].ReportO }
bjects["txtTLD"];
ld.Text = ldteam; private void
TextObject lds = cmbUType_DropDownClosed(object
(TextObject)game.ReportDefinition.Sec sender, EventArgs e)
tions["ReportHeaderSection2"].ReportO {
bjects["txtGSLD"]; if (cmbUType.SelectedItem
lds.Text = ldstatus; == null)
{
Game_Report r = new if
Game_Report(); (!cmbUType.Items.Contains("-Select-
r.Refresh(); "))
crGViewer.ReportSource = {
game;
crGViewer.Refresh(); cmbUType.Items.Add("-Select-");
} }
#endregion
cmbUType.Text = "-
} Select-";
} }
}
#endregion
#region Login
Login.cs private void
btnLogin_Click(object sender,
using System; EventArgs e)
using System.Collections.Generic; {
using System.ComponentModel; if (cmbUType.Text == "-
using System.Data; Select-")
using System.Drawing; {
using System.Linq;
using System.Text; MessageBox.Show("Please select user
using System.Windows.Forms; type.", "Login Failed",
using System.Data.SQLite; MessageBoxButtons.OK,
MessageBoxIcon.Error);
namespace }
Lucena_Sports_Office_BSSE_System
{ else if (cmbUType.Text ==
public partial class Login : Form "Administrator")
{ {
public Login() string myQuery =
{ "SELECT * FROM tbl_users WHERE
InitializeComponent(); User_Type = '" + cmbUType.Text + "'
AND Username = '" + txtUsername.Text
cmbUType.SelectedIndex = + "' AND Password = '" +
0; txtPassword.Text + "';";
} SQLiteConnection
myConnection = new
#region User Type Default - SQLiteConnection(Conn.ConnString);
Select- SQLiteCommand
private void myCommand = new
cmbUType_DropDown(object sender, SQLiteCommand(myQuery, myConnection);
EventArgs e)
{
296
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
SQLiteDataReader AND Username = '" + txtUsername.Text
myReader; + "' AND Password = '" +
txtPassword.Text + "';";
try SQLiteConnection
{ myConnection = new
SQLiteConnection(Conn.ConnString);
myConnection.Open(); SQLiteCommand
myReader = myCommand = new
myCommand.ExecuteReader(); SQLiteCommand(myQuery, myConnection);
int count = 0; SQLiteDataReader
while myReader;
(myReader.Read())
{ try
count = count {
+ 1;
} myConnection.Open();
myReader =
if (count == 1) myCommand.ExecuteReader();
{ int count = 0;
Administrator while
w = new Administrator(); (myReader.Read())
this.Hide(); {
w.Show(); count = count
} + 1;
}
else
{ if (count == 1)
{
MessageBox.Show("Administrator : Game w = new
Username or password incorrect.", Game();
"Login Failed", MessageBoxButtons.OK, this.Hide();
MessageBoxIcon.Error); w.Show();
} }
}
else
catch (Exception ex) {
{
MessageBox.Show("Staff : Username or
MessageBox.Show(ex.Message, "Error", password incorrect.", "Login Failed",
MessageBoxButtons.OK, MessageBoxButtons.OK,
MessageBoxIcon.Error); MessageBoxIcon.Error);
} }
}
finally
{ catch (Exception ex)
{
myConnection.Close();
} MessageBox.Show(ex.Message, "Error",
} MessageBoxButtons.OK,
MessageBoxIcon.Error);
else if (cmbUType.Text == }
"Staff")
{ finally
string myQuery = {
"SELECT * FROM tbl_users WHERE
User_Type = '" + cmbUType.Text + "' myConnection.Close();
297
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} }
} #endregion
}
#endregion }
}
#region Cancel
private void
btnCancel_Click(object sender,
EventArgs e)
{
Officials_Login.cs
dynamic dialog =
MessageBox.Show("Are you sure you using System;
want to cancel to exit the program?", using System.Collections.Generic;
"Login Cancel", using System.ComponentModel;
MessageBoxButtons.YesNo, using System.Data;
MessageBoxIcon.Question); using System.Drawing;
if (dialog == using System.Linq;
DialogResult.No) using System.Text;
{ } using System.Windows.Forms;
using System.Data.SQLite;
else if (dialog ==
DialogResult.Yes) namespace
{ Lucena_Sports_Office_BSSE_System
Application.Exit(); {
} public partial class Login : Form
} {
#endregion public Login()
{
#region Exit InitializeComponent();
private void
BSSE_Login_FormClosing(object sender, cmbUType.SelectedIndex =
FormClosingEventArgs e) 0;
{ }
if (e.CloseReason ==
CloseReason.UserClosing) #region User Type Default -
{ Select-
dynamic dialog = private void
MessageBox.Show("Are you sure you cmbUType_DropDown(object sender,
want to exit the program?", "Exit", EventArgs e)
MessageBoxButtons.YesNo, {
MessageBoxIcon.Question, cmbUType.Items.Remove("-
MessageBoxDefaultButton.Button2); Select-");
if (dialog == }
DialogResult.No)
{ private void
e.Cancel = true; cmbUType_DropDownClosed(object
} sender, EventArgs e)
{
else if (dialog == if (cmbUType.SelectedItem
DialogResult.Yes) == null)
{ {
e.Cancel = false; if
(!cmbUType.Items.Contains("-Select-
Application.Exit(); "))
} {
}
cmbUType.Items.Add("-Select-");
298
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
} {
Administrator
cmbUType.Text = "- w = new Administrator();
Select-"; this.Hide();
} w.Show();
} }
#endregion
else
#region Login {
private void
btnLogin_Click(object sender, MessageBox.Show("Administrator :
EventArgs e) Username or password incorrect.",
{ "Login Failed", MessageBoxButtons.OK,
if (cmbUType.Text == "- MessageBoxIcon.Error);
Select-") }
{ }
299
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
int count = 0; { }
while
(myReader.Read()) else if (dialog ==
{ DialogResult.Yes)
count = count {
+ 1; Application.Exit();
} }
}
if (count == 1) #endregion
{
Game w = new #region Exit
Game(); private void
this.Hide(); BSSE_Login_FormClosing(object sender,
w.Show(); FormClosingEventArgs e)
} {
if (e.CloseReason ==
else CloseReason.UserClosing)
{ {
dynamic dialog =
MessageBox.Show("Staff : Username or MessageBox.Show("Are you sure you
password incorrect.", "Login Failed", want to exit the program?", "Exit",
MessageBoxButtons.OK, MessageBoxButtons.YesNo,
MessageBoxIcon.Error); MessageBoxIcon.Question,
} MessageBoxDefaultButton.Button2);
} if (dialog ==
DialogResult.No)
catch (Exception ex) {
{ e.Cancel = true;
}
MessageBox.Show(ex.Message, "Error",
MessageBoxButtons.OK, else if (dialog ==
MessageBoxIcon.Error); DialogResult.Yes)
} {
e.Cancel = false;
finally
{ Application.Exit();
}
myConnection.Close(); }
} }
} #endregion
}
#endregion }
}
#region Cancel
private void
btnCancel_Click(object sender,
EventArgs e)
{
Program.cs
dynamic dialog =
MessageBox.Show("Are you sure you using System;
want to cancel to exit the program?", using System.Collections.Generic;
"Login Cancel", using System.Linq;
MessageBoxButtons.YesNo, using System.Windows.Forms;
MessageBoxIcon.Question);
if (dialog == namespace
DialogResult.No) Lucena_Sports_Office_BSSE_System
{
300
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
static class Program
{ Application.SetCompatibleTextRenderin
/// <summary> gDefault(false);
/// The main entry point for Application.Run(new
the application. Login());
/// </summary> }
[STAThread] }
static void Main() }
{
Application.EnableVisualStyles();
301
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
QUESTIONNAIRE
302
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
“COMPUTER-BASED BASKETBALL SCORING AND STATISTICAL EVALUATION
Name: Position:
Dear Respondents,
We are BSIT students from Dalubhasaan ng Lungsod ng Lucena (formerly City College of
Lucena) and currently conducting our research project entitled “Computer-based Basketball Scoring
and Statistical Evaluation System for Lucena City Sports Office”. In connection with this, we kindly
ask a little of time of the staffs, officials, and players of Lucena City Sports Office to test, evaluate and
get feedbacks regarding your personal point of view for our system for further development and analysis?
Instruction: Please provide your honest opinion by putting a check mark (√) to indicate the level of your
agreement and disagreement for the following, (1) being the lowest or Strong Disagree and (4) being the
303
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
304
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
LETTER
305
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
306
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
GANTT
CHART OF
ACTIVITIES
307
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
308
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
CURRICULUM
VITAE
309
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
310
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
311
DALUBHASAAN NG LUNGSOD NG LUCENA
BACHELOR OF SCIENCE IN INFORMATION TECHNOLOGY
312
DALUBHASAAN NG LUNGSOD NG LUCENA