Você está na página 1de 140

Preface

Page2

MCA | Rohit Kumar Pandey


Preface

The proposed project is a Online appointment Management system that provides


patients or any user an easy way of booking a doctor’s appointment online. This is
a web based application that overcomes the issue of managing and booking
appointments according to user’s choice or demands. The task sometimes
becomes very tedious for the compounder or doctor himself in manually allotting
appointments for the users as per their availability. Hence this project offers an
effective solution where users can view various booking slots available and select
the preferred date and time. The already booked space will be marked yellow and
will not be available for anyone else for the specified time. This system also allows
users to cancel their booking anytime.

The application uses HTML and PHP as a front-end and sql database as the back-
end.

Page3

MCA | Rohit Kumar Pandey


Acknowledgment

Page4

MCA | Rohit Kumar


Pandey
Acknowledgment

I take this opportunity to express our sincere thanks to all who helped me
in successfully completing this project.

First of all, I am thankful to my Parents, brother and my Family for


their love and moral as well as financial support during the completion of
the project.
I have short of words to express my profound gratitude to my Guide
Mr. Shushil Kumar for his timely and continuous help during the
completion of the project synopsis. I am thankful to him for his co-
operation and the time he spent taken out of his busy schedule.

Page5

MCA | Rohit Kumar Pandey


Introduction

Page6

MCA | Rohit Kumar Pandey


INTRODUCTION

Software Solutions is an IT solution provider for a dynamic


environment where study centre and technology strategies converge. Their
approach focuses on new ways of study centre combining IT innovation and
adoption while also leveraging an organization’s current IT assets. Their
work with large global corporations and new products or services and to
implement prudent study centre and technology strategies in today’s
environment.
They understand the importance of timing, of getting there before the
competition. A rich portfolio of reusable, modular frameworks helps jump-
start projects. Tried and tested methodology ensures that we follow a
predictable, low - risk path to achieve results. Our track record is testimony
to complex projects delivered within and evens before schedule.

Page7

MCA | Rohit Kumar Pandey


Objective of Project

Page8

MCA | Rohit Kumar Pandey


OBJECTIVEOF PROJECT
Data preparation and data entry operation depend on people,
because labour costs are high, the cost of preparing and entering data is
also high. Reducing data requirement expense. By reducing input
requirement, the speed of entire process from data capturing to processing
to provide results to users.

❖ Avoiding delay
The processing delay resulting from data preparation or data
entry operations is called bottlenecks. Avoiding bottlenecks should
be one objective of input.

❖ Avoiding errors
Through input validation we control the errors in the input data.

❖ Avoiding extra steps


The designer should avoid the input design that cause extra
steps in processing saving or adding a single step in large number of
transactions saves a lot of processing time or takes more time to
process.

❖ Keeping process simple


If controls are more people may feel difficult in using the
systems. The best designed system fits the people who use it in a way
that is comfortable for them.

❖ Quick search of information.


❖ User-friendly environment.
❖ Significant information for management.

The entire process has been automated using .NET technology to


smoothen the flow of information in a highly secure environment across the
network. The solution has been deployed, tested and validated thoroughly.
While designing the system, care has been taken in efficiency, maintenance
and reusability of the software for the present and future changes in the
system.
Page9

MCA | Rohit Kumar Pandey


Project Category
&Tools/Environment

Page10

MCA | Rohit Kumar Pandey


PROJECT CATEGORY
❖ RDBMS WITH OOPS

The project of Online Appointment Management System is mainly


based on the Data manipulation works. The help of a Study Center
handles the Data handling of any organization, so that this project comes
under the Object– Oriented Programming System (OOPs) that
describes the category of project.
Relational Database Management System
A database management system (DBMS) is a software program that
enables users to create and maintain databases. A DBMS also allows users
to write queries for an individual database to perform required actions
such as retrieving data, modifying data, deleting data, and so forth.
A relational database management system (RDBMS) is a type of
DBMS that stores information in the form of related tables. RDBMS is
based on the relational model.
RDBMS offer various benefits by controlling the following –
 Redundancy: RDBMSs prevent you from having duplicate
copies of the same data, which takes up disk space
unnecessarily.
 Inconsistency: Each redundant set of data may no longer
agree with other sets of the same data. When an RDBMS
removes redundancy, inconsistency cannot occur.
 Data Integrity: Data values stored in the database must satisfy
certain types of consistency constraints.
 Data Atomicity: In event of a failure, data is restored to the
consistent state it existed in prior to the failure. For example,
fund transfer activity must be atomic.
 Access Anomalies: RDBMSs prevent more than one user from
updating the same data simultaneously; such concurrent
updates may result in inconsistent data.
 Data Security: Not every user of the database system should
be able to access all the data. Security refers to the protection
Page11

of data against any unauthorized access.

MCA | Rohit Kumar Pandey


 Transaction Processing: A transaction is a sequence of
database operations that represents a logical unit of work. In
RDBMSs, a transaction either commits all the changes or rolls
back all the actions performed until the point at which the
failure occurred.
 Recovery: Recovery features ensure that data is reorganized
into a consistent state after a transaction fails.
 Storage Management: RDBMSs provide a mechanism for data
storage management. The internal schema defines how data
should be stored.

Object – Oriented Programming


The major objective of object – oriented approach is to eliminate
some of flows encountered in the procedural approach. OOP treats data
as a critical element in the program development and does not allow it
to flow freely around the system. It ties data more closely to functions
that operate on it and protects it from unintentional modification by
other functions.
Object – oriented programming incorporates all of object-based
programming features along with two additional features, namely,
inheritance and dynamic binding.
Object – oriented programming can therefore be characterized by the
following statement–
Object – Based features + Inheritance + Dynamic Binding
Some of the features of object-oriented programming are:
 Emphasis is on data rather than procedure.
 Programs are divided into modules what are known as objects.
 Data structures are designed such that they characterize the objects.
 Methods that operate on the data of an object are tied together in
the data structure.
 Data is hidden and cannot be accessed by external functions.
 Object may communicate with each other through methods.
 New data and methods can be easily added whenever necessary.
Page12

 Follows bottom – up approach in program design.

MCA | Rohit Kumar Pandey


TOOLS/ ENVIRONMENT USED
❖ HARDWARE REQUIREMENT

This project has the following hardware requirements.

1. Core 2 Duoor above


2. 1 GB RAM or above
3. Monitor,
4. 40 GB Hard disks or above
5. Network Card,
6. CD / DVD ROM.
7. Printer
8. Key – Board & Mouse

❖ SOFTWARE REQUIREMENT

Development: Visual Studio 2010


Language: C#. Net (Front End Tool)

Data base: SQL Server 2008 (Back End Tool)

Platform: Windows 7 or above


Page13

MCA | Rohit Kumar Pandey


DETAIL ABOUT TOOLS & LANGUAGE, WHICH ARE TO BE USED

C# .NET (Front End)

SQL SERVER 2008 (Back End)

JUSTIFICATION

G.U.I. is much easier and convenient method for interaction with


computers, compared to command (Writing long character sequences)
based system.
Page14

MCA | Rohit Kumar Pandey


Platform &
Language

Page15

MCA | Rohit Kumar Pandey


WINDOWS 7 OR LATER VERSIONS
Windows designed their operating systems to be more powerful and
easy to use.

1. EASIER TO USE:
With Windows OS, you have faster access to information, and
you are able to accomplish tasks more quickly and easily.

➢ Work with files.


➢ Find information.
➢ Personalize your computing environment.
➢ Work on the Window.
➢ Work remotely.

2. EASIER TO MANAGE:
You and your network administrators can work more efficiently
now, because many of the most common computer-
management tasks are automated and streamlined with
Windows all versions will be easier to:

➢ Set up.
➢ Administer.
➢ Supports
Page16

MCA | Rohit Kumar Pandey


C# .NET

C# (pronounced see sharp ) is a multi-paradigm programming


language encompassing imperative, declarative, functional, generic, object –
oriented (class – based), andcomponent – orientedprogrammingdisciplines.

It was developed by Microsoft within the .NET initiative and later


approved as a standard by Ecma (ECMA-334) and ISO (ISO/IEC 23270). C#
is one of the programming languages designed for the Common Language
Infrastructure.

C# is intended to be a simple, modern, general-purpose, object-


oriented programming language. Its development team is led by Anders
Hejlsberg. The most recent version is C# 4.0, which was released on April
12, 2010.

SQL SERVER 2008

SQL Server is a most popular relational database management system


these days following are some of the main characteristics of SQL Server.

The SQL server model eliminates all parent child relationships and
instead represented all data in the database as simple row/columns table of
data values.

❖ A relation is similar to table rows/columns of data value. The rows of


a table are referred to as attributes several tulles of equal length
place one below the other create a table.

❖ Each table is an independent entity and these are no physical


relationship between tables.

❖ Relational model of data management is based on set theory built – in


query language is designed in the RDBMS, so that it can manipulate
set of data.
Page17

MCA | Rohit Kumar Pandey


VISUAL STUDIO 2010

For Development Environment we choose visual studio 2010 which


is best GUI based Editor Environment for C# and also supports SQL server.
Microsoft Visual Studio is an integrated development
environment(IDE) from Microsoft. It can be used to develop console and
graphical user interface applications along with Windows Forms
applications, websites, web applications, and web services in both native
code together with managed code for all platforms supported
by Microsoft Windows, Windows Mobile, Windows CE, .NET Framework,
.NET Compact Framework and Microsoft Silver Light.

Visual Studio includes a code editor supporting IntelliSense as well as


code refactoring. The integrated debugger works both as a source-level
debugger and a machine-level debugger. Other built-in tools include a forms
designer for building GUI applications, web designer, class designer, and
database schema designer. It accepts plug-ins that enhance the functionality
at almost every level—including adding support for source-control systems
(like Subversion and Visual SourceSafe) and adding new toolsets like
editors and visual designers for domain-specific languages or toolsets for
other aspects of the software development lifecycle (like the Team
Foundation Server client: Team Explorer).

Visual Studio supports different programming languages by means of


language services, which allow the code editor and debugger to support (to
varying degrees) nearly any programming language, provided a language-
specific service exists. Built-in languages include C/C++ (via Visual
C++), VB.NET (via Visual Basic .NET), C# (via Visual C#), and F# (as of Visual
Studio 2010). Support for other languages such as M, Python,
and Ruby among others is available via language services installed
separately. It also supports XML/XSLT, HTML/XHTML, JavaScript and CSS.
Individual language-specific versions of Visual Studio also exist which
provide more limited language services to the user: Microsoft Visual Basic,
Visual J#, Visual C#, and Visual C++.
Page18

MCA | Rohit Kumar Pandey


Cost Estimation of
the Project

Page19

MCA | Rohit Kumar


Pandey
COST ESTIMATION OF THE PROJECT
HARDWARE
ITEMS COST
Intel Motherboard (DG41PR) + Processor (Core 2 Duo) 10000
LED Monitor 3000
Hard disk 3000
RAM 1200
Cabinet with SMPS 2000
Multimedia Keyboard & Mouse 500
Printer (HP LaserJet M1005) 12500
Total PC Cost 32200
SOFTWARE
INSTALLATION SOFTWARE CHARGE
MS – Windows OS (Windows 7 Ultimate) 700
MS SQL Server 2008 400
MS Visual Studio 2010 350
Total 1450
OPERATIONAL COST
ITEM COST
Cartridge (One Set Per Month) 700
Paper (Minimum 500 X 4 Sheets) 160
Total 760
MAINTENANCE
Maintenance Cost Per Month on PC (Excluding any accessories,
1200
if required)
Total 1200
TOTAL ONE TIME COST
ITEMS COST
PC 32200
Installation 14500
Total 46700
TOTAL PER MONTH COST
ITEMS COST
Operational cost 760
Maintenance 1200
Total 1960
Page20

MCA | Rohit Kumar Pandey


System Analysis

Page21

MCA | Rohit Kumar Pandey


SYSTEM ANALYSIS

Building computer-based information system needs a careful analysis


and design before implementation. Detailed study to understand the
information requirement forms the major component of the analysis.
Providing a system that would meet the information requirement in an
efficient manner is the subjects of information system design. With the
increased availability of new products and services ever-improving price
performance ratio, such analysis and design become far more challenging.

The newer products and services provides new ways of daring


business as well, While the conventional analysis of information system
requirement may indicate some possible alternatives, an alert analyst who
is abreast of current and emerging developments in information
technology, may propose entirely new systems.

Such exercises known as business "re – engineering" are the by –


products of good systems analysis and design, it should be clearly
understood that good systems analysis is not merely efficient way of getting
computers to do what has been done manually for years. Such more
mechanization fall short of the real objectives of good systems design,
particularly these days when Information Technology is moving leaps and
bounds.

In this stage a statement of the problem is formulated and a model is


built by the analyst in encouraging real-world situation. This phase shows
the important properties associated with the situation. Actually, the
analysis model is a concise, precise abstraction and agreement on how the
desired system must be developed. You can say that, here the objective is to
provide a model that can be understood and criticized by any application
experts in the area whether the expert is a programmer or not.
Page22

MCA | Rohit Kumar Pandey


Preliminary
Investigation

Page23

MCA | Rohit Kumar Pandey


PRELIMINARY INVESTIGATION

The first step in the system development life cycle is the preliminary
investigation to determine the feasibility of the system, the purpose of the
preliminary investigation is to evaluate project request. It is not a design
study nor does it include the collection of details to describe the business
system in all respect. Rather, it is the collecting of information that helps
committee members to evaluate the merits of the project request and make
an informed judgment about the feasibility of the proposed project.
Analysts working on the preliminary investigation should accomplish
the following objectives –
➢ Clarify and understand the project request.
➢ Determine the size of the project.
➢ Assess costs and benefits of alternative approaches.
➢ Determine the technical and operational feasibility of alternative
approaches.
➢ Report the findings to management; with recommendations Outlining
the acceptance or rejection of the proposal.

Page24

MCA | Rohit Kumar Pandey


Feasibility Study

Page25

MCA | Rohit Kumar Pandey


FEASIBILITY STUDY

I conduct the feasibility study in order to check out whether the


software “Online appointment Management System” is feasible or not.
During this phase, I check out for -

ECONOMIC FEASIBILITY
In this study, I concern for the broad range of factors that include cost
– benefit analysis, long term corporate income strategies, impact on other
centers, cost of resources needed for development and potential Centre
growth.

TECHNICAL FEASIBILITY
During the study of this feasibility, I take care of the development
risk, resource availability and technology of the organization and any
improvement if needed for the proper implementation.

