You are on page 1of 128

UNIVERSITY OF GONDAR

FACULTY OF NATURAL AND COMPUTATIONAL


SCIENCE
DEPARTMENT OF COMPUTER SCIENCE

STUDENT SERVICE MANAGEMENT SYSTEM FOR


UOG ATSE TEWODROS CAMPUS
INDUSTRIAL PROJECT
Prepared by:
Name ID.№
1. Mebrahtu Teshale 1459/03
2. Mulutsega Kiros 0674/03
3. Sara Sime 1669/03
4. Siraj Yenus 0687/03
5. Tsgereda Ashagre 3013/02

1
Acronym, Abbreviation and Definition

Certificate

This is tocertify that this BSc industrial projectreport entitled Student Service Management
System For Atse Tewodros Campus Of UoG by:

1. Mebratu Teshale
2. Sara Smie
3. Siraj Yenus
4. Tsgereda Ashagrie
5. Mulutsega Kiros

is approved by me for submission. I certify further that, to the best of my knowledge, the
report represents work carried out by the students.

___________________________ ____________________________________
Date Name and Signature of Supervisor

Department of Computer Science Page 2


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Declaration
Thisis to declare that the project work which isdone under the supervision ofMr. Abreham
Workuand having the title Student Service Management System For Atse Tewodros Campus
Of UoG is the sole contribution of:

Mebrahtu Teshale

Sara Smie

Siraj Yenus

Mulutsega Kiros

Tsgereda Ashagrie

No part of the project work has been reproduced illegally (copy and paste) which can be
considered as Plagiarism. All referenced parts have been used to argue the idea and cited
properly. We will be responsible and liable for any consequence if violation of this
declaration occurs.

Date: 05.01.2014

Group members:

Full Name: Signature

Mebratu Teshale _____________________________

Sara Smie _____________________________

Siraj Yenus _____________________________

Tsgereda Ashagrie _____________________________

Mulutsega Kiros _____________________________

Department of Computer Science Page 3


Acronym, Abbreviation and Definition

Acknowledgment

First and foremost, thanks to our advisor of this project, Mr. Abreham Worku for the
valuable guidance and advice. He inspired us greatly to work in this project. His willingness
to motivate us contributed tremendously to our project. We also would like to thank him for
showing us some example that related to the topic of our project. Besides, we would like to
thank the head of Computer Science department Mr. Adane Leta for providing us with a
good environment and facilities to complete this project. Also, we would like to take this
opportunity to thank to the Student Business Affairs Office of UoG Atse Tewodros Campus
for they providingthe needed information. They gave us the opportunity to learn how the
Student Service Management is performed.

Department of Computer Science Page 4


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Abstract

The main objectives of this project is to develop a desktop application for student service
management in UoG Atse Tewodros Campus. This desktop application helps the institution
and user to exchange and store information in easy way. In addition to that it also has best
contribution in minimizing the load and the number of employee in the University.

This document can be used as a reference for any person who is interested to upgrade the
desktop application that develop now and those that will develop an advanced desktop
application for the university.

Department of Computer Science Page 5


Acronym, Abbreviation and Definition

Table of Contents
Certificate..............................................................................................................................................i
Declaration............................................................................................................................................ii
Acknowledgment.................................................................................................................................iii
Abstract................................................................................................................................................iv
Table of Contents..................................................................................................................................v
List of Figures....................................................................................................................................viii
Acronym, Abbreviation and Definition................................................................................................ix
Acronyms and Abbreviations.................................................................................................................ix
Definitions..............................................................................................................................................ix
CHAPTER ONE...................................................................................................................................1
1. INTRODUCTION.........................................................................................................................1
1.1 Background........................................................................................................................................1
1.2 Statement of the Problem...................................................................................................................1
1.3 Project Objective...............................................................................................................................2
1.3.1General Objective........................................................................................................................2
1.3.2Specific Objective.......................................................................................................................2
1.4 Scope of the Project...........................................................................................................................2
1.5 System Development Methodology...................................................................................................2
1.5.1Investigation (Fact Finding) Methods..........................................................................................2
1.5.2System Development Tool..........................................................................................................2
1.6 Significant Of the Project...................................................................................................................3
1.7 Beneficiaries......................................................................................................................................3
1.8 Time Schedule...................................................................................................................................4
CHAPTER TWO..................................................................................................................................5
2. REQUIREMENT ANALYSIS......................................................................................................5
2.1 Introduction.......................................................................................................................................5
2.2 Detailed Study of the Current System................................................................................................5
2.2.1Current System Description.........................................................................................................5
2.2.2Problems of the existing system..................................................................................................6
2.3 Requirement Gathering......................................................................................................................6

Department of Computer Science Page 6


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

2.3.1Requirement Gathering Methodology.........................................................................................6


2.3.2Results Found..............................................................................................................................6
2.4 Proposed System................................................................................................................................7
2.4.1Overview the New System..........................................................................................................7
2.4.2Functional Requirement..............................................................................................................7
2.4.3Non-Functional Requirement......................................................................................................7
2.5 System Model....................................................................................................................................9
2.5.1Scenario.......................................................................................................................................9
2.5.2Use Case Model.........................................................................................................................11
2.5.3Activity Diagram.......................................................................................................................23
2.5.4Object Model.............................................................................................................................31
2.5.5User Interface............................................................................................................................43
CHAPTER THREE.............................................................................................................................48
3. SYSTEM DESIGN.....................................................................................................................48
3.1 Introduction.....................................................................................................................................48
3.2 Current SW Architecture.................................................................................................................48
3.3 Proposed SW Architecture...............................................................................................................48
3.3.1Overview...................................................................................................................................48
3.3.2Subsystem Decomposition........................................................................................................49
3.3.3Hardware/Software Mapping.....................................................................................................50
3.3.4Persistent data Management......................................................................................................51
3.3.5Access control and Security......................................................................................................52
3.3.6Subsystem Service.....................................................................................................................53
3.4 Detailed class diagram.....................................................................................................................54
3.4.1Class diagram............................................................................................................................54
3.4.2Algorithm Design......................................................................................................................55
3.5 Package Diagram.......................................................................................................................58
CHAPTER FOUR...............................................................................................................................59
4. Implementation...........................................................................................................................59
CHAPTER FIVE...............................................................................................................................110
5. Recommendation conclusion.....................................................................................................110
REFERENCE....................................................................................................................................111

Department of Computer Science Page 7


Acronym, Abbreviation and Definition

List of Tables

Table 2-1 Login Use Case Description................................................................................................15


Table 2-2 The Create New Student Use Case Description..................................................................16
Table 2-3 The Update Student Information Use Case Description......................................................17
Table 2-4 The Delete Student Use Case Description...........................................................................17
Table 2-5 The Register Non-Cafe Student Use Case Description.......................................................18
Table 2-6 The Create User Account Use Case Description.................................................................18
Table 2-7 The Delete User Account Use Case Description.................................................................19
Table 2-8 The Backup Use Case Description......................................................................................19
Table 2-9 Treatment Record Use Case Description............................................................................20
Table 2-10 The Generate Voucher use case description......................................................................20
Table 2-11 The Assign Dorm Use Case Description...........................................................................21
Table 2-12 The Give Serving Materials Use Case Description...........................................................21
Table 2-13 The Generate Voucher use case description for the Cafe Manager Actor.........................22
Table 2-14 The Make Payment Use Case Description........................................................................22
Table 2-15 The Generate Voucher Use Case Description For The Accountant Actor.........................23
Table 3-1 Access Privilege for each Actor..........................................................................................52
Table 3-2 Student Class......................................................................................................................55
Table 3-3 Employee Class...................................................................................................................55
Table 3-4 Non Cafe Student Class......................................................................................................56
Table 3-5 Dorm Class.........................................................................................................................56
Table 3-6 Payment Class.....................................................................................................................56
Table 3-7 Serving Material Class........................................................................................................57
Table 3-8 User Account Class.............................................................................................................57

Department of Computer Science Page 8


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

List of Figures
Figure 1-1 Time Schedule.....................................................................................................................4
Figure 2-1 Use case Diagram..............................................................................................................15
Figure 2-2 Login and Back Up Activity Diagram...............................................................................24
Figure 2-3 Add Student and Delete Student Activity Diagram...........................................................26
Figure 2-4 Update Student and Register Non-Cafe Student Activity Diagram....................................26
Figure 2-5 Create User Account and Delete User Account Activity Diagram.....................................27
Figure 2-6 Print Voucher and Search Student Activity Diagram.........................................................28
Figure 2-7 Assign Dorm and Make Treatment Record Activity Diagram...........................................29
Figure 2-8 Register Serving Material and Make Payment Activity Diagram......................................31
Figure 2-9 Class Diagram...................................................................................................................33
Figure 2-10 Login Sequence Diagram.................................................................................................34
Figure 2-11 Add New Student Sequence Diagram..............................................................................35
Figure 2-12 Delete Student Information Sequence Diagram...............................................................36
Figure 2-13 Register Non-Cafe Student Sequence Diagram...............................................................37
Figure 2-14 Assign Dorm Sequence Diagram....................................................................................38
Figure 2-15 Make Payment Sequence Diagram..................................................................................39
Figure 2-16 Register Serving Material................................................................................................40
Figure 2-17 State Chart Diagram for Cafe/Non Cafe Student, Serving Material and Dorm...............41
Figure 2-18 State Chart Diagram for User Account and Student........................................................43
Figure 2-19 Login User Interface........................................................................................................43
Figure 2-20 Main MDI Form..............................................................................................................44
Figure 2-21 Student Administrator User Interface..............................................................................44
Figure 2-22 The Medical Registration Book.......................................................................................45
Figure 2-23 The Dormitory Management User Interface....................................................................46
Figure 2-24 Help form........................................................................................................................47
Figure 3-1 Component Diagram..........................................................................................................49
Figure 3-2 Deployment Diagram........................................................................................................50
Figure 3-3 Object Diagram.................................................................................................................51
Figure 3-4 Detailed Class Diagram.....................................................................................................54
Figure 3-5 Package Diagram...............................................................................................................58
Figure 4-1 Login form.......................................................................................................................105
Figure 4-2 MDI container.................................................................................................................106
Figure 4-3 System Administrator form.............................................................................................106
Figure 4-4 Student administrator form..............................................................................................107
Figure 4-5 Student cost payment form..............................................................................................108
Figure 4-6 student clinical form........................................................................................................109

Department of Computer Science Page 9


Acronym, Abbreviation and Definition

Acronym, Abbreviation and Definition


Acronyms and Abbreviations

CPU: Central Processing Unit

FK: Foreign Key

Fname: First Name

Freq: Functional Requirement

LName: Last Name

PK: Primary key

RAM: Random Access Memory

SQL: Sequential Query Language

SSN: Social Security Number

StudID:Student Identification card

SW: Software

UI: User interface

UML: User interface Modeling Language

UoG: University of Gondar

Definitions

Access Control matrix: Model is system resource protection that depict who use the system
with what protection.

Class Diagram: a type of static structure diagram that describe the structure of a system by
showing system classes, their attribute, operation and the relationship among the class.

Department of Computer Science Page 10


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Component Diagram: is UML diagram depicts how components are wired together to form
larger components and or software system.

Deployment Diagram: is a UML diagram that models the physical deployment of artifact of
nodes.

Entity Relationship diagram: shows the relationship and Cardinality between entities.

Functional requirement: a requirement that specifies a function a component or system


must perform.

Hardware: is computer equipment including all the components use to make the computer.

Information: the meaning of data as it is intended to be interpreted by people.

Non-functional requirement: are requirements which specify criteria that can be used to
judge the operation of a system, rather than specific behaviors.

Package Diagram: UML diagram that depicts the dependency between the packages that
make up a model.

Process: is a sequence of instructions to perform some task.

Scenario: is an instance of use case explaining concerned major set of actions.

Sequence Diagram: is a king of interaction diagram that show how process operate with one
another and in what order.

Software: computer programs, instructions that make hardware work.

System: any collection of component element that work together to collect task.

Use Case Diagram: Graphical Representation of mark full of step wise activity and action
with support for choice, iteration and concurrency.

User interface: the combination of menus, screen design, keyboard command, command
language and help, which creates the way a user interact with computers.

User: any user of the system including Student administrator, Accountant, Dorm Manager,
Café manager, system Administrator.

Department of Computer Science Page 11


Acronym, Abbreviation and Definition

Department of Computer Science Page 12


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

CHAPTER ONE

1. INTRODUCTION

