Education Management System (EMS)
Education Management System (EMS)
By
Amila Thennakoon
P a g e 1 | 161
ACKNOWLEDGEMENT
I have great pleasure in writing this acknowledgement for completion of BCS Professional
Graduate Diploma project. First of all I thank BCS for offering this valuable opportunity to make
our Educational and career life in higher position.
I wish to express my sincere thanks to my project supervisor Mr. Viraj pinto. With his great
inspiration and support I was able to complete this project very successfully. Also I thanks to all
the members and my friends for supporting me to success this project.
I am also grateful to all the staff and employees of Mr Asela Mallikarathne without his support
and advises completion of this project would have been extremely complicated.
As a learner, I learnt lot of things about the programming fundamentals to advanced technics
mainly through the video tutorials, Books and forums on the Internet. So I take this space to
gratefully thank to all the instructors, authors and Communities for their valuable dedication.
Last but not the least, I would like to thank my family: my parents and my brother for supporting
me success this project and my future.
P a g e 2 | 161
Table of Contents
Chapter 1 Abstract ........................................................................................................................................ 8
1.1 Introduction ........................................................................................................................................ 8
1.2 Current system .................................................................................................................................... 9
1.3 PROPOSED SYSTEM ........................................................................................................................... 12
1.4 SELECTED SOLUTION JUSTIFICATION ................................................................................................ 12
1.5 PROJECT SCOPE ................................................................................................................................. 13
1.6 Project OBJECTIVES/ Deliverables..................................................................................................... 14
1.7 Project Plan ....................................................................................................................................... 15
1.8 Methodological Approach ................................................................................................................ 15
1.9 Unified Modeling Language (UML) ................................................................................................... 17
Chapter 2 REQUIREMENTS ANALYSIS & SPECIFICATION ............................................................................ 18
2.1 INTRODUCTION ................................................................................................................................. 18
2.2 Requirements Gathering ................................................................................................................... 18
2.3 Techniques used for Requirement gathering ................................................................................... 19
2.4 Functional Requirement ................................................................................................................... 20
2.4 Non Functional Requirement ............................................................................................................ 23
2.5 The Proposed System........................................................................................................................ 24
2.6 EXISTING SIMILAR SYSTEMS AND REFERENCES ................................................................................ 25
Chapter 3 DESIGN ....................................................................................................................................... 27
3.1 Introduction ...................................................................................................................................... 27
3.2 Proposed System Design ................................................................................................................... 27
3.2.1 Use Case diagram ........................................................................................................................... 28
3.2.2 Flow Charts .................................................................................................................................... 35
3.2.3 UML Sequence Diagrams ............................................................................................................... 46
3.2.4 UML Activity Diagrams ................................................................................................................... 50
3.2.5 Class Diagram ................................................................................................................................. 55
3.2.6 ERD Diagram .................................................................................................................................. 56
3.3 Database Design & Structure ............................................................................................................ 57
3.4 User Interface Designs ...................................................................................................................... 75
Chapter 4 CODING .................................................................................................................................... 116
4.1 Introduction .................................................................................................................................... 116
4.2 System Coding ................................................................................................................................. 117
P a g e 3 | 161
Chapter 5 Testing ...................................................................................................................................... 126
5.1 Introduction .................................................................................................................................... 126
5.2 Testing methods.............................................................................................................................. 126
5.3 Testing life cycle .............................................................................................................................. 127
5.3.1 Functional testing..................................................................................................................... 127
5.3.2 Unit testing............................................................................................................................... 127
5.4 Test Plan and test cases ...................................................................................................................... 128
5.4.1 Test proofs ............................................................................................................................... 136
Chapter 6 Implementation........................................................................................................................ 148
6.1 Introduction .................................................................................................................................... 148
6.2 Hardware and software Requirements........................................................................................... 149
Chapter 7 Critical Appraisal....................................................................................................................... 151
7.1 Introduction .................................................................................................................................... 151
7.2 SWOT Analysis of the New System ................................................................................................. 152
7. 3 Conclusion ...................................................................................................................................... 154
Appendix ................................................................................................................................................... 155
P a g e 4 | 161
LIST OF FIGURES
P a g e 5 | 161
FIGURE 47 CLASS PAYMENT NEW – SAVE NOTIFICATION ...........................................................................................85
FIGURE 48 CLASS PAYMENT VIEW – SAVE NOTIFICATION ..........................................................................................85
FIGURE 49 CLASS PAYMENT DETAILS ..........................................................................................................................86
FIGURE 50 ADD NEW MODEL PAPER ...........................................................................................................................87
FIGURE 51 MODEL PAPER VIEW ..................................................................................................................................87
FIGURE 52 MODEL PAPER EDIT ...................................................................................................................................88
FIGURE 53 HANDOUTS - NEW .....................................................................................................................................89
FIGURE 54 HANDOUTS - VIEW .....................................................................................................................................89
FIGURE 55 HANDOUTS - EDIT ......................................................................................................................................89
FIGURE 56 STUDENT - NEW .........................................................................................................................................90
FIGURE 57 STUDENT – NEW SYSTEM INFO. PANEL .....................................................................................................90
FIGURE 58 STUDENT – NEW –STUDENT INFO. ............................................................................................................91
FIGURE 59 STUDENT – VIEW WITH EMPTY GRID.........................................................................................................92
FIGURE 60 STUDENT – VIEW WITH DATA ....................................................................................................................92
FIGURE 61 USER – VIEW ..............................................................................................................................................93
FIGURE 62 STUDENT – NEW ........................................................................................................................................94
FIGURE 63 USER – EDIT ................................................................................................................................................95
FIGURE 64 USER – PERMISSION...................................................................................................................................96
FIGURE 65 ATTENDANCE – NEW .................................................................................................................................97
FIGURE 66 ATTENDANCE – NEW – WITH STUDENTS ...................................................................................................98
FIGURE 67 ATTENDANCE – NEW – WITH STUDENTS ...................................................................................................99
FIGURE 68 SUBJECT – VIEW – WITH SUBJECTS ..........................................................................................................100
FIGURE 69 SUBJECT – NEW........................................................................................................................................100
FIGURE 70 LESSONS – VIEW WITH NO RECORDS ......................................................................................................101
FIGURE 71 LESSONS – NEW .......................................................................................................................................101
FIGURE 72 LESSONS – NEW .......................................................................................................................................102
FIGURE 73 LESSONS – NEW .......................................................................................................................................102
FIGURE 74 QUESTION – NEW ....................................................................................................................................103
FIGURE 75 QUESTION – NEW WITHAL PANEL EXPANDED ........................................................................................103
FIGURE 76 QUIZ PAPER – NEW .................................................................................................................................104
FIGURE 77 QUIZ PAPER – CATALOG ..........................................................................................................................105
FIGURE 78 QUIZ PAPER STATISTICS ...........................................................................................................................106
FIGURE 79 ONLINE EXAM PORTAL QUIZ PAPERS ......................................................................................................107
FIGURE 80 ONLINE EXAM PORTAL QUIZ PAPER REGISTRATION ..............................................................................108
FIGURE 81 ONLINE EXAM PORTAL SECURITY KEY - GMAIL........................................................................................108
FIGURE 82 ONLINE EXAM PORTAL QUIZ PAPER SECURITY KEY VERIFY .....................................................................109
FIGURE 83 ONLINE EXAM PORTAL QUIZ PAPER HUMAN OR ROBOT VERIFICATION ................................................109
FIGURE 84 ONLINE EXAM PORTAL QUIZ PAPER TAKE EXAM.....................................................................................110
FIGURE 85 ONLINE EXAM PORTAL QUIZ PAPER TAKE EXAM.....................................................................................110
FIGURE 86 ONLINE EXAM PORTAL QUIZ PAPER ........................................................................................................111
FIGURE 87 ONLINE EXAM PORTAL QUIZ PAPER FINISH CONFIRMATION ..................................................................111
FIGURE 88 QUIZ PAPER RESULTS SHEET – RESULTS SUMMERY TAB .........................................................................112
FIGURE 89 QUIZ PAPER RESULTS SHEET – ANALYZE TAB ..........................................................................................113
FIGURE 90 CRYSTAL REPORT DESIGNER - DESIGN CLASS BARCODE CARD ................................................................114
FIGURE 91 CRYSTAL REPORT DESIGNER - EXECUTE REPORT .....................................................................................114
FIGURE 92 CRYSTAL REPORT DESIGNER - GENERATED CLASS CARDS .......................................................................115
FIGURE 93 SYSTEM ERROR PAGE ...............................................................................................................................115
FIGURE 94 PROJECT TECHNICAL ARCHITECTURE .......................................................................................................116
P a g e 6 | 161
FIGURE 95 TESTING TYPES .........................................................................................................................................126
FIGURE 96 TESTING METHODS ..................................................................................................................................126
FIGURE 97 SERVICE LAYER WITH UNIT TESTING PROJECT .........................................................................................127
FIGURE 98 LOGIN PANEL VALIDATIONS .....................................................................................................................136
FIGURE 99 LOGIN PANEL VALIDATIONS .....................................................................................................................136
FIGURE 100 CLASS ADDED SUCCESSFULLY ................................................................................................................137
FIGURE 101 CLASS ADD CLIENT SIDE VALIDATIONS ..................................................................................................137
FIGURE 102 CLASS NEW RECORD DUPLICATE ..........................................................................................................137
FIGURE 103 CLASS EDIT DATA LOADED .....................................................................................................................138
FIGURE 104 CLASS EDIT DATA UPDATED ...................................................................................................................138
FIGURE 105 CLASS CHARGES VALIDATION ................................................................................................................139
FIGURE 106 CLASS EDIT VALIDATIONS ......................................................................................................................139
FIGURE 107 CLASS CHARGES VALIDATIONS ..............................................................................................................139
FIGURE 108 CHARGES TYPES ADDED NOTIFICATION ................................................................................................140
FIGURE 109 CHARGE TYPE - NEW FIELD VALIDATION ...............................................................................................140
FIGURE 110 CHARGES TYPES EDIT WITH DATA .........................................................................................................141
FIGURE 111 CHARGES TYPES UPDATED NOTIFICATION ............................................................................................141
FIGURE 112 CHARGES TYPE EDIT VALIDATIONS ........................................................................................................142
FIGURE 113 ADD - ATTENDANCE VALIDATION ..........................................................................................................142
FIGURE 114 ADD - ATTENDANCE STUDENT PANEL VALIDATIONS .............................................................................143
FIGURE 115 ENTER A VALID STUDENT NO .................................................................................................................143
FIGURE 116 INVALID STUDENT NO ERROR ................................................................................................................144
FIGURE 117 ADD NEW USER ......................................................................................................................................144
FIGURE 118 QUESTION NEW VALIDATIONS ..............................................................................................................146
FIGURE 119 QUESTION NEW NOTIFICATION .............................................................................................................146
FIGURE 120 ADD QUIZ PAPER NOTIFICATION ...........................................................................................................147
FIGURE 121 AZURE APP SERVICE. TYPES OF APPS CAN HOST ..................................................................................148
FIGURE 122 AZURE HOSTING.....................................................................................................................................149
FIGURE 123 AZURE HARDWARE REQUIREMENTS .....................................................................................................149
FIGURE 124 BARCODE SCANNER ...............................................................................................................................150
P a g e 7 | 161
Chapter 1 Abstract
1.1 Introduction
G.C.E A/L (General Certificate of Education – Advance level) is the qualification and also exam
conducted by ministry of education and department of examinations Sri lanka. Students’ should
study two years in collage to qualify to this exam. The exam conducted in five mainstreams.
There for student should select a field to study and they can sit for the exam.
Mr.Asela is a professional private educator conducting Advance level Economic classes’ .to
improve the learning experience and manage administrative tasks he used some unique
methods manually with help of some other software tools. But he faced lot of issues of those
software tools and techniques’ because of the lack of maturity and inefficiency. In the market
there are no generic software to fulfill his requirements.
According to the above facts he decided to move a bespoke software solution. The proposed
system will convert his all manual works to computerized solution. Beside the admirations
tasks,this web based system provides facilities for measure student’s efficiency.
During period of study time the teacher can get a clear idea about his students’ competency
levels and also student can get better understanding about their current competency level of the
subject lessons.
Other side of this system is it will help students to score better results in real exam by its quizzed
based learning feature .actually the concepts use in this system will affect the students life’s
positively
This system used n- tier architecture .and developed using latest and matured Microsoft ASP.net
MVC platform .used object oriented platform (OOP) and Object Orient Design principles. Further
it consisted with token based authentication system to authorized users access and prevent
unauthorized accessed. To provide high availability and auto scaling facilities this system
optimized to and planned to host on Microsoft azure cloud platform
P a g e 8 | 161
Figure 1 Architecture of proposed system
Currently all of the tasks and processing’s doing by manually .there are several roles who
engaging with this process all of the manual tasks can be segregate in to two major areas
1. Administrative/Operational Tasks
2. Learning Management Tasks
P a g e 9 | 161
1. Administrative Tasks/Operational Tasks
The administrative tasks done by clerical staff works with the teacher. Their tasks can be list
down as below.
P a g e 10 | 161
Figure 3 Tasks of the teacher
After careful observations, I’m identified major weaknesses in current manual process below are
some difficulties exists in the manual system.
P a g e 11 | 161
1.3 PROPOSED SYSTEM
According to above problems he asked me to develop a system for to make easy his tasks, after
careful investigation about his requirements I’m chosen this project as a my BCS PGD project .
This web based “Education Management System “will solve above indicated difficulties and also
give proper picture about educators students, payments and proficiency level of each students
as well.
This system has develop using object orient programming (OOP) and Object Orient Design (OOD)
techniques. Therefor this approaches will help to do maintenance and future enhancements of
this system very efficiently.
The main technologies behind this web based system is Microsoft ASP.NET MVC 5 ,ASP.Net WEB
API , Microsoft SQL Server 2016 and Microsoft IIS Server on Microsoft Azure cloud platform all
these technologies are mature software platforms for developing enterprise level software
solutions .
Cross platform compatibility- the system can be accessed from any platform with
proposed system compatible browser.
Easily managed and update- web based system is deployed in company main server. If
arise any modification of the system that only need to be done in main server. Not to the
individual users level.
Security- Individual user access can be monitored and controlled from the central
location (from the system deployed server).
P a g e 12 | 161
Remote access- web based systems are best suited to remote access. The proposed
system is accessed by departmentally separated users. They can be connected with the
main server through the company local area network (LAN).
This projects developed as three separate solutions those solutions stands for
This web based software includes web based virtual exam facility. Students can navigate
web based portal and practice mock exams. with this facility the educator can publish
MCQ mock exams .students can practice those exams ,this will ensure to give best
learning experience to students and also it’s a valuable feature to the educator to be
highlight among other educators in the area .
P a g e 13 | 161
3. Barcode Card generation tool
A Desktop application can generate student’s barcode cards using premade templates
Microsoft WebAPI based service layer act as a middle layer between data base and front
end. The service developed as a standalone service .the reason is, in the future Mr Asela
(Educator) has an idea to develop a mobile application for this software .therefor it will
be much easy with this standalone REST Full web service .
Another feature of this software solution is the questions bank, normally as an educator he used
to store questions as MS Word files this will make tedious to manage when it became big. But
when moves to computerized question bank it’s become super easy.
Using this question repository the educator can maintain a question bank and also this will used
to web based virtual exam module.
1. Reduce long student queues ,speed up attendance and payment handling process by
using barcoded cards
2. Construct in detailed student database
3. Provides quick reports for visualize system data
4. Facilitate to analysis student progress
5. Control security of the data by using latest authentication technologies
6. Automate students barcode cards generation
P a g e 14 | 161
1.7 Project Plan
A Software prototype is early sample or model .in the prototype development model use if the
customer requirement are unclear or complaex .in this approach initially build small software
prototype give customer to evaluate .after evaluate customer will suggest new features and
show missing requirement .after that developers will rework necessary until an acceptable
prototype is finally achieved, from which the complete system can be developed. At each stage
the prototype 'evolves' towards the final system.
P a g e 15 | 161
Reason to choose Prototype as Development Model:
Generally in this model, developers listen to the customer, design a prototype, and then
test the prototype there for this model gives high user engagement.
The software developer can get feedback from the users/customers’ early in the project.
Very effective paradigm in software engineering
Can use when developers are faced with rapidly changing, unclear, or incomplete
requirements.
P a g e 16 | 161
1.9 Unified Modeling Language (UML)
The Unified Modelling Language (UML) is a general-purpose, developmental, modelling language
in the field of software engineering that is intended to provide a standard way to visualize the
design of a system. This document consists all the diagrams are described proposed system
design accordance to the UML standards.
P a g e 17 | 161
Chapter 2 REQUIREMENTS ANALYSIS & SPECIFICATION
2.1 INTRODUCTION
Gathering requirement is in first place of every software development .in here also the situation
is same before introduced the web based software they are used a manual data entry
techniques .to gather clear picture about the current proses and the requirements I have to get
the cooperation of the employees of the educator’s team
This chapter is written to review the existing system and described the fact gathering techniques
as well as collected functional and non-functional requirements. System analysis is addressed the
problem domain for examining the situation with the motive of improving it through suitable
procedures and methods. In analysis phase main and very difficult part is requirement gathering.
For succeed the difficult part, analyzer has to be studied and understand the current system and
the requirement of the problem domain
As mentioned earlier fact gathering is difficult part and time consuming process in analysis stage.
There are many methods and approaches can be used to find facts. In this requirement analysis
process was followed the most practical and accurate techniques. Requirements were primarily
gathered by interviewing the staff people and educator who is the primary user of existing
system
The whole point of requirement gathering phase is to identify functional and non-functional
requirements’
FUNCTIONAL
REQUIREMENTS
REQUIREMENTS
NON-FUNCTIONAL
REQUIREMENTS
P a g e 18 | 161
2.3 Techniques used for Requirement gathering
User Observations:
Analyzed how users interact with the current manual Process, and participated with them to do
some data entering tasks for identify and gather actual working of the system.
Interviewing:
The existing system most of the tasks are done by individual persons, not a
Common set of users or group. Since that Interviewing process main part has been
Completed trough the unstructured interviews.
Storyboards
Developed Storyboards to validate the requirements between developer and user .this
technique helps to visualize the identify missing requirements and This methods give a "big
picture" approach that very useful in requirements gathering.
Prototyping
This techniques helps a lot to identify and validate user’s requirements .initially this system
developed as a working prototype and hand over it to user .so the users can get exact picture of
the system going to develop .and also used UI prototypes for validate gathered user
requirements.
P a g e 19 | 161
2.4 Functional Requirement
Functional requirement section depict how achieve user requirements which are recognized
from the analysis phase. For the make clear view of the functions those are described under
modular wise. That would be easy of understand proposed system functionalities in design
phase. The modules as follows.
1.0 According to the system owner he currently conducting more than 6 class .therefor the
system should have a facility Add ,Edit and List all the class
2.0 Every class have a type ex: theory class, revision class, group class etc., therefor the
system should have a facility Add ,Edit and List all the class types
3.0 Should have facility to Add, Edit, and List student basic data. (Please see the Sample UI
prototype for student registration image for better understand).
4.0 Facility to Add, Edit, and List Payment types ,there are few payment types such as Full
Payments, Half Payment and Free this types will assign to students
P a g e 20 | 161
2. Student Attendance Module
Student attendance module is responsible for recording attendance of the student, before
starting the class every student should mark there attendance , when mark attendance student
should bring the student ID card ,the ID card is barcoded one and barcode scanners are used in
this process.
1.1 Need to add attendance in multiple points ,this will helps to reduce long student queues
This process also start before starting the class and after the marking attendance .the
student should bring the ID card for marking payment. Payment module is responsible for
record student payments.
4. Report Module
This module is responsible for gathering data collected from other modules and produce
analytical reports .the reports gives decision making capabilities to the user .types of reports
wanted
P a g e 21 | 161
Figure 6 below show sample ID card Templates
Template Sample
Template Sample
P a g e 22 | 161
2.4 Non Functional Requirement
In software engineering software designer is not focused fulfill user requirement only through
the system functionally. The nonfunctional requirement are also very important to system
endurance. The proposed system nonfunctional requirement can be described as below.
Availability and performance: Design and implement the system keep maximum uptime
(amount of time system run) in operational and available for users is very important.
System should be taken minimum time to complete user requested task is depend on the
system performance. The proposed system will be provided both necessity.
Portability and accessibility: The proposed system is totally operated as web based
system. So the system will not be subsisted specific operating system. It can be run
compatible web browsers located in any platform.
Integrity and security: When users interact with the system they are limited to access
whole task and features provided by the system. That process is controlled by users
allowed and denied privileges. User authentication and encrypted login credentials are
securely kept in database level.
Usability: The system is provided user friendly and ease of access interfaces for the users.
As a result user will be able to interact with the system very conveniently.
P a g e 23 | 161
2.5 The Proposed System
Server Environment
1. Azure Appservices
a. The proposed system uses 3 app services for host application
2. Azure storage (blob/file)
P a g e 24 | 161
a. Used as file storage to save documents ,images
3. SQL Server Database
a. Single SQL server Database use as data layer
Client Environment
On client side client should has below hardware or software requirement to run this system
properly
Hardware Requirements
Core i3 or i5 laptop or desktop computer(s)
Barcode scanner
Printer
Laminating machine for cards
Uninterruptable power supply unit (U.P.S)
Wired or wiles internet connection
Software Requirements
Windows O.S (7 or higher)
MS.net Framework 4.5
Crystal report runtime (redistributable package)
Barcode reader software
OTHER REQUIREMENTS
The other requirements of this system is
P a g e 25 | 161
Edu Happy
http://edu-happy.com/
EduHappy is an enterprise school management platform that integrates multiple systems for
School Management, Learning Management and Student Information Management.
OpenSIS
http://www.opensis.com/
OpenSIS is commercial grade open source software, how every users should have technical
knowledge about the system.
P a g e 26 | 161
Chapter 3 DESIGN
3.1 Introduction
System design is the process of defining an architecture, components, modules, interfaces and
data for a system achieve specified requirements. In software engineering system design is the
most important part of whole system development process. Success of most functional and non-
functional requirements which were identified on system analysis phase depend on careful
system design.
1 System Maintenance
1.0 Class Master
2.0 Charges type Master
3.0 Class Payment Master
4.0 User Master
5.0 Student Master
2.0 Reports
P a g e 27 | 161
3.0 Attendance
4.0 Tools
4.1 Card Builder
5.0 Question Bank
5.1 Subjects
5.2 Lessons
5.3 Questions
5.4 Quiz paper
5.5 Quiz paper Catalog
Symbol Description
Actor :person who play a role in the system can perform action in the
system
P a g e 28 | 161
System Boundary: separate system internal environment from external
environment
P a g e 29 | 161
Figure 9 System Use Case Diagram
The above use case diagram shows main functions/tasks done by each user
But teacher has permissions to do those tasks also. If we take a particular task such as
add/edit/view System Master Data, that task consists with 6 sub tasks .before perform any task
in the system the teacher or operator show authenticate them self .only successful logged users
P a g e 30 | 161
can only perform above operations, students can take online test and view there results .these
online test are publically available and no need to be member in this web site .and also any
student should provide their email address and should pass security check (Google REcaptcha)
before take any exam .
System Maintenance
The system maintenance module contains 6 sub modules which contains core system functions.
Figure 10 System Maintenance Use Case
P a g e 31 | 161
Attendance
The Attendance module is responsible for record students’ attendance records. The attendance
process will start before start the classes.
P a g e 32 | 161
User Management and Permissions
Under this module teacher can create new users and can assign permission for those users
P a g e 33 | 161
Web Based Virtual Exams
Students can do any exams publish in the web .first student has to select a exam paper and should
register for the exam .after that they have to pass the security check .if it success they can take the
exam.at the end of the exam student can view the result sheet .in the admin panel the teacher can view
student result sheet and marks also
P a g e 34 | 161
3.2.2 Flow Charts
User Login
P a g e 35 | 161
Master Data Management
Class Master
P a g e 36 | 161
Class Charges types Master
P a g e 37 | 161
Class Charges /Payment
Master
P a g e 38 | 161
Model Paper
P a g e 39 | 161
Handouts
P a g e 40 | 161
Add Student Attendance
P a g e 41 | 161
Add Student
P a g e 42 | 161
Add User
P a g e 43 | 161
Question bank Subjects
P a g e 44 | 161
Lessons
P a g e 45 | 161
3.2.3 UML Sequence Diagrams
User Login
P a g e 46 | 161
Add New Class
P a g e 47 | 161
Class Attendance
P a g e 48 | 161
Online Exam
P a g e 49 | 161
3.2.4 UML Activity Diagrams
User Login
P a g e 50 | 161
Class Master
P a g e 51 | 161
Figure 29 Class master Edit Activity Diagram
P a g e 52 | 161
Class Attendance
P a g e 53 | 161
Online Exam
P a g e 54 | 161
3.2.5 Class Diagram
P a g e 55 | 161
3.2.6 ERD Diagram
P a g e 56 | 161
3.3 Database Design & Structure
Table: - Class Master
P a g e 57 | 161
Table: - ClassPayment Master/ClassPaymentlineItems
P a g e 58 | 161
Table:- Student Master
P a g e 59 | 161
Table :- ModelPaperMaster
P a g e 60 | 161
Table :- HandoutMaster
Table: - Users
P a g e 61 | 161
Table: - Screens
P a g e 62 | 161
Table: - ScreenFunctions
P a g e 63 | 161
P a g e 64 | 161
Table :- UserScreenFunctions
P a g e 65 | 161
Table :- Serial
P a g e 66 | 161
Table: - AttendanceMaster/AttendanceLineItems
P a g e 67 | 161
Table: - SubjectMaster
Table: - LessonsMaster
P a g e 68 | 161
Tble: - QuestionMaster
P a g e 69 | 161
Table:- QuestionMasterAnswers
P a g e 70 | 161
Tble: - QuizImages
Table:- QuizPaperTaken
P a g e 71 | 161
Table:- QuizPaperTakenAnswers
P a g e 72 | 161
Table: - QuizPaperMaster
P a g e 73 | 161
Table:- QuizPaperLineItems
P a g e 74 | 161
3.4 User Interface Designs
In this section describes users interface designs of the application
Login
Before working in the system the system will authenticate the user .this will ensure unauthorized
user access and prevent it .if user entered a valid username and password the system will show
dashboard screen (Admin panel) to the user and load related menu functions (user permissions )
related to the user
P a g e 75 | 161
Admin Panel (Dashboard)
The Admin panel will show only for successful login process. The center area will used show
summarized information of the system to the user .the left hand side menu shows functionalities
that user can perform. According to user type the menu items of the menu will be visible or
hidden below are the full list of functionalities can perform by this system
System Maintenance
The system maintenance module contains 4 sub modules which contains core system functions
.before design the actual user interfaces .I’m produced U.I prototypes
System Maintenance
o Class master
o Charges Type Master
o Class Payment master
o Student
o Model paper
o Handouts
Attendance
P a g e 76 | 161
o Attendance – New
o Attendance – View
User Master
Reports
Payments
o Payment New
o Payment View
Question Bank
o Subjects
o Lessons
o Questions
o Quiz paper
o Quiz paper Catalog
P a g e 77 | 161
Class Master
This module is responsible for add /edit and view classes of the system.
Class View
If user click class master this the first screen will show to the user.to add new class click on “New
Class” button in the top left.
Class New
P a g e 78 | 161
After fill the new class form user should click “save” button if the save operation success the
system show success notification and class view UI will show with newly added class this will
shows in Figure 37
To add new charge type user should click “new charge type” button. This will open charge type
new UI. As in Figure 39 User should fill form and click save button .the ” is payable “dropdown
box indicate is the charge can be payable ex: if user enter charge type as Free ,the is payable
should be No .
P a g e 79 | 161
Charges Type New
The fig 40 Shows sample charges types loaded in to charges types grid .if user want to edit the
charge type user should click “Edit” link of particular charge type. The system will show particular
charge type in Charges type – Edit UI as Figure 41
P a g e 80 | 161
Figure 41 Charge Type Edit
In the Charge Type - Edit UI user can do any modification and can update that record by click on
save button
This module define payment types and their amounts for a class . such as if we take payment
type “Full Payment” its amount we can define as 1000 Rs .the no of payment types and the
amount of the payment type may different class to class.
The “View – Class Payment” is the main UI panel will show if click on “Class Payment Master
“Menu Item this will shows in figure 42.
P a g e 81 | 161
View - Class Payments
P a g e 82 | 161
To add new payment type for a class user should select “New Class payment” button. This will
show “Class Payment – New ” U.I.
P a g e 83 | 161
Figure 45 Class Payment New – basic Info section
P a g e 84 | 161
Figure 47 Class Payment New – Save notification
The Figure 48 shows success notification after save the new charge type .and after the user
clicks ok the system will redirect to class payment view screen and shows newly added
record .In the payment view screen user can do two main operation
P a g e 85 | 161
1. Edit payment record
2. View Details of a payment record
If user clicks “Detail ”link in the payment view of the particular record .the system will
shows read-only page of the selected class payment. This will shows in Figure 49.
The above user interface shows the summery of the class general information and the
available list of class charges types and their amounts.
P a g e 86 | 161
Model Paper
Model paper - New
This module gives save details about Class model papers .lecture or operator can add /Edit or view
model papers. Figure 50 shows add new model papers user interface.
P a g e 87 | 161
Model Paper – Edit
Figure 54 shows the model paper edit user interface .in this panel user can edit selected
record details. And also user can set status of the record (active or inactive) by status
checkbox.
Handout
P a g e 88 | 161
Figure 53 Handouts - New
Handouts are printed materials, contains short notes about class lectures .the handout
module responsible for add /edit view handout details.
Handout – View
In the view handout user interface shows available handouts .this grid give facility to edit
handouts available in the grid . Figure 55 shows the handouts edit user interface after click
edit link in the handout grid .
Handout – edit
P a g e 89 | 161
Student Master
One of the most important section is add student to the system. Add new user interface
responsible for that operation
Cleary there are two separate sections system info and student info .in the system info
section will select study year ,class name and enter student no .and click search if enter
student no not existing in the system the student info. Panel will enable and expand
P a g e 90 | 161
Figure 58 Student – New –student info.
If user entered data in the both panels ,user can click on save button to save data to the data
base.if everything happened successfully .the system will show success notification and show
student view user interface.
P a g e 91 | 161
Figure 59 Student – View with empty grid
P a g e 92 | 161
The Figure 60 show student view with some student records .these data in the grid will load
according to the selected class,study year,student type and payment type.
User Master
Managing user is one of the critical factor in the system .the user master is responsible for
provide those features to the system. Only teachers of the system given access to this user
interface.to add the user interface user should click New user button. This user interface will
show in Figure 62.
P a g e 93 | 161
Figure 62 Student – New
In the user new user interface can enter the details of the new user. Using type of the user
selection we can specify the new user’s type (Teacher/Operator) .by clicking the save button the
system will create a new user .and users in the system will show in users view grid as Figure 61.
In the user view grid we can edit details of the currently existing users’ .to do that we have to
select a user record and after click on edit link. Figure 63 shows user edit interface with some
data .there we can update the user data and set the status of the user .its mean we can set user
active or inactive .inactive users can’t log in to the system.
P a g e 94 | 161
Figure 63 User – Edit
Next thing we can do In the user grid is change the permissions levels .to change the user
permissions ,select a user from grid and click on “permission” hyper link .it will show user interface
as Figure 64.
In the user permission section we can add permission to users or remove permission from the user
.according to the permissions applied here the visibility of the menu items will change.
P a g e 95 | 161
Figure 64 User – Permission
P a g e 96 | 161
Attendance
In the attendance module used to records students’ class attendances .so the teacher can get
some reports about students’ attendances.
Add- Attendance User interface responsible for add attendance.in the system info panel user
select study year, date and name of the class and load student to student panel grid. It will look
like Figure 66.
P a g e 97 | 161
Figure 66 Attendance – New – With Students
Now operator starting to mark attendance. The operator can type Student No in the textbox
above the grid and can press enter key or click search button. If user found the system will
P a g e 98 | 161
highlight student with blue color bar and show green notification on bottom left and put a mark
in checkbox like Figure 67.
After the complete attendance mark the operator can save whole details by click on save button.
Question bank
This module gives facility to create and maintain a question bank. Before add questions to
Question bank the first this to build the subject list.to do that user should click subject menu
item in the menu.
If click on the subject menu item will show “Subject View” user interface .as in other views ,this
will show currently added subject records as seen on Figure 68.
P a g e 99 | 161
Figure 68 Subject – View – With Subjects
The “New Subject” button will open the Subject- New user interface as in fig xxx.
P a g e 100 | 161
After save the subject it will show in subject view grid .user can edit the subject details by click
on the edit link in the subject grid.
Lessons
Lessons define the section of the particular subject .if we add Subject as Economics, the lesson
will defines the section of the Economics .in the lesson view we can create new lesson and load
lesson according to subject.
The lesson – new user interface contains two sections. First we select the subject details and
second panel define the lessons under that subject. Figure 71 and Figure 72 shows both panels.
P a g e 101 | 161
Figure 72 Lessons – New
P a g e 102 | 161
Questions
Questions are the content of a quiz paper .in this module will define the Question and the
answers related question. Before enter those details user has to select the subject and lesson
details that question relates.
Figure 74 Question –
New
Figure 75 Question
– New withal
panel expanded
P a g e 103 | 161
Quiz Paper
P a g e 104 | 161
Last thing is create question paper. We created our question bank in the previous stages, in the
quiz paper module let the user to create question papers from question bank .these question
papers are will be available in online examination platform. The Figure 76 shows Quiz paper new
user interface this will create new Online Quiz paper.
The created quiz papers will show in under Quiz paper catalog menu item .this will show in
Figure 72.as above Figure 72 each quiz paper has “View Details” button .the teacher can click on
this button and it will show the details of students who take the quiz paper and their marks and
status (pass/fail).this user interface call Quiz Statistics .this will show in Figure 78. A single
student can done same quiz paper many times.
P a g e 105 | 161
Figure 78 Quiz Paper Statistics
Teacher can get better idea about students using this feature.
P a g e 106 | 161
Figure 79 Online Exam portal Quiz papers
In the next screen student has to register to take a Quiz paper .there student should enter email
address
P a g e 107 | 161
Figure 80 Online Exam portal Quiz paper registration
P a g e 108 | 161
Figure 82 Online Exam portal Quiz paper Security key Verify
P a g e 109 | 161
Figure 84 Online Exam portal Quiz paper Take exam
After click on ”Take exam “ button the online exam will start Figure 85 shows the how online
exam looks like
P a g e 110 | 161
Figure 86 Online Exam portal Quiz paper
After click on an answer, system will indicate total complete questions on a progress bar.
Student can finish quiz paper by click on “Finish” button.
After finish the Exam the system will shows the results sheet.in the Figure 88 shows a sample
result sheet for an Econ paper .this contains few tabs
P a g e 111 | 161
1. Results summery (Figure 88)
Under this tab shows explanation of questions and correct answers and marks
gained
2. Analyzing (Figure 89)
Shows analytical view about questions. such as lesson related to questions
question count comes under particular lesson and the student competency level
from each lesson
3. About Teacher
Here teacher will publish teacher’s information and his class details.
P a g e 113 | 161
Barcode Class Card and Report Design
To design barcoded class cards and reports I’m used crystal report designer .using crystal Report
designer can create report very easily and can connect those reports with SQL server Data base.
P a g e 114 | 161
Figure 92 Crystal Report Designer - Generated class cards
The system contains standard error page. This will show situation like if unexpected error
happen or unauthorized access.
P a g e 115 | 161
Chapter 4 CODING
4.1 Introduction
In this section demonstrate the coding structure of the system. This project constructed using
MVC architecture .therefor every feature consists with three sections
1. Model
2. View
3. Controller
Request (JSON)
Business Data
View Model Controller WEB API
Logic Access
Controller
Layer Layer
Response (JSON)
Users
MSSQL Server
P a g e 116 | 161
4.2 System Coding
Function Name :Admin Panel Login
Controller :Home
public class HomeController : BaseController
{
[HttpGet]
public ActionResult Login()
{
return View();
}
[HttpPost]
public ActionResult Login(string email, string password)
{
try
{
string url = "UserPermissions/Userlogin?email=" + email + "&password=" + password;
ConnecterManager connecterManager = new ConnecterManager();
User user = connecterManager.Get<User>(url);
if (user.IsSuccess)
{
Success("Success", true);
Warning(string.Format(ex.Message), true);
}
return View();
}
Address: localhost:2994/home/login
@{
Layout = null;
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=1,initial-scale=1,user-scalable=1" />
P a g e 117 | 161
<link rel="stylesheet" type="text/css" href="~/Content/bootstrap.min.css" />
@*<link rel="stylesheet" type="text/css" href="~/Content/loginPanel/styles.css" />*@
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<style>
body{
margin-top:50px;
}
form {
font: 14px/1.6em Tahoma, Verdana, serif;
color: #3c3c3c;
max-width: 310px;
padding-bottom: 50px;
}
form label {
font-weight: normal;
line-height: 40px;
float: left;
width: 90px;
text-align: right;
padding-right: 20px;
}
form input[type=text],
form input[type=password] {
border: 1px solid #cbcccc;
background: #fff;
box-shadow: none;
width: 220px;
height: 42px;
line-height: 42px;
-webkit-box-shadow: inset 0 1px 2px 0px rgba(104, 104, 104, .2);
-moz-box-shadow: inset 0 1px 2px 0px rgba(104, 104, 104, .2);
box-shadow: inset 0 1px 2px 0px rgba(104, 104, 104, .2);
}
</style>
</head>
<body>
@* img-responsive *@
<div class="container">
<div class="row">
<div class="col-sm-9 ">
<a href="#"><img src="~/Content/loginPanel/webpics.PNG" class="" alt="" /></a>
</div>
<div class="col-sm-3">
P a g e 118 | 161
<div>
<label>Password</label>
<input type="password" autocomplete="off" name="password" required class="form-
control" id="password" />
</div>
</form>
</div>
</div>
</div>
<script src="~/Scripts/jquery-1.10.2.min.js"></script>
<script src="~/Scripts/bootstrap.min.js"></script>
</body>
</html>
Web Service :
public class UserPermissionsController : ApiController
{
[HttpGet]
public WebAPIResponce Userlogin(string email, string password)
{
WebAPIResponce apiResponce = null;
try
{
UserPermissionManager userPermissionManager = new UserPermissionManager();
User user = userPermissionManager.Userlogin(email, password);
}
catch (Exception ex)
{
P a g e 119 | 161
User user = null;
try
{
UserPermissionDataService userPermissionDataservice = new UserPermissionDataService();
user = userPermissionDataservice.GetUserByEmail(email);
if (user != null)
{
string passwordDecrypted = SecurityManager.GetHashedPassword(password);
if (passwordDecrypted.Equals(user.Password))
{
result = true;
user.IsSuccess = true;
}
else
{
result = false;
user.IsSuccess = false;
}
}
}
catch
{
throw;
}
return user;
}
while (dReader.Read())
{
user = FillUser(dReader);
}
P a g e 120 | 161
con.Close();
}
}
return user;
}
catch
{
throw;
}
}
Master Data
View :AddNewClass.chtml
@model AdminPanel.Models.ClassMaster.ClassMasterVM
@{
ViewBag.Title = "AddNew";
Layout = "~/Views/Shared/_Layout.cshtml";
}
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
P a g e 121 | 161
@Html.DropDownListFor(model => model.TypeID, (SelectList)Model.TypeList, "Select Type",
new { @class = "form-control" })
@Html.ValidationMessageFor(model => model.TypeID, "", new { @class = "text-danger" })
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<input type="submit" value="Save" class="btn btn-danger" />
@Html.ActionLink("Back", "ShowAll", "ClassMaster", new { @class = "btn btn-default" })
</div>
</div>
</div>
}
<script src="~/Scripts/jquery-1.10.2.js"></script>
<script src="~/Scripts/jquery.validate.min.js"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.min.js"></script>
<script>
$(document).ready(function () {
});
</script>
Controller
namespace AdminPanel.Controllers
{
public class ClassMasterController : BaseController
{
[HttpGet]
public ActionResult AddNewClass()
{
return View(classMasterVm);
}
P a g e 122 | 161
[HttpPost]
[RESTAuthorizeAttribute]
public ActionResult AddNewClass(ClassMasterVM classMasterVM)
{
try
{
if (ModelState.IsValid)
{
ClassMaster classMaster = new ClassMaster();
classMaster.ClassName = classMasterVM.ClassName;
classMaster.ShortName = classMasterVM.ClassShortCode;
classMaster.Description = classMasterVM.Description;
classMaster.CreatedBy = TempData["UserID"].ToString();
classMaster.ClassTypeCode = classMasterVM.TypeID;
return View(classMasterVM);
}
}
catch (Exception ex)
{
Danger(string.Format(ex.Message), true);
return View(classMasterVM);
}
P a g e 123 | 161
Web Service
namespace MicroEduService.Controllers
{
// MasterData
public class MasterDataController : ApiController
{
//MasterData/NewClass
[HttpPost]
public WebAPIResponce NewClass(ClassMaster classMaster)
{
try
{
MasterDataManager masterDataManager = new MasterDataManager();
bool ressult = masterDataManager.NewClass(classMaster);
return apiresponce;
}
catch (Exception ex)
{
throw ex;
}
}
}
}
namespace MicroEduBusinessLogic.MasterManager
{
public class MasterDataManager
{
try
{
MasterDataService masterDataservice = new MasterDataService();
bool responce = masterDataservice.NewClass(classMaster);
return responce;
}
catch (Exception ex)
{
throw ex;
}
}
P a g e 124 | 161
Data layer
try
{
result = true;
}
catch
{
throw;
}
return result;
P a g e 125 | 161
Chapter 5 Testing
5.1 Introduction
Testing one of the most important step in software development process. The aim of testing is to
find bugs or errors before deliver the system to the customer.
Software Testing
White Box
Testing Testing
Methods Black Box
Testing
Figure 96 Testing Methods
P a g e 126 | 161
The different between above testing methods is we can test the system features by knowing the
internal behavior that’s called white box testing method. Or without knowing the system internal
knowledge called black box testing (like outsider test the system).
P a g e 127 | 161
5.4 Test Plan and test cases
Test case is set of actions used for check particular function of the system
P a g e 128 | 161
Title Add New Class
Pre-conditions User should logged in to the system as operator/teacher
ID Test Scenario Test Steps Test Data Expected Results Actual Test
Results Status
CLM1 Check Add 1. log on to Class Message: Class As Pass
new class web Name:Kandy Added Expected
with Valid application revision Successfully
data 2. Click
master and Type:revision The New Class
select Class Short code: should show in
3. Click Add KDR Class View grid
New Button ( See Fig:98)
4. Enter test
Data
5. Click Save
P a g e 129 | 161
Title Edit Existing Class
Pre-conditions User should logged in to the system as operator/teacher
P a g e 130 | 161
Title Add Charges types
Pre-conditions User should logged in to the system as operator/teacher
P a g e 131 | 161
Title Edit Charges types
Pre-conditions User should logged in to the system as operator/teacher
P a g e 132 | 161
Title Attendance
Pre-conditions User should logged in to the system as operator/teacher
P a g e 134 | 161
Title Create new user (teacher/operator)
Pre-conditions User should logged in to the system as teacher
P a g e 135 | 161
5.4.1 Test proofs
P a g e 136 | 161
Figure 100 Class Added Successfully
P a g e 137 | 161
Figure 103 Class Edit Data loaded
P a g e 138 | 161
Figure 105 Class charges Validation
P a g e 139 | 161
Figure 108 Charges Types Added Notification
P a g e 140 | 161
Figure 110 Charges Types Edit with data
P a g e 141 | 161
Figure 112 Charges Type edit Validations
P a g e 142 | 161
Figure 114 Add - Attendance student panel validations
P a g e 143 | 161
Figure 116 Invalid Student no error
P a g e 144 | 161
P a g e 145 | 161
Figure 118 Question New Validations
P a g e 146 | 161
Figure 120 Add Quiz Paper Notification
P a g e 147 | 161
Chapter 6 Implementation
6.1 Introduction
In this section will demonstrate how to implement this application for practical use .this is a web
application it has 4 major components
1. Admin Panel
2. Exam Portal
3. Web Service
4. Database (MSSQL)
According to the user requirement .we decided to host this applications’ on Microsoft
azure.to host application user should have MS Azure Hosting Account
Azure app services are fully scalable platform can host web site to web service and gives
fully manageable capabilities.
P a g e 148 | 161
Components from 1 to 3 will be host as Azure App Services in azure Cloud Platform
AdminPanel
Operator/Teacher
Azure AppService 2
Exam Portal
MSSQL Server
Database
WEBApi Service
Azure has wide range of feature selections .to host Appsservices I’m selected S1 standard option
as hosting platform configuration. This also call Service plan in azure .so according to project we
have 3 AppServices ,each AppService will run on separate App
service plan .
P a g e 149 | 161
Barcode Scanner
The barcode scanner will used to san student barcoded cards,
it should plug in to client pc
Barcode scanner
for card marking(Motorola/Symbol 3407)
Fig cm3s
Software requirements
1. FileZilla FTP Client
This FTP client Will use to upload Files/images to Appservices
2. Microsoft.NetFramwork 4.5
Class card generation tool need .net framework to run properly
3. Crystal report Runtime
This runtime needs to generate Crystal reports properly
P a g e 150 | 161
Chapter 7 Critical Appraisal
7.1 Introduction
Education Management System automates the traditional learning and teaching practices. Its
gives lot of facilities to teacher to manage his professional tasks and also improve the quality of
the teaching also Student also get big advantages from this system from online examination
portal.
The online exam portal replace traditional exam preparation approach. Score a good mark in
exam is every student’s dream. Past papers and model paper questions are good approach for
score better results in the exams. But sometimes lack of pass papers, model paper questions and
proper explanations students couldn’t get an expected results. Traditional question paper books
couldn’t fulfill those gaps immediately. EMS‘s Exam portal aims to fill these gaps and provides a
batter knowledge and skills assessment service. It will connect student and teachers directly and
also let the student to measure their knowledge levels to themselves.
P a g e 151 | 161
7.2 SWOT Analysis of the New System
In this SWOT analysis will show the Strengths, weakness. Opportunities and Threats of the new
system .the reason to use SWOT analysis is to get comprehensive details about the developed
system.
Strengths of EMS
Web Based Exam Portal
Quiz paper analytical Details
The questions of the quiz paper (target or past paper) should belongs to particular
lesson. This should be mark when the time entering questions, this details will used to
show in the exam report. These information will provide with graphical charts
Student’s Competency level measure
In the result sheet student will get a clear idea about, there competency level in lessons,
What are weak area and what lessons should focus more.
General Features
Can maintain detailed Student Database
The student database is the core of the system .so the teacher can easily get an idea about
class students
Facility to generate Barcoded Student class Cards and speed up Attendance and payment
Handling Process
Barcode cards enable gives valid identification to students’. Those cards contains pictures
also.so it will speed up attendance and payment handling process
Fast Reports Generation Ability
P a g e 152 | 161
Using powerful Crystal reports engine users can generate report instantly!
Weaknesses of EMS
Active and Stable Internet Connect must need
The system host on Mirosoft Azure cloud platform.so client should use active and stable
internet connection.
Hosting cost is high
Currently azure hosting is bit high than the traditional web hosting
Continues development is must
Technology is always changing .to achieve the best performance of the system ,it should use
updated technologies and techniques .
Opportunities of EMS
Can integrate Mobile applications
The system use wASP.net WEBApi technology to connect with web clients .so if teach want
to develop native mobile application client ,those applications can easily connect .
Threats to EMS
Taking data backups are must
The application host on cloud therefor someone should get responsible to get daily backups
Risk of Cyber attacks
Web based systems are usually attack by hackers .so if not use proper security solutions it’s a
big threat
Lessons learnt
How to create real-world projects :
Time management Skills :
Improve analytical Skills
P a g e 153 | 161
How to draw UML Diagrams
Project management Skills
7. 3 Conclusion
Developing professional level Software is a big challenge .lot of engineering and logical concepts
and techniques involve when going develop software. Sometimes it’s a risk to take to develop a
software application, because someone will left there manual works and will depend on that
software.
This system will give answers to faults in manual process .therefor I’m expect the aim of the
develop of the software has fulfill successfully
P a g e 154 | 161
Appendix
Code :
Application Security
Application Security
To authenticate users I’m used token base authenticate system. therefor every action method in
controller should use RESTAuthorizeAttribute action filter
[RESTAuthorizeAttribute]
namespace AdminPanel.Attributes
{
public class RESTAuthorizeAttribute : AuthorizeAttribute
{
if (string.IsNullOrEmpty(token))
{
string authHeader = request.Headers["Authorization"];
// string resultToken = authHeader.Substring("Basic ".Length).Trim();
token = authHeader;
}
if (user.IsSuccess)
{
actionContext.Controller.TempData["Token"] = user.Token;
actionContext.Controller.TempData["UserCompany"] = user.CollegeSerial;
actionContext.Controller.TempData["UserID"] = user.UserId;
return true;
}
else
{
return false;
P a g e 155 | 161
}
}
catch (Exception)
{
actionContext.Result = new RedirectToRouteResult(new RouteValueDictionary(new { controller
= "Index", action = "ShowError" }));
return false;
}
}
}
}
Security Manager
namespace AdminPanel.Attributes
{
public static class SecurityManager
{
private const int _expirationMinutes = 10;
private const string _alg = "HmacSHA256";
private const string _salt = "rz8LuOtFBXphj9WQfvFh"; // Generated at
https://www.random.org/strings
}
}
catch
{
}
return responce;
}
}
}
P a g e 157 | 161
Encrypt/Decrypt Strings
public class EncryptDecrypt
{
//'@'
string key = EncryptionKey.Key;
byte[] EncryptKey = { };
byte[] IV = { 55, 34, 87, 64, 87, 195, 54, 21 };
EncryptKey = System.Text.Encoding.UTF8.GetBytes(key.Substring(0, 8));
DESCryptoServiceProvider des = new DESCryptoServiceProvider();
byte[] inputByte = Encoding.UTF8.GetBytes(queryString);
MemoryStream mStream = new MemoryStream();
CryptoStream cStream = new CryptoStream(mStream, des.CreateEncryptor(EncryptKey,
IV), CryptoStreamMode.Write);
cStream.Write(inputByte, 0, inputByte.Length);
cStream.FlushFinalBlock();
inputByte = Convert.FromBase64String(incoming);
P a g e 158 | 161
MVC To WEPApi Caller
try
{
WebAPIResponce result =
(WebAPIResponce)Newtonsoft.Json.JsonConvert.DeserializeObject(responce, typeof(WebAPIResponce));
if (result.StatusCode == HttpStatusCode.OK)
{
return (T)Newtonsoft.Json.JsonConvert.DeserializeObject(result.Result.ToString(),
typeof(T));
}
else
{
throw new ErrorContainer(result.message);
}
}
catch (Exception)
{
throw;
}
WebAPIResponce result =
(WebAPIResponce)Newtonsoft.Json.JsonConvert.DeserializeObject(responce, typeof(WebAPIResponce));
if (result.StatusCode == HttpStatusCode.OK)
{
return (T)Newtonsoft.Json.JsonConvert.DeserializeObject(result.Result.ToString(),
typeof(T));
}
else
{
throw new ErrorContainer(result.message);
}
}
catch (Exception)
{
throw;
}
}
P a g e 159 | 161
public class Connector
{
public static string HTTP_Method = "GET";
public static string HTTP_Content_Type = "application/json; charset=utf-8";
public static string HTTP_Accept_Type = "application/json";
public static string HTTP_URL =
System.Configuration.ConfigurationManager.AppSettings["WebApiURL"];
return response;
}
catch (Exception ex)
{
throw ex;
}
HTTP_Method = "POST";
HttpWebRequest _request = (HttpWebRequest)WebRequest.Create(branduri);
_request.Method = HTTP_Method;
_request.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET
CLR 2.0.50727)";
_request.ContentType = HTTP_Content_Type;
_request.Accept = HTTP_Accept_Type;
_request.KeepAlive = true;
string postdata = System.Text.Encoding.UTF8.GetString(stream.ToArray());
//_request.ContentLength = postdata.Length;
P a g e 160 | 161
sw.Close();
//
StreamReader sr = new StreamReader(_response.GetResponseStream(), encording,
true, postdata.Length);
P a g e 161 | 161