LEGAL FEASIBILITY
During this feasibility study, I take care of the originality of the
project and many other type of the legal feasibility like infringement,
liability etc. According to me this is one of the important steps in the
development of the any site.

OPERATIONAL FEASIBILITY
During this phase, I take the concern of the organization about the
bearing of any cost that should be incurred during the execution of the site.
Page26

MCA | Rohit Kumar Pandey


Software
Requirement
Specification

Page27

MCA | Rohit Kumar


Pandey
SOFTWARE REQUIREMENT SPECIFICATION
A Software Requirements Specification is a complete description of
the behavior of the system to be developed. It includes a set of use cases
that describe all the interactions the users will have with the software. Use
cases are also known as functional requirements. In addition to use cases,
the SRS also contains non-functional (or supplementary) requirements.

System/Information
Engineering

Analysis Design Code Test

PROBLEM DEFINITION

Problem is a phrase originally used in social planning to describe a


problem that is difficult or impossible to solve because of incomplete,
contradictory, and changing requirements that are often difficult to
recognize. Moreover, because of complex interdependencies, the effort to
solve one aspect of a wicked problem may reveal or create other problems.
Page28

MCA | Rohit Kumar Pandey


Project Planning

Page29

MCA | Rohit Kumar Pandey


PROJECT PLANNING

Project planning is very important in every aspect of development


work. Good managers carefully monitor developments at various phases.
Improper planning leads to failure of the project.

Software project plan can be viewed as the following:

1. Within the organization: How the project is to be implemented?


What are various constraints (time, cost, and staff)? What is
market strategy?
2. With respect to the customer: Weekly or timely meetings with the
customer with presentations on status reports. Customer
feedback is also taken and further modifications and
developments are done. Project milestones and deliverables are
also presented to the customer.

In this activity the cost of the project is estimated. This includes


money effort, resources and time to build the software. It is done before
creating the software. It is the step of software project planning.

❖ Project complexity

❖ Project size

❖ Degree of structural uncertainty

❖ Availability of historical information


Page30

MCA | Rohit Kumar Pandey


Scheduling

Page31

MCA | Rohit Kumar Pandey


SCHEDULING

Scheduling of a software project can be correlated to prioritising


various tasks (jobs) with respect to their cost, time and duration.
Scheduling can be done with resource constraint or time constraint in
mind. Depending upon the project, scheduling methods can be static or
dynamic in implementation.
A schedule consists of a list of a project's terminal elements with
intended start and finish dates.

❖ The schedule must be constantly (weekly works best) updated.


❖ The EAC value must be equal to the baseline value.
The remaining effort must be appropriately distributed among team
members (taking vacations into consideration).

Page32

MCA | Rohit Kumar Pandey


Gantt Chart

Page33

MCA | Rohit Kumar Pandey


GANTT CHART
A Gantt chart can be developed for the entire project or a separate chart can
be developed for each function. A tabular form is maintained where rows
indicate the tasks with milestones and columns indicate duration
(weeks/months). The horizontal bars that spans across columns indicate
duration of the task. The circles indicate the milestones.

ID TASK PREDECES DURATION MARCH APRIL


TIME S-ORS

1 Start 1 0 days

2 A 1 4 days

3 B 2 10 days
4 C 2 15 days
5 D 3, 4 20 days
6 E 4 25 days
7 F 5 30 days

8 G 6 50 days
9 Finish 7, 8 0 days
Page34

MCA | Rohit Kumar Pandey


Pert Chart

Page35

MCA | Rohit Kumar Pandey


PERT CHART
Program Evaluation Review Technique: Mainly used for high-risk
projects with various estimation parameters. For each module in a project,
duration is estimated as follows:
1. Time taken to complete a project or module under normal
conditions, tnormal
2. Time taken to complete a project or module with minimum time
(all resources available), tmin.
3. Time taken to complete a project or module with maximum time
(resource constraints), tmax.
4. Time taken to complete a project from previous related history,
Thistory.
An average of tnormal, tmin, tmax and thistory is taken depending
upon the project. Sometimes, various weights are added as 2 *tnormal, 3
*tmin, 0.9*tmax and 4 *thistory to estimate the time for a project or
module. Parameter fixing is done by the project manager.

40

T=1wk F T=3w
C
k
T=3wk
T=3w T=2wk
10 20 50
A D

B E
T=4wk T=2wk
Page36

30

MCA | Rohit Kumar Pandey


Scope of the
Solution

Page37

MCA | Rohit Kumar Pandey


SCOPE OF THE SOLUTION

The proposed computer – based system can be used by different


Hospitals other than Online Appointment Management System with slight
change. The proposed system also can be used in any Hospital of India with
some modification.

The Online Appointment management system provides facility to A


hospital that provides health care appointment facility through an online
portal. You can book an OPD appointment of a Doctor at the time s/he is
available in the hospital. You can also book for an Appointment for a
Diagnostic Test. In order to do so, a patient first needs to register for the
website. Registration process involves recording patient name, address,
blood group, past medical history including height, weight, blood pressure,
past diseases, allergies, current medications, etc. All these information is
shown to the doctor at the time of visit of the patient. This system will
enable the Hospital to reduce complexity of management of appointment
of a Doctor or for a Diagnostic Test.

This system can be further enhanced for connecting all the resource
of Online Appointment Management System by doing petty changes. The
proposed system can be further enhanced to include different modules of
Resource like Hospital.
Page38

MCA | Rohit Kumar Pandey


Prototyping Model

Page39

MCA | Rohit Kumar Pandey


Prototyping Model
In this model, a working model of actual software is developed initially.
The prototype is just like a sample software having lesser functional
capabilities and low reliability and it does not undergo through the rigorous
testing phase. Developing a working prototype in the first phase overcomes
the disadvantage of the waterfall model where the reporting about serious
errors is possible only after completion of software development.
The working prototype is given to the customer for operation. The
customer, after its use, gives the feedback. Analysing the feedback given by
the customer, the developer refines, adds the requirements and prepares
the final specification document. Once the prototype becomes operational,
the actual product is developed using the normal waterfall model.
The prototype model has the following features:
➢ It helps in determining user requirements more deeply.
➢ At the time of actual product development, the customer feedback
is available.
➢ It does consider any types of risks at the initial level.
Feedback

Start Quick Plan Quick Design Develop prototype Deliver to customer

Prototyping Model
Page40

MCA | Rohit Kumar Pandey


Menu for GUI

Page41

MCA | Rohit Kumar Pandey


Menu for GUI

Admin
❖ Doctor Management
❖ Patients Management
❖ Appointments Management

Doctor
❖ Patient List with their problems
❖ Appointments Management

Patients
❖ Doctor List with their category
❖ Appointment Management

Exit

Page42

MCA | Rohit Kumar Pandey


Description of
Modules

Page43

MCA | Rohit Kumar Pandey


Description of Modules

Login
➢ It provides a frame to login to the Online Appointment
Management System.
➢ When fill user – id and password to login, it checks true or false. If
false, it generates message for fill valid user-id and password.
➢ After providing the user-id and password they get access to its main
frame.

Admin
➢ Add Doctors
❖ Save Doctors detail
❖ Update Doctors detail
❖ Delete Doctors detail
❖ Search Doctors detail

➢ View the Patients and Appointment detail


❖ Patients Name
❖ Patient’s Disease
❖ Appointment Detail

Patient
➢ Fill all the detail
❖ Save Patient detail
❖ Update Patient detail
❖ Delete Patient detail
❖ Search Patient detail Page44

MCA | Rohit Kumar Pandey


➢ Choose the Doctor
❖ Search Doctors detail by Department.
❖ Find the empty time and date for Appointment.

➢ Display Appointment List


❖ Search Appointment record by different option.

Doctor
➢ Fill all the Doctor detail
❖ Save Doctor detail
❖ Update Doctor detail
❖ Delete Doctor detail
❖ Search Doctor detail

➢ Display Patient list


❖ Search patient record by different option.

➢ Display Appointment detail.


❖ Search allotted appointment record by different option.

Exit

Page45

MCA | Rohit Kumar Pandey


DATA FLOW
DIAGRAM

Page46

MCA | Rohit Kumar Pandey


DATA FLOW DIAGRAM
A data flow diagram is graphical tool used to describe and analyze
movement of data through a system. These are the central tool and the
basis from which the other components are developed.

The Data Flow Diagram shows the flow of data. It is generally made of
symbols given below

❖ A square shows the Entity.


❖ A circle shows the process.
❖ An open-Ended Rectangle shows the data store
❖ An arrow shows the data flow.
❖ The DFD can be up to several levels. The 0 level DFD states the flow of
data in the system as seen from the outward in each module.
❖ The first level DFD show more detail, about the single process of
the 0 level DFD.
❖ The second levelDFD can show even more details and so on.

0 LEVEL DFD (Normal Process)

Administrator

Patient

Doctor
Online
Appointment Treatment
Management
System
Appointments
Page47

MCA | Rohit Kumar Pandey


1 LEVEL DFD (Appointment)

Programme Add
Appointment Add Appoinrment_
Detail Appointment
Programme Detail
1.0

1 LEVEL DFD (Course)

Course Add
Add Course
Course Course Course_Detail
Detail 2.0

1 LEVEL DFD (Student)

Add
Student Student Student Add Student Student_Detail
Detail
3.0
Page48

MCA | Rohit Kumar


Pandey
1 LEVEL DFD (Teacher)

Add
Teacher
Teacher Teacher Add Teacher Teacher_Detail
Detail
4.0

1 LEVEL DFD (Assigment)

Assignment Add
Assignment
Add Assignment_
Assignment Detail Assignment Detail
5.0

1 LEVEL DFD (Result)

Result Add
Result Add Result
Detail Result Result_Detail
6.0
Page49

MCA | Rohit Kumar


Pandey
2 LEVEL DFD (Programme)

Programme Save
Programme Save Programme_
Detail Programme
Programme Detail
1.0.0

Update
Programme Update Programme_
1.0.1 Programme Detail

Delete
Programme Delete Programme_
Programme Detail
1.0.2

Search
Programme Search Programme_
Programme Detail
1.0.3

Page50

MCA | Rohit Kumar


Pandey
2 LEVEL DFD (Course)

Course Save
Save Course
Course Course Course_Detail
Detail 2.0.0

Update
Course Update Course Course_Detail
2.0.1

Delete
Delete Course
Course Course_Detail
2.0.2

Search
Course Search Course Course_Detail
2.0.3

Page51

MCA | Rohit Kumar


Pandey
2 LEVEL DFD (Student)

Save
Student Student Student Save Student Student_Detail
Detail
3.0.0

Update
Student Update Student Student_Detail
3.0.1

Delete
Delete Student
Student Student_Detail
3.0.2

Search
Student Search Student Student_Detail
3.0.3
Page52

MCA | Rohit Kumar


Pandey
2 LEVEL DFD (Teacher)

Save
Teacher Teacher Save Teacher
Teacher Teacher_Detail
Detail 4.0.0

Update
Update
Teacher Teacher_Detail Teacher
4.0.1

Delete Delete Teacher


Teacher_Detail
Teacher
4.0.2

Search Search Teacher Teacher_Detail


Teacher
4.0.3
Page53

MCA | Rohit Kumar


Pandey
2 LEVEL DFD (Assignment)

Assignment Save
Assignment Assignment
Save Assignment_
Detail
5.0.0
Assignment Detail

Update
Assignment Update Assignment_
5.0.1 Assignment Detail

Delete
Assignment Delete Assignment_
5.0.2
Assignment Detail

Search
Assignment Search Assignment_
5.0.3
Assignment Detail

Allot
Assignment Allot Assignment_
5.0.4
Assignment Allot
Page54

MCA | Rohit Kumar


Pandey
2 LEVEL DFD (Result)

Result Save
Save Result
Result Result Result_Detail
Detail 6.0.0

Update
Update Result
Result Result_Detail
6.0.1

Delete
Result Delete Result Result_Detail
6.0.2

Search
Result Search Result Result_Detail
6.0.3
Page55

MCA | Rohit Kumar


Pandey
Entity –
Relationship
Diagram

Page56

MCA | Rohit Kumar


Pandey
Entity – Relationship Diagram

Entity-relationship (E-R) diagram is detailed logical representation of


data for an organisation. It is data-oriented model of a system whereas DFD
is a process-oriented model. The ER diagram represent data at rest while
DFD tracks the motion of data. ERD does not provide any information
regarding functionality of data. It has three main components – data
entities, their relationships and their associated attributes.

➢ Entity
➢ Attribute
➢ Relationship

Entity
It is most elementary thing of an organisation about which data is to
be maintained. Every entity has unique identity. It is represented by
rectangular box with the name of entity written inside.

Attributes
Attribute is a property or characteristic of an entity that is of interest
to the organisation. It is represented by oval shaped box with name of
attribute written inside it.

Relationship
Entities are connected to each other by relationships. It indicates how
two entities are associated. A diamond notation with name of relationship
represents as written inside. Entity types that participate in relationship is
called degree of relationship. It can be one to one (or unary), one to many
or many to many
Page57

MCA | Rohit Kumar


Pandey
E – R Diagram

Stu_ID
Tchr_ID

Stu _Name Student


Tchr
_Name

Tchr_Addre Stu_Address
Teacher 1
Course_I Stu _Contact

Tchr_Contac Course
1 Has
Course_Name

Stu_Name
Has Stu_ID
Programm
e Session
Stu_ID
Result_I Stu_Name 1 Course_ID
Semester
M
M Programme
Tchr_ID
M M
Has
Result Assignment

Couse_Code Course_Name

Status
Course

Submit_Dat
Assignme

Practical

Theory

Viva

Date
Page58

MCA | Rohit Kumar


Pandey
Class Diagram

Page59

MCA | Rohit Kumar


Pandey
CLASS DIAGRAM
A class diagram is used to support functional requirement of system. In a
static design view, the class diagram is used to model the vocabulary of the
system, simple collaboration, and logical schema. It contains sets of classes,
interfaces, collaborations, dependency and generalization and association
relationship.

Page60

MCA | Rohit Kumar


Pandey
Database Design

Page61

MCA | Rohit Kumar


Pandey
Database Design
Database design is the process of producing a detailed data model of
a database. This logical data model contains all the needed logical and
physical design choices and physical storage parameters needed to
generate a design in a data definition language, which can then be used to
create a database.