1.1 Background
Educational institutions are the most important centers for specific country for that they educate
society for the development of a country regarding technology science and so many aspects. The
University of Gondar is one of the oldest educational centers in Ethiopia. It is established in 1954
as a public health collage and training center. The university now have four functioning campus.
AtseTewodros is one of them and is the main campus. Like the other campus it serves around
5000 students and contains four academic units also it gives different service for the student. The
main facility are dormitories, student cafe and health clinic. This sector records all the personal
information of each student and let students to use the facility in the center by assigning and
offering identification card for general purpose also meal card for cafe service. All this process is
wide and significant but all the above student service are managed and performed manually. So
this system result many problem when assigning dorm,recording student/patient in the clinic and
cafe service.as a result this situations motivated us to focus on this area.

1.2 Statement of the Problem

At the current time the general system follow a file based management system as a result there
are countless drawback. For instance the task performed or the service that the system offers is
time taking. Due to the fact that employee cannot be perfect; the tasks will not be accurate. The
roles of the sector are scattered in such a way that they need storage management system as a
result there will be lose and redundancy of data. Countless burdens are on the employee which
result load of work because most tasks are performed manually; then it will be difficult to
manage without error so the following problem will occur.
 Assigning more than eight student in one dorm
 Assigning female student in male dorm and vice versa
 The name of the student even the department list may not be transferred.
 Student record in the clinic will be redundant and etc.

Department of Computer Science Page 1


Acronym, Abbreviation and Definition

1.3 Project Objective

1.3.1 General Objective

The core objective of this project is to develop centralized database desktop application which
can easily store, retrieve and update data.

1.3.2 Specific Objective

 Building one centralized database server for all the service given by student management
system.
 Developing system that enable to access the student data from the server to get cafeteria
service
 Developing desktop application that help user to assign dormitory for student
automatically

1.4 Scope of the Project

This project is limited only in university of Gondar AtseTewodros campus. The system will
capture information about student personal details, dorm details, student medical record and
Employee information. It also allow the employee to change their own user name and password.

1.5 System Development Methodology

We will use an object oriented approach to develop the system because it is more acceptable than
structured type of approach.

1.5.1 Investigation (Fact Finding) Methods

Data and facts to be used in the project are gathered through observing, interview and
questioners. The interview is prepared for the employee regarding the way they perform their
work. And the observation will be held in sight in addition to collecting available data at the last
all data will be analyze.

1.5.2 System Development Tool

 Documentation:
- Microsoft word 2010
- Microsoft office Visio 2007

Department of Computer Science Page 2


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

 Requirement Gathering:
- Through observation, Interviewing peoples and Questioner.
 Implementation tools:
- SQL database server
- Microsoft visual studio 2012
 Hardware:
- personal computer
- server

1.6 Significant Of the Project

This project has many significant and the important once are listed below

 Used to Register non café students


 Used to assign dorm for students
 Used to manage students medical record
 Used to manage cafeteria serving materials
 Used to make payment for non-café students

1.7 Beneficiaries

The people who will be beneficial from this system are the employee work in the university, the
nurse, the AtseTewodros student dean, the client, dorm manager, café manager, Accountants,
owner and technologist. It minimize employees workload, not only this but also it will minimize
the error occurrence percentage and from student perspective the amount of time will be
minimized.

Department of Computer Science Page 3


Acronym, Abbreviation and Definition

1.8 Time Schedule

Figure 1-1 Time Schedule

Department of Computer Science Page 4


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

CHAPTER ONE

2. REQUIREMENT ANALYSIS

2.1 Introduction

Considering UoGAtseTewodros student service management have no computerized management


systems we select some of the core tasks in order to go through and develop window application
system. Has it been said above we proposed to develop a centralized client/server based system
for UoG students service management.

Now the UoG student service management is running manual functioning, when providing
services like dormitory management, students’ cafeteria service and clinic service. Hence the
functioning system is prone to errors and in addition it has many disadvantages related to the
campus’s resources like time and paper.

2.2 Detailed Study of the Current System

2.2.1 Current System Description

The university of Gondar student services have different departments. These departments work
to give different services to the students. Each department has its own workers. Some of the
departments are; Clinic service, dormitory service management, Finance department and the
Cafeteria is the main service departments. All these departments collect the list of students from
the registrar office beside the student’s associate dean office.

Student who wants to be non-café are registered in the associate dean office. This office also
return back this list to the student’s cafeteria management office. The student’s cafe management
office gives to café student’s cup, fork and meal card. Non café students list also send to finance
office of the campus. The dormitory management office assign to students manually. The
student’s clinics manage patient medical record using a registration book.

Department of Computer Science Page 5


Acronym, Abbreviation and Definition

The entire structure and data flow is not well designed more over the office does not use very
well computerized system. Consequently it’s very difficult to store students’ records in
structured manner to help the process of retrieving, searching and locating specific information
easily.

2.2.2 Problems of the existing system

 In the Clinic: The records of patient students are stored manually. This leads to loose of
some data and redundancy of data.
 In the Finance Office: the list for some students does not send to this office by mistake.
 In Dormitory management: students have assigned dormitory manually using MS
excel. So this leads to several problems like; students may be jumped without assigning
dorm, many students may also assigned to a single dormitory out of the bound, the
processes of assigning is very boring to the employees.
 In the students’ cafeteria: the students’ cafeteria gives a service to the students by
giving a meal card number. The registrar gives the list of student that can get the service
to the cafeteria manager.

2.3 Requirement Gathering

2.3.1 Requirement Gathering Methodology

To gather the requirement and to proceed analyzing them .the following methodology where
used:-

 Observation:-the development of this project observed the work flow of the student
management system.
 Interview: - employees, managers and users where the main interviewee.
 Questionnaires: - Questionnaires were distributed to the employees working in the
student management system. The questionnaires were directed toward of examine the
existing system.

2.3.2 Results Found

Due to the methodology used to find the requirement, it can be concluded that all the works are
done manually. Even though there are computer workings, no computer application exist in the
system. This implies that countless mistakes might appear. Hence make computerized system
which include application should be practiced.

Department of Computer Science Page 6


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

2.4 Proposed System

2.4.1 Overview the New System

The new system is aimed to perform basic and crucial tasks of the sector. The system contains a
well-organized database server which makes data to retrieve, update easily. In this system the
basic performances or functions are transferred in to computer application. This led to
minimizing work load and improvement of work flow.

2.4.2 Functional Requirement

Functional Requirements is a statement that specifies functions or services that a software


system is able to perform. The system (student service management system) software
requirements are define clearly and precisely here. We divide the functional requirement by the
interaction between the actor and system.[1]

The functional requirements of the new system are the following:-

- Every user toLogin, Logout and Update their own username and password
- It allow toregister:
 New student
 Student medical record
 Non-café student and Café students
 Payment record
 Serving material record
- Allow to update student information, view café and non-café students, print
prescription report.
- View previous medical history of a student.
- Assign dorm to students.
- Manage user accounts.

2.4.3 Non-Functional Requirement

The non-function requirements of the new system that we proposed are those requirements that
are not readily captured in the use case.[4]

2.4.3.1 User interface and human factors

Department of Computer Science Page 7


Acronym, Abbreviation and Definition

The interface of the new proposed system is very good and flexible for users. It can be usable
using English or Amharic language as they want (for student cafeteria office and dormitory
management offices). The user of this system must should have a know how about a computer.

2.4.3.2 Documentation

The system has a guide book discussing how to use the system for users. Technical
documentation that contains instructions on how to install the product and configure it for
different purposes must be prepared for maintainers/administrator.

2.4.3.3 Hardware Consideration

The system may use different operating systems like window 7 and window 8. The hard ware
required to run the system are server, network cable and laptop/desktop computer.

2.4.3.4 Performance characteristics


 Efficiency: The proposed system has fast response time. It needs at least 1 second
response time and the worse response time is 3 second. The system can also support
concurrent users. It can support up to 25 concurrent user to access, retrieve and
update the central database.
 Interoperability: it can work with different desktop applications developed using C#
and java languages.

2.4.3.5 ErrorHandlingandExtremeConditions
Incorrect input: the system handles many exceptions like inserting empty string
to the database, assigning a dormitory for empty student list, and inserting a
duplicated id no and display an appropriate message for each error.
 Login error: the system shall handle an attempt to login with incorrect username
and password and display appropriate message.
 Read/Write exceptions: the system should handle the read/write operation
conflict to the central database.
2.4.3.6 QualityIssues
Reliability: the system should not fail more than one in a month.
Usability: the system that we develop should easy to learn and operate. It will
need only two day training to use the system.
 Availability: the system will available for all working hours (24 hours).
2.4.3.7 SystemModifications

Department of Computer Science Page 8


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

As the world is capable of change from time to time; there will be future change to the system as
a result of new technology invention. Therefore the system can be upgrade to the new technology
by maintainer or the systems developers.

2.4.3.8 SecurityIssues
The system is protected from external in torsions and malicious users.
The system is secured i.e. user must be able to give rights or deny for all users
based on his/her position by the administrator of the system.
 All major operations/transactions done on the system should be logged to the
central database and seen only by the student administrator.
 Any change in the structure of the database is shall done by system administrator.
2.4.3.9 ResourceIssues
The new system needs the following resource
 Server
Minimum hard ware requirements for SQL server are:
- CPU: 32 bit or 64 bit
- Cores: single(single core 3hz or higher dual core 2GHz or
higher is recommended)
- Display resolution:1360X768(or higher)
 Client:
- CPU: 32 or 64 bit
- RAM: 2GB or higher

2.5 System Model

2.5.1 Scenario

This describes a particular sequence of activities with in a use case.

1. Scenario name: Login


Participating actor: system administrator, student administrator
Flow of event:
1.1. User initiates the system
1.2. User enters user name and password
1.3. The system validate user name and password
1.3.1. If user name and password is valid, access shall be granted
1.3.2. If user name and password is invalid access is denied and then the system
display error message.

Department of Computer Science Page 9


Acronym, Abbreviation and Definition

2. Scenario name: Maintain user Account


Participating actor: System Administrator
Flow of Event:
2.1. The system administrator selects the user accounts menu from the menu.
2.2. The system displays existing user accounts the user to select for deletion or
generate a form used to create user account which holds user name and password.
2.3. User selects user account for deletion or fills required fields to create new user
account.
2.4. System display’s confirmation message for deletion or validates the fields for
creating new user account.
2.5. The system deletes the user account from the database or save the user account
details for the new use account and display message.
3. Scenario name: Backup
Participating Actor: system Administrator
Flow of Event:
3.1. The system administrator selects the backup menu.
3.2. System displays the backup form.
3.3. User selects the backup device.
3.4. The system takes a backup from the specified device.
4. Scenario name: Maintain Student list
Participating Actor: Student Administrator
Flow of Event:
4.1. User selects the Add/Delete/Withdraw student menu.
4.2. - System generate the new student registration form or
- System generate the deletion form for deletion form or
- System generate the student withdraw form
4.3. - user fill the students detail to register new student or
- user search for the deleted student from the database
- user search the student who withdraw
4.4. The system will display an appropriate message for each.
5. Scenario name: Treatment Record
Participating Actor: Nurse
Flow of Event:
5.1. User selects the treatment registration menu
5.2. System loads the Registration book form
5.3. User searches the patient students ID
5.3.1. If the student is available/found the student is going to be treated and the
student’s medical results are saved to the database.
5.3.2. If the student is not found in the database the student should not be treated.
6. Scenario name: Print Voucher
Participating Actor: Nurse/Accountant/Café Manager
Flow of Event:
6.1. User selects the generate voucher card control
6.2. System loads the Report form
6.3. User fills the required fields and press print control

Department of Computer Science Page 10


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

6.4. System prints the voucher


7. Scenario name Make Payment
Participating Actor: Accountant
Flow of Event:
7.1. User selects the payment menu in the finance form
7.2. System loads the cost payment form
7.3. User opens the non-café student list
7.4. System loads all non-café student lists from the central database.
7.5. User searches for a specified student by his/her ID No
7.6. System checks if the student is non-café
7.6.1. If he/she is non-café he/she can take payment and system mark as he/she has
taken their payment.
7.6.2. If he/she system displays appropriate message.
8. Scenario name: Give serving Materials
Participating Actor: Café Manager
Flow of Event:
8.1. User select/opens the café students list
8.2. System loads the café students list from the central database
8.3. User selects for specific student by his/her ID
8.3.1. If the student is café the café manager gives to him/her serving materials and
meal card and the system registers the materials that the students have taken.
8.3.2. If he/she is non-café system displays appropriate message for he she is not
café student.
9. Scenario name: Assign dorm
Participating Actor: Dormitory manager
Flow of Event:
9.1. The manager opens the students list
9.2. System loads all students list from the central database
9.3. User selects the assign dorm button
9.4. System loads the dormitory assignment form
9.5. User selects the assignment criteria and press the save button
9.6. System assigns dorm for each student and save to the central database and display
message.