Student_Detail Programme_Detail
Enroll_ID varchar(10) Code varchar(50)
Name varchar(MAX) Name varchar(MAX)
Birthdate date
Gender varchar(6)
Marital_Status varchar(10)
Course
Gaurdian_Name varchar(MAX) Code varchar(50)
Husband_Name varchar(MAX) Name varchar(MAX)
Address varchar(MAX) Programme varchar(50)
State varchar(20) Semester varchar(MAX)
Pincode varchar(6)
Contact varchar(13) Course_Detail
Email varchar(MAX)
Programme_Code varchar(50) S_No int
Qualification varchar(50) Enroll_ID varchar(10)
Course_Code varchar(50)

Student_Image Qulification_Detail
Enroll_ID varchar(10) S_No varchar(50)
Photo image Qualification varchar(50)
Signature image
User_Detail Table
User_Id varchar(50)
User_Type varchar(MAX)
User_Name varchar(MAX)
Page62

Password varchar(MAX)

MCA | Rohit Kumar Pandey


Semester_Detail Teacher_Detail
S_No varchar(50) Teacher_Code varchar(50)
Enroll_ID varchar(10) Name varchar(MAX)
Programme_Code varchar(50) Birthdate date
Semester varchar(MAX) Gender varchar(6)
Session varchar(MAX) Marital_Status varchar(10)
Gaurdian_Name varchar(MAX)
Husband_Name varchar(MAX)
Teacher_Image Address varchar(MAX)
State varchar(20)
Teacher_Code varchar(50) Pincode varchar(6)
Photo image Contact varchar(13)
Signature image Email varchar(MAX)
Qualification varchar(MAX)
Specilization varchar(MAX)
Assignment_Submission

S_No int Alloted_Assignment


Session_Year varchar(50)
Course_Code varchar(50)
S_N varchar(50)
Enroll_ID varchar(10)
Ref_No varchar(50)
Submission_Date date
Techer_No varchar(50)
Enroll_No varchar(10)
Date date

Result_Detail
S_N varchar(50)
Teacher_Code varchar(50) S_No int
Programme_Code varchar(50) Enroll_ID varchar(10)
Semester varchar(MAX) Course_ID varchar(50)
Assignment_Code varchar(50) Assign_Max varchar(3)
Session varchar(50) Assign_Obtn varchar(3)
Copy varchar(50) Theory_Max varchar(3)
Duration varchar(50) Theory_Obtn varchar(3)
Status varchar(MAX) Pract_Max varchar(3)
Date Date Pract_Obtn varchar(3)
Viva_Max varchar(3)
3Page6

Viva_Obtn varchar(3)
Date date

MCA | Rohit Kumar


Pandey
Data Dictionary

Page64

MCA | Rohit Kumar


Pandey
Data Dictionary
A data dictionary is a collection of descriptions of the data objects or
items in a data model for the benefit of programmers and others who need
to refer to them. A first step in analyzing a system of objects with which
users interact is to identify each object and its relationship to other objects.

FIELD IN THE FORM FIELD IN THE DATA


TABLE TYPE/SIZE
Login Form
txtUsrID User_ID varchar(50)
txtPsswrd Password varchar(8)
Programme & Course Management
txtCode Code varchar(50)
txtName Name varchar(max)
Course
txtCode Code varchar(50)
txtName Name varchar(max)
cmbProgramme Programme varchar(50)
cmbSemester Semester varchar(max)
User Management
txtUserId UserId varchar(50)
cmbUserType UserType varchar(max)
txtName UserName varchar(max)
txtPassword Password varchar(8)
Qualification Panel
txtQualification Qualification varchar(50)
Student Management
txtEnrollment Enrollment varchar(9)
txtName Name varchar(max)
dtpDoB Birthdate Date
rbSingle & rbMarried MaritalStatus varchar(max)
Page65

rbMale & rbFemale Gender varchar(max)

MCA | Rohit Kumar Pandey


txtCarer Father / Husband varchar(max)
txtAddress Address varchar(max)
cmbState State Varchar(20)
txtPinCode PinCode varchar(max)
txtContact Contact varchar(10)
txtEmail Email varchar(max)
cmbProgramme Programme varchar(50)
cmbQualification Qualification varchar(50)
pbPhoto Photo image
pbSign Sign image
Semester Management
txtSemmester Semester varchar(50)
Teacher Management
txtName Name varchar(max)
dtpDoB Birthdate Date
rbSingle & rbMarried MaritalStatus varchar(max)
rbMale & rbFemale Gender varchar(max)
txtCarer Father / Husband varchar(max)
txtAddress Address varchar(max)
cmbState State Varchar(20)
txtPinCode PinCode varchar(max)
txtContact Contact varchar(10)
txtEmail Email varchar(max)
cmbQualification Qualification varchar(50)
clbSpecilization Specilization varchar(max)
pbPhoto Photo image
pbSign Sign image
Assignment Submission
lblID EnrollmentID varchar(9)
lblSession Session varchar(max)
dgvAssignmentList(CodeColumn) AssignmentCode varchar(50)
System Date SubmissionDate date
Assignment Bundle Allot
txtTchrCode TeacherCode varchar(50)
cmbProgramme Programme varchar(50)
cmbSemester Semester varchar(50)
cmbAssignment AssignmentCode varchar(50)
lblSession Session varchar(50)
Page66

txtCopy Copy varchar(2)

MCA | Rohit Kumar Pandey


txtDays Duration varchar(3)
txtStatus Status varchar(max)
Result Entry
lblID Enrollment varchar(9)
cmbCourse Couese varchar(50)
txtMax AssignMax varchar(3)
Assignment
txtObtn AssignObtn varchar(3)
txtMax PractMax varchar(3)
Practical
txtObtn PractObtn varchar(3)
txtMax TheoryMax varchar(3)
Theory
txtObtn TheoryObtn varchar(3)
txtMax VivaMax varchar(3)
Viva
txtObtn VivaObtn varchar(3)
System Date Date date

Page67

MCA | Rohit Kumar


Pandey
Input Design

Page68

MCA | Rohit Kumar


Pandey
INPUT DESIGN
Input design is a part of overall system design. The main objective
during the input design is as given below:

➢ To produce a cost-effective method of input.


➢ To achieve the highest possible level of accuracy.
➢ To ensure that the input is acceptable and understood by the user.

INPUT STAGES

The main input stages can be listed as below:


➢ Data recording
➢ Data transcription
➢ Data conversion
➢ Data verification
➢ Data control
➢ Data transmission
➢ Data validation
➢ Data correction

INPUT TYPES

It is necessary to determine the various types of inputs. Inputs can be


categorized as follows:
➢ External inputs, which are prime inputs for the system.
➢ Internal inputs, which are user communications with the system.
➢ Operational, which are computer department’s communications to
the system?
➢ Interactive, which are inputs entered during a dialogue.

INPUT MEDIA

At this stage choice has to be made about the input media. To conclude
about the input media consideration has to be given to:
➢ Type of input
➢ Flexibility of format
Page69

➢ Speed

MCA | Rohit Kumar Pandey


➢ Accuracy
➢ Verification methods
➢ Rejection rates
➢ Ease of correction
➢ Storage and handling requirements
➢ Security
➢ Easy to use
➢ Portability

Keeping in view the above description of the input types and input
media, it can be said that most of the inputs are of the form of internal and
interactive. AsInput data is to be the directly keyed in by the user, the
keyboard can be considered to be the most suitable input device.

ERROR AVOIDANCE

At this stage care is to be taken to ensure that input data remains


accurate form the stage at which it is recorded up to the stage in which the
data is accepted by the system. This can be achieved only by means of
careful control each time the data is handled.

ERROR DETECTION

Even though every effort is make to avoid the occurrence of errors,


still a small proportion of errors is always likely to occur, these types of
errors can be discovered by using validations to check the input data.

DATA VALIDATION

Procedures are designed to detect errors in data at a lower level of


detail. Data validations have been included in the system in almost every area
where there is a possibility for the user to commit errors. The system will not
accept invalid data. Whenever an invalid data is keyed in, the system
immediately prompts the user and the user has to again key in the data and
the system will accept the data only if the data is correct. Validations have
been included where necessary. The system is designed to be a user friendly
Page70

MCA | Rohit Kumar Pandey


one. In other words, the system has been designed to communicate
effectively with the user.

USER INTERFACE DESIGN

It is essential to consult the system users and discuss their needs


while designing the user interface:

USER INTERFACE SYSTEMS CAN BE BROADLY CLASIFIED AS

1. User initiated interface the user is in charge, controlling the progress


of the user/computer dialogue. In the computer-initiated interface,
the computer selects the next stage in the interaction.
2. Computer initiated interfaces

In the computer-initiated interfaces the computer guides the progress of


the user/computer dialogue. Information is displayed and the user
response of the computer takes action or displays further information.

USER_INITIATED INTERGFACES

User initiated interfaces fall into two approximate classes:


1. Command driven interfaces: In this type of interface the user inputs
commands or queries which are interpreted by the computer.
2. Forms oriented interface: The user calls up an image of the form to
his/her screen and fills in the form. The forms-oriented interface is
chosen because it is the best choice.

COMPUTER-INITIATED INTERFACES

The following computer – initiated interfaces were used:


1. The menu system for the user is presented with a list of alternatives
and the user chooses one; of alternatives.
2. Questions – answer type dialog system where the computer asks
question and takes action based on the basis of the users reply.

Right from the start the system is going to be menu driven, the opening
menu displays the available options. Choosing one option gives another
Page71

MCA | Rohit Kumar Pandey


popup menu with more options. In this way every option leads the users to
data entry form where the user can key in the data.

ERROR MESSAGE DESIGN

The design of error messages is an important part of the user


interface design. As user is bound to commit some errors or other while
designing a system the system should be designed to be helpful by
providing the user with information regarding the error he/she has
committed. This application must be able to produce output at different
modules for different inputs.

PERFORMANCE REQUIREMENTS

Performance is measured in terms of the output provided by the


application. Requirement specification plays an important part in the
analysis of a system. Only when the requirement specifications are properly
given, it is possible to design a system, which will fit into required
environment. It rests largely in the part of the users of the existing system
to give the requirement specifications because they are the people who
finally use the system. This is because the requirements have to be known
during the initial stages so that the system can be designed according to
those requirements. It is very difficult to change the system once it has
been designed and on the other hand designing a system, which does not
cater to the requirements of the user, is of no use.

The requirement specification for any system can be broadly stated as


given below:
➢ The system should be able to interface with the existing system
➢ The system should be accurate
➢ The system should be better than the existing system

The existing system is completely dependent on the user to perform all


the duties.
Page72

MCA | Rohit Kumar


Pandey
Output Design

Page73

MCA | Rohit Kumar


Pandey
OUTPUT DESIGN

Outputs from computer systems are required primarily to communicate


the results of processing to users. They are also used to provide a
permanent copy of the results for later consultation. The various types of
outputs in general are:

➢ External Outputs, whose destination is outside the organization.


➢ Internal Outputs whose destination is within organization and they
are the User’s main interface with the computer.
➢ Operational outputs whose use is purely with in the computer
department.
➢ Interface outputs, which involve the user in communicating directly
with the computer.

OUTPUT DEFINITION

The outputs should be defined in terms of the following points:

➢ Type of the output


➢ Content of the output
➢ Format of the output
➢ Location of the output
➢ Frequency of the output
➢ Volume of the output
➢ Sequence of the output

It is not always desirable to print or display data as it is held on a


computer. It should be decided as which form of the output is the most
suitable.
For Example
➢ Will decimal points need to be inserted?
➢ Should leading zeros be suppressed.
Page74

MCA | Rohit Kumar


Pandey
Output Media

In the next stage it is to be decided that which medium is the most


appropriate for the output. The main considerations when deciding about
the output media are:

➢ The suitability for the device to the particular application.


➢ The need for a hard copy.
➢ The response time required.
➢ The location of the users
➢ The software and hardware available.

Keeping in view the above description the project is to have outputs


mainly coming under the category of internal outputs. The main outputs
desired according to the requirement specification are:
The outputs were needed to be generated as a hot copy and as well as
queries to be viewed on the screen. Keeping in view these outputs, the
format for the output is taken from the outputs, which are currently being
obtained after manual processing. The standard printer is to be used as
output media for hard copies.

Page75

MCA | Rohit Kumar


Pandey
Testing &
Validation

Page76

MCA | Rohit Kumar


Pandey
TESTING & VALIDATION

Testing means executing a program in order to understand its


behaviour, that is, whether or not the program exhibits a failure, its
response time or throughput for certain data sets, its mean time to failure,
or the speed and accuracy with which users complete their designated
tasks. In other words, it is a process of operating a system or component
under specified conditions, observing or recording the results, and making
an evaluation of some aspect of the system or component. Testing can also
be described as part of the process of Validation and Verification.

Validation

Validation is the process of evaluating a system or component during


or at the end of the development process to determine if it satisfies the
requirements of the system, or, in other words, are we building the correct
system?

Verification

Verification is the process of evaluating a system or component at the


end of a phase to determine if it satisfies the conditions imposed at the
start of that phase, or, in other words, are we building the system correctly?
Software testing gives an important set of methods that can be used
to evaluate and assure that a program or system meets its non-functional
requirements.
Page77

MCA | Rohit Kumar


Pandey
To be more specific, software testing means that executing a program
or its components in order to assure:
❖ The correctness of software with respect to requirements or
intent;
❖ The performance of software under various conditions;
❖ The robustness of software, that is, its ability to handle
erroneous inputs and unanticipated conditions;
❖ The usability of software under various conditions;
❖ The reliability, availability, survivability or other dependability
measures of software;
❖ Install ability and other facets of a software release
The purpose of testing is to show that the program has errors. The
aim of most testing methods is to systematically and actively locate faults in
the program and repair them. Debugging is the next stage of testing.
Debugging is the activity of:
❖ Determining the exact nature and location of the suspected
error within the program and fixing the error.
❖ Usually, debugging begins with some indication of the existence
of an error.
The purpose of debugging is to locate errors and fix them.
Testing phase is one of the important phase in between development
and implementation phase. I perform the testing by following two testing
strategies.
They are:
➢ Code Testing
➢ Specification Testing
During the code testing, I check out the execution of each and every
statement of PHP and checkout the path of the program and forms. During
the specification testing, I check out the execution of the program by
Page78

MCA | Rohit Kumar Pandey


inputting some values as a test data and verify whether it satisfy the
requirement or not.
I perform
➢ Unit Testing and
➢ Integration Testing
During the Unit testing phase, I have performed the testing for each
and every individual form (design and coding). I most important thing that
I have observed in the form is the use of proper data type or not.
I perform the test so as to make maximum coverage and maximum
error detection. So, during unit testing I make use of the White-Box testing
technique.
During the Integration testing, I have linked every form with the
required form, and check out for the proper working. I also ensure in this
step that whether forms are linked in correct manner or not. In this testing
phase, verification as well as program construction can be done. So, during
this phase I make use of the Black-Box testing technique.