2.5.2 Use Case Model

The system that we will develop has defined the following use cases.

 Make Treatment Record


 Login
 Search Student
 Add student
 Delete Student
 Update Student Information

Department of Computer Science Page 11


Acronym, Abbreviation and Definition

 Register non-café Student


 Create user Account
 Delete User Account
 Assign Dorm
 Make Payment
 Generate Voucher
 Register serving Material

Actors of the system are the following:

 Student Administrator: a person who is responsible in registering a new student,


updating student information.
 Nurse: is a person who is responsible to teat students whose name is in the central
database.
 Accountant: is a person who is responsible to make a payment for every non-café
student and generate a report in the finance.
 Dormitory manger: is a person who is responsible to assigning a dorm to regular student
s in the dormitory management office.
 Café Manager: is a person who is responsible to give café students serving materials
such as meal card, tea cup and fork.
 System Administrator: is a person who is responsible for taking backup, managing user
accounts (creating user account, deleting user account).

2.5.2.1. Use case diagram

Department of Computer Science Page 12


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

The use case diagram shown below shows the Actors interaction with the system. The use case
contains six subsystems. Namely cafe management system, clinic management system,
dormitory management,student administrator,system administrator and Finance management

Department of Computer Science Page 13


Acronym, Abbreviation and Definition

system.

Department of Computer Science Page 14


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Department of Computer Science Page 15


Acronym, Abbreviation and Definition

Figure 2-2Use case Diagram


2.5.2.2. Use case description

This part describes what the system must provide to the actor when the use case is executed.

1. Authenticate user

Use case name Login


Priority High

Accountant,Nurse,System Administrator, Student Administrator, café manager


Actor and dormitory manager

Description This use case check for validity of the user


Pre-condition User are registered

Post condition Users are authorized


User Action System Response
Step2. System prompts user to enter user name
Step1.User starts the system
and password
Basic course of Step3.User enters user name Step4.System validates the user name and
action and password password
Step5.System well comes user if user name and
pass word are valid.[A]

Step 6: Use case ends


Alternative A: If user entered invalid user name and password
Alternate course of
action A1:system displays “Please Enter valid user name and password”
and back to step2.

Table 2-1Login Use Case Description

2. Student Administrator subsystem

Use case name Add student


Priority High
Actor Student Administrator
Description This system will let add new student to the database
Pre-condition Student unregistered to the central database

Department of Computer Science Page 16


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Post condition Student registered


User Action System Response
Step1.User log in to the system
Step2. user clicks the add new student Step3. system loads the new
control student form
Basic course of Step4. user fills the required
action information(ID,name,department)
Step6. system save’s the student
Step5. user clicks the save button
information to the database.[A]
Step 7: Use case ends
Alternative A. If all the required fields are not filled
A1. System displays error message and back to step 3.
Alternate course Alternative A. If the student information is failed to save
action
A2. : The system displays “The record is not added into the system” error

Message

Table 2-2 The Create New Student Use Case Description

Use case name Update student information


Priority High
Actor Student Administrator
Description This use case updates student information.
Pre-condition Students must be registered and must be legal student.
Post condition Student information updated successfully
User Action System Response
Step1. user starts the system
Basic course of Step2. user searches for a Step3. system displays the student
action specific student using ID information
Step4. user modifies student Step5. System updates the student
information and click the information in the database and displays
update button “update success” message.[A]
Step 6: Use case ends
Alternative A: if the entered data is invalid
A1: system display’s “Invalid data entry” error message and
Alternate course back to step3.
of action Alternative A: if the update not complete in the database
A2: system display’s “update not completed” error message and
back to step3.

Department of Computer Science Page 17


Acronym, Abbreviation and Definition

Table 2-3 The Update Student Information Use Case Description

Use case name Delete Student


Priority High
Actor Student Administrator
Description This use case Inactive students information those withdraw, dismissed and
graduated
Pre-condition Students who are withdraw, dismissed and graduate.
Post condition Student deleted from the database
Basic course of User Action System Response
action Step1. User login to the system
Step2. User searches for a student by Step3. System displays the student
entering ID number in the search text information.
box.
Step4. User clicks the Delete control Step5. System Inactive student
information.[A]
Step 6: Use case ends
Alternate course Alternative A: if the deletion is failed
of action A1: system displays “Failed to Delete” error message and back to step2.

Table 2-4The Delete Student Use Case Description

Use case name Register non-cafe students


Priority Medium
Actor Student Administrator
Description This use case will allows register students who want to be non-café
Pre-condition Student not registered as non-café
Post condition Student registered as non-cafe student
Basic course of User Action System Response
action Step1. Student Administrator
login to the system
Step2. User selects the non-cafe Step3. System loads the non-cafe students
student registration form registration form
Step4. User enters the required Step5. System saves new record to the
fields and click’s the register non-student’s list and display “student
button. registered” message.[A]
Step 6: Use case ends
Alternate course Alternative A: if the entered data is not valid
of action A1: system displays “Invalid input data” error message and
back to step3.

Department of Computer Science Page 18


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Alternative A: if system failed to save the record to the database


A1: system display’s “failed to Register a record!” error
message and back to step3.

Table 2-5 The Register Non-Cafe Student Use Case Description

3. System administrator

Use case name Create user Account


Priority High
Actor System Administrator
Description The system will allow creating new user accounts for new users.
Pre-condition User have no user account
Post condition User account created for a new user
User Action System Response
Step1:User login to the system
Basic course of Step2. User selects the user accounts Step3. System loads the user
action menu accounts list
Step4. User selects create new user Step5. System generate the create
account new user account form
Step6. User enters all the required Step7. System save’s user
fields(user ID, user name and account details to the database
password) and clicks the create button and display success message.[A]
Step 8: Use case ends
Alternate course of Alternative A: if the entered data is invalid(e.g. to short password length)
action A1: system displays “Enter a valid data “error message and back to step5.

Table 2-6 The Create User Account Use Case Description

Use case Delete user Account


name
Priority High
Actor System Administrator
Description Deletes user accounts which are no longer used.
Pre-condition User not deleted
Post condition User account deleted
User Action System Response
Step1. User login to the system
Step2. Use selects user accounts Step3. System loads all existing user
menu accounts
Basic Course of Step4. User selects a user account Step5. System displays confirmation

Department of Computer Science Page 19


Acronym, Abbreviation and Definition

and click delete button options “Delete account” and “Cancel”


Actions Step6. User selects “Delete Step7. System Inactivate user account
account”[A] from the database and display success
message.
Step 8: Use case ends
Alternative Alternative A: If the user selects “Cancel” option
course of flow
A1: system cancel’s the ‘delete operation”
Table 2-7 The Delete User Account Use Case Description

Usecase name Backup


Priority Medium
Actor System Administrator
Description Takes a backup from the system
Pre-condition Backup untaken
Post condition Backup taken
User Action System Response
Step1. User login to the system
Basic Course of Step2. System Administrator selects the Step3. system displays the backup
Actions. backup menu form
Step4. user selects the backup device Step5. System takes a backup from
the specified device and display
“backup success” message.
Step 6: Use case ends

Table 2-8 The Backup Use Case Description

4. The Clinical subsystem

Use case name Treatment record


Priority High
Actor Nurse
Description This use case allow to register students medical records
Pre-condition Students medical Result does not register
Post condition Students medical result is Registered to the database
User Action System Response
Step1. Nurse initiates the
system
Step2. Nurse selects the Step3. System loads the Registration Book
Basic Course of medical history Registration form
Actions Book.
Step4. Nurse checks if a Step5. Displays the search results if a
student Regular by searching student is regular and found in the database.

Department of Computer Science Page 20


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

using ID number [A]


Step6. Nurse starts Step7. System saves the students medical
registering the student’s record to the database.
medical results and click
save after finishing.
Alternative course Alternative A: if the student is not found in the database
of flow

Table 2-9 Treatment Record Use Case Description

Use case name Generate a Voucher


Priority Medium
Actor Nurse
Description Nurse gives students a prescription to the Pharmacy.
Pre-condition Prescription not printed
Post condition Prescription printed
User Action System Response
Step1. User login to the
Basic Course of system
Actions Step2. User selects the Step3. System loads the print form
print voucher control in
the Registration book.
Step4. User fill the form Step5. System prints the voucher.
and clicks the print button
Step 6: Use case ends

Table 2-10 The Generate Voucher use case description


5. Dormitory management

Use case name Assign Dorm


Priority High
Actor Dormitory Manager
Description Assign dorm for students whose name registered in the database
Pre-condition Student does not assigned dorm
Post condition Student Assigned a dorm
User Action System Response
Step1. User login to the system
Step2. User selects the dormitory management Step3. System loads the
menu. dormitory management form.

Department of Computer Science Page 21


Acronym, Abbreviation and Definition

Step4. User selects students list in the Step5. System loads students
dormitory management form list
Step6. User selects assign dorm control Step7. System prompts user
Basic Course to select the assignment
of Actions criteria
Step8. User selects the Block number of the Step9. System assign to
block to be assigned, assignment students and save the result
criteria(assign alphabetically, assign by to the database.
department and assign both by department and
alphabet) and press “Finish button”
Step 10: Use case ends

Table 2-11 The Assign Dorm Use Case Description

6. Café management subsystem

Use case name Check for Serving Material


Priority High
Actor Cafe manager
Description The cafe manager gives serving materials (tea cup, fork) and meal card to
cafe students to get cafe services.
Pre-condition Students have not serving materials and a meal card
Post condition Students take meal card and serving materials
User Action System Response
Step1. Cafe manager initiates the
system
Step2. User selects the view cafe Step3. System loads all cafe students
Basic Course students list control list.
of Actions Step4. User searches for a specific Step5. System displays the student
student using ID. details.[A]
Step6. User ‘marks’ the materials Step7. System assigns meal card
that the student take number and saves the record to the
database.
Step 8: Use case ends

Table 2-12 The Give Serving Materials Use Case Description

Use case name Generate Voucher


Priority Medium
Actor Cafe manager
Description Allows to Print student meal card

Department of Computer Science Page 22


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Pre-condition Meal Card did not printed


Post condition A Meal Card is Printed for a student
User action System Response
Step1. User clicks print meal card control in Step2. System loads the
Basic Course of the payment form print form
Actions Step3. User enters the required fields(meal
card number, student name, department, ID
number)
Step4. User clicks the print button Step5. System prints
Meal Card.
Step 6: Use case ends

Table 2-13 The Generate Voucher use case description for the Cafe Manager Actor

7. Finance Department

Use case name Make Payment


Priority High
Actor Accountant
Description Manage payment for non-cafe students.
Pre-condition Students do not take payment
Post condition Students take payment
User Action System Response
Step1. User login to the system
Step2. Accountant selects the Payment menu Step3. System loads the
payment form
Basic Course of Step4. User searches for a specific student Step5. System displays the
Actions using ID to make a payment student details.[A]
Step6. User ‘mark’ the ‘paid’ check box and Step7. System saves the
press save data to the database and
back to
Step 8: Use case ends
Alternative course Alternative A: if the student could not found in the database
of flow
A1: system displays “Student is not Non cafe” error message and
back to step3.

Table 2-14 The Make Payment Use Case Description

Use case name Generate Voucher

Department of Computer Science Page 23


Acronym, Abbreviation and Definition

Priority Medium
Actor Accountant
Description This use case prints payroll
Pre-condition voucher did not printed
Post condition System prints the required card.
User action System Response
Step1. User clicks the generate voucher Step2. System loads the print form
Basic Course of control in the payment form
Actions Step3. User enters the required fields
Step4. User clicks the print button Step5. System prints the voucher.
Step 6: Use case ends

Table 2-15 The Generate Voucher Use Case Description For The Accountant Actor

2.5.3 Activity Diagram

Activity diagram shows the flow of control from activity to activity. The following activity
diagrams are for the use cases.

Department of Computer Science Page 24


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-3 Login and Back Up Activity Diagram

Department of Computer Science Page 25


Acronym, Abbreviation and Definition

Department of Computer Science Page 26


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-4 Add Student and Delete Student Activity Diagram

Department of Computer Science Page 27


Acronym, Abbreviation and Definition

Figure 2-5 Update Student and Register Non-Cafe StudentActivity Diagram

Department of Computer Science Page 28


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Department of Computer Science Page 29