Page79

MCA | Rohit Kumar


Pandey
Implementation

Page80

MCA | Rohit Kumar


Pandey
IMPLEMENTATION

IMPLEMENTATION METHODOLOGY
A product software implementation method is a systematically
structured approach to effectively integrate the software based service or
component into the workflow of an organizational structure or an
individual end – user.

COMPONENTS

❖ Transactional database
❖ Business intelligence system
❖ Customizable reporting
❖ Document management
❖ Workflow management
Implementation phase is basically comprising of three steps. They are:
➢ Implementation
➢ User’s Training
➢ Post-Implementation (Maintenance Phase)

IMPLEMENTATION
During the implementation phase, the software is installed at the site
of the customer and all the required documents and user manual is handed
over to the concerned authority. The main task of the shop owner is
installed the software and make it ready for use.
Page81

MCA | Rohit Kumar


Pandey
TRAINING USERS
During this phase, training should be given to the users who are
going to use the software. The users are basically of two types: System
operator and various other users to be going to assist the main user. In
order to give training, the personals, any one of the following methods can
be adopted. They are:
➢ In-service training
➢ In-house training
In study centre owner site, study centre owner adds new
programmes, course, users, teachers, students and result. In study centre
owner site, it updates student information, programme, course and update
assignment & result status.

POST IMPLEMENTATION
After the implementation and proper update to the user, a review is
conducted to determine whether the system is meeting expectations or new
type of improvement is required (this is post implementation phase). A post
implementation review measures the system’s performance against pre-
defined requirement and actual costs exceed initial estimates or not. It also
provides information whether major re-design or modification is required
or not.

IMPLEMENTATION OF SECURITY

During this stage we have to check that an authorized user (employee or


admin) is using the client software. For that we have given the username and
password to use the product. If person is new, with the help of registration
module he/she can also make his login id and use the software.
Page82

MCA | Rohit Kumar


Pandey
Future Scope

Page83

MCA | Rohit Kumar


Pandey
FUTURE SCOPE

The proposed computer-based system can be used by different


Resource study centre other than Assignment Submission & Result
Management System with slight change. The proposed system also can be
used all study center of India with some modification.

❖ The study centre software provides facility to generate result,


manage assignment submit, a lot bundle of assignment for
evalueating to teacher.
❖ This system will enable the study centre to reduce complexity
of management of assignment submission and result.
❖ This system can be further enhanced for connecting all the
resource of Assignment Submission & Result Management
System by doing petty changes.
❖ The proposed system can be further enhanced to include
different modules of Resource like study center maintenance.
Page84

MCA | Rohit Kumar


Pandey
Screen Shot

Page85

MCA | Rohit Kumar


Pandey
Login Form

Page86

MCA | Rohit Kumar


Pandey
Main Form

Page87

MCA | Rohit Kumar


Pandey
Programme & Course Management Form

Page88

MCA | Rohit Kumar


Pandey
User Management Form

Page89

MCA | Rohit Kumar


Pandey
Student Management Form

Page90

MCA | Rohit Kumar


Pandey
Semester Management Form

Page91

MCA | Rohit Kumar


Pandey
Teacher Management Form

Page92

MCA | Rohit Kumar


Pandey
Assignment Submission Form

Page93

MCA | Rohit Kumar


Pandey
Assignment Bundle Allot Form

Page94

MCA | Rohit Kumar


Pandey
Result Entry Form

Page95

MCA | Rohit Kumar


Pandey
Coding

Page96

MCA | Rohit Kumar


Pandey
Login
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Assignment_Submission_RMS
{
public partial class frmLogin : Form
{
public frmLogin()
{
InitializeComponent();
}

private void btnCancel_Click(object sender, EventArgs e)


{
Application.Exit();
Application.ExitThread();
}

private void btnLogin_Click(object sender, EventArgs e)


{
Program.dstTbl = Secret_DB_File.SearchRecord("User_Detail", "WHERE
User_ID = '" + txtUserId.Text + "' AND Password = '" + txtPassword.Text + "'");
Close();
}

private void txtUserId_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtPassword;
}

private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
{
btnLogin_Click(sender, e);
Close();
}
}

private void frmLogin_Load(object sender, EventArgs e)


{
lblerrMsg.Text = Program.logInMsg;
Page97

ActiveControl = txtUserId;
}

MCA | Rohit Kumar Pandey


public string UserIDentity
{
get
{
return txtUserId.Text;
}
}

public string UserPass


{
get
{
return txtPassword.Text;
}
}
}
}

Page98

MCA | Rohit Kumar


Pandey
Main Form
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Assignment_Submission_RMS
{
public partial class frmMain : Form
{
private frmLogin flog;
public frmMain()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)


{
Secret_Front_File.SetScreen(this);
CenterToScreen();
lbltitle.Text = "Assignment Submission && Result Management System";
}

private void btnExit_Click(object sender, EventArgs e)


{
Application.ExitThread();
Application.Exit();
}

private void btnMinimize_Click(object sender, EventArgs e)


{
WindowState = FormWindowState.Minimized;
}

private void btnStudent_Click(object sender, EventArgs e)


{
Secret_Front_File.OpenForm(new frmStudent(), pnlWork);
}

private void btnAssign_Click(object sender, EventArgs e)


{
Secret_Front_File.OpenForm(new frmAssignment(), pnlWork);
}

private void btnTeacher_Click(object sender, EventArgs e)


{
Secret_Front_File.OpenForm(new frmTeacher(), pnlWork);
}
Page99

private void btnAdmin_Click(object sender, EventArgs e)


{

MCA | Rohit Kumar Pandey


Secret_Front_File.OpenForm(new frmAdmin(), pnlWork);
}

private void frmMain_Shown(object sender, EventArgs e)


{
pnlWork.Controls.Clear();
flog = new frmLogin();
Secret_Front_File.OpenDialog(flog);
try
{
if (Program.dstTbl.Tables[0].Rows.Count > 0)
{

Program.count = 1;
Program.logInMsg = "";
}
else
{
Program.count++;
if (Program.count < 4)
{
if (flog.UserIDentity == "" || flog.UserPass == "")
Program.logInMsg = "Please! Fill User ID and
Password.";
else if (Program.dstTbl.Tables[0].Rows.Count == 0)
Program.logInMsg = "You have entered wrong User ID or
Password!";
frmMain_Shown(sender, e);
}
else
{
Program.logInMsg = "";
Secret_Front_File.OpenDialog(new frmMessage());
}
}
}
catch
{
MessageBox.Show("Server connection fail.\nPlease check server
system.\nMay be server is unavailabe on this network right now.\nPlease turn on the
sever.", "Server Connection", MessageBoxButtons.OK, MessageBoxIcon.Warning);
Application.Exit();
Application.ExitThread();
}
}
}
}
Page100

MCA | Rohit Kumar