Acronym, Abbreviation and Definition

Figure 2-6 Create User Account and Delete User Account Activity Diagram

Department of Computer Science Page 30


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Department of Computer Science Page 31


Acronym, Abbreviation and Definition

Figure 2-7 Print Voucher and Search Student Activity Diagram

Department of Computer Science Page 32


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Department of Computer Science Page 33


Acronym, Abbreviation and Definition

Figure 2-8 Assign Dorm and Make Treatment Record Activity Diagram

Department of Computer Science Page 34


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Department of Computer Science Page 35


Acronym, Abbreviation and Definition

Figure 2-9 Register Serving Material and Make Payment Activity Diagram
2.5.4 Object Model
2.5.4.1Data Dictionary

In our system we have identify the following objects with their attributes.

 Student:
- Student Identification number(studID)
- First name
- Last name
- Department
- Age
- Status
- Year
- Sex
 Non-café student
- code No
 Café student List
- Meal card number
 Payment
- Date of payment
- Amount
- Month
 Dorm
- Number of Dorms
- Block number
 Serving Materials
- Material name
- Cup
- Fork
 User account
- User name
- Password
- Role
- Enabled
- Recovery key
 Treatment Record
- Date
- Disease
- Dose name
- Dose amount
 Employee
- Fname

Department of Computer Science Page 36


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

- Lname
- SSN

2.5.4.2Class Modeling

The relationships between the objects that we have identified are defined as follows using class
diagram.

Department of Computer Science Page 37


Acronym, Abbreviation and Definition

Figure 2-10 Class Diagram

2.5.4.3 Dynamic Modeling


Sequence Diagram

Department of Computer Science Page 38


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-11Login Sequence Diagram

Department of Computer Science Page 39


Acronym, Abbreviation and Definition

Figure 2-12Add New Student Sequence Diagram

Department of Computer Science Page 40


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-13Delete Student Information Sequence Diagram

Department of Computer Science Page 41


Acronym, Abbreviation and Definition

Figure 2-14Register Non-Cafe Student Sequence Diagram

Department of Computer Science Page 42


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-15Assign Dorm Sequence Diagram

Department of Computer Science Page 43


Acronym, Abbreviation and Definition

Figure 2-16Make Payment Sequence Diagram

Department of Computer Science Page 44


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-17 Register Serving Material

State Chart Diagram

The state chart diagram shows the different states that an object can encounter when it passes
through different states. The states that can encounter in the objects of this project are described
as follows using the state chart diagram.

Department of Computer Science Page 45


Acronym, Abbreviation and Definition

Figure 2-18 State Chart Diagram for Cafe/Non Cafe Student, Serving Material and Dorm

Department of Computer Science Page 46


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Department of Computer Science Page 47


Acronym, Abbreviation and Definition

Department of Computer Science Page 48


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-19 State Chart Diagram for User Account and Student
2.5.5 User Interface
1. Login Form

Log in form used to enter to system by providing the user name and password in the given text box.If the
user have not User name before, can not enter to the UoGATSSMS.

Figure 2-20 Login User Interface


2. Main form(MDI parent form)
The main form used to display or load the other forms like container. It contains a menu bar that
contaien’s the exit button, the Help and Account setting menu items.

Department of Computer Science Page 49


Acronym, Abbreviation and Definition

Figure 2-21Main MDI Form


3. The Form for Student Administrator

Figure 2-22 Student Administrator User Interface


4. The medical registration book

Department of Computer Science Page 50


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-23The Medical Registration Book

5. The Dormitory Management Form


User uses this to view students’ information and to assign dorm for students.

Department of Computer Science Page 51


Acronym, Abbreviation and Definition

Figure 2-24The Dormitory Management User Interface


6. Help Form
The help form is used to display help information for the user. It contains buttons that let
to move to the appropriate Help center for each user.

Department of Computer Science Page 52


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 2-25 Help form

Department of Computer Science Page 53


Acronym, Abbreviation and Definition

Chapter Two

3. SYSTEM DESIGN

3.1 Introduction

In this section we provide overview of the software architecture and the design goals. The system
is decomposed in to subsystem like Dormitory management,Clinic management system,Cafe
service management subsystem,Student Administrator subsystem,system administrator
subsystem and Finance service management system.The software/Hardware mapping of this
system is the students information is stored in a central database server and managed by SQL
server. Clients access the data using their computer. And each user have a user account to login
to the system and have a restricted access control.

3.2 Current SW Architecture

There is no system being used rather than using some application software’s like MS-excel to
manage dormitory management.

3.3 Proposed SW Architecture

3.3.1 Overview

As we have said the software architecture of the system is client/server architecture. A


centralized SQL server manages and stores the operations and students information. Users can
access(use) the system remotely by login to the system and sending actions to the server. The
system is have divided into subsystems having different functionality each subsystem. The
subsystems and their functionality are:[2]

 Student Administrator subsystem: this subsystem add new students, inactive student
information, and update student information.
 System Administrator subsystem: this subsystem manages user accounts.
 Clinic service management subsystem: this subsystem manages student medical
record.

Department of Computer Science Page 54


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

 Dormitory management subsystem: this subsystem assign dorm to students and


manage these records.
 Financial service subsystem: keep the non-café students financial information.
 Café service management subsystem: this subsystem manages students serving
materials record.

3.3.2 Subsystem Decomposition

This subsection describes the decomposition into subsystems and the responsibilities. The UoG
Student service Management UI subsystem provides user friendly interface for user. Café service
management, dormitory management, financial service management and clinic service
management subsystems are dependent from the student Admin subsystem because, students can
get the other subsystem services if they are only registered by the student admin. The database
subsystem manages all the operations and data of the other subsystems.

Department of Computer Science Page 55


Acronym, Abbreviation and Definition

Figure 3-26 Component Diagram

3.3.3 Hardware/Software Mapping

This section describes the HW/SW mapping of the proposed system. To describe this we have
use the UML deployment diagram.

Application Server

Student
Administrator

System
Administrator

Department of Computer Science Page 56


Client PC Clinic Database Server
Management
User
Interface
SQL server
Dorm
management

STUDENT SERVICE MANAGEMENT SYSTEM


Cafe
FOR ATSE TEWODROS CAMPUS OF UOG
Managemenet

3.3.4 Persistent data Management


Finance er
Persistent objects are stored in a persistence mechanism. The Development Team identifies
Management

tables that are present in the Data Base for describing the data stored on the database. Every table
is related to each through their primary and foreign key. Also each Table has Attribute with
compatible Data type.

Figure 3-28 Object Diagram

Department of Computer Science Page 57


Acronym, Abbreviation and Definition

3.3.5 Access control and Security


Actor Access Privilege on Class’s
Student Student Non-Café Café-Student Treatmen Payment Dorm Serving_ User acc
Service Student t_Record Materials
manag’t
system
Student Login() View() RegisterNoncaf Register café-
Admin Add () é_stud () students()
Update_stud_Info ()
Delete_stud_Info ()
System Login() Create ()
Admin Delete()
Nurse Login() View() Make
treatment
record()
Account Login() View() Make
ant payment()
Dorm Login() View() AssignDo
Manager rm()
Café Login() View() saveServin
manager gMaterialR
ecord()
The Access control table below shows who can access which data with a specified access privilege on each class.

Department of Computer Science Page 58

Table 3-16 Access Privilege for each Actor


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

3.3.6 Subsystem Service

This section describes the service provided by each subsystem.

 Student Administrator subsystem: the service provided by this subsystem are


registering new students, registering non-café and café students, updating student
information and inactivating student information. This subsystem contains the
Student, non-café student and café-student classes.
 System Admin: this subsystem manages all user accounts like creating user account
and deleting user account. It includes the user account class.
 Clinic service management: this subsystem includes the treatment record class with
adding and viewing student medical history.
 Dormitory management subsystem: this subsystem contains the dorm class with the
assigning dorm for student’s service.
 Cafeteria service management subsystem: this subsystem includes student serving
material class with checking a student weather a student is café or non café and
saving student serving material record.
 Finance service management: this subsystem includes the payment class and the
services provide are checking weather a student is non-cafe and checking if a student
have taken payment.

Department of Computer Science Page 59


Acronym, Abbreviation and Definition

3.4 Detailed class diagram


3.4.1 Class diagram

Figure 3-29Detailed Class Diagram

Department of Computer Science Page 60


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

3.4.2 Algorithm Design

This subsection of the design phase try’s to explore the input/output and processes of the
system. As a result we have written all the inputs, processes and outputs of the system for
each class as the follows.

Method name Input Process Output


studID Accept the inputs from the user A new student is
Fname Validate the inputs registered to the
Lname If all inputs are valid and all required fields are filled, database system.
addNewStudent() Age it will register the student to the database, else
displays not a valid data or fill all required fields error
Sex
message.
Dep’t
Year
studID Get thestudID or Fname from the user. A students
Search the studID or fname in the student table. information is
deleteStudent() Ifstudent is found it will Inactivate the students inactivated from
information, else display student not found the database.
message
studID Get the inputs and validate them. A student
Fname If all inputs are valid and all required fields are information is
Lname filled properly it changes the stored student updated from old
UpdateStudent() Age, Sex information to the new updated, else it display to new
Dep’t enter a valid data message information.
Year
Status
studID or Accept one or more of the inputs and process Display’s
Fname them. If there is a value corresponding to the information for
Searchstud() entered value in the database it should display the specified
students information, else generate Not found students
message

Table 3-17Student Class

Method Input Processes Output


name
SSN Get the entered values and validate them. A new employee is
Register() Fname If all input are valid save employee information to the registered.
Lname employee table in the database, else display error
message.

Table 3-18 Employee Class

Department of Computer Science Page 61


Acronym, Abbreviation and Definition

Method name Input Process Output


studID Get studID and codeNo and process them. Student is registered as
codeN IfstudID is exist in database and codeNo is non-café
registerStud() o valid it will register the student to non café
student table, else display error message

Table 3-19Non Cafe Student Class

Method name Input Process output


studID Accept all the inputs Students are
blockNo If dormNo is not assigned to student and assigned
dormNo studID have no assigned dorm it assign student dormitory
Assigndorm() criteria on the specified dorm and save the students
sex block no and dormNo in student table, else
Dep’t display student have assigned dorm or dorm
no is assigned to student message.

blockNo Get blockNo then check if there is empty dorm Display List of
checkDormIfEmpty() in block. If there is, display all the dormNo, dormNo’s dose
else display no empty dorm message. not assigned to
students.

Table 3-20 Dorm Class

Method name Input Process Output


studID or Read the input and process it. IfcodeNo Allow student to take
chekIfPay() codeNo is found in non-café list and if student payment.
is not take payment it display student
information to take payment.
codeNo Read all the inputs and validate them.
savePayement() dateOfPayment Ifall inputs are filled and are valid data Payment information
amount it will insert to the payment table, else is recorded to the
display error message. database.
studID Read all the inputs and validate them. A voucher is printed to
PrintVoucher() fname If all the inputs not empty and are valid put students sign.
lname It will print a voucher, else display
codeNo error message.
dateOfPayment
amount
dep’t

Table 3-21Payment Class

Department of Computer Science Page 62


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Method name Input Process Output


mealCardNo Read inputs and process them. Ifall entered Registers students
registerMat() amount data are valid it will insert the information to who have take
matName the serving Material table. serving material
studID Read all the inputs and check if they are valid.
fname If all the inputs are filled and are valid print Printed student
printMealCard( lname student meal card. meal card.
) dep’t
mealCardNo

Table 3-22 Serving Material Class

Method name Input Process Output


username Read all inputs and validate them.
password Ifall inputs are not empty and are A user account is create
createUserAccount() SSN valid it insert user account for new user
information into the user accounts
table.
Username Get input and process it. Ifentered A user account is
DeleteUserAccount( or value is found in saved one it should deactivated from being
) SSN deactivate user account in the user used by a user
account table
username Read all the inputs and process them.
Validate() password Ifentered values are the same as User is logged to the
SSN stored value it logged in user to the system
system.

Table 3-23User Account Class

Department of Computer Science Page 63


Acronym, Abbreviation and Definition

3.5 Package Diagram

UoG Students Service Management system

Student Admin subsystem Dormitory Management subsystem System Administrator subsystem

Student
Non-Cafe
Dorm Employee User
Student
Accounts

Non-Cafe
Student

Cafe Service Management


Clinic service Management
Finance Service Management

Serving
Treatment Rec
Payment Materials
ord

Figure 3-30 Package Diagram

Department of Computer Science Page 64


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

CHAPTER THREE