Pandey
Programme, Course & User Management
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Assignment_Submission_RMS
{
public partial class frmAdmin : Form
{
string rb;
bool flg;

public frmAdmin()
{
InitializeComponent();
}

private void rbProgramme_CheckedChanged(object sender, EventArgs e)


{
if (rbProgramme.Checked == true)
{
lblEntryTitle.Text = "Programme Entry Box";
lblListTitle.Text = "Programme List Box";
label6.Text = "Programme Code :";
label7.Text = "Programme Name :";
cmbProgramme.Visible = cmbSem.Visible = label33.Visible =
label34.Visible = label39.Visible = rbSSem.Enabled = rbSProgramme.Enabled = false;
btnReset.Location = new Point(331, 204);
bntCreate.Location = new Point(438, 204);
Secret_DB_File.Display(dgvData, "Programme_Detail", "ORDER BY
Code");
}
if (rbCourse.Checked == true)
{
lblEntryTitle.Text = "Course Entry Box";
lblListTitle.Text = "Course List Box";
label6.Text = "Course Code :";
label7.Text = "Course Name :";
Secret_DB_File.FillList(cmbProgramme, "SELECT DISTINCT Code
FROM Programme_Detail ORDER BY Code","Code", "Select Programme");
btnReset.Location = new Point(331, 248); bntCreate.Location
= new Point(438, 248); cmbProgramme.Visible =
cmbSem.Visible = label33.Visible =
label34.Visible = label39.Visible = rbSSem.Enabled = rbSProgramme.Enabled = true;
Secret_DB_File.Display(dgvData, "Course", "");
}
bntCreate.Text = "Save";
Page101

btnReset.Text = "Reset";
btnReset_Click(sender, e);
rbCode.Checked = true;

MCA | Rohit Kumar Pandey


}

private void bntCreate_Click(object sender, EventArgs e)


{
errorProvider_Admin.Clear();
if (rbProgramme.Checked == true)
{
if (txtCode.Text == "")
errorProvider_Admin.SetError(txtCode, "Please enter programme
code.");
if (txtName.Text == "")
errorProvider_Admin.SetError(txtName, "Please enter programme
name.");

if (txtCode.Text == "")
flg = false;
else if (txtName.Text == "")
flg = false;
else
flg = true;
}
if (rbCourse.Checked == true)
{
if (txtCode.Text == "")
errorProvider_Admin.SetError(txtCode, "Please enter course
code.");
if (txtName.Text == "")
errorProvider_Admin.SetError(txtName, "Please enter course
name.");
if (cmbProgramme.Text == "Select Programme")
errorProvider_Admin.SetError(cmbProgramme, "Please select
programme.");
if (cmbSem.Text == "Select Semester")
errorProvider_Admin.SetError(cmbSem, "Please enter programme
semester.");

if (txtCode.Text == "")
flg = false;
else if (txtName.Text == "")
flg = false;
if (cmbProgramme.Text == "Select Programme")
flg = false;
else if (cmbSem.Text == "Select Semester")
flg = false;
else
flg = true;
}
if (flg == true)
{
if (bntCreate.Text == "Save")
{
if (rbProgramme.Checked == true)
Secret_DB_File.Programme_Detail_Insert(txtCode.Text,
txtName.Text);
Page102

if (rbCourse.Checked == true)

MCA | Rohit Kumar Pandey


Secret_DB_File.Course_Insert(txtCode.Text,
txtName.Text, cmbProgramme.Text, cmbSem.Text);
}
if (bntCreate.Text == "Update")
{
if (rbProgramme.Checked == true)
Secret_DB_File.Programme_Detail_Update(txtCode.Text,
txtName.Text);
if (rbCourse.Checked == true)
Secret_DB_File.Course_Update(txtCode.Text, txtName.Text,
cmbProgramme.Text, cmbSem.Text);
}
rbProgramme_CheckedChanged(sender, e);
}
else
{
MessageBox.Show("Please fill all mandatory fields.",
"Mandatory Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
flg = true;
}
}

private void btnReset_Click(object sender, EventArgs e)


{
if (btnReset.Text == "Reset")
{
txtCode.Text = txtName.Text = "";
cmbSem.SelectedIndex = cmbProgramme.SelectedIndex =
0; ActiveControl = txtCode;
}
if (btnReset.Text == "Delete")
{
if (MessageBox.Show("Are you sure to delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
if (rbProgramme.Checked == true)
Secret_DB_File.Programme_Detail_Delete(txtCode.Text);
if (rbCourse.Checked == true)
Secret_DB_File.Course_Delete(txtCode.Text);
}
rbProgramme_CheckedChanged(sender, e);
}
}

private void cmbProgramme_SelectedIndexChanged(object sender, EventArgs e)


{
if (cmbProgramme.Text != "Select Programme")
{
cmbSem.Enabled = true;
}
else
{
cmbSem.Enabled = false;
}
Page103

MCA | Rohit Kumar Pandey


private void txtCode_KeyPress(object sender, KeyPressEventArgs e)
{
if (rbProgramme.Checked == true)
{
Secret_Front_File.OnlyChar(sender, e);
}
if (rbCourse.Checked == true)
{
Secret_Front_File.MinusNumberChar(sender, e);
}
if (e.KeyChar == 13)
ActiveControl = txtName;
}

private void txtName_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
{
if (rbProgramme.Checked == true)
{
bntCreate_Click(sender, e);
}
if (rbCourse.Checked == true)
{
ActiveControl = cmbProgramme;
}
}
}

private void cmbProgramme_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
{
ActiveControl = cmbSem;
}
}

private void cmbSem_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
{
bntCreate_Click(sender, e);
}
}

private void rbCode_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearch, rbCode, rbName, rbSProgramme, rbSSem);
}

private void txtSearch_TextChanged(object sender, EventArgs e)


{
Page104

if (rbCode.Checked == true)
rb = "WHERE Code LIKE '" + txtSearch.Text + "%' ORDER BY Code";

MCA | Rohit Kumar Pandey


if (rbName.Checked == true)
rb = "WHERE Name LIKE '" + txtSearch.Text + "%' ORDER BY Code"; ;
if (rbProgramme.Checked == true)
{
Secret_DB_File.Display(dgvData, "Programme_Detail", rb);
}
if (rbCourse.Checked == true)
{
if (rbSProgramme.Checked == true)
rb = "WHERE Programme LIKE '" + txtSearch.Text + "%' ORDER BY
Code";
if (rbSSem.Checked == true)
rb = "WHERE Semester LIKE '" + txtSearch.Text + "%' ORDER BY
Code";
Secret_DB_File.Display(dgvData, "Course", rb);
}
}

private void dgvData_CellContentClick(object


sender, DataGridViewCellEventArgs e)
{
try
{
if (dgvData.Rows[e.RowIndex].Cells["clmEdit"].ColumnIndex ==
e.ColumnIndex)
{
txtCode.Text =
dgvData.Rows[e.RowIndex].Cells[1].Value.ToString();
txtName.Text =
dgvData.Rows[e.RowIndex].Cells[2].Value.ToString();
if (rbCourse.Checked == true)
{
cmbProgramme.Text =
dgvData.Rows[e.RowIndex].Cells[3].Value.ToString();
cmbSem.Text =
dgvData.Rows[e.RowIndex].Cells[4].Value.ToString();
}
btnReset.Text = "Delete";
bntCreate.Text = "Update";
}
}
catch { }
}

private void tbcAdmin_SelectedIndexChanged(object sender, EventArgs e)


{
if (tbcAdmin.SelectedIndex == 0)
{
rbCode_CheckedChanged(rbCode, e);
rbProgramme_CheckedChanged(sender, e);
}
if (tbcAdmin.SelectedIndex == 1)
{
btnClear_Click(sender, e);
Page105

}
}

MCA | Rohit Kumar Pandey


private void frmAdmin_Load(object sender, EventArgs e)
{
tbcAdmin_SelectedIndexChanged(sender, e);
}

private void chkShwHd_CheckedChanged(object sender, EventArgs e)


{
if (chkShwHd.Checked == true)
{
txtPassword.UseSystemPasswordChar = false;
chkShwHd.Text = "Hide";
}
else
{
txtPassword.UseSystemPasswordChar = true;
chkShwHd.Text = "Show";
}
}

private void btnSave_Click(object sender, EventArgs e)


{
errorProvider_Admin.Clear();
if (txtUserId.Text == "")
errorProvider_Admin.SetError(txtUserId, "Please enter user id.");
if (cbUsrType.Text == "Select")
errorProvider_Admin.SetError(cbUsrType, "Please select user
type.");
if (txtUser.Text == "")
errorProvider_Admin.SetError(txtUser, "Please enter user name.");
if (txtPassword.Text == "")
errorProvider_Admin.SetError(txtPassword, "Please enter user
password.");

if (txtUserId.Text == "")
flg = false;
else if (cbUsrType.Text == "Select")
flg = false;
else if (txtUser.Text == "")
flg = false;
else if (txtPassword.Text == "")
flg = false;
else
flg = true;

if (flg == true)
{
if (btnSave.Text == "Save")
Secret_DB_File.User_Insert(txtUserId.Text, cbUsrType.Text,
txtUser.Text, txtPassword.Text);
if(btnSave.Text=="Update")
Secret_DB_File.User_Update(txtUserId.Text,
cbUsrType.Text, txtUser.Text, txtPassword.Text);
btnClear.Text = "Reset";
Page106

btnClear_Click(sender, e);
}

MCA | Rohit Kumar Pandey


else
{
MessageBox.Show("Please fill all mandatory fields.",
"Mandatory Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
flg = true;
}
}

private void btnClear_Click(object sender, EventArgs e)


{
if (btnClear.Text == "Reset")
{
txtUser.Text = txtUserId.Text = txtPassword.Text = "";
cbUsrType.SelectedIndex = 0; btnClear.Text = "Reset";
btnSave.Text = "Save";
Secret_DB_File.Display(dgvUser, "User_Detail",
""); ActiveControl = txtUserId;
}
if (btnClear.Text == "Delete")
{
if (MessageBox.Show("Are you sure to delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
Secret_DB_File.User_Delete(txtUserId.Text);
}
btnClear.Text = "Reset";
btnClear_Click(sender, e);
}
}

private void rbID_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearchUsr, rbID, rbUser, rbType);
}

private void txtUserId_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = cbUsrType;
}

private void cbUsrType_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtUser;
}

private void txtUser_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtPassword;
}
Page107

MCA | Rohit Kumar Pandey


private void txtPassword_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
btnSave_Click(sender, e);
}

private void dgvUser_CellContentClick(object


sender, DataGridViewCellEventArgs e)
{
try
{
if (dgvUser.Rows[e.RowIndex].Cells["clmEditUsr"].ColumnIndex ==
e.ColumnIndex)
{
txtUserId.Text =
dgvUser.Rows[e.RowIndex].Cells[1].Value.ToString();
cbUsrType.Text =
dgvUser.Rows[e.RowIndex].Cells[2].Value.ToString();
txtUser.Text =
dgvUser.Rows[e.RowIndex].Cells[3].Value.ToString();
txtPassword.Text =
dgvUser.Rows[e.RowIndex].Cells[4].Value.ToString();
btnSave.Text = "Update";
btnClear.Text = "Delete";
}
}
catch { }
}

private void txtSearchUsr_TextChanged(object sender, EventArgs e)


{
if (rbID.Checked == true)
rb = "WHERE User_ID LIKE '" + txtSearchUsr.Text + "%' ORDER BY
User_ID";
if (rbUser.Checked == true)
rb = "WHERE User_Name LIKE '" + txtSearchUsr.Text + "%' ORDER BY
User_ID";
if (rbType.Checked == true)
rb = "WHERE User_Type LIKE '" + txtSearchUsr.Text + "%' ORDER BY
User_ID";
Secret_DB_File.Display(dgvUser, "User_Detail", rb);
}
}
}
Page108

MCA | Rohit Kumar


Pandey
Student & Semester Management
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Assignment_Submission_RMS
{
public partial class frmStudent : Form
{
string gndr, mrtl, hn, fn, rb;
DataSet ds;
int n, cnt;
bool flg;

public frmStudent()
{
InitializeComponent();
}

private void btnPhoto_Click(object sender, EventArgs e)


{
Secret_Front_File.ImageOpen("Attach Student Photo", pbPhoto);
}

private void btnSign_Click(object sender, EventArgs e)


{
Secret_Front_File.ImageOpen("Attach Student Signature", pbSign);
}

private void btnSave_Click(object sender, EventArgs e)


{
errorProvider_Student.Clear();
errorProvider_Student.RightToLeft = true;
if (txtEnroll.Text == "")
errorProvider_Student.SetError(txtEnroll, "Please enter
student enrollment no.");
if (txtName.Text == "")
errorProvider_Student.SetError(txtName, "Please enter student
name.");
if (dtpBirthdate.Value == DateTime.Today)
errorProvider_Student.SetError(dtpBirthdate, "Please enter student
birthdate.");
if (rbSingle.Checked == false && rbMarried.Checked == false)
errorProvider_Student.SetError(pnlMrtl, "Please select student
marital status.");
if (rbMale.Checked == false && rbFemale.Checked == false)
Page109

errorProvider_Student.SetError(pnlGndr, "Please select student


gender.");
if (txtCarer.Text == "")

MCA | Rohit Kumar Pandey


{
if (lblCarer.Text == "Husband Name :")
errorProvider_Student.SetError(txtCarer, "Please enter husband
name.");
else if (lblCarer.Text == "Father Name :")
errorProvider_Student.SetError(txtCarer, "Please enter father
name.");
}
if (txtAddress.Text == "")
errorProvider_Student.SetError(txtAddress, "Please enter student
current address.");
if (txtContact.Text == "")
errorProvider_Student.SetError(txtContact, "Please enter student
contact no.");
if (cmbProgramme.Text == "Select Programme")
errorProvider_Student.SetError(cmbProgramme, "Please select
programme which student is applied.");
if (cmbQualification.Text == "Select Qualification")
errorProvider_Student.SetError(cmbQualification, "Please select
student qualification.");

if (txtEnroll.Text == "")
flg = false;
else if (txtName.Text == "")
flg = false;
else if (dtpBirthdate.Value == DateTime.Today)
flg = false;
else if (rbSingle.Checked == false && rbMarried.Checked == false)
flg = false;
else if (rbMale.Checked == false && rbFemale.Checked == false)
flg = false;
else if (txtCarer.Text == "")
flg = false;
else if (txtAddress.Text == "")
flg = false;
else if (txtContact.Text == "")
flg = false;
else if (cmbProgramme.Text == "Select Programme")
flg = false;
else if (cmbQualification.Text == "Select Qualification")
flg = false;
else
flg = true;

if (flg == true)
{
if (lblCarer.Text == "Husband Name :")
{
hn = txtCarer.Text;
fn = "";
}
else if (lblCarer.Text == "Father Name :")
{
fn = txtCarer.Text;
Page110

hn = "";
}

MCA | Rohit Kumar Pandey


try
{
if (btnSave.Text == "Save")
{
ds = Secret_DB_File.SearchRecord("Course", "WHERE
Programme= '" + cmbProgramme.Text + "' AND Semester = 'I SEM.' ORDER BY Code");
if (ds.Tables[0].Rows.Count > 1)
{
Secret_DB_File.Student_Detail_Insert(txtEnroll.Text,
txtName.Text, dtpBirthdate.Value.ToString("MM/dd/yyyy",
CultureInfo.InvariantCulture), gndr, mrtl, fn, hn, txtAddress.Text,
cmbState.Text, txtPin.Text, txtContact.Text, txtEmail.Text, cmbProgramme.Text,
cmbQualification.Text);

Secret_DB_File.Semester_Insert(Secret_DB_File.Unique_Number("SELECT S_No
FROM Semester_Detail ORDER BY CAST(S_No AS INT) DESC", "S_No"),
txtEnroll.Text, cmbProgramme.Text, "I SEM.", Program.strSession());
for (n = 0; n < ds.Tables[0].Rows.Count; n++)

Secret_DB_File.Course_Detail_Insert(Secret_DB_File.Unique_Number("SELECT S_No FROM


Course_Detail ORDER BY S_No DESC", "S_No"), txtEnroll.Text, ds.Tables[0].Rows[n]
["Code"].ToString());
Secret_DB_File.Student_Image_Insert(txtEnroll.Text,
pbPhoto, pbSign);
}
else
MessageBox.Show("Programme or Course not
created.\nFirst create programmme & course.\nThen fill student detail", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (btnSave.Text == "Update")
{
Secret_DB_File.Student_Detail_Update(txtEnroll.Text,
txtName.Text, dtpBirthdate.Value.ToString("MM/dd/yyyy",
CultureInfo.InvariantCulture), gndr, mrtl, fn, hn, txtAddress.Text,
cmbState.Text, txtPin.Text, txtContact.Text, txtEmail.Text, cmbProgramme.Text,
cmbQualification.Text);
Secret_DB_File.Student_Image_Update(txtEnroll.Text,
pbPhoto, pbSign);
}
}
catch
{
MessageBox.Show("Something is missing.", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
btnReset_Click(sender, e);
}
else
{
MessageBox.Show("Please fill all mandatory fields.",
"Mandatory Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
flg = true;
Page111

}
}

MCA | Rohit Kumar Pandey


private void btnReset_Click(object sender, EventArgs e)
{
if (btnReset.Text == "Reset")
{
txtEnroll.Text = txtName.Text = txtCarer.Text = txtAddress.Text
= txtPin.Text = txtEmail.Text = txtContact.Text = txtSearch.Text = "";
dtpBirthdate.Value = DateTime.Today;
rbSingle.Checked = rbMarried.Checked = rbFemale.Checked
= rbMale.Checked = false;
txtAge.Text = "0";
txtEmail.Text = "NA";
cmbState.SelectedIndex = cmbProgramme.SelectedIndex = 0;
pbPhoto.Image = Properties.Resources.photo;
pbSign.Image = Properties.Resources.Signature;
Secret_DB_File.Display(dgvData, "vwStudent", "ORDER BY
Enroll_ID");
txtEnroll.ReadOnly = false;
btnSave.Text = "Save";
btnReset.Text = "Reset";
Secret_DB_File.FillList(cmbProgramme, "SELECT DISTINCT Code
FROM Programme_Detail ORDER BY Code", "Code", "Select Programme");
Secret_DB_File.FillList(cmbQualification, "SELECT
Qualification FROM Qualification_Detail ORDER BY Qualification",
"Qualification", "Select Qualification");
ActiveControl = txtEnroll;
}
else if (btnReset.Text == "Delete")
{
if (MessageBox.Show("Are you sure to delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
Secret_DB_File.Student_Detail_Delete(txtEnroll.Text);
Secret_DB_File.Student_Image_Delete(txtEnroll.Text);
MessageBox.Show("1 Student record deleted successfully!",
"Student Deletion Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
MessageBox.Show("Any other record is being
connected it.\nSo this record can not be deleted", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
btnReset.Text = "Reset";
btnReset_Click(sender, e);
}
}
}

private void dtpBirthdate_ValueChanged(object sender, EventArgs e)


{
Page112

txtAge.Text = Secret_Front_File.urAge(dtpBirthdate);
}

MCA | Rohit Kumar Pandey


private void tbcStudent_SelectedIndexChanged(object sender, EventArgs e)
{
if (tbcStudent.SelectedIndex == 0)
{
rbEnroll_CheckedChanged(rbEnroll, e);
btnReset_Click(sender, e);
}
if (tbcStudent.SelectedIndex == 1)
{
btnCourseReset_Click(sender, e);
}
if (tbcStudent.SelectedIndex == 2)
{
Secret_DB_File.Display(dgvDataL, "vwStudent", "ORDER BY
Enroll_ID");
rbEnrollL.Checked = true;
ActiveControl = txtSearchL;
}
}

private void frmStudent_Load(object sender, EventArgs e)


{
tbcStudent_SelectedIndexChanged(sender, e);
}

private void rbFemale_CheckedChanged(object sender, EventArgs e)


{
if (rbMale.Checked == true)
{
gndr = rbMale.Text;
}
else if (rbFemale.Checked == true)
{
gndr = rbFemale.Text;
}

if (rbSingle.Checked == true)
{
mrtl = rbSingle.Text;
}
else if (rbMarried.Checked == true)
{
mrtl = rbMarried.Text;
}

if (rbSingle.Checked == true || rbMarried.Checked == true)


{
if (rbFemale.Checked == true && rbMarried.Checked == true)
lblCarer.Text = "Husband Name :";
else
lblCarer.Text = "Father Name :";
}
}
Page113

private void btnStudent_Click(object sender, EventArgs e)

MCA | Rohit Kumar Pandey


{
if (txtSrchEnrllmnt.Text != "")
{
ds = Secret_DB_File.SearchRecord("vwStudentForCourseEntry",
"WHERE Enroll_ID = '" + txtSrchEnrllmnt.Text + "' ORDER BY Semester DESC");
if (ds.Tables[0].Rows.Count > 0)
{
lblID.Text = ds.Tables[0].Rows[0]["Enroll_ID"].ToString();
lblStudent.Text = ds.Tables[0].Rows[0]["Name"].ToString();
lblCode.Text =
ds.Tables[0].Rows[0]["Programme_Code"].ToString();
lblName.Text =
ds.Tables[0].Rows[0]["Programme_Name"].ToString();
lblCrntSem.Text = ds.Tables[0].Rows[0]["Semester"].ToString();
if (ds.Tables[0].Rows[0]["Husband_Name"].ToString() != "") {
lbCarer.Text =
ds.Tables[0].Rows[0]["Husband_Name"].ToString();
lblTitle.Text = "Husband Name :";
}
else if (ds.Tables[0].Rows[0]["Gaurdian_Name"].ToString() !=
"")
{
lbCarer.Text =
ds.Tables[0].Rows[0]["Gaurdian_Name"].ToString();
lblTitle.Text = "Father Name :";
}
lblAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString();
lblContact.Text = ds.Tables[0].Rows[0]["Contact"].ToString();
lblSession.Text = ds.Tables[0].Rows[0]["Session"].ToString();
pictureBox1.Image =
Secret_Front_File.ByteToImg((byte[])ds.Tables[0].Rows[0]["Photo"]);
txtSrchEnrllmnt.Enabled = btnStudent.Enabled = false;
pnlDetail.Enabled = cmbSem.Enabled = true;
n = cmbSem.Items.IndexOf(lblCrntSem.Text);
while (n >= 1)
{
cmbSem.Items.RemoveAt(n);
n--;
}
cmbSem.Focus();
}
else
{
MessageBox.Show("Record not found.", "Search Record",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
btnCourseReset_Click(sender, e);
}
}
else
{
MessageBox.Show("Please enter an enrollment number of the
student.", "Search Record", MessageBoxButtons.OK, MessageBoxIcon.Warning);
ActiveControl = txtSrchEnrllmnt;
}
Page114

MCA | Rohit Kumar Pandey


private void txtEnroll_KeyPress(object sender, KeyPressEventArgs e)
{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtName;
}

private void txtName_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
ActiveControl = dtpBirthdate;
}

private void dtpBirthdate_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = rbSingle;
}

private void rbSingle_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = rbMale;
}

private void rbMale_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtCarer;
}

private void txtCarer_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtAddress;
}

private void cmbState_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtPin;
}

private void txtPin_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtContact;
}

private void txtContact_KeyPress(object sender, KeyPressEventArgs e)


Page115

{
Secret_Front_File.OnlyNum(sender, e);

MCA | Rohit Kumar Pandey


if (e.KeyChar == 13)
ActiveControl = txtEmail;
}

private void txtAddress_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyAddress(sender, e);
}

private void txtEmail_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyEmail(sender, e);
if (e.KeyChar == 13)
ActiveControl = cmbProgramme;
}

private void cmbProgramme_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = cmbQualification;
}

private void txtEmail_Leave(object sender, EventArgs e)


{
Secret_Front_File.CheckEmail(txtEmail);
}

private void dgvData_CellContentClick(object


sender, DataGridViewCellEventArgs e)
{
try
{
if (e.ColumnIndex ==
dgvData.Rows[e.RowIndex].Cells["clmEdit"].ColumnIndex)
{
txtEnroll.Text =
dgvData.Rows[e.RowIndex].Cells["clmEnroll_ID"].Value.ToString();
txtName.Text =
dgvData.Rows[e.RowIndex].Cells["clmStuName"].Value.ToString();
dtpBirthdate.Value =
DateTime.ParseExact(dgvData.Rows[e.RowIndex].Cells["clmBirthdate"].Value.ToString(
), "dd/MM/yyyy", CultureInfo.InvariantCulture);
gndr =
dgvData.Rows[e.RowIndex].Cells["clmGender"].Value.ToString(); ;
mrtl =
dgvData.Rows[e.RowIndex].Cells["clmMarital_Status"].Value.ToString(); ;
fn =
dgvData.Rows[e.RowIndex].Cells["clmGaurdian_Name"].Value.ToString(); ;
hn =
dgvData.Rows[e.RowIndex].Cells["clmHusband_Name"].Value.ToString(); ;
txtAddress.Text =
dgvData.Rows[e.RowIndex].Cells["clmAddress"].Value.ToString(); ;
cmbState.Text =
dgvData.Rows[e.RowIndex].Cells["clmState"].Value.ToString(); ;
Page116

txtPin.Text =
dgvData.Rows[e.RowIndex].Cells["clmPincode"].Value.ToString(); ;

MCA | Rohit Kumar Pandey


txtContact.Text =
dgvData.Rows[e.RowIndex].Cells["clmContact"].Value.ToString(); ;
txtEmail.Text =
dgvData.Rows[e.RowIndex].Cells["clmEmail"].Value.ToString(); ;
cmbProgramme.Text =
dgvData.Rows[e.RowIndex].Cells["clmProgramme_Code"].Value.ToString();
cmbQualification.Text =
dgvData.Rows[e.RowIndex].Cells["clmQualification"].Value.ToString();
pbPhoto.Image =
Secret_Front_File.ByteToImg((byte[])dgvData.Rows[e.RowIndex].Cells["clmPhoto"].Val
ue);
pbSign.Image =
Secret_Front_File.ByteToImg((byte[])dgvData.Rows[e.RowIndex].Cells["clmSignature"]
.Value);

if (mrtl == rbSingle.Text)
{
rbSingle.Checked = true;
}
else if (mrtl == rbMarried.Text)
{
rbMarried.Checked = true;
}

if (gndr == rbMale.Text)
{
rbMale.Checked = true;
}
else if (gndr == rbFemale.Text)
{
rbFemale.Checked = true;
}

if (hn != "")
{
lblCarer.Text = "Husband Name :";
txtCarer.Text = hn;
}
if (fn != "")
{
lblCarer.Text = "Father Name :";
txtCarer.Text = fn;
}

btnSave.Text = "Update";
txtEnroll.ReadOnly = true;
ActiveControl = txtName;
}
}
catch { }
}

private void rbEnroll_CheckedChanged(object sender, EventArgs e)


{
Page117

MCA | Rohit Kumar Pandey


Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name , txtSearch, rbEnroll, rbName, rbCarer, rbMarital,
rbContact);
}

private void txtSearch_TextChanged(object sender, EventArgs e)


{
if (rbEnroll.Checked == true || rbEnrollL.Checked == true)
rb = "WHERE Enroll_ID LIKE '" +((TextBox)sender).Text + "%' ORDER
BY Enroll_ID";
if (rbName.Checked == true || rbNameL.Checked == true)
rb = "WHERE Name LIKE '" + ((TextBox)sender).Text + "%' ORDER BY
Enroll_ID";
if (rbCarer.Checked == true || rbGaurdianL.Checked == true)
rb = "WHERE Gaurdian_Name LIKE '" + ((TextBox)sender).Text +
"%' OR Husband_Name LIKE '" + ((TextBox)sender).Text + "%' ORDER BY Enroll_ID";
if (rbMarital.Checked == true || rbStatusL.Checked == true)
rb = "WHERE Marital_Status LIKE '" + ((TextBox)sender).Text +
"%' ORDER BY Enroll_ID";
if (rbContact.Checked == true || rbContactL.Checked == true)
rb = "WHERE Contact LIKE '" + ((TextBox)sender).Text + "%' ORDER
BY Enroll_ID";
if(rbProgrammeL.Checked==true)
rb = "WHERE Programme_Code LIKE '" + ((TextBox)sender).Text +
"%' ORDER BY Enroll_ID";
if (tbcStudent.SelectedIndex == 0)
Secret_DB_File.Display(dgvData, "vwStudent", rb);
if(tbcStudent.SelectedIndex == 2)
Secret_DB_File.Display(dgvDataL, "vwStudent", rb);
}

private void txtSrchEnrllmnt_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
btnStudent_Click(sender, e);
}

private void btnCourseReset_Click(object sender, EventArgs e)


{
lblID.Text = lblStudent.Text = lblCode.Text = lblCrntSem.Text =
lblName.Text = lbCarer.Text = lblAddress.Text = lblContact.Text = lblSession.Text
= "NA";
pnlDetail.Enabled = cmbSem.Enabled = chkCheck.Checked = false;
cmbSem.SelectedIndex = cnt = 0;
txtSrchEnrllmnt.Clear();
lblTitle.Text = "Father Name :";
pictureBox1.Image = Properties.Resources.photo;
txtSrchEnrllmnt.Enabled = btnStudent.Enabled = true;
txtSrchEnrllmnt.Focus();
}

private void cmbSem_SelectedIndexChanged(object sender, EventArgs e)


{
Page118

Secret_DB_File.Display(dgvCourse, "Course", "WHERE Programme= '"


+ lblCode.Text + "' AND Semester = '" + cmbSem.Text + "' ORDER BY Code");

MCA | Rohit Kumar Pandey


}

private void rbEnrollL_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearchL, rbEnrollL, rbNameL, rbGaurdianL,
rbStatusL, rbContactL, rbProgrammeL);
}

private void btnCourseSave_Click(object sender, EventArgs e)


{
if (cmbSem.Text != "Select Semester")
{
try
{
try
{
for (n = 0; n < dgvCourse.Rows.Count; n++)
{
if ((bool)(dgvCourse.Rows[n].Cells["clmCheck"].Value)
= true)
{
cnt++;
}
}
}
catch { }
if (cnt > 0)
{

Secret_DB_File.Semester_Insert(Secret_DB_File.Unique_Number("SELECT S_No
FROM Semester_Detail ORDER BY CAST(S_No AS INT) DESC", "S_No"), lblID.Text,
lblCode.Text, cmbSem.Text, Program.strSession());
for (n = 0; n < dgvCourse.Rows.Count; n++)
{
if ((bool)(dgvCourse.Rows[n].Cells["clmCheck"].Value)
= true)
{

Secret_DB_File.Course_Detail_Insert(Secret_DB_File.Unique_Number("SELECT S_No FROM


Course_Detail ORDER BY S_No DESC", "S_No"), lblID.Text,
dgvCourse.Rows[n].Cells["clmCode"].Value.ToString());
}
}
MessageBox.Show("1 Semester record Transferred
successfully!", "Semester Info", MessageBoxButtons.OK,
MessageBoxIcon.Information);
btnCourseReset_Click(sender, e);
}
else
MessageBox.Show("You are not selected any course in Course
Detail Box.\nPlease select course for select semester.",
"Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
Page119

catch
{

MCA | Rohit Kumar Pandey


MessageBox.Show("Something is missing.", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
}
else
{
MessageBox.Show("Something is missing.",
"Mistake", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}

private void chkCheck_CheckedChanged(object sender, EventArgs e)


{
if (chkCheck.Checked == true)
{
Secret_Front_File.SelectRow(true, dgvCourse);
}
else if (chkCheck.Checked == false)
{
Secret_Front_File.SelectRow(false, dgvCourse);
}
}

private void lnkQualification_LinkClicked(object


sender, LinkLabelLinkClickedEventArgs e)
{
Secret_Front_File.OpenDialog(new frmQualification());
Secret_DB_File.FillList(cmbQualification, "SELECT Qualification
FROM Qualification_Detail ORDER BY Qualification", "Qualification", "Select
Qualification");
}

private void cmbQualification_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
btnSave_Click(sender, e);
}
}
}
Page120

MCA | Rohit Kumar


Pandey
Teacher Management
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;

namespace Assignment_Submission_RMS
{
public partial class frmTeacher : Form
{
string gndr, mrtl, hn, fn, rb;
private bool flg;

public frmTeacher()
{
InitializeComponent();
}

private void frmTeacher_Load(object sender, EventArgs e)


{
tbcTeacher_SelectedIndexChanged(sender, e);
}

private void tbcTeacher_SelectedIndexChanged(object sender, EventArgs


e)
{
if (tbcTeacher.SelectedIndex == 0)
{
btnReset_Click(sender, e);
}
if (tbcTeacher.SelectedIndex == 1)
{
Secret_DB_File.Display(dgvDataL, "vwTeacher", "ORDER BY
Teacher_Code");
rbEnrollL.Checked = true;
ActiveControl = txtSearchL;
}
}

private void dtpBirthdate_ValueChanged(object sender, EventArgs e)


{
txtAge.Text = Secret_Front_File.urAge(dtpBirthdate);
}

private void txtEmail_Leave(object sender, EventArgs e)


Page121

{
Secret_Front_File.CheckEmail(txtEmail);

MCA | Rohit Kumar Pandey


}

private void txtName_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
ActiveControl = dtpBirthdate;
}

private void dtpBirthdate_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = rbSingle;
}

private void rbSingle_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = rbMale;
}

private void rbMale_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtCarer;
}

private void txtCarer_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtAddress;
}

private void txtAddress_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyAddress(sender, e);
}

private void cmbState_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtPin;
}

private void txtPin_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtContact;
}
Page122

private void txtContact_KeyPress(object sender, KeyPressEventArgs e)


{

MCA | Rohit Kumar Pandey


Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtEmail;
}

private void txtEmail_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyEmail(sender, e);
if (e.KeyChar == 13)
ActiveControl = cmbQualification;
}

private void cmbQualification_KeyPress(object


sender, KeyPressEventArgs e)
{
if (e.KeyChar == 13)
btnSave_Click(sender, e);
}

private void btnPhoto_Click(object sender, EventArgs e)


{
Secret_Front_File.ImageOpen("Attach Teacher Photo", pbPhoto);
}

private void btnSign_Click(object sender, EventArgs e)


{
Secret_Front_File.ImageOpen("Attach Teacher Signature", pbSign);
}

private void btnReset_Click(object sender, EventArgs e)


{
if (btnReset.Text == "Reset")
{
txtName.Text = txtCarer.Text = txtAddress.Text = txtPin.Text
= txtEmail.Text = txtContact.Text = txtSearch.Text = "";
dtpBirthdate.Value = DateTime.Today;
rbSingle.Checked = rbMarried.Checked = rbFemale.Checked
= rbMale.Checked = false;
txtAge.Text = "0";
txtEmail.Text = "NA";
cmbState.SelectedIndex = cmbQualification.SelectedIndex =
0; pbPhoto.Image = Properties.Resources.photo;
pbSign.Image = Properties.Resources.Signature;
Secret_DB_File.FillList(cmbQualification,
"SELECT
Qualification FROM Qualification_Detail ORDER BY Qualification",
"Qualification", "Select Qualification");
Secret_DB_File.FillList(clbCourse, "SELECT Code FROM
Course ORDER BY Code");
Secret_DB_File.Display(dgvData, "vwTeacher", "ORDER BY
Teacher_Code");
Page123

btnSave.Text = "Save";
btnReset.Text = "Reset";
ActiveControl = txtName;
}

MCA | Rohit Kumar Pandey


else if (btnReset.Text == "Delete")
{
if (MessageBox.Show("Are you sure to delete?", "Confirmation",
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
{
try
{
Secret_DB_File.Teacher_Image_Delete(txtEnroll.Text);
Secret_DB_File.Teacher_Detail_Delete(txtEnroll.Text);
MessageBox.Show("1 Teacher record deleted
successfully!", "Teacher Deletion Info",
MessageBoxButtons.OK, MessageBoxIcon.Information);
}
catch
{
MessageBox.Show("Any other record is being
connected it.\nSo this record can not be deleted", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
btnReset.Text = "Reset";
btnReset_Click(sender, e);
}
}
}

private void btnSave_Click(object sender, EventArgs e)


{
errorProvider_Teacher.Clear();
errorProvider_Teacher.RightToLeft = true;
if (txtName.Text == "")
errorProvider_Teacher.SetError(txtName, "Please enter teacher
name.");
if (dtpBirthdate.Value == DateTime.Today)
errorProvider_Teacher.SetError(dtpBirthdate, "Please enter
teacher birthdate.");
if (rbSingle.Checked == false && rbMarried.Checked == false)
errorProvider_Teacher.SetError(pnlMrtl, "Please select teacher
marital status.");
if (rbMale.Checked == false && rbFemale.Checked == false)
errorProvider_Teacher.SetError(pnlGndr, "Please select teacher
gender.");
if (txtCarer.Text == "")
{
if (lblCarer.Text == "Husband Name :")
errorProvider_Teacher.SetError(txtCarer, "Please enter
husband name.");
else if (lblCarer.Text == "Father Name :")
errorProvider_Teacher.SetError(txtCarer, "Please enter
father name.");
}
Page124

if (txtAddress.Text == "")
errorProvider_Teacher.SetError(txtAddress, "Please enter
teacher current address.");

MCA | Rohit Kumar Pandey


if (txtContact.Text == "")
errorProvider_Teacher.SetError(txtContact, "Please enter
teacher contact no.");
if (cmbQualification.Text == "Select Qualification")
errorProvider_Teacher.SetError(cmbQualification, "Please
select qualification.");

if (txtName.Text == "")
flg = false;
else if (dtpBirthdate.Value == DateTime.Today)
flg = false;
else if (rbSingle.Checked == false && rbMarried.Checked == false)
flg = false;
else if (rbMale.Checked == false && rbFemale.Checked == false)
flg = false;
else if (txtCarer.Text == "")
flg = false;
else if (txtAddress.Text == "")
flg = false;
else if (txtContact.Text == "")
flg = false;
else if (cmbQualification.Text == "Select Qualification")
flg = false;
else
flg = true;

if (flg == true)
{
if (lblCarer.Text == "Husband Name :")
{
hn = txtCarer.Text;
fn = "";
}
else if (lblCarer.Text == "Father Name :")
{
fn = txtCarer.Text;
hn = "";
}
try
{
if (btnSave.Text == "Save")
{
txtEnroll.Text = "TCHR" +
Secret_DB_File.Unique_Number("SELECT CAST(REPLACE(Teacher_Code, 'TCHR', '')AS
INT) AS Teacher_Code FROM Teacher_Detail ORDER BY Teacher_Code DESC",
"Teacher_Code");
Secret_DB_File.Teacher_Detail_Insert(txtEnroll.Text,
txtName.Text, dtpBirthdate.Value.ToString("MM/dd/yyyy",
CultureInfo.InvariantCulture), gndr, mrtl, fn, hn, txtAddress.Text,
cmbState.Text, txtPin.Text, txtContact.Text, txtEmail.Text,
cmbQualification.Text, Secret_Front_File.clbString(clbCourse));
Page125

Secret_DB_File.Teacher_Image_Insert(txtEnroll.Text,
pbPhoto, pbSign);
}

MCA | Rohit Kumar Pandey


else if (btnSave.Text == "Update")
{
Secret_DB_File.Teacher_Detail_Update(txtEnroll.Text,
txtName.Text, dtpBirthdate.Value.ToString("MM/dd/yyyy",
CultureInfo.InvariantCulture), gndr, mrtl, fn, hn, txtAddress.Text,
cmbState.Text, txtPin.Text, txtContact.Text, txtEmail.Text,
cmbQualification.Text, Secret_Front_File.clbString(clbCourse));
Secret_DB_File.Teacher_Image_Update(txtEnroll.Text,
pbPhoto, pbSign);
}
}
catch
{
MessageBox.Show("Something is missing.", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
btnReset.Text = "Reset";
btnReset_Click(sender, e);
}
else
{
MessageBox.Show("Please fill all mandatory fields.",
"Mandatory Fields", MessageBoxButtons.OK, MessageBoxIcon.Error);
flg = true;
}
}

private void dgvData_CellContentClick(object


sender, DataGridViewCellEventArgs e)
{
try
{
if (e.ColumnIndex ==
dgvData.Rows[e.RowIndex].Cells["clmEdit"].ColumnIndex)
{
txtEnroll.Text =
dgvData.Rows[e.RowIndex].Cells["clmEnroll_ID"].Value.ToString();
txtName.Text =
dgvData.Rows[e.RowIndex].Cells["clmStuName"].Value.ToString();
dtpBirthdate.Value =
DateTime.ParseExact(dgvData.Rows[e.RowIndex].Cells["clmBirthdate"].Value.ToStr
ing(), "dd/MM/yyyy", CultureInfo.InvariantCulture);
gndr =
dgvData.Rows[e.RowIndex].Cells["clmGender"].Value.ToString(); ;
mrtl =
dgvData.Rows[e.RowIndex].Cells["clmMarital_Status"].Value.ToString(); ;
fn =
dgvData.Rows[e.RowIndex].Cells["clmGaurdian_Name"].Value.ToString(); ;
hn =
dgvData.Rows[e.RowIndex].Cells["clmHusband_Name"].Value.ToString(); ;
Page126

txtAddress.Text =
dgvData.Rows[e.RowIndex].Cells["clmAddress"].Value.ToString(); ;

MCA | Rohit Kumar Pandey


cmbState.Text =
dgvData.Rows[e.RowIndex].Cells["clmState"].Value.ToString(); ;
txtPin.Text =
dgvData.Rows[e.RowIndex].Cells["clmPincode"].Value.ToString(); ;
txtContact.Text =
dgvData.Rows[e.RowIndex].Cells["clmContact"].Value.ToString(); ;
txtEmail.Text =
dgvData.Rows[e.RowIndex].Cells["clmEmail"].Value.ToString(); ;
cmbQualification.Text =
dgvData.Rows[e.RowIndex].Cells["clmProgramme_Code"].Value.ToString();
Secret_Front_File.clbCheck(clbCourse,
dgvData.Rows[e.RowIndex].Cells["clmSpecilization"].Value.ToString());
pbPhoto.Image =
Secret_Front_File.ByteToImg((byte[])dgvData.Rows[e.RowIndex].Cells["clmPhoto"]
.Value);
pbSign.Image =
Secret_Front_File.ByteToImg((byte[])dgvData.Rows[e.RowIndex].Cells["clmSignatu
re"].Value);

if (mrtl == rbSingle.Text)
{
rbSingle.Checked = true;
}
else if (mrtl == rbMarried.Text)
{
rbMarried.Checked = true;
}

if (gndr == rbMale.Text)
{
rbMale.Checked = true;
}
else if (gndr == rbFemale.Text)
{
rbFemale.Checked = true;
}

if (hn != "")
{
lblCarer.Text = "Husband Name :";
txtCarer.Text = hn;
}
if (fn != "")
{
lblCarer.Text = "Father Name :";
txtCarer.Text = fn;
}

btnSave.Text = "Update";
btnReset.Text = "Delete";
ActiveControl = txtName;
Page127

}
}
catch { }

MCA | Rohit Kumar Pandey


}

private void rbFemale_CheckedChanged(object sender, EventArgs e)


{
if (rbMale.Checked == true)
{
gndr = rbMale.Text;
}
else if (rbFemale.Checked == true)
{
gndr = rbFemale.Text;
}

if (rbSingle.Checked == true)
{
mrtl = rbSingle.Text;
}
else if (rbMarried.Checked == true)
{
mrtl = rbMarried.Text;
}

if (rbSingle.Checked == true || rbMarried.Checked == true)


{
if (rbFemale.Checked == true && rbMarried.Checked == true)
lblCarer.Text = "Husband Name :";
else
lblCarer.Text = "Father Name :";
}
}

private void rbEnroll_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearch, rbEnroll, rbName, rbCarer,
rbMarital, rbContact);
}

private void rbEnrollL_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearchL, rbEnrollL, rbNameL, rbGaurdianL,
rbStatusL, rbContactL, rbProgrammeL);
}

private void lnkQualification_LinkClicked(object


sender, LinkLabelLinkClickedEventArgs e)
{
Secret_Front_File.OpenDialog(new frmQualification());
Secret_DB_File.FillList(cmbQualification, "SELECT Qualification
FROM Qualification_Detail ORDER BY Qualification", "Qualification",
Page128

"Select Qualification");
}
}

MCA | Rohit Kumar Pandey


Assignment Submission & Bundle Allot & Result Entry
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Globalization;

namespace Assignment_Submission_RMS
{
public partial class frmAssignment : Form
{
DataSet ds;
int n,m, cnt;
string am, ao, tm, to, pm, po, vm, vo,rb;

public frmAssignment()
{
InitializeComponent();
}

private void Entry()


{
m = (int.Parse)(Secret_DB_File.Unique_Number("SELECT S_N
FROM Assignment_Allot ORDER BY CAST(S_N AS INT) DESC", "S_N"));
Secret_DB_File.Assignment_Allot_Insert(m.ToString(),
txtTeacher.Text, cmbProgramme.Text, cmbSemester.Text, cmbCode.Text,
lblSessionCurrent.Text, txtNum.Text, txtDays.Text, txtStatus.Text);
for (n = 0; n < dataGridView1.Rows.Count; n++)
{
if ((bool)(dataGridView1.Rows[n].Cells["clmChekok"].Value) ==
true)
{

Secret_DB_File.Alloted_Assignment_Insert(Secret_DB_File.Unique_Number("SELECT S_N
FROM Alloted_Assignment ORDER BY CAST(S_N AS INT) DESC", "S_N"), m.ToString(),
txtTeacher.Text, dataGridView1.Rows[n].Cells["clmID"].Value.ToString());
}
}
}

private void btnStudent_Click(object sender, EventArgs e)


{
if (txtSrchEnrllmnt.Text != "")
{
ds = Secret_DB_File.SearchRecord("vwStudentForCourseEntry",
"WHERE Enroll_ID = '" + txtSrchEnrllmnt.Text + "' ORDER BY Semester DESC");
if (ds.Tables[0].Rows.Count > 0)
{
Page129

lblID.Text = ds.Tables[0].Rows[0]["Enroll_ID"].ToString();
lblStudent.Text = ds.Tables[0].Rows[0]["Name"].ToString();

MCA | Rohit Kumar Pandey


lblCode.Text =
ds.Tables[0].Rows[0]["Programme_Code"].ToString();
lblName.Text =
ds.Tables[0].Rows[0]["Programme_Name"].ToString();
lblCrntSem.Text = ds.Tables[0].Rows[0]["Semester"].ToString();
if (ds.Tables[0].Rows[0]["Husband_Name"].ToString() != "") {
lbCarer.Text =
ds.Tables[0].Rows[0]["Husband_Name"].ToString();
lblTitle.Text = "Husband Name :";
}
else if (ds.Tables[0].Rows[0]["Gaurdian_Name"].ToString() !=
"")
{
lbCarer.Text =
ds.Tables[0].Rows[0]["Gaurdian_Name"].ToString();
lblTitle.Text = "Father Name :";
}
lblAddress.Text = ds.Tables[0].Rows[0]["Address"].ToString();
lblContact.Text = ds.Tables[0].Rows[0]["Contact"].ToString();
lblSession.Text = ds.Tables[0].Rows[0]["Session"].ToString();
pictureBox1.Image =
Secret_Front_File.ByteToImg((byte[])ds.Tables[0].Rows[0]["Photo"]);
Secret_DB_File.Display(dgvCourse, "Course", "WHERE Programme=
'" + lblCode.Text + "' AND Semester = '" + lblCrntSem.Text + "' ORDER BY Code");
for (m = 0; m < dgvCourse.Rows.Count; m++) {

ds = Secret_DB_File.SearchRecord("Assignment_Submission",
" WHERE Enroll_ID = '" + lblID.Text + "'");
for (n = 0; n < ds.Tables[0].Rows.Count; n++)
{
if (ds.Tables[0].Rows[n]["Course_Code"].ToString() ==
dgvCourse.Rows[m].Cells["clmCode"].Value.ToString())
{
dgvCourse.Rows[m].Cells["clmCheck"].Value = true;
break;
}
}
}
txtSrchEnrllmnt.Enabled = btnStudent.Enabled = false;
pnlDetail.Enabled = true;
}
else
{
MessageBox.Show("Record not found.", "Search Record",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
else
{
MessageBox.Show("Please enter an enrollment number of the
student.", "Search Record", MessageBoxButtons.OK, MessageBoxIcon.Warning);
ActiveControl = txtSrchEnrllmnt;
}
}
Page130

MCA | Rohit Kumar Pandey


private void txtSrchEnrllmnt_KeyPress(object sender, KeyPressEventArgs e)
{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
btnStudent_Click(sender, e);
}

private void tbcAssign_SelectedIndexChanged(object sender, EventArgs e)


{
if (tbcAssign.SelectedIndex == 0)
{
btnCourseReset_Click(sender, e);
}
if (tbcAssign.SelectedIndex == 1)
{
btnReset_Click(sender, e);
}
if (tbcAssign.SelectedIndex == 2)
{
rbTeacher.Checked = true;
Secret_DB_File.Display(dataGridView3, "vwAssignmentAllot", "");
ActiveControl = txtSearch;
}
if (tbcAssign.SelectedIndex == 3)
{
btnResetResult_Click(sender, e);
}
if (tbcAssign.SelectedIndex == 4)
{
rbEnrollL.Checked = true;
Secret_DB_File.Display(dgvDataL, "vwResult", "");
ActiveControl = txtSearchL;
}
}

private void btnCourseReset_Click(object sender, EventArgs e)


{
lblID.Text = lblStudent.Text = lblCode.Text = lblCrntSem.Text =
lblName.Text = lbCarer.Text = lblAddress.Text = lblContact.Text = lblSession.Text
= "NA";
pnlDetail.Enabled = chkCheck.Checked = false;
txtSrchEnrllmnt.Clear(); cnt = 0;

lblTitle.Text = "Father Name :"; pictureBox1.Image =


Properties.Resources.photo; txtSrchEnrllmnt.Enabled =
btnStudent.Enabled = true;
Secret_DB_File.Display(dgvCourse, "Course", "WHERE Programme= '"
+ lblCode.Text + "' AND Semester = '" + lblCrntSem.Text + "' ORDER BY Code");
txtSrchEnrllmnt.Focus();
}

private void frmAssignment_Load(object sender, EventArgs e)


{
tbcAssign_SelectedIndexChanged(sender,e);
Page131

MCA | Rohit Kumar Pandey


private void chkCheck_CheckedChanged(object sender, EventArgs e)
{
if (chkCheck.Checked == true)
{
Secret_Front_File.SelectRow(true, dgvCourse);
}
else if (chkCheck.Checked == false)
{
Secret_Front_File.SelectRow(false, dgvCourse);
}
}

private void btnCourseSave_Click(object sender, EventArgs e)


{
if (txtSrchEnrllmnt.Text != "")
{
try
{
try
{
for (n = 0; n < dgvCourse.Rows.Count; n++)
{
if ((bool)(dgvCourse.Rows[n].Cells["clmCheck"].Value)
= true)
{
cnt++;
}
}
}
catch { }
if (cnt > 0)
{
cnt = 0;
for (n = 0; n < dgvCourse.Rows.Count; n++)
{
if ((bool)(dgvCourse.Rows[n].Cells["clmCheck"].Value)
= true)
{
ds =
Secret_DB_File.SearchRecord("Assignment_Submission", "WHERE Enroll_ID = '" +
lblID.Text + "' AND Course_Code = '" +
dgvCourse.Rows[n].Cells["clmCode"].Value.ToString() + "'");
if (ds.Tables[0].Rows.Count == 0)
{

Secret_DB_File.Assignment_Submission_Insert(Secret_DB_File.Unique_Number("SELECT
S_No FROM Assignment_Submission ORDER BY S_No DESC", "S_No"), lblSession.Text,
dgvCourse.Rows[n].Cells["clmCode"].Value.ToString(), lblID.Text);
cnt++;
}
}
}
if (cnt != 0)
{
Page132

MCA | Rohit Kumar Pandey


MessageBox.Show(cnt.ToString() + " Assignment
submitted successfully!", "Assignment Submission Info", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
else
{
MessageBox.Show("Selected assignment already
submitted", "Assignment Submission Info", MessageBoxButtons.OK,
MessageBoxIcon.Information);
}
btnCourseReset_Click(sender, e);
}
else
{
MessageBox.Show("You are not selected any assignment in
Assignment Detail Box.\nPlease select assignment.", "Warning",
MessageBoxButtons.OK, MessageBoxIcon.Warning);
}
}
catch
{
MessageBox.Show("Something is missing.", "Mistake",
MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
}
else
{
MessageBox.Show("Please enter student enrollment
number.", "Mistake", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnCourseReset_Click(sender, e);
}
}

private void btnReset_Click(object sender, EventArgs e)


{
Secret_DB_File.FillList(cmbProgramme, "SELECT CODE
FROM Programme_Detail ORDER BY Code", "Code", "Select Programme");
cmbSemester.SelectedIndex = cmbProgramme.SelectedIndex
= cmbCode.SelectedIndex = 0;
txtTeacher.Text = txtNum.Text = txtDays.Text = txtStatus.Text = "";
lblSessionCurrent.Text = Program.strSession(); ActiveControl =
txtTeacher;
}

private void btnSave_Click(object sender, EventArgs e)


{
try
{
ds = Secret_DB_File.SearchRecord("Assignment_Allot", "WHERE
Assignment_Code = '" + cmbCode.Text + "' AND Session = '" + lblSessionCurrent.Text
+ "' ORDER BY CAST(S_N AS INT) DESC");
if (ds.Tables[0].Rows.Count > 0)
{
Page133

MCA | Rohit Kumar Pandey


if
(Secret_Front_File.DayCount(ds.Tables[0].Rows[0]["Date"].ToString()) >=
(int.Parse)(ds.Tables[0].Rows[0]["Duration"].ToString()))
{

Secret_DB_File.Assignment_Reallot_Update(ds.Tables[0].Rows[0]["S_N"].ToString(),
"NOT COMPLETED");
Entry();
}
}
else if (ds.Tables[0].Rows.Count == 0)
{
Entry();
}
MessageBox.Show("Assignment alloted successfuly.", "Alloted",
MessageBoxButtons.OK, MessageBoxIcon.Information);
btnReset_Click(sender, e);
}
catch
{
MessageBox.Show("Something is missing.",
"Mistake", MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
}

private void cmbProgramme_SelectedIndexChanged(object sender, EventArgs e)


{
Secret_DB_File.FillList(cmbCode, "SELECT Code FROM Course WHERE
Programme = '" + cmbProgramme.Text + "' AND Semester = '" + cmbSemester.Text + "'
ORDER BY Code", "Code", "Select Assignment Code");
Secret_DB_File.Display(dataGridView1, "vwAssignAlloted", "WHERE
Programme_Code = '" + cmbProgramme.Text + "' AND Semester = '" + cmbSemester.Text
+ "'");
}

private void cmbCode_SelectedIndexChanged(object sender, EventArgs e)


{
try
{
lblAssignment.Text = Secret_DB_File.SearchRecord("Course", "WHERE
Code = '" + cmbCode.Text + "'").Tables[0].Rows[0]["Name"].ToString();
Secret_DB_File.Display(dataGridView1, "vwAssignAlloted", "WHERE
Programme_Code = '" + cmbProgramme.Text + "' AND Semester = '" + cmbSemester.Text
+ "' AND Course_Code = '" + cmbCode.Text + "'");
}
catch
{
lblAssignment.Text = "NA";
}
}

private void txtTeacher_KeyPress(object sender, KeyPressEventArgs e)


{
Page134

Secret_Front_File.OnlyCharNum(sender, e);
if (e.KeyChar == 13)

MCA | Rohit Kumar Pandey


ActiveControl = cmbProgramme;
}

private void cmbProgramme_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = cmbSemester;
}

private void cmbSemester_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = cmbCode;
}

private void cmbCode_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtNum;
}

private void txtNum_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtDays;
}

private void txtDays_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtStatus;
}

private void txtStatus_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyChar(sender, e);
if (e.KeyChar == 13)
btnSave_Click(sender, e);
}

private void txtTeacher_Leave(object sender, EventArgs e)


{
try
{
lblTeacher.Text = Secret_DB_File.SearchRecord("Teacher_Detail",
"WHERE Teacher_Code = '" + txtTeacher.Text + "'").Tables[0].Rows[0]
["Name"].ToString();
}
catch
{
lblTeacher.Text = "NA";
}
Page135

MCA | Rohit Kumar Pandey


private void chkAlotCheck_CheckedChanged(object sender, EventArgs e)
{
if (chkAlotCheck.Checked == true)
{
Secret_Front_File.SelectRow(true, dataGridView1);
}
else if (chkAlotCheck.Checked == false)
{
Secret_Front_File.SelectRow(false, dataGridView1);
}
}

private void btnSearchStdnt_Click(object sender, EventArgs e)


{
if (txtSearchStdnt.Text != "")
{
ds = Secret_DB_File.SearchRecord("vwStudentForCourseEntry",
"WHERE Enroll_ID = '" + txtSearchStdnt.Text + "' ORDER BY Semester DESC");
if (ds.Tables[0].Rows.Count > 0)
{
label15.Text = ds.Tables[0].Rows[0]["Enroll_ID"].ToString();
label27.Text = ds.Tables[0].Rows[0]["Name"].ToString();
label22.Text =
ds.Tables[0].Rows[0]["Programme_Code"].ToString();
label36.Text =
ds.Tables[0].Rows[0]["Programme_Name"].ToString();
if (ds.Tables[0].Rows[0]["Husband_Name"].ToString() != "")
{
label10.Text =
ds.Tables[0].Rows[0]["Husband_Name"].ToString();
label29.Text = "Husband Name :";
}
else if (ds.Tables[0].Rows[0]["Gaurdian_Name"].ToString() !=
"")
{
label10.Text =
ds.Tables[0].Rows[0]["Gaurdian_Name"].ToString();
label29.Text = "Father Name :";
}
label24.Text = ds.Tables[0].Rows[0]["Address"].ToString();
label19.Text = ds.Tables[0].Rows[0]["Contact"].ToString();
pictureBox2.Image =
Secret_Front_File.ByteToImg((byte[])ds.Tables[0].Rows[0]["Photo"]);
txtSearchStdnt.Enabled = btnSearchStdnt.Enabled = false;
panel3.Enabled = panel5.Enabled = true;
Secret_DB_File.FillList(cmbSem, "SELECT Semester FROM
Semester_Detail WHERE Enroll_ID = '" + txtSearchStdnt.Text + "'", "Semester",
"Select Semester");
Secret_DB_File.Display(dataGridView2, "Result_Detail",
"WHERE Enroll_ID = '" + txtSearchStdnt.Text + "'");
ActiveControl = cmbSem;
}
else
{
Page136

MessageBox.Show("Record not found.", "Search Record",


MessageBoxButtons.OK, MessageBoxIcon.Warning);

MCA | Rohit Kumar Pandey


}
}
else
{
MessageBox.Show("Please enter an enrollment number of the
student.", "Search Record", MessageBoxButtons.OK, MessageBoxIcon.Warning);
ActiveControl = txtSearchStdnt;
}
}

private void txtSearchStdnt_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
btnSearchStdnt_Click(sender, e);
}

private void cmbSem_SelectedIndexChanged(object sender, EventArgs e)


{
Secret_DB_File.FillList(cmbCourse, "SELECT Code FROM Course WHERE
Programme = '" + label22.Text + "' AND Semester = '" + cmbSem.Text + "' ORDER BY
Code", "Code", "Select Course Code");
}

private void cmbSem_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = cmbCourse;
}

private void cmbCourse_SelectedIndexChanged(object sender, EventArgs e)


{
try
{
label25.Text = Secret_DB_File.SearchRecord("Course", "WHERE Code
= '" + cmbCourse.Text + "'").Tables[0].Rows[0]["Name"].ToString();
}
catch
{
label25.Text = "NA";
}
}

private void cmbCourse_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = cmbType;
}

private void cmbType_KeyPress(object sender, KeyPressEventArgs e)


{
if (e.KeyChar == 13)
ActiveControl = txtMax;
}
Page137

private void txtMax_KeyPress(object sender, KeyPressEventArgs e)


{

MCA | Rohit Kumar Pandey


Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
ActiveControl = txtObtain;
}

private void txtObtain_KeyPress(object sender, KeyPressEventArgs e)


{
Secret_Front_File.OnlyNum(sender, e);
if (e.KeyChar == 13)
btnSaveResult_Click(sender, e);
}

private void btnResetResult_Click(object sender, EventArgs e)


{
label15.Text = label27.Text = label22.Text = label36.Text
= label10.Text = label24.Text = label19.Text = "NA";
txtSearchStdnt.Text = txtMax.Text = txtObtain.Text = am = ao = pm =
po = tm = to = vm = vo = "";
label29.Text = "Father Name :";
cmbSem.SelectedIndex = cmbCourse.SelectedIndex = cmbType.SelectedIndex
= 0;
pictureBox2.Image = Properties.Resources.photo;
txtSearchStdnt.Enabled = btnSearchStdnt.Enabled = true;
panel3.Enabled = panel5.Enabled = false;
ActiveControl = txtSearchStdnt;
Secret_DB_File.Display(dataGridView2, "Result_Detail", "");
}

private void btnSaveResult_Click(object sender, EventArgs e)


{
try
{
ds = Secret_DB_File.SearchRecord("Result_Detail", "WHERE Enroll_ID
= '" + txtSearchStdnt.Text + "' AND Course_ID = '" + cmbCourse.Text + "'");
try
{
am = ds.Tables[0].Rows[0]["Assign_Max"].ToString(); ao
= ds.Tables[0].Rows[0]["Assign_Obtn"].ToString(); pm =
ds.Tables[0].Rows[0]["Pract_Max"].ToString(); po =
ds.Tables[0].Rows[0]["Pract_Obtn"].ToString(); tm =
ds.Tables[0].Rows[0]["Theory_Max"].ToString(); to =
ds.Tables[0].Rows[0]["Theory_Obtn"].ToString(); vm =
ds.Tables[0].Rows[0]["Viva_Max"].ToString(); vo =
ds.Tables[0].Rows[0]["Viva_Obtn"].ToString();
}
catch { }
if (cmbType.Text == "ASSIGNMENT")
{
am = txtMax.Text;
ao = txtObtain.Text;
}
else if (cmbType.Text == "PRACTICAL")
{
pm = txtMax.Text;
Page138

po = txtObtain.Text;
}

MCA | Rohit Kumar Pandey


else if (cmbType.Text == "THEORY")
{
tm = txtMax.Text;
to = txtObtain.Text;
}
else if (cmbType.Text == "VIVA")
{
vm = txtMax.Text;
vo = txtObtain.Text;
}
if (ds.Tables[0].Rows.Count != 0)
{

Secret_DB_File.Result_Detail_Update(ds.Tables[0].Rows[0]["S_No"].ToString(), am,
ao, tm, to, pm, po, vm, vo);
}
if (ds.Tables[0].Rows.Count == 0)
{

Secret_DB_File.Result_Detail_Insert(Secret_DB_File.Unique_Number("SELECT S_No FROM


Result_Detail ORDER BY S_No DESC", "S_No"), txtSearchStdnt.Text, cmbCourse.Text,
am, ao, tm, to, pm, po, vm, vo);
}
MessageBox.Show("Marks added successfully.", "Result Info",
MessageBoxButtons.OK, MessageBoxIcon.Information);
txtMax.Text = txtObtain.Text = am = ao = pm = po = tm = to = vm =
vo = "";
cmbType.SelectedIndex = 0;
ActiveControl = cmbSem;
Secret_DB_File.Display(dataGridView2, "Result_Detail",
"WHERE Enroll_ID = '" + txtSearchStdnt.Text + "'");
}
catch
{
MessageBox.Show("Something is missing.",
"Mistake", MessageBoxButtons.OK, MessageBoxIcon.Error);
Secret_DB_File.cn.Close();
}
}

private void rbEnrollL_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearchL, rbEnrollL, rbCourseL, rbProgrammeL);
}

private void rbTeacher_CheckedChanged(object sender, EventArgs e)


{
Secret_Front_File.RadioCheck(Color.Red, Color.Black,
((RadioButton)sender).Name, txtSearch, rbTeacher, rbName, rbProgramme, rbCourse,
rbSession);
}

}
Page139

MCA | Rohit Kumar Pandey


Bibliography

Page140

MCA | Rohit Kumar


Pandey
BIBLIOGRAPHY

❖ Software Engineering by Roger. S. Pressman.


❖ C# 3.0 - The Complete Reference by Herbert Schildt.
❖ SQL for Professionals by Jain.
❖ Google
❖ Wikipedia

Page141

MCA | Rohit Kumar


Pandey

Você também pode gostar