4. Implementation
4.1 Introduction
Implementation phase is one of the main parts of the whole project. It includes the graphical interface
between the system and user. It provides the general structure and requirement to function of the
system also consists of the coding part of the system how to response the action to the user.

4.2 Objective
 To show the graphical structure of the project
 To give some explanation
 To show what the system do or to show the function of the system
4.3 Mapping models to code

In this document we have been seen around 6 actors.

 Student administrator
 System administrator
 Dorm manager
 Café manager
 Nurse
 Accountant

Student

Café Student

Student Administrator Non Cafe

The student administrator can add,delete and update the student table. Can also register café
and non-café students to the café student and non-café student table.

Department of Computer Science Page 65


Acronym, Abbreviation and Definition

Employee

User Account
System Administrator

The system administrator can add new employee to Eemployee table and access the User Account
table.

Dorm

Dorm Assignment
Dorm Manager

The dorm manager can access the dorm,dorm assignment,student and user account tables.

Student

User Account

Nurse

The Nurse actor can access the Student,User Account and Treatment_Record tables.

Payment

Non Café
Accountant

The Accountant actor have the permission Payment,Non-Café and User Account tables.

Department of Computer Science Page 66


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Café Student

User Account
Café Manager

The Café Manager can view the table Café Student and can access the User account
table.

4.3 Source codes of major classes[3]

Source code for the login form


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Reflection;
using System.Resources;
using System.Globalization;
using System.Data.SqlClient;

namespace UoGStudentsServiceMangt
{
publicpartialclassfrmLogin : Form
{
publicstring UserRole;

Department of Computer Science Page 67


Acronym, Abbreviation and Definition

publicstring UserName;
privateclsUserAccount userAcc;
privateImage btnBackImage; // an image variable that stores the button
background image
public frmLogin()
{
InitializeComponent();
}

privatevoid txtusername_TextChanged(object sender, EventArgs e)


{
lblpsswrderr.Visible = false;
}

privatevoid txtUsername_TextChanged(object sender, EventArgs e)


{
lblusrnamerr.Visible = false;

}
// a method that check if a user provides user name and password
// during Login
privatebool CheckLogin()
{
bool log = true;
if (txtusername.Text == "") { lblusrnamerr.Visible = true; log = false; }
else { lblusrnamerr.Visible = false; }
if (txtpassword.Text == "") { lblpsswrderr.Visible = true; log = false; }
else { lblpsswrderr.Visible = false; }
return log;
}
privatevoid Get(string Username, string Password)
{
try
{
userAcc = clsLogin.GetUser(Username, Password);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, ex.GetType().ToString());
}
}

privatevoid lblLanguage_Click(object sender, EventArgs e)


{
if (lblLanguage.Text == "አማርኛ (ኢትዮ)")
{
picFlag.Image =
UoGStudentsServiceMangt.Properties.Resources.USAflag;
CultureInfo ci = newCultureInfo("en-Us");
Assembly a = Assembly.Load("UoGStudentsServiceMangt");
ResourceManager rm =
newResourceManager("UoGStudentsServiceMangt.Languages.Amharic", a);
lblusrname.Text = rm.GetString("lblusrname", ci);
lblpsswrd.Text = rm.GetString("lblpsswrd", ci);
btnlogin.Text = rm.GetString("btnlogin", ci);
btncancel.Text = rm.GetString("btncancel", ci);
lblLanguage.Text = rm.GetString("lblLanguage", ci);

Department of Computer Science Page 68


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

}
elseif (lblLanguage.Text == "English (Eng-US)")
{
picFlag.Image =
UoGStudentsServiceMangt.Properties.Resources.ethiopian_flag;
CultureInfo ci = newCultureInfo("en-Us");
Assembly a = Assembly.Load("UoGStudentsServiceMangt");
ResourceManager rm =
newResourceManager("UoGStudentsServiceMangt.Languages.English", a);
lblusrname.Text = rm.GetString("lblusrname", ci);
lblpsswrd.Text = rm.GetString("lblpsswrd", ci);
btnlogin.Text = rm.GetString("btnlogin", ci);
btncancel.Text = rm.GetString("btncancel", ci);
lblLanguage.Text = rm.GetString("lblLanguage", ci);
}
}

privatevoid btnlogin_MouseHover(object sender, EventArgs e)


{
btnBackImage = btnlogin.Image;
btnlogin.Image =
UoGStudentsServiceMangt.Properties.Resources.formbackground;
}

privatevoid btnlogin_MouseLeave(object sender, EventArgs e)


{
btnlogin.Image = btnBackImage;
}

privatevoid btncancel_MouseHover(object sender, EventArgs e)


{
btnBackImage = btncancel.Image;
btncancel.Image =
UoGStudentsServiceMangt.Properties.Resources.formbackground;
}

privatevoid btncancel_MouseLeave(object sender, EventArgs e)


{
btncancel.Image = btnBackImage;
}

privatevoid txtpassword_MouseEnter(object sender, EventArgs e)


{
txtpassword.SelectAll();
}

privatevoid linkLabel1_LinkClicked(object sender,


LinkLabelLinkClickedEventArgs e)
{
grpPasswordReset.Visible = true;
grpPasswordReset.Location = grpLogin.Location;
grpLogin.Visible = false;
this.HideErrorProviders();

Department of Computer Science Page 69


Acronym, Abbreviation and Definition

privatevoid btnhide_Click(object sender, EventArgs e)


{
grpLogin.Location = grpPasswordReset.Location;
grpLogin.Visible = true;
grpPasswordReset.Visible = false;
this.HideErrorProviders();
}
privatevoid HideErrorProviders()
{
lblConfirmPasswordError.Visible = false;
lblNewPasswordError.Visible = false;
lblResetUserNameError.Visible = false;
lblSecurityAnswerError.Visible = false;
lblpsswrderr.Visible = false;
lblusrnamerr.Visible = false;
}

privatevoid txtRcovery_TextChanged(object sender, EventArgs e)


{
if (txtRecoveryKey.Text.Trim() == "")
{
lblSecurityAnswerError.Visible = true;
lblSecurityAnswerError.Text = "Enter Recovery key.";
}
if (txtRecoveryKey.Text.Trim() != "")
{
lblSecurityAnswerError.Visible = false;
}
}

privatevoid txtresetUsername_TextChanged(object sender, EventArgs e)


{
if (txtresetUsername.Text.Trim() == "")
{
lblResetUserNameError.Visible = true;
lblResetUserNameError.Text = "Enter username";
}
if (txtresetUsername.Text.Trim() != "")
{
lblResetUserNameError.Visible = false;
}

privatevoid txtNewPassword_TextChanged(object sender, EventArgs e)


{
if (txtNewPassword.Text.Trim() == "")
{
lblNewPasswordError.Text = "Enter new Password";
lblNewPasswordError.Visible = true;
}
if (txtNewPassword.Text.Trim().Length < 6)
{
lblNewPasswordError.Text = "Password Length is at least
6.";

Department of Computer Science Page 70


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

lblNewPasswordError.Visible = true;
}
if (txtNewPassword.Text.Trim().Length >= 6)
{
lblNewPasswordError.Visible = false;
}
}

privatevoid txtconfirmPassword_TextChanged(object sender, EventArgs e)


{
if (txtconfirmPassword.Text.Trim() == txtNewPassword.Text.Trim())
{
lblConfirmPasswordError.Text = "Password matched";
lblConfirmPasswordError.ForeColor = Color.Green;
}
if (txtconfirmPassword.Text.Trim() != txtNewPassword.Text.Trim())
{
lblConfirmPasswordError.ForeColor = Color.Red;
lblConfirmPasswordError.Text = "Password not mathced";
lblConfirmPasswordError.Visible = true;
}
}

privatevoid btnSubmit_Click(object sender, EventArgs e)


{
if (submitCheck())
{
clsUserAccount account = newclsUserAccount();
account.UserName = txtresetUsername.Text.ToString();
account.Password = txtconfirmPassword.Text.ToString();
account.RecoveryKey = txtRecoveryKey.Text.ToString();
int result = clsUserAccountDB.AlterUserAccount(account);
if (result >0)
{
MessageBox.Show("Password reset Successfully!", "Password reset",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
if (result == 0)
{
MessageBox.Show("Zero rows affected");
}
}
}
privatebool submitCheck()
{
bool valid = true; ;

if (txtRecoveryKey.Text.Trim()=="")
{
lblSecurityAnswerError.Visible = true;
lblSecurityAnswerError.Text = "Enter your answer.";
valid = false;
}
if (txtresetUsername.Text.Trim()=="")
{
lblResetUserNameError.Visible = true;

Department of Computer Science Page 71


Acronym, Abbreviation and Definition

lblResetUserNameError.Text = "Eneter your username.";


valid = false;
}
if (txtNewPassword.Text.Trim() == "")
{
lblNewPasswordError.Text = "Enter the new password";
lblNewPasswordError.Visible = true;
valid = false;
}
if (txtconfirmPassword.Text.Trim() == "")
{
lblConfirmPasswordError.Text = "Confirm password";
valid = false;
}

return valid;
}

privatevoid button1_Click(object sender, EventArgs e)


{

if (CheckLogin())
{
string Username = Convert.ToString(txtusername.Text);
string Password = Convert.ToString(txtpassword.Text);
this.Get(Username, Password);
if (userAcc == null)
{
lblusrnamerr.Text = "UnKnown user name or type the
password";
lblusrnamerr.Visible = true;
lblpsswrderr.Visible = true;
txtpassword.Text = "";
txtpassword.Focus();
}
else
{
int a = Convert.ToInt16(userAcc.Enabled);
if (a == 1)
{
MessageBox.Show(userAcc.UserName + " is blocked for some reason. \r Please
contact the System Administrator for more information.", "User Account
Disabled", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
if (a == 0)
{
frmSplashScreen1 splash = newfrmSplashScreen1(userAcc.UserName,
userAcc.Role, userAcc.Password, userAcc.SSN.ToString(), userAcc.Photo);
this.Hide();
splash.Show();
}
}
}
}

privatevoid button2_Click(object sender, EventArgs e)


{

Department of Computer Science Page 72


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Application.Exit();
}

}
}

Source Code for Student class

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Drawing;

using System.Data;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Data.SqlClient;

namespace UoGStudentsServiceMangt

publicclassclsStudentDB

Department of Computer Science Page 73


Acronym, Abbreviation and Definition

// a method that used to registr new student

publicstaticint AddNewStudent(clsStudent stud)

SqlConnection connectionAddNewStud = clsSSMS.GetConnection();

string sqlStatmentAddnewStud = "INSERT INTO


STUDENT(studID,Fname,Lname,Department,Age,Sex,Year)
VALUES(@studID,@fName,@lName,@Dep,@Age,@Sex,@year)";

SqlCommand sqlCommandAddnewStud = newSqlCommand(sqlStatmentAddnewStud,


connectionAddNewStud);

// pass the parameters

sqlCommandAddnewStud.Parameters.AddWithValue("@studID",
stud.StudID);

sqlCommandAddnewStud.Parameters.AddWithValue("@fName",
stud.FName);

sqlCommandAddnewStud.Parameters.AddWithValue("@lName",
stud.LName);

sqlCommandAddnewStud.Parameters.AddWithValue("@Dep",
stud.Department);

sqlCommandAddnewStud.Parameters.AddWithValue("@Age", stud.Age);

sqlCommandAddnewStud.Parameters.AddWithValue("@Sex", stud.Sex);

sqlCommandAddnewStud.Parameters.AddWithValue("@year",
stud.Year);

try

connectionAddNewStud.Open();

int NoOfRowsAffected= sqlCommandAddnewStud.ExecuteNonQuery();

return NoOfRowsAffected;

catch (SqlException ex)

MessageBox.Show("Registration not completed. \r Review your inputs again or


There might be another student with that IDNo"+stud.StudID, "Student
registration error", MessageBoxButtons.OK, MessageBoxIcon.Error);

Department of Computer Science Page 74


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

return 0;

finally { connectionAddNewStud.Close(); }

// the method that update student information

publicstaticint UpdateStudentInformation(clsStudent student)

SqlConnection connectionUpdateStudInfo = clsSSMS.GetConnection();

string updateStatement = "UPDATE STUDENT SET


Fname=@fname,Lname=@lname,Department=@department,Sex=@sex,Age=@age WHERE
studID=@studid";

SqlCommand commandUpdateStudInfo = newSqlCommand(updateStatement,


connectionUpdateStudInfo);

// Add the paramenters of the statment

commandUpdateStudInfo.Parameters.AddWithValue("@studid",
student.StudID);

commandUpdateStudInfo.Parameters.AddWithValue("@fname",
student.FName);

commandUpdateStudInfo.Parameters.AddWithValue("@lname",
student.LName);

commandUpdateStudInfo.Parameters.AddWithValue("@department",
student.Department);

commandUpdateStudInfo.Parameters.AddWithValue("@sex",
student.Sex);

commandUpdateStudInfo.Parameters.AddWithValue("@age",
student.Age);

try

connectionUpdateStudInfo.Open();

int NoRowsAffected=commandUpdateStudInfo.ExecuteNonQuery();

return NoRowsAffected;

catch (SqlException ex)

Department of Computer Science Page 75


Acronym, Abbreviation and Definition

MessageBox.Show("Update not completed.\r Review your inputs again. Don't


change the IDNo. ", "Update error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

return 0;

finally { connectionUpdateStudInfo.Close(); }

// search method for searching all students and display on a datagridview

// this method takes DataGrideView object as an argument

publicstaticSqlDataReader SearchStudent()

SqlConnection connectionNonCafeRegistrationOnload =
clsSSMS.GetConnection();

string selectStatment = "Select studID as IDNO,Fname as First_Name,Lname as


Last_Name,Department,Year,Sex FROM STUDENT ORDER BY DEPARTMENT,YEAR ASC";

SqlCommand commandSelect = newSqlCommand(selectStatment,


connectionNonCafeRegistrationOnload);

try

connectionNonCafeRegistrationOnload.Open();

SqlDataReader reader = commandSelect.ExecuteReader();

return reader;

catch (SqlException ex)

MessageBox.Show("There is a problem encounterd while searching. \rPlease


try again.","Search error", MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

Department of Computer Science Page 76


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

// search method that searchs for a specific students using IDNo

// takes a string as an argument(IDNO)

publicstaticSqlDataReader SearchStudent(string studID)

SqlConnection connectionSearchStudUsingIDNo = clsSSMS.GetConnection();

string selectStatment = "SELECT * FROM STUDENT WHERE studID='" + studID +


"' or Fname='" + studID + "'";

SqlCommand commandSearchstudByID = newSqlCommand(selectStatment,


connectionSearchStudUsingIDNo);

try

connectionSearchStudUsingIDNo.Open();

SqlDataReader readStud = commandSearchstudByID.ExecuteReader();

return readStud;

catch (SqlException ex) { throw ex; }

// a method that deletes student from the database permanently

publicstaticint DeleteStudent(clsStudent student)

SqlConnection connDeleteStud = clsSSMS.GetConnection();

string deleteStatment = "DELETE FROM STUDENT WHERE studID=@studid";

SqlCommand commDeleteStud = newSqlCommand(deleteStatment, connDeleteStud);

commDeleteStud.Parameters.AddWithValue("@studid",
student.StudID);

try

connDeleteStud.Open();

int rowsAffected = commDeleteStud.ExecuteNonQuery();

return rowsAffected;

Department of Computer Science Page 77


Acronym, Abbreviation and Definition

catch (Exception ex)

MessageBox.Show("Delete command not completed. \r Couldn't found student


with IDNo= " + student.StudID, "Delete student error",
MessageBoxButtons.OK, MessageBoxIcon.Error);

return 0;

finally { connDeleteStud.Close(); }

Source code for the Non-Café class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Data.SqlClient;

using System.Windows.Forms;

namespace UoGStudentsServiceMangt.folderStudentAdmin

publicclassclsNonCafeStudentDB:clsStudentDB

// a method that register non-cafe students

publicstaticvoid RegisterNonCafeStudents(clsNonCafeStudent NonCafeStudent)

bool Registered = false;

Department of Computer Science Page 78


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

SqlConnection connectionRegisterNonCafe = clsSSMS.GetConnection();

string statmentRegisterNoncafe = "Insert into NON_CAFÉ(studID)


values(@studid)";

SqlCommand commandRegisterNoncafe = newSqlCommand(statmentRegisterNoncafe,


connectionRegisterNonCafe);

// pass the parameter

commandRegisterNoncafe.Parameters.AddWithValue("@studid",
NonCafeStudent.StudID);

try

{ // check if the student is registered before

connectionRegisterNonCafe.Open();

string selectCheck = "select studID from NON_CAFÉ where studID=@studid";

SqlCommand commancheck = newSqlCommand(selectCheck,


connectionRegisterNonCafe);

commancheck.Parameters.AddWithValue("@studid",
NonCafeStudent.StudID);

SqlDataReader reader = commancheck.ExecuteReader();

if(reader.Read())

{ // if the a record is found do nothing

Registered = true;

catch (Exception) { MessageBox.Show("Failed to check if a \rstudent is


registered in Non-cafe student list", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error); }

finally { connectionRegisterNonCafe.Close(); }

if (!Registered)

try

Department of Computer Science Page 79


Acronym, Abbreviation and Definition

connectionRegisterNonCafe.Open();

commandRegisterNoncafe.ExecuteNonQuery();

catch (SqlException ex)

MessageBox.Show(ex.Message, "Registraton Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

finally { connectionRegisterNonCafe.Close(); }

// a method that delete Non-cafe student from the Noncafe student list

publicstaticvoid DeleteNonCafeStud(string studID)

SqlConnection connectionDeleteNonCafe = clsSSMS.GetConnection();

string statmentDeleteNoncafe = "Delete NON_CAFÉ where studID=@studid";

SqlCommand commandDeleteNoncafe = newSqlCommand(statmentDeleteNoncafe,


connectionDeleteNonCafe);

commandDeleteNoncafe.Parameters.AddWithValue("@studid",
studID);

// pass the parameters

try

connectionDeleteNonCafe.Open(); // open a connection to


execute the sqlcommand against the database

commandDeleteNoncafe.ExecuteNonQuery();

catch (SqlException)

Department of Computer Science Page 80


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

MessageBox.Show("Unable to delete the student "+studID, "Deletion From


Noncafe List", MessageBoxButtons.OK, MessageBoxIcon.Error);

finally { connectionDeleteNonCafe.Close(); }

publicstaticSqlDataReader SearchAllNonCafeStudents(string tableName)

SqlConnection connectionNonCafeOnload = clsSSMS.GetConnection();

string selectStatment = "SELECT STUDENT.studID AS IDNo,STUDENT.Fname as


First_Name,STUDENT.Lname as Last_Name,NON_CAFÉ.codeNO As
Code_No,STUDENT.Department,STUDENT.Year FROM STUDENT,NON_CAFÉ WHERE
STUDENT.studID=NON_CAFÉ.studID";

SqlCommand commandSelect = newSqlCommand(selectStatment,


connectionNonCafeOnload);

try

connectionNonCafeOnload.Open();

SqlDataReader reader = commandSelect.ExecuteReader();

return reader;

catch (SqlException)

MessageBox.Show("Error is occured while loandin non-cafe student


list","Non-Cafe Students Loading
Error",MessageBoxButtons.OK,MessageBoxIcon.Error);

returnnull;

Department of Computer Science Page 81


Acronym, Abbreviation and Definition

Source Code for the Café student class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Data.SqlClient;

using System.Windows.Forms;

namespace UoGStudentsServiceMangt.folderStudentAdmin

publicclassclsNonCafeStudentDB:clsStudentDB

// a method that register non-cafe students

publicstaticvoid RegisterNonCafeStudents(clsNonCafeStudent NonCafeStudent)

bool Registered = false;

SqlConnection connectionRegisterNonCafe = clsSSMS.GetConnection();

string statmentRegisterNoncafe = "Insert into NON_CAFÉ(studID)


values(@studid)";

SqlCommand commandRegisterNoncafe = newSqlCommand(statmentRegisterNoncafe,


connectionRegisterNonCafe);

// pass the parameter

commandRegisterNoncafe.Parameters.AddWithValue("@studid",
NonCafeStudent.StudID);

try

{ // check if the student is registered before

connectionRegisterNonCafe.Open();

string selectCheck = "select studID from NON_CAFÉ where studID=@studid";

Department of Computer Science Page 82


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

SqlCommand commancheck = newSqlCommand(selectCheck,


connectionRegisterNonCafe);

commancheck.Parameters.AddWithValue("@studid",
NonCafeStudent.StudID);

SqlDataReader reader = commancheck.ExecuteReader();

if(reader.Read())

{ // if the a record is found do nothing

Registered = true;

catch (Exception) { MessageBox.Show("Failed to check if a \rstudent is


registered in Non-cafe student list", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error); }

finally { connectionRegisterNonCafe.Close(); }

if (!Registered)

try

connectionRegisterNonCafe.Open();

commandRegisterNoncafe.ExecuteNonQuery();

catch (SqlException ex)

MessageBox.Show(ex.Message, "Registraton Error",MessageBoxButtons.OK,


MessageBoxIcon.Error);

finally { connectionRegisterNonCafe.Close(); }

Department of Computer Science Page 83


Acronym, Abbreviation and Definition

// a method that delete Non-cafe student from the Noncafe student list

publicstaticvoid DeleteNonCafeStud(string studID)

SqlConnection connectionDeleteNonCafe = clsSSMS.GetConnection();

string statmentDeleteNoncafe = "Delete NON_CAFÉ where studID=@studid";

SqlCommand commandDeleteNoncafe = newSqlCommand(statmentDeleteNoncafe,


connectionDeleteNonCafe);

commandDeleteNoncafe.Parameters.AddWithValue("@studid",
studID);

// pass the parameters

try

connectionDeleteNonCafe.Open(); // open a connection to


execute the sqlcommand against the database

commandDeleteNoncafe.ExecuteNonQuery();

catch (SqlException)

MessageBox.Show("Unable to delete the student "+studID, "Deletion From


Noncafe List", MessageBoxButtons.OK, MessageBoxIcon.Error);

finally { connectionDeleteNonCafe.Close(); }

publicstaticSqlDataReader SearchAllNonCafeStudents(string tableName)

SqlConnection connectionNonCafeOnload = clsSSMS.GetConnection();

string selectStatment = "SELECT STUDENT.studID AS IDNo,STUDENT.Fname as


First_Name,STUDENT.Lname as Last_Name,NON_CAFÉ.codeNO As
Code_No,STUDENT.Department,STUDENT.Year FROM STUDENT,NON_CAFÉ WHERE
STUDENT.studID=NON_CAFÉ.studID";

Department of Computer Science Page 84


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

SqlCommand commandSelect = newSqlCommand(selectStatment,


connectionNonCafeOnload);

try

connectionNonCafeOnload.Open();

SqlDataReader reader = commandSelect.ExecuteReader();

return reader;

catch (SqlException)

MessageBox.Show("Error is occured while loandin non-cafe student


list","Non-Cafe Students Loading
Error",MessageBoxButtons.OK,MessageBoxIcon.Error);

returnnull;

Source code for the Treatment_Record class

using System;

using System.Collections.Generic;

using System.Windows.Forms;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Data.SqlClient;

namespace UoGStudentsServiceMangt

publicstaticclassclsTreatment_RecordDB

Department of Computer Science Page 85


Acronym, Abbreviation and Definition

// this metohd saves new treatment record of students

publicstaticint AddNewRecord(clsTreatment_Record treatmentRecord)

SqlConnection connectionAddnewTreatmentRecord = clsSSMS.GetConnection();

string addNewTreatmentRecordStatment = "INSERT INTO


TREATMENT_RECORD(Date,studID,Desease,doseName,doseAmount,SSN)" +

"VALUES(@date,@studId,@desease,@dosename,@doseamount,@Ssn)";

SqlCommand commandAddnewTreatmentRecord =
newSqlCommand(addNewTreatmentRecordStatment,
connectionAddnewTreatmentRecord);

// pass the parameters

commandAddnewTreatmentRecord.Parameters.AddWithValue("@date",
treatmentRecord.Date);

commandAddnewTreatmentRecord.Parameters.AddWithValue("@studId",
treatmentRecord.StudID);

commandAddnewTreatmentRecord.Parameters.AddWithValue("@desease",
treatmentRecord.Desease);

commandAddnewTreatmentRecord.Parameters.AddWithValue("@dosename",
treatmentRecord.DoseName);

commandAddnewTreatmentRecord.Parameters.AddWithValue("@doseamount",
treatmentRecord.DoseAmount);

commandAddnewTreatmentRecord.Parameters.AddWithValue("@Ssn",
treatmentRecord.SSN);

try

connectionAddnewTreatmentRecord.Open(); // open connection

int affectedRows= commandAddnewTreatmentRecord.ExecuteNonQuery();

return affectedRows;

Department of Computer Science Page 86


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

catch (SqlException)

MessageBox.Show("Faild to register the medical record. \r Check if all the


input data are correct and try again.", "Error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

return 0;

finally { connectionAddnewTreatmentRecord.Close(); }

// a method that retrieves the medical history of a student

publicstaticSqlDataReader studMedicalHistory(clsTreatment_Record
treatementHistory)

SqlConnection medHistoryConnection = clsSSMS.GetConnection();

string selectMedHistory="SELECT * FROM TREATMENT_RECORD WHERE


studID=@studid";

SqlCommand commandMedHistory = newSqlCommand(selectMedHistory,


medHistoryConnection);

commandMedHistory.Parameters.AddWithValue("@studid",
treatementHistory.StudID);

try

medHistoryConnection.Open(); // open the connection

SqlDataReader reader = commandMedHistory.ExecuteReader(); // execute the


command against the DB

return reader;

catch (Exception ex)

MessageBox.Show(ex.Message, "Loading Student Medical history error",


MessageBoxButtons.RetryCancel, MessageBoxIcon.Error);

returnnull;

Department of Computer Science Page 87


Acronym, Abbreviation and Definition

Source code for the Payment class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

using System.Data.SqlClient;

namespace UoGStudentsServiceMangt

publicstaticclassclsPaymentDB

// a method that adds a new payement record to the payment table of the
database

publicstaticint AddnewPaymentRecord(clsPayment payment)

SqlConnection connectionPaymentRecord = clsSSMS.GetConnection();

string insertPaymentStatment = "INSERT INTO


PAYMENT(Amount,DateOfPayment,CodeNO,SSN,Month)
VALUES(@amount,@dataofPayment,@codeNo,@SSn,@month)";

SqlCommand commandInsertPayment = newSqlCommand(insertPaymentStatment,


connectionPaymentRecord);

//add the parameteres

Department of Computer Science Page 88


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

commandInsertPayment.Parameters.AddWithValue("@amount",
payment.Amount);

commandInsertPayment.Parameters.AddWithValue("@dataofPayment",
payment.DateOfPayment);

commandInsertPayment.Parameters.AddWithValue("@codeNo",
payment.CodeNO);

commandInsertPayment.Parameters.AddWithValue("@SSn",
payment.SSN);

commandInsertPayment.Parameters.AddWithValue("@month",payment.Month);

try

connectionPaymentRecord.Open(); // opening a connection to a


database

int a=commandInsertPayment.ExecuteNonQuery(); // execute the command

return a;

catch (SqlException)

MessageBox.Show(ex.Message,"Error",MessageBoxButtons.OK,
MessageBoxIcon.Error);

return 0;

finally { connectionPaymentRecord.Close(); }

// a method that searches a student based on studentID

publicstaticSqlDataReader SearchNonCafeStud(string studID)

SqlConnection connSearchStudByID = clsSSMS.GetConnection();

string statmentSearchNonCafeByID = "SELECT


STUDENT.Fname,STUDENT.Lname,STUDENT.studID,STUDENT.Department,NON_CAFÉ.code
No,Student.Year FROM STUDENT,NON_CAFÉ WHERE STUDENT.studID=@studId and
NON_CAFÉ.studID=@studId";

Department of Computer Science Page 89


Acronym, Abbreviation and Definition

SqlCommand commandSearchNonCafeByID =
newSqlCommand(statmentSearchNonCafeByID, connSearchStudByID);

// pass the parameter

commandSearchNonCafeByID.Parameters.AddWithValue("@studId",
studID);

try

connSearchStudByID.Open(); // open a connection to execute

SqlDataReader reader= commandSearchNonCafeByID.ExecuteReader();

return reader;

catch (Exception ex) { MessageBox.Show(ex.Message, "Searching Error",


MessageBoxButtons.OK, MessageBoxIcon.Error); }

returnnull;

// a method that Load all noncafe students that donot take Cost

publicstaticSqlDataReader FindAllDoNotTakeCost()

SqlConnection connNotTakeCost = clsSSMS.GetConnection();

string selectStatment = "SELECT NON_CAFÉ.studID as IDNo,STUDENT.Fname as


First_Name,STUDENT.Lname as
Last_Name,NON_CAFÉ.codeNO,STUDENT.department,student.year FROM
NON_CAFÉ,STUDENT WHERE NOT EXISTS (SELECT codeNo FROM PAYMENT WHERE
NON_CAFÉ.codeNo=PAYMENT.codeNo) and NON_CAFÉ.studID=STUDENT.studID";

SqlCommand commandLoad = newSqlCommand(selectStatment, connNotTakeCost);

try

connNotTakeCost.Open();

SqlDataReader reader = commandLoad.ExecuteReader();

return reader;

catch (Exception ex)

Department of Computer Science Page 90


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

MessageBox.Show("Failed to load all students don't take cost.", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

// a method that finds all students who have take cost

publicstaticSqlDataReader FindAllHaveTakeCost()

SqlConnection connTakeCost = clsSSMS.GetConnection();

string selectAllTakeCost = "SELECT NON_CAFÉ.studID as IDNo,STUDENT.Fname as


First_Name,STUDENT.Lname as
Last_Name,NON_CAFÉ.codeNO,STUDENT.department,student.year FROM
NON_CAFÉ,STUDENT WHERE NOT EXISTS (SELECT codeNo FROM PAYMENT WHERE
NON_CAFÉ.codeNo=PAYMENT.codeNo) and NON_CAFÉ.studID=STUDENT.studID";

SqlCommand
commandAllTakeCost=newSqlCommand(selectAllTakeCost,connTakeCost);

try

connTakeCost.Open();

SqlDataReader reader = commandAllTakeCost.ExecuteReader();

return reader;

catch (Exception EX)

MessageBox.Show("An error occured while searching students who take cost.\r


Try again.","Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

Department of Computer Science Page 91


Acronym, Abbreviation and Definition

// this method checks if a student takes cost sharing

publicstaticbool checkIfStudentTakeCose(clsPayment payment)

bool paid = false;

SqlConnection conn = clsSSMS.GetConnection();

string CheckStatment = "SELECT codeNo,Month FROM PAYMENT WHERE


codeNo=@code AND Month=@month";

SqlCommand commCheckPaid = newSqlCommand(CheckStatment, conn);

commCheckPaid.Parameters.AddWithValue("@code", payment.CodeNO);

commCheckPaid.Parameters.AddWithValue("@month", payment.Month);

try

conn.Open();

SqlDataReader reader = commCheckPaid.ExecuteReader();

if (reader.Read())

paid = true;

return paid;

catch (SqlException)

MessageBox.Show("The operation failed to check if a student is paid. \r Try


again.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);

returntrue;

Department of Computer Science Page 92


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

finally { conn.Close(); }

Source code for the Dorm class

using System;

using System.Collections.Generic;

using System.Windows.Forms;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Data.SqlClient;

namespace UoGStudentsServiceMangt

publicstaticclassclsDormDB

// a method that registers new Block/buldings

publicstaticint AddNewBlock(clsDorm newDorm)

SqlConnection connectionAddnewBlock = clsSSMS.GetConnection();

string AddnewBlockStatment = "INSERT INTO DORM(BlockNo,DormNo,Available)


VALUES(@BlockN0,@DormN0,@available)";

Department of Computer Science Page 93


Acronym, Abbreviation and Definition

SqlCommand sqlCommandAddnewBlock = newSqlCommand(AddnewBlockStatment,


connectionAddnewBlock);

// pass the parameters

sqlCommandAddnewBlock.Parameters.AddWithValue("@BlockN0",
newDorm.BlockNo);

sqlCommandAddnewBlock.Parameters.AddWithValue("@DormN0",
newDorm.DormNo);

sqlCommandAddnewBlock.Parameters.AddWithValue("@available",
newDorm.Available);

try

connectionAddnewBlock.Open();

int RowsAffected= sqlCommandAddnewBlock.ExecuteNonQuery();

return RowsAffected;

catch (SqlException ex)

MessageBox.Show("Bulding Registration failed", "Registration error",


MessageBoxButtons.OK, MessageBoxIcon.Error);

return 0;

finally { connectionAddnewBlock.Close(); }

// a method that searches all the Available Buldings

publicstaticList<string> FindAllBuldings()

SqlConnection connFindAllBulding=clsSSMS.GetConnection();

Department of Computer Science Page 94


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

string SelectAllBulding="SELECT * from DORM";

SqlCommand
commFindAllBulding=newSqlCommand(SelectAllBulding,connFindAllBulding);

try

connFindAllBulding.Open();

SqlDataReader reader=commFindAllBulding.ExecuteReader();

List<string> list = newList<string>();

while(reader.Read())

list.Add(reader[0].ToString());

return list;

catch(Exception ex)

MessageBox.Show("An error occured while loading the available


buldings.","Error",MessageBoxButtons.OK,MessageBoxIcon.Error);

returnnull;

finally {connFindAllBulding.Close();}

publicstaticSqlDataReader FindAvailableDorms()

SqlConnection connAvailableDorm = clsSSMS.GetConnection();

Department of Computer Science Page 95


Acronym, Abbreviation and Definition

string statmentAvailable = "SELECT BlockNo as Block_No,DormNo as


Number_of_Dorm,Available FROM DORM ";

SqlCommand commandAvailable = newSqlCommand(statmentAvailable,


connAvailableDorm);

try

connAvailableDorm.Open();

SqlDataReader reader = commandAvailable.ExecuteReader();

return reader;

catch (Exception)

MessageBox.Show("Unable to load the available dorms. \r Please refresh the


List.", "Search available dorm error", MessageBoxButtons.OK,
MessageBoxIcon.Error);

returnnull;

Source code for the Employee class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Threading.Tasks;

using System.Data.SqlClient;

Department of Computer Science Page 96


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

namespace UoGStudentsServiceMangt

publicstaticclassclsEmployeeDB

publicstaticvoid registerEmployee(clsEmployee employee)

SqlConnection regEmpConnection = clsSSMS.GetConnection();

string insertEmployeeStatment = "INSERT INTO EMPLOYEE(Fname,Lname,SSN)


VALUES(@F_Name,@L_Name,@Ssn)";

SqlCommand insertEmpCommand = newSqlCommand(insertEmployeeStatment,


regEmpConnection);

insertEmpCommand.Parameters.AddWithValue("@F_Name",
employee.FName);

insertEmpCommand.Parameters.AddWithValue("@L_Name",
employee.LName);

insertEmpCommand.Parameters.AddWithValue("@Ssn", employee.SSN);

try

regEmpConnection.Open();

insertEmpCommand.ExecuteNonQuery();

catch (Exception ex)

throw ex;

finally

Department of Computer Science Page 97


Acronym, Abbreviation and Definition

regEmpConnection.Close();

// searches employee by SSN

publicstaticSqlDataReader SearchEmpBySSN(string SSNorName)

SqlConnection connSearchEmp = clsSSMS.GetConnection();

string selectEmp = "SELECT Fname,Lname,SSN FROM EMPLOYEE where SSN=@empssn


";

SqlCommand commandSelectEmp = newSqlCommand(selectEmp, connSearchEmp);

// pass the parameters

commandSelectEmp.Parameters.AddWithValue("@empssn", SSNorName);

try

connSearchEmp.Open(); // open a connection

SqlDataReader reader= commandSelectEmp.ExecuteReader();

return reader;

catch (Exception ex)

MessageBox.Show(ex.Message, "Finding Employee Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

returnnull;

// this method deletes an employee with a specified ssn

Department of Computer Science Page 98


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

publicstaticint DeleteEmployee(clsEmployee empTobeDeledted)

SqlConnection deleteEmpconn = clsSSMS.GetConnection();

string statmentDeleteEmp = "DELETE EMPLOYEE where SSN=@empSSN";

SqlCommand commandDeleteEmp = newSqlCommand(statmentDeleteEmp,


deleteEmpconn);

// pass the parameters

commandDeleteEmp.Parameters.AddWithValue("@empSSN",
empTobeDeledted.SSN);

try

deleteEmpconn.Open(); // open a connection to execute the


command against the database

int rowsAffected= commandDeleteEmp.ExecuteNonQuery();

return rowsAffected;

catch (Exception ex)

MessageBox.Show(ex.Message, "Delete employee error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

return 0;

finally

deleteEmpconn.Close(); //close the connection

// a method that Searches all Employees

publicstaticSqlDataReader LoadAllEmployeeList()

Department of Computer Science Page 99


Acronym, Abbreviation and Definition

SqlConnection LoadAllEmpconn = clsSSMS.GetConnection();

string selectAllEmpStatment = "SELECT SSN,Fname as First_Name,Lname as


Last_Name FROM EMPLOYEE";

SqlCommand loadallEmpcommand =
newSqlCommand(selectAllEmpStatment,LoadAllEmpconn);

try

LoadAllEmpconn.Open(); // open connection to the


database

SqlDataReader reader = loadallEmpcommand.ExecuteReader();

return reader;

catch (Exception ex)

MessageBox.Show(ex.Message, "Employee list loading error",


MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

// a method that update/alter Employee information

publicstaticvoid UpdatEmployee(clsEmployee empUpdate)

try

SqlConnection connUpdateEmp = clsSSMS.GetConnection();

string UpdateStatment = "UPDATE EMPLOYEE SET FNAME=@fname,LNAME=@lname


WHERE SSN=@ssn";

SqlCommand commUpdateEmp = newSqlCommand(UpdateStatment, connUpdateEmp);

Department of Computer Science Page 100


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

// pass the parameteres

commUpdateEmp.Parameters.AddWithValue("@fname",
empUpdate.FName);

commUpdateEmp.Parameters.AddWithValue("@lname",
empUpdate.LName);

commUpdateEmp.Parameters.AddWithValue("@ssn",
empUpdate.SSN);

connUpdateEmp.Open(); // open a connection

commUpdateEmp.ExecuteNonQuery(); // execute the command


against the database

MessageBox.Show("Update completed successfully.!", "Update Employee


information", MessageBoxButtons.OK, MessageBoxIcon.Information);

catch (Exception ex)

MessageBox.Show(ex.Message, "Update Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

Source code for Serving Material class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

Department of Computer Science Page 101


Acronym, Abbreviation and Definition

using System.Windows.Forms;

using System.Data.SqlClient;

namespace UoGStudentsServiceMangt

publicstaticclassclsServingMaterialDB

// This method registers new Serving material records

publicstaticvoid AddNewServingMaterialRecord(clsServingMaterial newRecord)

SqlConnection connectionNewServingMaterialRecord = clsSSMS.GetConnection();

string statmentAddnewServingMaterialRecod = "INSERT INTO


SERVING_MATERIAL(mealCardNo,Cup,Fork) VALUES(@mealCardNo,@cup,@fork)";

SqlCommand commandAddnewServingMaterialRecord =
newSqlCommand(statmentAddnewServingMaterialRecod,
connectionNewServingMaterialRecord);

// pass the patametres

commandAddnewServingMaterialRecord.Parameters.AddWithValue("@cup",
newRecord.Cup);

commandAddnewServingMaterialRecord.Parameters.AddWithValue("@fork",
newRecord.Fork);

commandAddnewServingMaterialRecord.Parameters.AddWithValue("@mealCardNo",
newRecord.MealCardNo);

try

Department of Computer Science Page 102


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

connectionNewServingMaterialRecord.Open(); // open the


connection

commandAddnewServingMaterialRecord.ExecuteNonQuery(); //
execute the command

catch (SqlException ex)

{MessageBox.Show("Failed to register new")

finally { connectionNewServingMaterialRecord.Close(); }

// this method retrives all students that does not take serving material

publicstaticSqlDataReader readerNotTakeServingMat()

SqlConnection connNoTakeServMat = clsSSMS.GetConnection();

string statmentSelect = "SELECT STUDENT.studID AS


IDNo,CAFÉ_STUDENT.mealcardNo as Mealcard_No,STUDENT.Fname AS
First_Name,STUDENT.Lname as Last_Name,STUDENT.Department,STUDENT.Year FROM
STUDENT,CAFÉ_STUDENT WHERE NOT EXISTS (SELECT mealCardNo from
SERVING_MATERIAL where SERVING_MATERIAL.mealCardNo=CAFÉ_STUDENT.mealcardNo)
and CAFÉ_STUDENT.studID=STUDENT.studID";

SqlCommand commandNoTakeSerMat = newSqlCommand(statmentSelect,


connNoTakeServMat);

try

connNoTakeServMat.Open();

SqlDataReader reader= commandNoTakeSerMat.ExecuteReader();

return reader;

catch (Exception ex)

Department of Computer Science Page 103


Acronym, Abbreviation and Definition

MessageBox.Show(ex.Message, "Loading list of student who does not take


serving material ", MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

// a method that finds all the students who take serving material

publicstaticSqlDataReader ListOfStudTakeServingMat()

SqlConnection connTakeServMat = clsSSMS.GetConnection();

string statmentSelect = "SELECT STUDENT.studID AS


IDNo,CAFÉ_STUDENT.mealcardNo as Mealcard_No,STUDENT.Fname AS
First_Name,STUDENT.Lname as Last_Name,STUDENT.Department,STUDENT.Year FROM
STUDENT,CAFÉ_STUDENT WHERE EXISTS (SELECT mealCardNo from SERVING_MATERIAL
where SERVING_MATERIAL.mealCardNo=CAFÉ_STUDENT.mealcardNo) and
CAFÉ_STUDENT.studID=STUDENT.studID";

SqlCommand commandNoTakeSerMat = newSqlCommand(statmentSelect,


connTakeServMat);

try

connTakeServMat.Open();

SqlDataReader reader = commandNoTakeSerMat.ExecuteReader();

return reader;

catch (Exception ex)

MessageBox.Show(ex.Message, "Loading list of student who does not take


serving material ", MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

Department of Computer Science Page 104


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Source code for Employee class

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Windows.Forms;

using System.Threading.Tasks;

using System.Data.SqlClient;

namespace UoGStudentsServiceMangt

publicstaticclassclsEmployeeDB

publicstaticvoid registerEmployee(clsEmployee employee)

SqlConnection regEmpConnection = clsSSMS.GetConnection();

string insertEmployeeStatment = "INSERT INTO EMPLOYEE(Fname,Lname,SSN)


VALUES(@F_Name,@L_Name,@Ssn)";

SqlCommand insertEmpCommand = newSqlCommand(insertEmployeeStatment,


regEmpConnection);

insertEmpCommand.Parameters.AddWithValue("@F_Name",
employee.FName);

Department of Computer Science Page 105


Acronym, Abbreviation and Definition

insertEmpCommand.Parameters.AddWithValue("@L_Name",
employee.LName);

insertEmpCommand.Parameters.AddWithValue("@Ssn", employee.SSN);

try

regEmpConnection.Open();

insertEmpCommand.ExecuteNonQuery();

catch (SqlException)

MessageBox.Show("Employe registration not completed. \try again.", "Error",


MessageBoxButtons.OK, MessageBoxIcon.Error);

finally

regEmpConnection.Close();

// searches employee by SSN

publicstaticSqlDataReader SearchEmp(string SSNorName)

SqlConnection connSearchEmp = clsSSMS.GetConnection();

string selectEmp = "SELECT Fname,Lname,SSN FROM EMPLOYEE where SSN=@empssn


";

SqlCommand commandSelectEmp = newSqlCommand(selectEmp, connSearchEmp);

// pass the parameters

Department of Computer Science Page 106


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

commandSelectEmp.Parameters.AddWithValue("@empssn", SSNorName);

try

connSearchEmp.Open(); // open a connection

SqlDataReader reader= commandSelectEmp.ExecuteReader();

return reader;

catch (Exception ex)

MessageBox.Show(ex.Message, "Finding Employee Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

returnnull;

// this method deletes an employee with a specified ssn

publicstaticint DeleteEmployee(clsEmployee empTobeDeledted)

SqlConnection deleteEmpconn = clsSSMS.GetConnection();

string statmentDeleteEmp = "DELETE EMPLOYEE where SSN=@empSSN";

SqlCommand commandDeleteEmp = newSqlCommand(statmentDeleteEmp,


deleteEmpconn);

// pass the parameters

commandDeleteEmp.Parameters.AddWithValue("@empSSN",
empTobeDeledted.SSN);

try

deleteEmpconn.Open(); // open a connection to execute the


command against the database

int rowsAffected= commandDeleteEmp.ExecuteNonQuery();

Department of Computer Science Page 107


Acronym, Abbreviation and Definition

return rowsAffected;

catch (SqlException)

MessageBox.Show("Delete employee"+empTobeDeledted.SSN+"note completed",


"Delete employee error", MessageBoxButtons.OK, MessageBoxIcon.Error);

return 0;

finally

deleteEmpconn.Close(); //close the connection

// a method that Searches all Employees

publicstaticSqlDataReader SearchEmp()

SqlConnection LoadAllEmpconn = clsSSMS.GetConnection();

string selectAllEmpStatment = "SELECT SSN,Fname as First_Name,Lname as


Last_Name FROM EMPLOYEE";

SqlCommand loadallEmpcommand =
newSqlCommand(selectAllEmpStatment,LoadAllEmpconn);

try

LoadAllEmpconn.Open(); // open connection to the


database

SqlDataReader reader = loadallEmpcommand.ExecuteReader();

return reader;

catch (Exception ex)

Department of Computer Science Page 108


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

MessageBox.Show(ex.Message, "Employee list loading error",


MessageBoxButtons.OK, MessageBoxIcon.Error);

returnnull;

// a method that update/alter Employee information

publicstaticvoid UpdatEmployee(clsEmployee empUpdate)

try

SqlConnection connUpdateEmp = clsSSMS.GetConnection();

string UpdateStatment = "UPDATE EMPLOYEE SET FNAME=@fname,LNAME=@lname


WHERE SSN=@ssn";

SqlCommand commUpdateEmp = newSqlCommand(UpdateStatment, connUpdateEmp);

// pass the parameteres

commUpdateEmp.Parameters.AddWithValue("@fname",
empUpdate.FName);

commUpdateEmp.Parameters.AddWithValue("@lname",
empUpdate.LName);

commUpdateEmp.Parameters.AddWithValue("@ssn",
empUpdate.SSN);

connUpdateEmp.Open(); // open a connection

commUpdateEmp.ExecuteNonQuery(); // execute the command


against the database

MessageBox.Show("Update completed successfully.!", "Update Employee


information", MessageBoxButtons.OK, MessageBoxIcon.Information);

catch (Exception ex)

Department of Computer Science Page 109


Acronym, Abbreviation and Definition

MessageBox.Show(ex.Message, "Update Error", MessageBoxButtons.OK,


MessageBoxIcon.Error);

Screen Shoots and Images

Login form

Figure 4-31 Login form

The MDI parent container Image

Department of Computer Science Page 110


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Figure 4-32 MDI container

The System Administrator form

Figure 4-33 System Administrator form

Department of Computer Science Page 111


Acronym, Abbreviation and Definition

The student administrator Form

Figure 4-34 Student administrator form

the dorm Management Form

Department of Computer Science Page 112


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

Café Management system form

Screen image of the Accountant

Figure 4-35 Student cost payment form

Department of Computer Science Page 113


Acronym, Abbreviation and Definition

Screen image of the Clinical system

Figure 4-36 student clinical form

Department of Computer Science Page 114


STUDENT SERVICE MANAGEMENT SYSTEM FOR ATSE TEWODROS CAMPUS OF UOG

CHAPTER FOUR

5. Recommendation conclusion
The objective of this project is to change the existing manual system to computerize system
in relation with the fulfillments of B.Sc in computer science. The system provides a desktop
application in UoG atse tewodros.

Based on the objective specified earlier in chapter one, relevant information Was gathered
and analyzed with team members also desired data was collected through interview,
questioner& observation. So depending on the above analysis the following conclusions are
drawn:-

 The developed system enables to access the student data from the server.
 One centralized data base server were build for the service given by student
management system.
 The desktop application that developed help user to assign dormitory automatically.

Recommendation

The team that developed this desktop recommended the following points for the
implementation & installment of this project.

 Gondar university should take the purpose of the project seriously and must be
willing to apply the desktop application also make a great effort to realize the
implementation b/c this application solve main problem observed in university of
Gondar.

Department of Computer Science Page 115


Acronym, Abbreviation and Definition

REFERENCE

[1] JhonW.Satzinger,RobertB.Jackson and StepinD.Brud.System Analysis and Design


in the changing World, Kristen Duerr, United states,2000.

[2] P. Kruchten, H. Obbink, J. Sta_ord. The Past, Present and Future of Software

Architecture. IEEE Software, 23(2):22-30, November, 2006.

[3] Bernd Bruegge& Allen H. Dutoit.Object-Oriented Software Engineering

Using UML, Patterns, and Java™ Third Edition, Prentice Hall, United
States,1985

[4] http://programmers.stackexchange.com/questions/215367/functional-
nonfunctional-requirements-vs-design-ideas

Department of Computer Science Page 116

You might also like