Sie sind auf Seite 1von 121

Connecting Avalon

th
6 Semester Major Project
Project Report

Submitted in partial fulfilment of the requirements


for the award of the degree of Bachelor of Computer
Applications

Guide Submitted By
Mr. Ramesh Suwal Mr. Rajendra Man Banepali
Bachelor of Computer Application
6th Semester

Submitted To:
M.C. National Journalism and
Communication University,
Bhopal, India

Study Centre:
Lord Buddha Education Foundation,
Maitidevi, Kathmandu, Nepal
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Page 2 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Page 3 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Acknowledgements

It is my pleasure to present this project report. "Avalon". As Management


Development such as efficiency of management development has a vital role for the
economic stability and development of country. In today's, modern life one should
know a bit more than past about email. It has great stability among all the past public
not only businessman & professionals. Nepal being a developing country it is not
getting able to develop communication only by the national or domestic
communication.

One who wants to know about Roster Management System can be taken this
work as a reference. He / she can gather necessary information from it.

I obliged to my family members & my companions for their suggestions,


support & feedback of great value.

I would like to my heart thanks humble gratitude to the state of office of some
organization like Lord Buddha Education Foundation (LBEF) and United Nation
Development Programme (UNDP) project Micro-Enterprise Development
Programme (MEDEP) for their valuable suggestion & guidance & I'm also grateful for
its co-operation & co-ordination in providing necessary information.

I would like to extend my sincere gratitude & respect to the teachers and all
friends for his contribution & suggestions at different step to prepare the report.

Rajend ra Man Banepali


Bhaktapur-17

Page 4 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Roster Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. ……………………………….. Mr. ………………………………..


Viva – Voce Panel Viva – Voce Panel
Date:-…………………………… Date:-……………………………

Page 5 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Roster Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. ………………………………..
Univiversity LC
Date:-……………………………

Page 6 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

SELF CERTIFICATE

This is to certify that the dissertation/project report entitled


“Avalon (Roster Management System)” is done by me
Is an authentic work carried out for the partial fulfilment of the
Requirements for the award of the degree of Bachelor of Computer
Applications under the guidance of Mr. Ramesh Suwal.
The matter embodied in this project work has not been submitted
Earlier for award of any degree or diploma to the best of my
Knowledge and belief.

Signature of the student


Rajendra Man Banepali
Roll No.
Lord Buddha Education Foundation
Maitidevi, Kathmandu

Page 7 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Roster Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. P Jejriwal
Managing Director
Date:- ……………………………

Page 8 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Roster Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. Pankaj Jalan


Administrative Director
Date:- ……………………………

Page 9 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Ros ter Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. Prakash Kumar


Academic Director
Date:- ……………………………

Page 10 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Roster Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. Kamal Mani Dikshit


Head of Department
Date:- ……………………………

Page 11 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Faculty of Computer
Makhanlal Chaturvedi Rashtriya Patrakarita
yewam Sanchar Vishwavidyalaya, Bhopal

Student Centre Certificate

This is certify that project work assignment report

Submitted By:
Rajendra Man Banepali

Entitled
"A project work of Avalon (Roster Management System) " has been
prepared as approved by this computer programming
department. The project framework assignment is forward for
examination.

Mr. Ramesh Suwal


Project Guide
Date:-……………………………

Page 12 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Abbreviation

BCA Bachelor of Computer Application


MCRP Makhanlal Chaturbedhi National Journalism and
Communication University.
LBEF Lord Buddha Education Foundation
HI-Take Highly Technical
PH Personal History
AH Academic History
TH Training History
EH Experience History
DMS Dynamic Menu System
UNDP United Nationa Development Programme
MEDEP Micro-Enterprise Development Programme
CV Curricula Vita

Page 13 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Table of Content
1. BACKGROUND ........................................................................................................................................................16

2. INTRODUCTION .....................................................................................................................................................17

3. OBJECTIVE AND SCOPE.....................................................................................................................................18

3.1. HUMAN RESOURCE M ANAGEMENT .................................................................................................................18


3.2. CAPACITY BUILDING ..........................................................................................................................................18
3.3. BUILDING P ROFESSIONALISM STATUS THROUGH ACADEMIC PRACTICE ....................................................18

4. PROJECT OUTLINE...............................................................................................................................................19

4.1. T HEORITICAL BACKGROUND............................................................................................................................20


4.2. DEFINATION OF PROBLEM.................................................................................................................................20
4.3. CONCEPTUAL FRAMEWORK..............................................................................................................................21
4.3.1. Architectural Framework ...........................................................................................................................21
4.3.2. Structure Framework...................................................................................................................................22
4.4. PROJECT T IMELINE AND SYSTEM PLANNING OR PERT CHART ....................................................................23
4.5. PROJECT INTEGRATION AND M ODULES ..........................................................................................................24
4.5.1. Personal History (PH) ................................................................................................................................24
4.5.2. Academic History (AH) ...............................................................................................................................24
4.5.3. Training History...........................................................................................................................................24
4.5.4. Experience History (EH).............................................................................................................................24
4.5.5. Dynamic Menu System (DMS)...................................................................................................................24
4.5.6. User Creation ...............................................................................................................................................24
4.5.7. Use Management and Permission of Accessible of Menu .....................................................................24
4.6. T OOLS E NVIRONMENT USED: ...........................................................................................................................25
4.6.1. Hardware specification of machine used .................................................................................................25
4.6.2. Software used along With the version. .....................................................................................................25

5. SOFTWARE ENGINEERING AND DESIGN .................................................................................................26

5.1. ANALYSIS AND D ESIGN .....................................................................................................................................26


5.1.1. Project Analysis along with user requirements ......................................................................................26
5.1.2. Feasibility Study and Cost-Benefit Analysis ............................................................................................27
5.1.3. Programming Language and Platform ....................................................................................................27
5.1.4. System Design:.............................................................................................................................................28
5.1.4.1. Input Design.............................................................................................................................................28
5.1.4.2. Output Design..........................................................................................................................................29
5.1.4.3. Database D esign .....................................................................................................................................29
5.1.4.4. Module level Design ...............................................................................................................................30
5.1.5. Design Methodology....................................................................................................................................30
5.1.5.1. Information System Design and Optimization System (ISDOS) :- .................................................30

Page 14 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

5.1.5.2. Pseudocode : - ..........................................................................................................................................30


5.1.5.3. Structured Des ign (SD):-.......................................................................................................................30
5.1.5.4. Jackson Design Methodology (JDM)..................................................................................................30
5.1.5.5. Hierarchy Plus Input, Process, and Output (HIPO).........................................................................31
5.1.6. Specific Data Abstraction, Information Hiding ......................................................................................31
5.1.7. Table structure..............................................................................................................................................32
5.1.8. DFDs, Data Dictionary, Pert chart etc....................................................................................................32
5.1.9. Form Design .................................................................................................................................................34
5.1.10. Coding.......................................................................................................................................................36
5.2. T ESTING & DEBUGGING (M ETHOLOGY USE FOR T ESTING ).........................................................................37
5.2.1. Error Fault and Reliability.........................................................................................................................37
5.2.2. Functional Testing.......................................................................................................................................37
5.3. USER OPERATION M ANNUAL ...........................................................................................................................37
5.3.1. Security of the System ..................................................................................................................................37
5.3.1.1. Physical Security.....................................................................................................................................37
5.3.1.2. Operating System Level Security,........................................................................................................37
5.3.1.3. Database Security,..................................................................................................................................37
5.3.1.4. Application Security,..............................................................................................................................38
5.3.1.5. Transaction Security, .............................................................................................................................38
5.3.2. Backup and Restore Database...................................................................................................................38

6. OPPORTUNITY........................................................................................................................................................41

6.1. E-ROSTER PROCESS ............................................................................................................................................41


6.2. M ORE DYNAMIC USER INT ERACTION ...............................................................................................................41

7. CONCLUSION (THESIS).......................................................................................................................................42

8. BIBLIOGRAPHY......................................................................................................................................................43

9. ANNEX PROFILE ....................................................................................................................................................44

Page 15 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

1. Chapter ( Project Outline )


1. Background

Much more professional technical empowerment and enhancement of under graduate


students in Bachelor of Computer Application (BCA) is essential through practical and
implementation in real field. Lord Buddha Education Foundation (LBEF) has been
conducting BCA since long time. BCA in LBEF is affiliated by Makhanlan Chaturvedhi
National Journalism and Communication University (MCRP), Bhopal, India. BCA has six
semesters and each of semesters has theory and practical subjects so that BCA student can
face the real world out of the door.

There is minor project in 4th semester and major project in 6th semester. This 6th semester
project work has potential hidden objective to promote the student for practical war of the
competitive market of software industry in the Nepalese market. Not only hi-take and theory
concept is sufficient but also practical desired is essential for reality.

Page 16 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

2. Introduction

BCA is three years regular programme for computer application and diversify field of
computer concept. Mr. Rajendra Man Banepali (I) is a student of BCA and I am in 6th
semester in current scenario with this concept paper of major project. This is monitor and
evaluated by MCRP university of Bhopal, India through LBEF, Kathmandu, Nepal.

My project name is “Connecting Avalon (Avalon)” for roster extension. This type of
project has potential objective for human resource and hiring right people. Avalon has
extension of roster management, administration of users and more about roster. Avalon has
been conceptualized for easy and efficient human resource management in any organization.
Avalon helps in human resource department as well as resource hiring for any one due to its
online service.

Page 17 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

3. Objective and Scope

This academic project work of under graduate student in Bachelor of Computer


Application (BCA). First objective is to build the capacity of BCA student in practical fie ld
of software engineering and development along with efficient management of Human
Resource Management in an organization. Avalon, begin HRM software, has been helpful for
managing detail of person and organization for planning, hiring people for specific propose.

3.1. Human Resource Management


Avalon is to management detail information about people working with personnel
information, academic details and training as well as experiences. This information is very
huge however Avalon handles all these data very easily.

3.2. Capacity building


Capacity and skill are assets of every one and most of case in student age. Avalon
promotes my capacity in Microsoft .Net framework, especially in c# technology with
ASP.NET. Avalon is being developed in ASP.NET with C#.

3.3. Buildin g Professionalism status through academic practice


Avalon is my one of the project that I want to implement in the professional
organization so that I could be able to establish myself in Nepalese software industry. I am
searching such type of organization. It is best practice of academic phase not commercial
phase of development. So, Avalon has principal and potential enhancement with academic
base line.

Page 18 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4. Project Outline
Project outline contains introduction of project summary which describes about project
development related details. The review of project outline is bellow.

Review project outline


a. Theoretical Background
b. Problem Defination
c. Conceptual Framework
d. Project Timeline
e. Project Integration and Modules
f. Tools Environment used:
1. Hardware specification of machine used
2. Software used along With the version.

Page 19 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4.1. Theoritical Background


Hiring human resource with processing multiple CVs is called roster. Roster is a
important process for hiring consultant and shorterm staff or an organization. It directly
affects the management committee to manage the organization.

Avalon has been introduce d for managing R oster process. It is based on manual work
of the roster. It gets the application from applicants and register into the system and store
essential information. Avalon produces the essential information for management.

4.2. Defination of Problem


Collecting CVs and applications is not hard as if managing CVs and applications and
information. It make s us slow and late for next job. If we have to compare and manage
just 5 and 10 CVs, it is easy whereas it is very tedious job when it is necessary to manage
more and more. Not only receiving the CVs, but also we have to do processing for hiring
people in the job. It is very har d to compare and make it possib le for hiring.

This is the main problem that Avalon has slove and reduce the time for productive
work for management.

Page 20 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4.3. Conceptual Framework


Conceptual Framework (CF) gives us the abstract meaning of Avalon in two way these
are follows.

4.3.1. Architectural Framework

Page 21 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4.3.2. Structure Framework

Page 22 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4.4. Project Timeline and System Planning or Pert Chart

Timeline in weeks for 5 months


Total 1 1 1 1 1
Sn Task Weeks 1 2 3 4 5 6 7 8 9 0 2 3 4 5
1 Proposal Preparation 1
Fesibility Study/ Information
2 Collection 1
System Requirement Specification
3 (SRS) 3
Design (Database, Concept,
4 Functions) 2
5 Programming Code 2
6 Testing 2
7 Implementing 2
8 Project Report Writing 3

::: Pie Chart of Project Development timeline or pert chart

Total Weeks for Project Development

Proposal Fesibility Study/


Project Report Preparation Information
Writing Collection
6%
18% 6%

System
Requirement
Specification
Implementing (SRS)
13% 18%

Design (Database,
Testing Concept,
13% Functions)
13%

Programming Code
13%

Page 23 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4.5. Project Integration and Modules

4.5.1. Personal History (PH)


PH has personnel information of person and potential resource of applicant.
PH has name of person, address, age, sex, gender, ethnicity, contact and more.

4.5.2. Academic History (AH)


AH store academic progress of applicant for his area of expertise.

4.5.3. Training History


His technical and other vocational skill are entered in to the TH section and it
is associated with Personal History (PH).

4.5.4. Experience History (EH)


EH can store experience and promotion of person during his working practice.

4.5.5. Dynamic Menu System (DM S)


DMS is very clear and easy for user permission. It is automatically displayed
according to user permission level set by creating user in the Avalon. DMS has
provides the abstraction of permission with tree view structure of menu in Avalon.
Tree view structure has implemented recursive function to manage hierarchy of menu.

4.5.6. User Creation


Avalon has facility of user creating and modification for dynamic users and
additional users.

4.5.7. Use Management and Permission of Accessible of Menu


Avalon has implemented menu item management for user permission and
accessibility of system component. It affects the DMS of Avalon.

Page 24 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

4.6. Tools Environment used:

4.6.1. Hardware specification of machine used


• Pentium 4, Intel Micro Processor
• RAM 128 MB
• HDD 40 GB
• Sound System

4.6.2. Software used along With the version.


• Dream Weaver MX
• Edit Plus 2.0.1
• Flash MX
• Language s: - Hypertext Markup Language (HTML) 4.0.0, Active Server Page
.NET (ASP .NET with C#) 3.0, Java script, VB script
• Database:- Microsoft SQL Server , Text Files , XML
• Microsoft V isio 2003
• Microsoft Word 2000
• OS – Windows 2000 or higher
• WEB Server – Internet Information System (IIS) or IIM
• Microsoft Access SQL Client from Microsoft SQL Server.

Page 25 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

2. Chapter

5. Software Engineering and Design

Review Software Engineering and Design


1. Analysis and Design
2. Testing & Debugging
3. User Operation Manual

5.1. Analysis and Design


This section should be included and depicted clearly in the project file such as flow
charts, Data flow Diagrams, Use of Decision table, Structural Analysis, ER Diagram etc. This
chapter deals with techniques applied in information system analysis, data modeling and
normalization. This chapter shows a process of providing full specification of systems to
users to help them consider and accept. This specification is also a major information source
for designers of the new system. It not only specifies the system's objectives but also
describes the work and its constraints to which designers have to comply.

5.1.1. Project Analysis along with user requirements


Project Analysis, in software engineering, has included project design part
analyzing manual work and documents prepared by manual workers in prior working
style.

To make effective and more practical in daily life of management roster is


very essential for hiring consultant and short term employee. Manual searching for
every CVs and profile is very hard and time consuming so electronics system like
Avalon deducts the time and makes our work efficiency in office. We can search the
CVs of candidates within a couple minute and compares these CVs for further
process. Not only time saving but also we could get up-to-date information about
potential candidates. It is the strength of the Avalon.

This is man-made system category if we see the system definition. Let’s see
the definition of Man-made System from text book.
Man-made systems
Man-made systems include such things as:
1. Social systems: organizations of laws, doctrines, customs, and so on.

Page 26 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

2. An organized, disciplined collection of ideas.


3. Transportation systems: networks of highways, canals, airlines and so on.
4. Communication systems: telephone, telex, and so on.
5. Manufacturing systems: factories, assembly lines, and so on.
6. Financial systems: accounting, inventory, general ledger and so on.

Most of these systems include computers today. As a systems analyst, you will
naturally assume that every system that you come in contact with should be
computerized. And the customer or user, with whom you interact will generally
assume that you have such a bias. A systems analyst will analyze, or study, the system
to determine its essence: and understand the system's required behavior, independent
of the technology used to implement the system. In most case, we will be in a position
to determine whether it makes sense to use a computer to carry out the functions of
the system only after modeling its essential behavior.

5.1.2. Feasibility Study and Cost-Benefit Analysis


Here, for Avalon we can simply use net cost benefit anlysis tool which give the
overall cost of the project. It shows cash follow of budget againt the work in progress.
We can use simple formula for cast estimated,
For example:
Net Cost = {working days(analyst + programmer + data entry) } * { (man/day rate) }

5.1.3. Programming Language and Platform


Microsoft .NET platform is used in Avalon for programming platform. It has
very good frame of web programming in the case of change management, template
and object oriented programming language. Avalon has used framework 2.0 which is
extended version of framework 1.0. We can use both of framework 1.0 and
framewor k 2.0 in single a computer simultaneously. Let’s see some of important thing
in Microsoft .NET framework from text book

Microsoft Says,
The .NET Framework is a development and execution environment that
allows different programming languages & libraries to work together seamlessly to
create Windows-based applications that are easier to build, manage, deploy, and
integrate with other networked systems.

Page 27 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Is .NET a runtime service or a development platform? Answer It’s both hand


actually a lot more. Microsoft .NET is a company-wide initiative. It includes a new
way of delivering software and services to businesses and consumers. A part of
Microsoft.NET is the .NET Frameworks. The .NET frameworks consist of two parts:
the .NET common language runtime and the .NET class library. These two
components are packaged together into the .NET Frameworks SDK which will be
available for free download from Microsoft’s MSDN web site later this month. In
addition, the SDK also includes command-line compilers for C#, C++, JScr ipt, and
VB. You use these compilers to build applications and components. These
components require the runtime to execute so this is a development platform. When
Visual Studio.NET ships, it will include the .NET SDK and a GUI editor, wizards,
tools, and a slew of other things. However, Visual Studio.NET is NOT required to
build .NET applications.

5.1.4. System Design:


Life Cycle of the project:
Let’s see below, Life Cycle, design methology and principles are use when
Avalon is developed. Prototype modeling is use d for Avalon life cycle. While using
prototype modeling is used some of these system design and methologies are used
which are listed bellow.

5.1.4.1. Input Design


While deigning system, input design is very conscious thing that we have to
analyze because it is end-user interface. It is important for in case of data
consistency and data integrity. We have to design input screens and layout in such a
way that end-user can enter data and information easily and in limited time for
efficiency. We have to conscious in data entry of option values while we are in main
form for editing and new data entry. It helps the user to reduce the half of the data
entry time and management. Some of the essential data entry forms are bellow.

i. Login Form
Basically, for security purpose to view mails we should login site and can see
our personal mails only.

Page 28 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

ii. Personnel History


This form is user for data entry of personnel information about the candidate.
It includes other sub form like qualification, training and experience which has
more than 5 sub input form for option values which is popup while entering
data.

5.1.4.2. Output Design


A number of basic design principles ensure that the output is presented in a
way that is easy to understand and interpret. Notes, headings, and output formats
should be standardized whenever possible. Format consistency is an attribute of
‘user-friendly’ output. Users feel comfortable with familiar layouts. Acronyms and
abbreviations in output should be avoided especially when the output will serve
novice users. Define words that may be unfamiliar to the user. Algorithms and
assumptions on which calculations are based should be available to users of the
output. This assures correct interpretation of output.

5.1.4.3. Database Design


A specialized set of programs, called a Data Base Management System
(DBMS) is generally acquired to help computer users’ access and manipulate the
data in a data base system. Most DBMS include a special query language that allow
users to access the data base, retrieve information from data base wit hout having to
write a program. Data can be added, retrieved, updated, and deleted from data base
using DBMS functions. If writing an application program for a transactional system
n batch, the programmer accesses and uses the data base by writing the program in a
record-level language provided by the DBMS, which is called the host language. An
important function provided by a DBMS is data independence. Data independence
means that users and programmers are insulated from database. They do not know
how the physical database is stored. Since all access to data is made via the DBMS,
data base management systems can perform another important function- data access
protection. For example, the DBMS might be programmed to refer to an internal
security matrix to determine which data elements a particular user is permitted to
access and what type of operations that users can perform- read only, write only, or
read, write and delete.

Page 29 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

5.1.4.4. Module level Design


While designing modules, Avalon has been considered as having independent
module concept. Any module has no dependency with other module even with data
of programming and configuration along with database system. This concept reduce
the error raise on transit period of switch in modules and running modules
independently.

5.1.5. Design Methodology


There are many ways to approach system design and many tools and techniques
that contribute to the design process. In this part we will find a discussion of still
other methodologies that are comely used by analysts.

5.1.5.1. Information Syste m Design and Optimization System (ISDOS) :-


It will be able to generate system specifications from user requirements recorded
in a machine -readable form, design an optimal system to meet these specifications,
and construct code for operational system.

5.1.5.2. Pseudocode :-
Pseudocode can be used to describe an algorithm. Although pseudocode
resembles structured English (SE) in using a restricted subset of English, it may be
coded and more closely resemble a programming language.

5.1.5.3. Structured Design (SD):-


Nature of SD is achieved (implemented) by dividing the system in independent
modules (separate pieces) that can be designed, implemented and modified with no
(or little) effect on other modules of the system. Coarse (tho) program structure,
based on DFD, is depicted by means of a structure chart. This structure chart, which
resembles an organization chart, show relationships between units or modules, and
how modules are combined to achieve systems (organization) and design goals. SD
is user for Avalon when developed.

5.1.5.4. Jackson Design Methodology (JDM)


The JDM is a three -step design technique. In essence, it decomposes the
design process itself.

Page 30 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

5.1.5.5. Hierarchy Plus Input, Process, and Output (HIPO)


HIPO is a graphic technique that can be used to describe a system. A series
of drawings are prepared by analysts that show the function of the system starting
with general overview diagrams, then proceeding to detailed diagrams of each
specific function.

5.1.6. Specific Data Abstraction, Information Hiding


Avalon has used completely object oriented programming language (OOP)
concept. It is implemented by Microsoft .NET. Avalon has used C# for
programming interface which is absolutely OOP language. There is class for data or
information hiding whereas method and function are used for complexity hiding for
process and data.
Let see the one example of the project which show the completely reduce
complexity of process and data hiding for configuration of database.
File Name: DatabaseEngine.cs

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Resources;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for Class1

namespace sahara
{
public class DatabaseEngine
{
public SqlConnection SqlConn;
public String dsn;
public SqlDataSource ds;

public DatabaseEngine()
{
//
// TODO: Add constructor logic here
//
//Get_Connection();
dsn = ConfigurationSettings.AppSettings["DSN"];
}

Page 31 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

// *** Making connection with database


public SqlConnection Get_Connection()
{
try
{
dsn = ConfigurationSettings.AppSettings["DSN"];
SqlConnection SqlConn = new SqlConnection(dsn);
return SqlConn;
}
catch (Exception eo)
{
Functions.Sys_Error = eo;
throw eo;
//Func tions.Set_Error(eo);
}
}}

5.1.7. Table structure

Table Diagram

About SQL Server and database code we can refer annex #13 . Avalon has implemented
Microsoft SQL Server 2000 and its facilities.

5.1.8. DFDs, Data Dictionary, Pert chart etc.


In the late 1970s da ta-flow diagrams (DFDs) were introduced and popularized for
structured analysis and design (Gane and Sarson 1979). DFDs show the flow of data

Page 32 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

from external entities into the system, showed how the data moved from one process
to another, as well as its logical storage. Figure 1 presents an example of a DFD
using the Gane and Sarson notation. There are only four symbols:
• Squares representing external entities, which are sources or destinations of
data.
• Rounded rectangles representing processes, which take data as input, do
something to it, and output it.
• Arrows representing the data flows, which can either, be electronic data or
physical items.
• Open-ended rectangles representing data stores, including electronic stores
such as databases or XML files and physical stores such as or filing cabinets
or stacks of paper.
Figure 1
Avalon (Roster Management)

P #1.0
Applicant Application for
Roster

P #2.0 D1: Roster


Register in Roster

P #3.0 D2: Academic,


Training,
Enrolment and Experiece, etc
further information

P #4.0
Emailing and contact Details Reports
or Staement

Page 33 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Hre, we can see an applicant is eleme nt of our external input and going for internal
input in our system as application in roster in process #1. If applicat is valid then it is process
for registration into roster database in process #2. Pocess #3 show the processing of detail
information of applicant to store into D2 which indicates the Academic, training and
experiences database. And all these are prepared by reports module and it is deseminated by
our process of #4.0 to essential unit and department. It is used for communicating the
applica nt too.

5.1.9. Form Design


::: Login

::: Home Page

::: Search Person for Editing

Page 34 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

::: Update Personnel History

::: Search Person Details By Criteria

Page 35 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

::: Menu Administration

5.1.10. Coding
Aavlon has use Microsoft .NET framework 2. 0 which reducre more than 70% of
C# code than framework 1.0. It has very good libraries like SqlDataSource which
works for connection, command object and reader for Grid view. We can see this
entire thing in project source code. Please see annex profile from #1 to #12 for
project source code.

Page 36 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

5.2. Testing & Debugging (Methology use for Testing)

5.2.1. Error Fault and Reliability


This project has very good testing period. It is conducted while it is
implemented. System development phase and implementation are goes parallel along
with comments.

5.2.2. Functional Testing


Avalon has centralized code system which controls the informality of
functions and procedures. Most of the time is devoted for functional testing in
development of Avalon.

5.3. User Operation Mannual

5.3.1. Security of the System


Avalon has implemented the .NET security layer of database connection for
data security and APSP.NET user security for web server. While we have to user
network Microsoft SQL Server database, we should have permission of computer
(WEB Server) user of the computer for the Microsoft SQL Server computer. Only
ASP.NET assigned user can access the data and information of the SQL Server which
is implemented by Avalon.

5.3.1.1. Physical Security


Source file is existed in web server so client computer can just access a copy
of web page allotted by web server.

5.3.1.2. Operating System Level Security,


Use name and password project the data of individual and session object
control the session which is highly used fro session security. After finishing the
session data can not be accessed.

5.3.1.3. Database Security,


Database has its own username and password which save the data of database.
Database consists of all the data and information of roster in Avalon.

Page 37 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

5.3.1.4. Application Security,


It’s a web base application and it depends upon the web server security. It can
get all the security provided by web server like Internet Information Service (IIS).

5.3.1.5. Transaction Security,

Session is used to make more secure the transaction with ADO.NET Trascation
facilities.

5.3.2. Backup and Restore Database


Avalon has implemented Microsoft SQL Server Database. So, before backup
and recovery system we should know about Microsoft SQL Server. Let’s see some
about SQL Sever.

SQL Server is a relational database management system (RDBMS) produced


by Microsoft. Its primary query language is Transact-SQL, an implementation of the
ANSI/ISO standard Structured Query Language (SQL) used by both Microsoft and
Sybase. SQL Server is commonly used by businesses for small- to medium-sized
databases, but the past five years have seen greater adoption of the product for larger
enterprise databases.

Microsoft® SQL Server™ 2005 provides support for creating snapshots from
SQL Server data using Volume Shadow Copy Service (VSS). This is accomplished
by providing a VSS compliant writer (the SQL writer) so that a third-party backup
application can use the VSS framework to back up database files. This paper
describes the SQL writer component and its role in the VSS snapshot creation and

Page 38 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

restores process for SQL Server databases. It also captures details on how to configure
and use the SQL writer to work with backup applications in the context of the VSS
framework.

How to get Backup? See the picture bellow;

This is first screen to get the complete backup of Avalon which do backup with all the
component of the database and schema of users with log. There are four type of backup in
SQL Server. They are:-
1. Database – Complete
2. Database Differential
3. Transaction Log
4. File and file group

Page 39 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

As we do backup, we have to restore the database. Simply we user Database-Complete


Backup for complete backup of database in which we can restore all database with user
schema. There are four type of retoring database as Backup type. They are;
5. Database – Complete
6. Database Differential
7. Transaction Log
8. File and filegroup

Note: We have to give new database name for restoring database otherwise the database
is not restoring into the database. The physical database is store with its real name not
according to given name when we store the database.

Page 40 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

6. Opportunity
6.1. E-Roster process
Avalon has a challenge of roster process. Not only in manual but also it should be
completed in e-Roster process management in Avalon. It is further enhancement of
Avalon in new version. It is a opportunity of Avalon in coming future.

6.2. More dynamic user interaction


I want to implement mail system or others communication system in Avalon so that each
and every users can share their information and share their e-Roster process selection. It
is very essential feature of Avalon in coming version.

Page 41 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

7. Conclusion (Thesis)
Avalon will be best academic practice of Microsoft .Net framework in ASP.NET with
c#. Avalon has implement dynamic component with new Microsoft technology for faster and
well being ranking.

This present project report has been undertaken to examine and evaluate the Avalon
(Roster Management System) in web base application. Web base application has so many
advantages that we can get through that application.

About the issue of security, this project is built on Microsoft .NET framework so, all the
security and protection have been inherited automatically when we use this system. In
additional we have implement session approach which make more secured. Lastly, it’s better
system for Roster management system.

Page 42 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

8. Bibliography

• Introduction of Microsoft .NET Framework, website:


http://www.techinterviews.com/?p=74 , http://www.microsoft.com
• System Analysis and Design, Author: Elias M. Awad,
• ASP 3 Instant Reference, Author: Evangelos Petroutsos (BPB Publication),
• System Ana lysis and Design, downloaded from Internet.
• DFDs and flow chart, Author:
http://www.agilemodeling.com/artifacts/dataFlowDiagram.htm
• SQL Server and other information, http://en.wikipedia.org/

Page 43 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

9. Annex Profile
Annex: #1
Page: DatabaseEngine.cs
Module: System
Task: Database Connection and System Functions

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using Resources;
//using System.Web;
//using System.Web.Security;
//using System.Web.UI;
using System.Web.UI.WebControls;
//using System.Web.UI.WebControls.WebParts;
//using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for Class1

namespace sahara
{
public class DatabaseEngine
{
public SqlConnection SqlConn;
public String dsn;
public SqlDataSource ds;

public DatabaseEngine()
{
//
// TODO: Add const ructor logic here
//
//Get_Connection();
dsn = ConfigurationSettings.AppSettings["DSN"];
}

// *** Making connection with database


public SqlConnection Get_Connection()
{
try
{
dsn = ConfigurationSettings.AppSettings["DSN"];
SqlConnection SqlConn = new SqlConnection(dsn);
return SqlConn;
}

Page 44 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

catch (E xception eo)


{
Functions.Sys_Error = eo;
throw eo;
//Functions.Set_Error(eo);
}
}

//*** Feeding data into grid


public GridView Show_Grid(String Isql, GridView Grid)
{
SqlDataSource ds = new SqlDataSource();
ds.ProviderName = "System.Data.SqlClient";
ds.ConnectionString = dsn;
ds.SelectCommand = Isql;
Grid.AllowPaging = true;
Grid.AllowSorting = true;
//Grid.Columns.Add("select");
Grid.DataSource = ds;
Grid.DataBind();
ds.DataBind();
return Grid;
}

public SqlDataSource Prepare_SqlDataSource(String isql, SqlDataSource ds)


{
ds.ConnectionString = dsn;
ds.SelectCommand = isql;
return ds;
}

// *** Making DataReader Dataset


public SqlDataReader Get_DataReader(String isql)
{
try
{
SqlConn = Get_Connection();
SqlCommand cmd = new SqlCommand(isql, SqlConn);
SqlConn.Open();
SqlDataReader Reader = cmd.ExecuteReader();
//Reader.Read();
return (Reader);
}
catch (Exception eo)
{
Exception e = new Exception(eo.Message.ToString() + "===========" + isql);
throw e;
}
}

Page 45 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

public String Get_NewID(String Table_Name, String Field_Name)


{
try
{
String id;
String isql = "Select Max(" + Field_Name + ")+1 as newid From " +
Table_Name;
SqlDataReader rs = Get_DataReader(isql);
rs.Read();
id = rs["newid"].ToString();
return id;
}
catch (Exception eo)
{
Exception eo1 = new Exception("Error on Get_NewID
Function\n===============\n"+eo);
throw eo1;
}
}

public String Get_FieldValue(String Table_Name, String Field_Name, String Key,


String Criteria)
{
try
{
String id;
String isql = "Select " + Field_Name + " From " + Table_Name + " Where " +
Key + "='" + Criteria + "'";
SqlDataReader rs = Get_DataReader(isql);
rs.Read();
if (rs.HasRows == true)
{
id = rs[Field_Name].ToString();
}
else
{
id = "[no_rows]";
}
return id;
}
catch(Exception eo)
{
Exception eo1 = new Exception("Error on Get_Value
Function\n===========\n"+eo);
throw eo1;
}

public SqlCommand Get_ Command()

Page 46 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
SqlConn = Get_Connection();
SqlConn.Open();
SqlCommand sqlcmd = new SqlCommand();
sqlcmd.Connection = SqlConn;

return sqlcmd;
}

public DropDownList Fill_Combo(DropDownList Combo, String Isql)


{
Combo.Items.Clear();
SqlDataReader rs = Get_DataReader(Isql);

//ListItem ls1 = new ListItem("No Selection", "-1");


//Combo.Items.Add(ls1);

while (rs.Read() != false)


{
ListItem ls = new ListItem(rs[0].ToString(), rs[1].ToString());
Combo.Items.Add(ls);
}
return Combo;
}

public ListBox Fill_ListBox(ListBox Combo, String Isql)


{
Combo.Items.Clear();
SqlDataReader rs = Get_DataReader(Isql);

//ListItem ls1 = new ListItem("No Selection", "-1");


//Combo.Items.Add(ls1);

while (rs.Read() != false)


{
ListItem ls = new ListItem(rs[0].ToString(), rs[1].ToString());
Combo.Items.Add(ls);
}
return Combo;
}

public DropDownList Fill_Combo(DropDownList Combo, String Isql, B oolean


No_Selection)
{
Combo.Items.Clear();
SqlDataReader rs = Get_DataReader(Isql);

if (No_Selection == true)
{

Page 47 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

ListItem ls1 = new ListItem("No Selection", "-1");


Combo.Items.Add(ls1);
}

while (rs.Read() != false)


{
ListItem ls = new ListItem(rs[0].ToString(), rs[1].ToString());
Combo.Items.Add(ls);
}
return Combo;
}

public String Get_Version()


{
String tmp = Resource.Version;
return tmp;
}

public Boolean Delete_Data(String Table_Name, String Search_Field_Name,


String Search_Value)
{
//**** Created Date:- Feb-17-2007
//**** Last Modified Date:- Feb-17-2007
try
{
String id;
String isql = "Delete From " + Table_Name + " Where " + Search_Field_Name
+ "='" + Search_Value + "'";
SqlCommand cmd = Get_Command();
cmd.CommandText = isql;
cmd.ExecuteNonQuery();
return true;
}
catch (Exception eo)
{
//Exception eo1 = new Exception("Error on Get_NewID
Function\n===============\n" + eo);
//throw eo1;
return false;
}
}

}
}

Annex: #2
Page: Side_menu_master.master.cs
Module: Menu

Page 48 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Task: Display Tree Menu

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class side_menu_master : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
if (Session["User_Name"] != null)
{
Label_User_Name.Text = " Log on: " +
Session["User_Name"].ToString().ToUpper();
}
else
{
Label_User_Name.Text = " Log on: Unkown";
}
Add_Menu();
}

protected void Add_Menu()


{
DatabaseEngine de = new DatabaseEngine();
String PID = "";
if (Session["Permission_Level_ID"] != null)
{
PID = Session["Permission_Level_ID"].ToString();
}
else
{
PID = "3";
}

String Isql =
"Select * From VIEW_Menu_Configuration Where Visible=1 and
Permission_Level_ID=" + PID + " Order by Menu_Item_ID";
SqlDataReader rs = de.Get_DataReader(Isql);
TreeView1.Nodes.Clear();

Page 49 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

while (rs.Read())
{
String Menu_Item = rs["Menu_Item"].ToString();
String Menu_Item_ID = rs["Menu_Item_ID"].ToString();
String Menu_Item_Parent_ID = rs["Menu_Item_Parent_ID"].ToString();
String Link = rs["Link"].ToString();
String Target = rs["Target"].ToString();

TreeNode node = new TreeNode(Menu_Item, Menu_Item_ID, "", Link, Target);


TreeNode node_parent = TreeView1.FindNode(Menu_Item_Parent_ID);

if (node_parent != null)
{
node_parent.ChildNodes.Add(node);
}
else
{
TreeView1.Nodes.Add(node);
}
}

}
}
}

Annex: #3
Page: Personnel_history.aspx.cs
Module: Human Resource
Task: Data entry and update Personnel History, Qualification, Training and Experiences

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class Update_Recruitment_Master : System.Web.UI.Page
{
protected String Person_ID = "";
protected String Info = "";
protected String Isql = "";

Page 50 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

protected DatabaseEngine de = new DatabaseEngine();

protected bool AddingNew


{
get
{
object o = ViewState["AddingNew"];
return (o == null) ? false : (bool)o;
}
set
{
ViewState["AddingNew"] = value;
}
}

protected void Page_Load(object sender, EventArgs e)


{
Label_Title.Text = " ::: Personnel History";

if (Request.QueryString["mode"] == "new")
{
Response.Cookies["Person_ID"].Expires = DateTime.Now;
Response.Cookies["Search_Person_ID"].Expires = DateTime.Now;
AddingNew = true;
Response.Redirect("Personnel_History.aspx");
MultiView1.ActiveViewIndex = 0;
}

if (!IsPostBack)
{
//DatabaseEngine de = new DatabaseE ngine();
Isql = "Select Qualification_Name, Qualification_Name_ID From
Tbl_Qualification_Name Order By Qualification_Name_ID";
DropDownList_Qualification_Name =
de.Fill_Combo(DropDownList_Qualification_Name, Isql);

//Load_Project_Combo();
//Load_Post_Data();
//Load_Post_Level_Data();
//Load_Employee_Type_Data();
Load_Permission_Level();
Load_Training_Type();
Load_Experience_Post_Level();

if (Request.Cookies["Person_ID"] != null)
{
String ID = Request.Cookies["Person_ID"].Value.ToString();
Load_Data(ID);
Load_Data_Qualification_List(ID);
Load_Data_Training_List(ID);

Page 51 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Load_Data_Experience_List(ID);
AddingNew = false;
}
else
{
Load_Data();
AddingNew = true;
}
}

if (Request.Cookies["Person_ID"] != null)
{
String ID = Request.Cookies["Person_ID"].Value.ToString();
//Load_Data(ID);
MultiView1.ActiveViewIndex = 0;
Load_Data_Qualification_List(ID);
Load_Data_Training_List(ID);
Load_Data_Experience_List(ID);
//Label_Show_Time.Text = "[" + DateTime.Now.ToLongTimeString() + "] ";
AddingNew = false;
}

if (Request.Cookies["Search_Person_ID"] != null)
{
String Search_Person_ID =
Request.Cookies["Search_Person_ID"].Value.ToString();
Load_Data_Recruitment_Detail_Searched(Search_Person_ID);
}
else
{
Load_Data_Recruitment_Detail_Searched("-1");
}
}

protected void Load_Permission_Level()


{
//DatabaseEngine de = new DatabaseEngine();
Isql = "Select Permission_Level_Name, Permission_Level_ID From
Tbl_Permission_Level order by Permission_Level_ID desc";
DropDownList_Permission_Level_ID =
de.Fill_Combo(DropDownList_Permission_Level_ID, Isql);
}

protected void ImageButton_ShowHide_Person_Detail_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Person_Detail.Visible == false)
{
MultiView_Person_Detail.Visible = true;

Page 52 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

LinkButton_Save.Enabled = true;
}
else
{
MultiView_Person_Detail.Visible = false;
LinkButton_Save.Enabled = false;
Label_Title.Text = Label_Title.Text + " [" + TextBox_First_Name.Text + " " +
TextBox_Last_Name.Text + "]";
}
}

protected void Load_Data()


{
AddingNew = true;

Label_Person_ID.Text = "New Information";


TextBox_First_Name.Text = null;
TextBox_Last_Name.Text = null;
//DropDownList_Person_Type.Text = null;
DropDownList_Sex.Text = null;
TextBox_DOB.Text = DateTime.Now.ToShortDateString();
//DropDownList_Ethnicity.Text = null;
TextBox_Address.Text = null;
TextBox_Phone.Text = null;
TextBox_Mobile.Text = null;
TextBox_Email.Text = null;
TextBox_Keyword.Text = "";
Label_Info.Text = "Adding new..";
Panel1.Visible = true;
LinkButton_Save.Enabled = true;
}

protected void Load_Data(String ID)


{
try
{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();
String Isql = "Select * From View_Person Where Person_ID=" + ID;
SqlDataReader rs = de.Get_DataReader(Isql);
rs.Read();

// *** Assign Values


if (MultiView_Person_Detail.Visible==false)
{
Label_Title.Text = Label_Title.Text + " [" + rs["name"].ToString() +"]";
}
Label_Person_ID.Text = ID;
TextBox_First_Name.Text = rs["First_Name"].ToString();

Page 53 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

TextBox_Last_Name.Text = rs["Last_Name"].ToString();
DropDownList_Person_Type.Text = rs["Person_Type"].ToString();
DropDownList_Sex.Text = rs["Sex"].ToString();
TextBox_DOB.Text = rs["DOB"].T oString();
DropDownList_Ethnicity.Text = rs["Ethnicity"].ToString();
TextBox_Address.Text = rs["Address"].ToString();
TextBox_Phone.Text = rs["Phone"].ToString();
TextBox_Mobile.Text = rs["Mobile"].ToString();
TextBox_Email.Text = rs["Email"].ToString();
TextBox_Keyword.Text = rs["Keyword"].ToString();
TextBox_Username.Text = rs["User_name"].ToString();
TextBox_Password.Text = rs["User_Password"].ToString();
DropDownList_Permission_Level_ID.SelectedValue =
rs["Permission_Level_ID"].ToString();

if (Session["Permission_Level_ID"] != null)
{
if (Session["Permission_Level_ID"].ToString().CompareTo("1") == 0 ||
Session["Permission_Level_ID"].ToString().CompareTo("2") == 0)
{
Panel1.Visible = true;
}
else
{
Panel1.Visible = false;
}
}

//MapPath("..\\..\\cv_profile \\" +
//*** CV Link Processing ****
if (rs["CV"].ToString() != "")
{
String CV_Path = rs["CV"].ToString();
String CV_File = Functions.Get_FileName(CV_Path);
//String CV = "..\\..\\cv_profile \\" + CV_File;
String CV = "../../cv_profile/" + CV_File;
//String CV = "..\\..\\cv_profile \\" + CV_File;
String CV_Text = "<A href='" + CV + "' Target=_new> Download CV
</A>";
Label_CV.Text = CV_Text;
}
AddingNew = false;
Info = "Loaded..";
}
else
{
AddingNew = true;
Info = "Add New..";
}
LinkButton_Save.Enabled = true;

Page 54 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
catch (Exception eo)
{
Info = eo.ToString();
//Functions.Set_Error(eo);
}
Label_Info.Text = Info + " ["+ ID + "]";
}

protected void LinkButton_Save_Click(object sender, EventArgs e)


{
String Person_ID = Label_Person_ID.Text;
String First_Name = TextBox_First_Name.Text;
String Last_Name = TextBox_Last_Name.Text;
String Person_Type = DropDownList_Person_Type.Text;
String Sex = DropDownList_Sex.Text;
String DOB = TextBox_DOB.Text;
String Ethnicity = DropDownList_Ethnicity.Text;
String Address = TextBox_Address.Text;
String Phone = TextBox_Phone.Text;
String Mobile = TextBox_Mobile.Text;
String Email = TextBox_Email.Text;
String Keyword = TextBox_Keyword.Text;
String User_name = TextBox_Username.Text;
String User_Password = TextBox_Password.Text;
String Permission_Level_ID =
DropDownList_Permission_Level_ID.SelectedValue.ToString();

String CV = FileUpload_CV.FileName.ToString();
String CV_File_Path = "";
Boolean Save_CV = false;
String CV_Field = "CV";
String CV_Field_Param = "@CV";
String CV_Update_String = "," + CV_Field + "=" + CV_Field_Param;

if (CV.Length >= 5)
{
Label_CV.Text = CV;
Save_CV = true;
//**** for Insert statement if necessary
CV_Field = "," + CV_Field;
CV_Field_Param = "," + CV_Field_Param;
}
else
{
// **** Not inluding CV file when not exist
CV_Update_String = "";
CV_Field = "";
CV_Field_Param = "";
Save_CV = false;

Page 55 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

//DatabaseEngine de = new DatabaseEngine();


try
{
SqlCommand sqlcmd = de.Get_Command();
if (AddingNew == false)
{
Isql =
" Update Tbl_Person set " +
" First_Name=@First_Name, Last_Name=@Last_Name " +
", Sex=@Sex, DOB=@DOB, Person_Type=@Person_Type " +
", Ethnicity=@Ethnicity " +
", Address=@Address " +
", Phone=@Phone " +
", Mobile=@Mobile " +
", Email=@Email " +
", Keyword=@Keyword " +
", User_name=@User_name " +
", User_Password=@User_Password " +
", Permission_Level_ID=@Permission_Level_ID " +
CV_Update_String +
" Where Person_ID=@Person_ID";
Info = "Record Update..";
}
else
{
Isql =
" Insert Into Tbl_Person" +
" (Person_ID, First_Name, Last_Name, Sex, DOB, Person_Type, Ethnicity,
Address, Phone, Mobile, Email, Keyword, User_name, User_Password,
Permission_Level_ID" + CV_Field + ") " +
" values(@Person_ID, @First_Name, @Last_Name, @Sex, @DOB,
@Person_Type, @Ethnicity, @Address, @Phone, @Mobile, @Email, @Keyword,
@User_name, @User_Password, @Permission_Level_ID " + CV_Field_Param + ")";
Info = "Record Inserted..";
Person_ID = de.Get_NewID("Tbl_Person", "Person_ID");
}

sqlcmd.CommandText = Isql;
//Info = sqlcmd.CommandText;
sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar, 8).Value =
Person_ID;
sqlcmd.Parameters.Add("@First_Name", SqlDbType.VarChar, 50).Value =
First_Name;
sqlcmd.Parameters.Add("@Last_Name", SqlDbType.VarChar, 50).Value =
Last_Name;
sqlcmd.Parameters.Add("@DOB", SqlDbType.VarChar).Value = DOB;
sqlcmd.Parameters.Add("@Sex", SqlDbType.VarChar, 10).Value = Sex;
sqlcmd.Parameters.Add("@Person_Type", SqlDbType.VarChar, 50).Value =

Page 56 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Person_Type;
sqlcmd.Parameters.Add("@Ethnicity", SqlDbType.VarChar, 10).Value =
Ethnicity;
sqlcmd.Parameters.Add("@Address", SqlDbType.VarChar, 50).Value =
Address;
sqlcmd.Parameters.Add("@Phone", SqlDbType.VarChar, 50).Value = Phone;
sqlcmd.Parameters.Add("@Mobile", SqlDbType.VarChar , 50).Value = Mobile;
sqlcmd.Parameters.Add("@Email", SqlDbType.VarChar, 50).Value = Email;
sqlcmd.Parameters.Add("@Keyword", SqlDbType.VarChar).Value = Keyword;
sqlcmd.Parameters.Add("@User_name", SqlDbType.VarChar).Value =
User_name;
sqlcmd.Parameters.Add("@User_Password", SqlDbType.VarChar).Value =
User_Password;
sqlcmd.Parameters.Add("@Permission_Level_ID", SqlDbType.VarChar).Value
= Permission_Level_ID;
if (Save_CV == true)
{
CV_File_Path =
MapPath("..\\..\\cv_profile \\" +
Person_ID + "_" +
First_Name + "_" +
Last_Name +
"." + Functions.Get_FileExetension(CV));
//CV.Substring(CV.IndexOf("."), 4));

sqlcmd.Parameters.Add("@CV", SqlDbType.VarChar, 255).Value =


CV_File_Path;
FileUpload_CV.SaveAs(CV_File_Path);
}
int n = sqlcmd.ExecuteNonQuery();
Load_Data(Person_ID);
AddingNew = false;
//Info = n.ToString() + " " + Person_ID + " " + First_Name;
}
catch (Exception eo)
{
Info = eo.ToString() + "\n\n===================\n" + Isql + " " +
AddingNew;
//Functions.Set_Error(eo);
//Info = "Sorry, There is some error in your data please ve rfiy and submit
again.";
}
Label_Info.Text = Info;
}

protected void LinkButton_New_Click(object sender, EventArgs e)


{
Response.Cookies["Person_ID"].Expires = DateTime.Now;
Load_Data();

Page 57 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Load_Data_Qualification_List("-1");
Load_Data_Experience_List("-1");
Load_Data_Training_List("-1");

MultiView1.ActiveViewIndex = 0;
MultiView_Person_Detail.Visible = true;

MultiView2.Visible = false;
MultiView3.Visible = false;
MultiView4.Visible = false;

//Response.Cookies["Person_ID"].Expires = DateTime.Now;
//Response.Redirect("Update_Recruitment_Master.aspx");
}

protected void LinkButton_Tab_New_Click(object sender, EventArgs e)


{
LinkButton_New_Click(sender, e);
}

protected void LinkButton_Tab_Help_Click(object sender, EventArgs e)


{
MultiView1.ActiveViewIndex = 2;
}

protected void GridView1_RowCommand(object sender,


GridViewCommandEventArgs e)
{
Label_Info2.Text = e.CommandName;
switch (e.CommandName.ToLower())
{
case "select":
LinkButton_Qualification_Delete.Text = "Delete";
break;
}
}

/// <summary>
/// Searc h Section Functions ///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_Search_Click(object sender, EventArgs e)
{
Response.Cookies["Person_ ID"].Expires = DateTime.Now;
Response.Cookies["Search_Person_ID"].Expires = DateTime.Now;
TextBox_Search_Value.Text = null;
Load_Data_Recruitment_Detail_Searched("-1");
//Load_Data();

Page 58 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

//Load_Data_ Recruitment_Detail("-1");
MultiView1.ActiveViewIndex = 1;
}

protected void Load_Data_Recruitment_Detail_Searched(String ID)


{
try
{
String StringCtriteria = "";
String[] Arg = new String[3];
String Isql = "";

Arg[0] = " Hello ";


Arg[1] = " Where Person_ID=?";
Arg[2] = " Where Name Like '%?%'";

ID.Trim();
if ((ID.CompareTo("") == 0) || (ID == null))
{
StringCtriteria = "Hello";
Isql =
" Select Person_ID as Code, Name, Address, Sex, DOB, Ethnicity " +
" From VIEW_Person " +
StringCtriteria;
//DatabaseEngine de = new DatabaseEngine();
SqlDataSource1 = de.Prepare_SqlDataSource(Isql, SqlDataSource1);
//GridView2.DataBind();
}
else
{
for (int i = 2; i < Arg.Length; i++)
{
StringCtriteria = Arg[i].Replace("?", ID);
Isql =
" Select Person_ID as Code, Name, Address, Sex, DOB, Ethnicity " +
" From VIEW_Person" +
StringCtriteria;
//DatabaseEngine de = new DatabaseEngine();
SqlDataSource1 = de.Prepare_SqlDataSource(Isql, SqlDataSource1);
//GridView2.DataBind();
GridView_Search.DataBind();
if (GridView_Search.Rows.Count >= 1)
{
break;
}
}
}
if (GridView_Search.Rows.Count >= 1)
{
Label_Search_Info.Text = "Search Completed..";

Page 59 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
else
{
Label_Search_Info.Text = "Record not found.";
}
//Label_Search_Info.Text = Isql + " (ID=" + ID + ")";
}
catch (Exception eo)
{
Label_Search_Info.Text = "Error: "+eo.ToString();
}
}

protected void LinkButton_Search_Data_Click(object sender, EventArgs e)


{
try
{
Response.Cookies["Search_Person_ID"].Expires = DateTime.Now;
HttpCookie Search_Person_ID = new HttpCookie("Search_Person_ID");
Search_Person_ID.Value = TextBox_Search_Value.Text;
Response.Cookies.Add(Search_Person_ID);
Load_Data_Recruitment_Detail_Searched(TextBox_Search_Value.Text);
}
catch (Exception eo)
{
Label_Search_Info.Text = "Error on search.";
}
}
protected void LinkButton_Search_Show_Detail_Click(object sender, EventArgs e)
{
try
{
if (GridView_Search.SelectedIndex >= 0)
{
HttpCookie Person_ID1 = new HttpCookie("Person_ ID");
Person_ID1.Value = GridView_Search.SelectedRow.Cells[1].Text;
Response.Cookies.Add(Person_ID1);
Load_Data(Person_ID1.Value);
Load_Data_Qualification_List(Person_ID1.Value);
Load_Data_Training_List(Person_ID1.Value);
Load_Data_Experience_List(Person_ID1.Value);

MultiView1.ActiveViewIndex = 0;
}
else
{
Label_Search_Info.Text = "Select any row for details.";
}
}
catch (Exception eo)

Page 60 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
Label_Search_Info.Text = "Error on Search..";
}
}
/// <summary>
/// Search Section Functions
/// </summary>
/// <param name="ID"></param>

///
/// Qualification Section
///

protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)


{
if (MultiView2.Visible == true)
{
LinkButton_Qualification_Edit_Click(sender, e);
}
}

protected void Load_Data_Qualification_Detail_Update(String ID)


{
try
{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();
String Isql =
"Select * From View_Qualification Where Qualification_ID=" + ID;
SqlDataReader rs = de.Get_DataReader(Isql);
rs.Read();
// *** Assign Values
Person_ID = rs["Person_ID"].ToString();
Label_Qualification_ID.Text = ID;
Label_Qulification_Person_ID.Text = Person_ID;
DropDownList_Qualification_Name.SelectedValue =
rs["Qualification_Name_ID"].ToString();
TextBox_Qualification_Description.Text = rs["Description"].ToString();
TextBox_Qualification_Passed_Year.Text = rs["Passed_Year"].ToString();
TextBox_Qualification_Institute.Text = rs["Institute_Name"].ToString();
Label_Update_Qualification_Info.Text = "Loaded..";
}
else
{
Label_Qualification_ID.Text = "-1";
Label_Qulification_Person_ID.Text = Label_Person_ID.Text;

Page 61 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

TextBox_Qualification_Description.Text = "";
TextBox_Qualification_Passed_Year.Text = "";
TextBox_Qualification_Institute.Text = "";
Label_Update_Qualification_Info.Text = "Adding new..";
AddingNew = true;
}
}
catch (Exception eo)
{
Label_Update_Qualification_Info.Text = eo.Message.ToString();
}
}

protected void LinkButton_Update_Qualification_Cancel_Click(object sender,


EventArgs e)
{
MultiView2.Visible = false;
}

protected void LinkButton_Qualification_New_Click(object sender, EventArgs e)


{
Load_Data_Qualification_Detail_Update("");
MultiView2.Visible = true;
}

protected void LinkButton_Qualification_Edit_Click(object sender, EventArgs e)


{
try
{
if (GridView2.SelectedIndex != -1)
{
HttpCookie Qualification_ID = new HttpCookie("Qualification_ID");
Qualification_ID.Value = GridView2.SelectedRow.Cells[1].Text;
Response.Cookies.Add(Qualification_ID);
Load_Data_Qualification_Detail_Update(Qualification_ID.Value);
MultiView2.Visible = true;
}
else
{
Label_Info2.Text = "Please, Select any record of the table.";
MultiView2.Visible = false;
}
}catch(Exception eo)
{
Label_Info2.Text = "Error on selection.";
}
}

protected void LinkButton_Update_Qualification_Save_Click(object sender,

Page 62 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

EventArgs e)
{
try
{
String Qualification_ID = Label_Qualification_ID.Text;
String Person_ID = Label_Qulification_Person_ID.Text;
String Qualification_Name_ID =
DropDownList_Qualification_Name.SelectedValue.ToString();
String Description = TextBox_Qualification_Description.Text;
String Passed_Year = TextBox_Qualification_Passed_Year.Text;
String Institute_Name = TextBox_Qualification_Institute.Text;

//DatabaseEngine de = new DatabaseEngine();

SqlCommand sqlcmd = de.Get_Command();


if (Label_Qualification_ID.Text.CompareTo("-1")!=0)
{
Isql =
" Update Tbl_Qualification set " +
" Qualification_Name_ID=@Qualification_Name_ID,
Passed_Year=@Passed_Year " +
", Person_ID=@Person_ID, Description=@Description,
Institute_Name=@Institute_Name " +
" Where Qualification_ID=@Qualification_ID";
Info = "Record Updated..";
}
else
{
Isql =
" Insert Into Tbl_Qualification " +
" (Qualification_ID, Person_ID, Qualification_Name_ID, Description,
Passed_Year, Institute_Name) " +
" values(@Qualification_ID, @Person_ID, @Qualification_Name_ID,
@Description, @Passed_Year, @Institute_Name)";
Info = "Record Inserted..";
Qualification_ID = de.Get_NewID("Tbl_Qualification", "Qualification_ID");
}

sqlcmd.CommandText = Isql;
//Info = sqlcmd.CommandText;
sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
sqlcmd.Parameters.Add("@Qualification_ID", SqlDbType.VarChar).Value =
Qualification_ID;
sqlcmd.Parameters.Add("@Qualification_Name_ID",
SqlDbType.VarChar).Value = Qualification_Name_ID;
sqlcmd.Parameters.Add("@Description", SqlDbType.VarChar).Value =
Description;
sqlcmd.Parameters.Add("@Passed_Year", SqlDbType.VarChar).Value =
Passed_Year;

Page 63 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

sqlcmd.Parameters.Add("@Institute_Name", SqlDbType.VarChar).Value =
Institute_Name;

int n = sqlcmd.ExecuteNonQuery();
//Load_Data_Qualification_Detail_Update(Qualification_ID);
Label_Qualification_ID.Text = Qualification_ID;
Load_Data_Qualification_List(Person_ID);
MultiView2.Visible = false;

//Info = n.ToString() + " " + Qualification_ID + " " + First_Name;


//Label_Info2.Text = Person_ID;
//Info = "Record Updated.." + DateTime.Now.ToShortTimeString();
Info = Info + " " +DateTime.Now.ToLongTimeString();
}
catch (Exception eo)
{
//Info = eo.ToString() + "\n\n=================== \n" + Isql + " " +
AddingNew;
//Functions.Set_Error(eo);
Info = eo.Message.ToString(); // "Sorry, There is some error in your data please
verfiy and submit again.";
}
Label_Update_Qualification_Info.Text = Info;
Label_Info2.Text = Info;
}

protected void Load_Data_Qualification_List(String ID)


{
try
{
if ((Person_ID == "") || (Person_ID == null))
{
Person_ID = "-1";
}

String Isql =
" Select Qualification_ID as ID, Qualification_Name as Degree, Description,
Passed_Year," +
" Institute_Name From View_Qualification" +
" Where Person_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource2 = de .Prepare_SqlDataSource(Isql, SqlDataSource2);
GridView2.DataBind();
Label_Info2.Text = "Loaded.. ";// +DateTime.Now.ToShortTimeString();

//MultiView_Qualification_List.Visible = true;
//LinkButton_Qualification_Delete.Enabled = true;
}

Page 64 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

catch (Exception eo)


{
Label_Info2.Text = "Error on Loading " +Person_ID;
}
}

protected void LinkButton_Qualification_Delete_Click(object sender, EventArgs e)


{
try
{
LinkButton btn = LinkButton_Qualification_Delete;
if (GridView2.SelectedIndex != -1)
{
if (btn.Text.CompareTo("[Confirm Delete]") == 0)
{
String Qualification_ID = GridView2.SelectedRow.Cells[1].Text;
//DatabaseEngine de = new DatabaseEngine();
if (de.Delete_Data("Tbl_Qualification", "Qualification_ID",
Qualification_ID) == true)
{
Load_Data_Qualification_List(Label_Person_ID.Text);
//Load_Data_Recruitment_Detail(Person_ID);
Label_Info2.Text = "Record Deleted.";
btn.Text = "Delete";
}
else
{
Label_Info2.Text = "Error on Deletion.";
};
}
else
{
btn.Text = "[Confirm Delete]";
Label_Info2.Text = "Confirm your deletion of record pressing [Delete
Confirm] Button.";
}
}
else
{
Label_Info2.Text = "Select any one record to delete.";
}
}
catch (Exception eo)
{
Label_Info2.Text = "Error on Deletion.";
}
}
protected void LinkButton_update_Qualification_New_Click(object sender,
EventArgs e)
{

Page 65 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

LinkButton_Qualification_New_Click(sender,e);
}

protected void ImageButton_HideShow_Qualification_List_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Qualification_List.Visible == false)
{
MultiView_Qualification_List.Visible = true;
LinkButton_Qualification_Delete.Enabled = true;
}
else
{
MultiView_Qualification_List.Visible = false;
LinkButton_Qualification_Delete.Enabled = false;
}
}

/// <summary>
///
/// Training Information Here
/// </summary>
/// <param name="ID"></param>

protected void Load_Data_Training_List(String ID)


{
try
{
if ((Person_ID == "") || (Person_ID == null))
{
Person_ID = "-1";
}

String Isql =
" Select Training_ID as ID, Training_Name as [Name], Training_Type as
[Type], From_Date as [From], To_date as [To]" +
" From View_Training" +
" Where Person_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource3 = de.Prepare_SqlDataSource(Isql, SqlDataSource3);
GridView3.DataBind();
Label_TrainingList_Info.Text = "Loaded.. ";//
+DateTime.Now.ToShortTimeString();

//MultiView_Training_List.Visible = true;
//LinkButton_Training_Delete.Enabled = true;
}

Page 66 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

catch (Exception eo)


{
Label_TrainingList_Info.Text = "Error on Loading " +
Person_ID+eo.ToString();
}
}

protected void ImageButton_ShowHide_Trainging_List_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Training_List.Visible == false)
{
MultiView_Training_List.Visible = true;
LinkButton_Training_Delete.Enabled = true;
}
else
{
MultiView_Training_List.Visible = false;
LinkButton_Training_Delete.Enabled = false;
}
}
protected void LinkButton_Training_New_Click(object sender, EventArgs e)
{
Load_Data_Trainging_Detail_Update("");
MultiView3.Visible = true;
}
protected void LinkButton_Cancel_Update_Training_Click(object sender, EventArgs
e)
{
MultiView3.Visible = false;
}
protected void LinkButton_Training_Update_New_Click(object sender, EventArgs e)
{
LinkButton_Training_New_Click(sender, e);
}

protected void Load_Training_Type()


{
//DatabaseEngine de = new DatabaseEngine();
Isql = "Select Training_Type, Training_Type_ID From Tbl_Training_Type Order
By Training_Type_ID";
DropDownList_Training_Type_ID =
de.Fill_Combo(DropDownList_Training_Type_ID, Isql);
ListItem ls = new ListItem("---- Others ---- ", "-1");
DropDownList_Training_Type_ID.Items.Add(ls);
}
protected void DropDownList_Training_Type_ID_SelectedIndexChanged(object
sender, EventArgs e)
{
if (DropDownList_Training_Type_ID.SelectedValue .CompareTo("-1") == 0)

Page 67 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
Label_OtherTraining.Visible = true;
TextBox_OtherTraining.Visible = true;
}
else
{
Label_OtherTraining.Visible = false;
TextBox_OtherTraining.Visible = false;
}
}

protected void LinkButton_Training_Update_Save_Click(object sender, EventArgs e)


{
String Training_ID = Label_Training_ID.Text;
String Person_ID = Label_Training_Person_ID.Text;
String Training_Name = TextBox_Training_Name.Text;
String Training_Type_ID = ""; //
DropDownList_Training_Type_ID.SelectedValue.ToString();
String From_Date = TextBox_From_Date.Text;
String To_Date = TextBox_To_Date.Text;
String Duration = TextBox_Duration.Text;

//DatabaseEngine de = new DatabaseEngine();


try
{
if (DropDownList_Training_Type_ID.SelectedValue.CompareTo("-1") == 0)
{
//*** If New POst is selected it should be inserted into
// *** post table and retrieve form post table as ID
Isql = "Insert Into Tbl_Training_Type(Training_Type)
values(@Training_Type)";
SqlCommand sqlcmd1 = de.Get_Command();
String Training_Type = TextBox_OtherTraining.Text;
sqlcmd1.CommandText = Isql;
sqlcmd1.Parameters.Add("@Training_Type", SqlDbType.VarChar).Value =
Training_Type;
//*** Inserting data of Post
sqlcmd1.ExecuteNonQuery();
Training_Type_ID = de.Get_FieldValue("Tbl_Training_Type",
"Training_Type_ID", "Training_Type", Training_Type);

//reloading Post table data.


Load_Training_Type();
DropDownList_Training_Type_ID_SelectedIndexChanged(sender, e);
}
else
{
Training_Type_ID =
DropDownList_Training_Type_ID.SelectedValue.ToString();
}

Page 68 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

SqlCommand sqlcmd = de.Get_Command();


if (Label_Training_ID.Text.CompareTo("-1")!=0)
{
Isql =
" Update Tbl_Training set " +
" Person_ID=@Person_ID, Training_Type_ID=@Training_Type_ID,
Training_Name=@Training_Name" +
", From_Date=@From_Date, To_Date=@To_Date, Duration=@Duration"
+
" Where Training_ID=@Training_ID";
Info = "Record Updated.";
}
else
{
Isql =
" Insert Into Tbl_Training " +
" (Training_ID, Person_ID, Training_Type_ID, Training_Name,
From_Date, To_Date, Duration) " +
" values(@Training_ID, @Person_ID, @Training_Type_ID,
@Training_Name, @From_Date, @To_Date, @Duration)";
Info = "Record Inserted.";
Training_ID = de.Get_NewID("Tbl_Training", "Training_ID");
}

sqlcmd.CommandText = Isql;
//Info = sqlcmd.CommandText;
sqlcmd.Parameters.Add("@Training_ID", SqlDbType.VarChar).Value =
Training_ID;
sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
sqlcmd.Parameters.Add("@Training_Name", SqlDbType.VarChar).Value =
Training_Name;
sqlcmd.Parameters.Add("@Training_Type_ID", SqlDbType.VarChar).Value =
Training_Type_ID;
sqlcmd.Parameters.Add("@From_Date", SqlDbType.VarChar).Value =
From_Date;
sqlcmd.Parameters.Add("@To_Date", SqlDbType.VarChar).Value = To_Date;
sqlcmd.Parameters.Add("@Duration", SqlDbType.VarChar).Value = Duration;

int n = sqlcmd.ExecuteNonQuery();
Label_Training_ID.Text = Training_ID;
Load_Data_Training_List(Person_ID);
//Info = n.ToString() + " " + Training_ID + " " + First_Name;

MultiView3.Visible = false;
}
catch (Exception eo)

Page 69 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
Info = eo.ToString() + "\n\n===================\n" + Isql + " " +
AddingNew;
//Functions.Set_Error(eo);
//Info = "Sorry, There is some error in your data please verfiy and submit
again.";
}
//AddingNew = false;
Label_TrainingList_ Info.Text = Info;
}

protected void LinkButton_Training_Edit_Click(object sender, EventArgs e)


{
try
{
if (GridView3.SelectedIndex != -1)
{
HttpCookie Trainging_ID = new HttpCookie("Trainging_ID");
Trainging_ID.Value = GridView3.SelectedRow.Cells[1].Text;
Response.Cookies.Add(Trainging_ID);
Load_Data_Trainging_Detail_Update(Trainging_ID.Value);
MultiView3.Visible = true;
}
else
{
Label_TrainingList_Info.Text = "Please, Select any record of the table.";
MultiView3.Visible = false;
}
}catch(Exception eo)
{
Label_TrainingList_Info.Text = "Error on list.";
}
}

protected void Load_Data_Trainging_Detail_Update(String ID)


{
try
{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();
String Isql =
"Select * From View_Training Where Training_ID=" + ID;
SqlData Reader rs = de.Get_DataReader(Isql);
rs.Read();
// *** Assign Values
Person_ID = rs["Person_ID"].ToString();
Label_Training_ID.Text = ID;
Label_Training_Person_ID.Text = Person_ID;
TextBox_Training_Name.Text = rs["Training_Name"].ToString();

Page 70 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

DropDownList_Training_Type_ID.SelectedValue =
rs["Training_Type_ID"].ToString();
TextBox_From_Date.Text = rs["From_Date"].ToString();
TextBox_To_Date.Text = rs["To_Date"].ToString();
TextBox_Duration.Text = rs["Duration"].ToString();
Label_Trainging_Update_Info.Text = "Loaded..";
}
else
{
Label_Training_ID.Text = "-1";
Label_Training_Person_ID.Text = Label_Person_ID.Text;
TextBox_Training_Name.Text = "";
TextBox_To_Date.Text = "";
TextBox_From_Date.Text = "";
TextBox_Duration.Text = "";
Label_Trainging_Update_Info.Text = "Adding new..";
AddingNew = true;
}
}
catch (Exception eo)
{
Label_Trainging_Update_Info.Text = eo.Message.ToString();
}
}

protected void GridView3_RowCommand(object sender,


GridViewCommandEventArgs e)
{
Label_TrainingList_Info.Text = e.CommandName;
switch (e.CommandName.ToLower())
{
case "select":
LinkButton_Training_Delete.Text = "Delete";
break;
}
}

protected void LinkButton_Training_Delete_Click(object sender, EventArgs e)


{
try
{
// **** Delete Configuration
LinkButton btn = LinkButton_Training_Delete;
GridView Grid = GridView3;
Label Label_Info = Label_TrainingList_Info;
String Table_Name = "Tbl_Training";
String Search_Key = "Training_ID";
// **** Delete Configuration

if (Grid.SelectedIndex != -1)

Page 71 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
if (btn.Text.CompareTo("[Confirm Delete]") == 0)
{
String ID = Grid.SelectedRow.Cells[1].Text;
//DatabaseEngine de = new DatabaseEngine();
if (de.Delete_Data(Table_Name, Search_Key, ID) == true)
{
Load_Data_Training_List(Label_Person_ID.Text);
//Load_Data_Recruitment_Detail(Person_ID);
Label_Info.Text = "Record Deleted.";
btn.Text = "Delete";
}
else
{
Label_Info.Text = "Error on Deletion.";
};
}
else
{
btn.Text = "[Confirm Delete]";
Label_Info.Text = "Confirm your deletion of record pressing [Delete
Confirm] Button.";
}
}
else
{
Label_Info.Text = "Select any one record to delete.";
}
}
catch (Exception eo)
{
Label_Info.Text = "Error on Deletion.";
}
}

protected void GridView3_SelectedIndexChanged(object sender, EventArgs e)


{
if (MultiView3.Visible == true)
{
LinkButton_Training_Edit_Click(sender, e);
}
}

/// <summary>
/// Experience Details
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ImageButton_ShowHide_Experience_Click(object sender,

Page 72 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

ImageClickEventArgs e)
{
if (MultiView_ExperienceList.Visible == false)
{
MultiView_ExperienceList.Visible = true;
LinkButton_Experience_Dalete.Enabled = true;
}
else
{
MultiView_ExperienceList.Visible = false;
LinkButton_Experience_Dalete.Enabled = false;
}
}

protected void Load_Data_Experience_List(String ID)


{
try
{
if ((Person_ID == "") || (Person_ID == null))
{
Person_ID = "-1";
}

String Isql =
" Select Experience_ID as ID, From_Date as [From], To_Date as [To], Duration,
Organization, Post" +
" From View_Experience" +
" Where Person_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource4 = de.Prepare_SqlDataSource(Isql, SqlDataSource4);
GridView4.DataBind();
Label_Experience_List_Info.Text = "Loaded.. "; / /
+DateTime.Now.ToShortTimeString();

//MultiView_ExperienceList.Visible = true;
//LinkButton_Experience_Dalete.Enabled = true;
}
catch (Exception eo)
{
Label_Experience_List_Info.Text = "Error on Loading " + Person_ID +
eo.ToString();
}
}

protected void LinkButton_Cancel_Experience_Click(object sender, EventArgs e)


{
MultiView4.Visible = false;
}

Page 73 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

protected void Load_Data_Experience_Detail_Update(String ID)


{
try
{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();

// *** Assign Values


String Isql = "Select * From View_Experience Where Experience_ID=" + ID;
SqlDataReader rs = de.Get_DataReader(Isql);
rs.Read();
// *** Assign Values
Person_ID = rs["Person_ID"].ToString();
Label_Experience_ID.Text = ID;
Label_Experience_Person_ID.Text = Person_ID;
TextBox_Organization.Text = rs["Organization"].ToString();
DropDownList_Post_ID.SelectedValue = rs["Post_ID"].ToString();
TextBox_eFrom_Date.Text = rs["From_Date"].ToString();
TextBox_eTo_Date.Text = rs["To_Date"].ToString();
TextBox_eDuration.Text = rs["Duration"].ToString();
Label_Experience_Update_Info.Text = "Loaded..";
}
else
{
Label_Experience_ID.Text = "-1";
Label_Experience_Person_ID.Text = Label_Person_ID.Text;
TextBox_Organization.Text = "";
TextBox_eTo_Date.Text = "";
TextBox_eFrom_Date.Text = "";
TextBox_eDuration.Text = "";

Label_Experience_Update_Info.Text = "Adding new..";


AddingNew = true;
}
}
catch (Exception eo)
{
Label_Experience_Update_Info.Text = eo.Message.ToString();
}
}

protected void DropDownList_Post_ID_SelectedIndexChanged(object sender,


EventArgs e)
{
if (DropDownList_Post_ID.SelectedValue.CompareTo("-1") == 0)
{
Label_If_Other_Post.Visible = true;
TextBox_Other_Post.Visible = true;
}

Page 74 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

else
{
Label_If_Other_Post.Visible = false;
TextBox_Other_Post.Visible = false;
}
}

protected void LinkButton_Experience_Dalete_Click(object sender, EventArgs e)


{
try
{
// **** Delete Configuration
LinkButton btn = LinkButton_Experience_Dalete;
GridView Grid = GridView4;
Label Label_Info = Label_Experience_List_Info;
String Table_Name = "Tbl_Experience";
String Search_Key = "Experience_ID";
// **** Delete Configuration

if (Grid.SelectedIndex != -1)
{
if (btn.Text.CompareTo("[Confirm Delete]") == 0)
{
String ID = Grid.SelectedRow.Cells[1].Text;
//DatabaseEngine de = new DatabaseEngine();
if (de.Delete_Data(Table_Name, Search_Key, ID) == true)
{
Load_Data_Training_List(Label_Person_ID.Text);
//Load_Data_Recruitment_Detail(Person_ID);
Label_Info.Text = "Record Deleted.";
btn.Text = "Delete";
}
else
{
Label_Info.Text = "Error on Deletion.";
};
}
else
{
btn.Text = "[Confirm Delete]";
Label_Info.Text = "Confirm your deletion of record pressing [Delete
Confirm] Button.";
}
}
else
{
Label_Info.Text = "Select any one record to delete.";
}
}
catch (Exception eo)

Page 75 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
Label_Info.Text = "Error on Deletion.";
}
}

protected void GridView4_RowCommand(object sender,


GridViewCommandEventArgs e)
{
Label_Experience_List_Info.Text = e.CommandName;
switch (e.CommandName.ToLower())
{
case "select":
LinkButton_Experience_Dalete.Text = "Delete";
break;
}
}

protected void LinkButton_Experience_Edit_Click(object sender, EventArgs e)


{
try
{
if (GridView4.SelectedIndex != -1)
{
HttpCookie Experience_ID = new HttpCookie("Experience_ID");
Experience_ID.Value = GridView4.SelectedRow.Cells[1].Text;
Response.Cookies.Add(Experience_ID);
Load_Data_Experience_Detail_Update(Experience_ID.Value);
MultiView4.Visible = true;
}
else
{
Label_Experience_List_Info.Text = "Please, Select any record of the table.";
MultiView4. Visible = false;
}
}
catch (Exception eo)
{
Label_TrainingList_Info.Text = "Error on list.";
}
}

protected void Load_Experience_Post_Level()


{
//DatabaseEngine de = new DatabaseEngine();
Isql = "Select Post, Post_ID From Tbl_Post order by Post";
DropDownList_Post_ID = de.Fill_Combo(DropDownList_Post_ID, Isql);

ListItem ls = new ListItem("--- Other ----","-1");


DropDownList_Post_ID.Items.Add(ls);
}

Page 76 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

protected void LinkButton_Experience_Update_Save_Click(object sender, EventArgs


e)
{
String Experience_ID = Label_Experience_ID.Text;
String Person_ID = Label_Experience_Person_ID.Text;
String Organization = TextBox_Organization.Text;
String Post_ID = "";
String From_Date = TextBox_eFrom_Date.Text;
String To_Date = TextBox_eTo_Date.Text;
String D uration = TextBox_eDuration.Text;

//DatabaseEngine de = new DatabaseEngine();


try
{
if (DropDownList_Post_ID.SelectedValue.CompareTo("-1") == 0)
{
//*** If New POst is selected it should be inserted into
// *** post table and retrieve form post table as ID
Isql = "Insert Into Tbl_Post(Post) values(@Post)";
SqlCommand sqlcmd1 = de.Get_Command();
String Post = TextBox_Other_Post.Text;
sqlcmd1.CommandText = Isql;
sqlcmd1.Parameters.Add("@Post", SqlDbType.VarChar).Value = Post;
//*** Inserting data of Post
sqlcmd1.Exe cuteNonQuery();
Post_ID = de.Get_FieldValue("Tbl_Post", "Post_ID", "Post", Post);

//reloading Post table data.


Load_Experience_Post_Level();
DropDownList_Post_ID_SelectedIndexChanged(sender, e);
}
else
{
Post_ID = DropDownList_Post_ID.SelectedValue.ToString();
}

SqlCommand sqlcmd = de.Get_Command();


if (Label_Experience_ID.Text.CompareTo("-1")!=0)
{
Isql =
" Update Tbl_Experience set " +
" Person_ID=@Person_ID, Post_ID=@Post_ID,
Organization=@Organization" +
", From_Date=@From_Date, To_Date=@To_Date, Duration=@Duration"
+
" Where Experience_ID=@Experience_ID";
Info = "Record Update..";
}
else

Page 77 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
Isql =
" Insert Into Tbl_Experience " +
" (Experience_ID, Person_ID, Post_ID, Organization, From_Date,
To_Date, Duration) " +
" values(@Experience_ID, @Person_ID, @Post_ID, @Organization,
@From_Date, @To_Date, @Duration)";
Info = "Record Inserted..";
Experience_ID = de.Get_NewID("Tbl_Experience", "Experience_ID");
}

sqlcmd.CommandText = Isql;
//Info = sqlcmd.CommandText;
sqlcmd.Parameters.Add("@Experience_ID", SqlDbType.VarChar).Value =
Experience_ID;
sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
sqlcmd.Parameters.Add("@Organization", SqlDbType.VarChar).Value =
Organization;
sqlcmd.Parameters.Add("@Post_ID", SqlDbType.VarChar).Value = Post_ID;
sqlcmd.Parameters.Add("@From_Date", SqlDbType.VarChar).Value =
From_Date;
sqlcmd.Parameters.Add("@To_Date", SqlDbType.VarChar).Value = To_Date;
sqlcmd.Parameters.Add("@Duration", SqlDbType.VarChar).Value = Duration;

int n = sqlcmd.ExecuteNonQuery();
Label_Experience_ID.Text = Experience_ID;
Load_Data_Experience_List(Person_ID);
MultiView4.Visible = false;
//Info = n.ToString() + " " + Experience_ID + " " + First_Name;
}
catch (Exception eo)
{
Info = eo.ToString() + "\n\n===================\n" + Isql + " " +
AddingNew;
//Functions.Set_Error(eo);
//Info = "Sorry, There is some error in your data please verfiy and submit
again.";
}
//AddingNew = fa lse;
Label_Experience_Update_Info.Text = Info;
}
protected void LinkButton_Experience_New_Click(object sender, EventArgs e)
{
Load_Data_Experience_Detail_Update("");
MultiView4.Visible = true;
}
protected void LinkButton_Experience_Update_New_Click(object sender, EventArgs
e)
{

Page 78 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

LinkButton_Experience_New_Click(sender, e);
}

protected void GridView4_SelectedIndexChanged(object sender, EventArgs e)


{
if (MultiView4.Visible == true)
{
LinkButton_Experience_Edit_Click(sender, e);
}
}

protected void LinkButton_Search_Delete_Click(object sender, EventArgs e)


{
try
{
// **** Delete Configuration
LinkButton btn = LinkButton_Search_Delete;
GridView Grid = GridView_Search;
Label Label_Info = Label_Search_Info;
String Table_Name = "Tbl_Person";
String Search_Key = "Person_ID";
// **** Delete Configuration

if (Grid.SelectedIndex != -1)
{
if (btn.Text.CompareTo("[Confirm Delete]") == 0)
{
String ID = Grid.SelectedRow.Cells[1].Text;
//DatabaseEngine de = new DatabaseEngine();
if (de.Delete_Data(Table_Name, Search_Key, ID) == true)
{
//(Label_Person_ID.Text);
//Load_Data_Recruitment_Detail(Person_ID);

Load_Data_Recruitment_Detail_Searched(TextBox_Search_Value.Text);
Label_Info.Text = "Record Deleted.";
btn.Text = "[Delete]";
}
else
{
Label_Info.Text = "Error on Deletion: The Record may be used in other
tables.";
};
}
else
{
btn.Text = "[Confirm Delete]";
Label_Info.Text = "Confirm your deletion of record pressing [Delete
Confirm] Button.";
}

Page 79 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
else
{
Label_Info.Text = "Select any one record to delete.";
}
}
catch (Exception eo)
{
Label_Info.Text = "Error on Deletion: " + eo.Message.ToString();
}
}

protected void GridView_Search_RowCommand(object sender,


GridViewCommandEventArgs e)
{
Label_Search_Info.Text = e.CommandName;
switch (e.CommandName.ToLower())
{
case "select":
LinkButton_Search_Delete.Text = "[Delete]";
break;
}
}
}
}

Annex: #4
Page: Preview_Personal_History.aspx.cs
Module: Reports
Task: Show Report of Personnel History

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class Update_Recruitment_Master : System.Web.UI.Page
{
protected String Person_ID = "";

Page 80 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

protected String Info = "";


protected String Isql = "";
protected DatabaseEngine de = new DatabaseEngine();

protected void Page_Load(object sender, EventArgs e)


{
Label_Title.Text = " ::: Personnel History";

if (!IsPostBack)
{
if (Request.QueryString["pid"] != null)
{
String ID = Request.QueryString["pid"];
Load_Data(ID);
Load_Data_Qualification_List(ID);
Load_Data_Training_List(ID);
Load_Data_Experience_List(ID);
}
else
{
Load_Data();
}
}
}

protected void ImageButton_ShowHide_Person_Detail_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Person_Detail.Visible == false)
{
MultiView_Person_Detail.Visible = true;
}
else
{
MultiView_Person_Detail.Visible = false;
Label_Title.Text = Label_Title.Text + " [" + TextBox_First_Name.Text + "]";
}
}

protected void Load_Data()


{

TextBox_First_Name.Text = null;
//DropDownList_Person_Type.Text = null;
DropDownList_Sex.Text = null;
TextBox_DOB.Text = DateTime.Now.ToShortDateString();
//DropDownList_Ethnicity.Text = null;
TextBox_Address.Text = null;
TextBox_Phone.Text = null;

Page 81 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

TextBox_Mobile.Text = null;
TextBox_Email.Text = null;
TextBox_Keyword.Text = "";
}

protected void Load_Data(String ID)


{
try
{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();
String Isql = "Select * From View_Person Where Person_ID=" + ID;
SqlDataReader rs = de.Get_DataReader(Isql);
rs.Read();

// *** Assign Values


if (MultiView_Person_Detail.Visible == false)
{
Label_Title.Text = Label_Title.Text + " [" + rs["name"].ToString() + "]";
}
TextBox_First_Name.Text = ID +". "+ rs["Name"].ToString();
DropDownList_Person_Type.Text = rs["Person_Type"].ToString();
DropDownList_Sex.Text = rs["Sex"].ToString();
TextBox_DOB.Text = rs["DOB"].ToString();
DropDownList_Ethnicity.Text = rs["Ethnicity"].ToString();
TextBox_Address.Text = rs["Address"].ToString();
TextBox_Phone.Text = rs["Phone"].ToString();
TextBox_Mobile.Text = rs["Mobile"].ToString();
TextBox_Email.Text = rs["Email"].ToString();
TextBox_Keyword.Text = rs["Keyword"].ToString();

//MapPath("..\\..\\cv_profile \\" +
//*** CV Link Processing ****
if (rs["CV"].ToString() != "")
{
String CV_Path = rs["CV"].ToString();
String CV_File = Functions.Get_FileName(CV_Path);
//String CV = "..\\..\\cv_profile \\" + CV_File;
String CV = "../../cv_profile/" + CV_File;
//String CV = "..\\..\\cv_profile \\" + CV_File;
String CV_Text = "<A href='" + CV + "' Target=_new> Download CV
</A>";
Label_CV.Text = CV_Text;
}
Info = "Loaded..";
}
else
{

Page 82 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Info = "Add New..";


}
}
catch (Exception eo)
{
Info = eo.ToString();
//Functions.Set_Error(eo);
}
Label_Info.Text = Info + " ["+ ID + "]";
}

///
/// Qualification Section
///

protected void Load_Data_Qualification_List(String ID)


{
try
{
if ((Person_ID == "") || (Person_ID == null))
{
Person_ID = "-1";
}

String Isql =
" Select Qualification_ID as ID, Qualification_Name as Degree, Description,
Passed_Year," +
" Institute_Name From View_Qualification" +
" Where Person_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource2 = de.Prepare_ SqlDataSource(Isql, SqlDataSource2);
GridView2.DataBind();
Label_Info2.Text = "Loaded.. ";// +DateTime.Now.ToShortTimeString();

//MultiView_Qualification_List.Visible = true;
//LinkButton_Qua lification_Delete.Enabled = true;
}
catch (Exception eo)
{
Label_Info2.Text = "Error on Loading " +Person_ID;
}
}

protected void ImageButton_HideShow_Qualification_List_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Qualification_List.Visible == false)
{

Page 83 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

MultiView_Qualification_List.Visible = true;
}
else
{
MultiView_Qualification_List.Visible = false;
}
}

/// <summary>
///
/// Training Information Here
/// </summary>
/// <param name="ID"></param>

protected void Load_Data_Training_List(String ID)


{
try
{
if ((Person_ID == "") || (Person_ID == null))
{
Person_ID = "-1";
}

String Isql =
" Select Training_ID as ID, Training_Name as [Name], Training_Type as
[Type], From_Date as [From], To_date as [To]" +
" From View_Training" +
" Where Person_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource3 = de.Prepare_SqlDataSource(Isql, SqlDataSource3);
GridView3.DataBind();
Label_TrainingList_Info.Text = "Loaded.. ";//
+DateTime.Now.ToShortTimeString();

//MultiView_Training_List.Visible = true;
//LinkButton_Training_Delete.Enabled = true;
}
catch (Exception eo)
{
Label_TrainingList_Info.Text = "Error on Loading " +
Person_ID+eo.ToString();
}
}

protected void ImageButton_ShowHide_Trainging_List_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Training_List.Visible == false)

Page 84 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
MultiView_Training_List.Visible = true;
}
else
{
MultiView_Training_List.Visible = false;
}
}

/// <summary>
/// Experience Details
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ImageButton_ShowHide_Experience_Click(object sender,
ImageClickEventArgs e)
{
if (MultiView_ExperienceList.Visible == false)
{
MultiView_ExperienceList.Visible = true;
}
else
{
MultiView_ExperienceList.Visible = false;
}
}

protected void Load_Data_Experience_List(String ID)


{
try
{
if ((Person_ID == "") || (Person_ID == null))
{
Person_ID = "-1";
}

String Isql =
" Select Experience_ID as ID, From_Date as [From], To_Date as [To], Duration,
Organization, Post" +
" From View_Experience" +
" Where Person_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource4 = de.Prepare_SqlDataSource(Isql, SqlDataSource4);
GridView4.DataBind();
Label_Experience_List_Info.Text = "Loaded.. "; //
+DateTime.Now.ToShortTimeString();

//MultiView_ExperienceList.Visible = true;

Page 85 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

//LinkButton_Experience_Dalete.Enabled = true;
}
catch (Exception eo)
{
Label_Experience_List_Info.Text = "Error on Loading " + Person_ID +
eo.ToString();
}
}
}
}

Annex: #5
Page: Search_Personal.aspx.cs
Module: Search
Task: Search the all person with criteria

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class pages_Search_Person : System.Web.UI.Page
{
protected String iT itle_Heading = "Mr. Ram";
protected String iBody = "";
protected String iOthers = "";
static int i = 0;
protected DatabaseEngine de = new DatabaseEngine();
string Info = "";
String Isql = "";
protected void Page_Load(object sender, EventArgs e)
{
//QueryStringParameter QueryString = new QueryStringParameter();
if (Request.QueryString["mode"] == "search")
{
if (Request.Cookies["Where"] != null)
{
String Where = Request.Cookies["Where"].Value.ToString();
//Response.Write("<b>Avalon Searching..</b><br>");
Search_Data(Where);

Page 86 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
else
{
Search_Data(" Where Person_ID=-1");
}
}
else
{
//Response.Write("::: No Search Now..");
}
}

protected void Search_Data(String CtrString)


{
try
{
//DatabaseEngine de = new DatabaseEngine();

//***** Deleting Tmp table


//SqlCommand sqlcmd_tmp = de.Get_Command();
//Isql = "Delete from Tbl_tmp_Search";
//sqlcmd_tmp.CommandText = Isql;
//sqlcmd_tmp.ExecuteNonQuery();
//***** Deleting Tmp table

if (CtrString.Trim().Length >= 1 &&


CtrString.Trim().StartsWith("Where") == false)
{
CtrString = "Where " + CtrString + " And Person_Type='Roster'";
}
else
{
CtrString = " Where Person_Type='Roster'";
}

Isql =
" Select Person_ID, Name+' ('+Left(Sex,1)+')'+', '+Ethnicity as iTitle," +
" '<B><Font color=green>Keyword: </Font></B>'+Keyword as iBody, " +
" '<A href=''../../'+
subStr ing(Replace(CV,' \\','/'),CHARINDEX('cv_profile',Replace(CV,' \\','/')),len(Replace(CV,' \\','/')))+'''>Downloa
CV </a>' as iCV, " +
" '<A href=Preview_Personnel_History.aspx?pid='+ Convert(Varchar,Person_ID) +'> More..</A>' as
iMore" +
" From View_Person " + CtrString;

SqlDataSource1 = de.Prepare_SqlDataSource(Isql, SqlDataSource1);


}
catch (Exception eo)
{
Functions.Set_Error(eo);

Page 87 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

//Info = eo.Message.ToString();
}
//Info = Info + " <HR>(" + Isql + ")";
Label_Info.Text = Info;
}

protected void LinkButton_Search_Click(object sender, EventArgs e)


{
try
{
String CtrString = "";

String Keyword = TextBox_Keyword.Text;


String Sex = DropDownList_Gender.SelectedItem.Text;
String Ethnicity = DropDownList_Ethnicity.SelectedItem.Text;

//*** Personal History Information Processiong


CtrString = " ([Keyword] like '%" + Keyword + "%')";
if (Sex.CompareTo("No Selection") != 0)
{
CtrString = CtrString + " And ([Sex] like '%" + Sex + "%')";
}

if (Ethnicity.CompareTo("No Selection") != 0)
{
CtrString = CtrString + " And ([Ethnicity] like '%" + Ethnicity + "%')";
}

HttpCookie Where = new HttpCookie("Where");


Where.Value = CtrString;
Response.Cookies.Add(Where);

//Response.Redirect("Search_Personal_History_Result.aspx?mode=search");
Response.Redirect("Search_Person.aspx?mode=search");
}
catch (Exception eo)
{
Functions.Set_Error(eo);
}
}
protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e)
{
//e.Item.Controls[1]
}
}
}

Annex: #6

Page 88 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Page: update_group_menu_configuration.aspx.cs
Module: WEB administration
Task: Menu Configuration

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class Update_Group_Menu_Configuration : System.Web.UI.Page
{
protected String Permission_Level_ID = "";
protected DatabaseEngine de = new DatabaseEngine();

protected void Page_Load(object sender, EventArgs e)


{
if (!IsPostBack)
{
Load_Group();
Load_Data(DropDownList_Permission_Level_ID.SelectedValue.ToString());
}
}

protected void Load_Group()


{
String Isql = "Select Convert(Varchar,Permission_Level_ID) + '. ' +
Permission_Level_Name as Permission_Level, Permission_Level_ID from
Tbl_Permission_Level Order By Permission_Level_Name";
//DatabaseEngine de = new DatabaseEngine();
DropDownList_Permission_Level_ID =
de.Fill_Combo(DropDownList_Permission_Level_ID, Isql);
DropDownList_Permission_Level_ID.Items.Add(new ListItem("==== Others
====", "0"));
}

protected void Load_Data(String ID)


{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();

Page 89 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

String Isql = "Select Convert(varchar,Menu_Item_ID)+'.


'+Convert(varchar,Menu_Item_Parent_ID)+') '+Menu_Item, Menu_Item_ID From
VIEW_Menu_Configuration Where Permission_Level_ID=" + ID;
de.Fill_ListBox(ListBox_Selected, Isql);

Isql = "Select Convert(varchar,Menu_Item_ID)+'.


'+Convert(varchar,Menu_Item_Parent_ID)+') '+Menu_Item, Menu_Item_ID From
Tbl_Menu_Item Where Menu_Item_ID not in (Select Menu_Item_ID From
VIEW_Menu_Configuration Where Permission_Level_ID=" + ID + ")";
de.Fill_ListBox(ListBox_Available, Isql);
}
}

protected void LinkButton_Add_One_Click(object sender, EventArgs e)


{
if (ListBox_Available.SelectedIndex >= 0)
{
ListItem item = ListBox_Available.SelectedItem;
String Permission_Level_ID =
DropDownList_Permission_Level_ID.SelectedValue.ToString();
String Menu_Item_ID = item.Value.ToString();
//DatabaseEngine de = new DatabaseEngine();
String Isql =
" Insert Into Tbl_Menu_Configuration(Permission_Level_ID,
Menu_Item_ID)" +
" Values(" + Permission_Level_ID + ", " + Menu_Item_ID + ")";
SqlCommand SqlCmd = de.Get_Command();
SqlCmd.CommandText = Isql;
SqlCmd.ExecuteNonQuery();
}
Label_Info.Text = Functions.Swap_ListBox_Item(ListBox_Available,
ListBox_Selected);
}

protected void LinkButton_Remove_One_Click(object sender, EventArgs e)


{
if (ListBox_Selected.SelectedIndex >= 0)
{
ListItem item = ListBox_Selected.SelectedItem;
String Permission_Level_ID =
DropDownList_Permission_Level_ID.SelectedValue.ToString();
String Menu_Item_ID = item.Value.ToString();
//DatabaseEngine de = new DatabaseEngine();
String Isql =
" Delete From Tbl_Menu_Configuration " +
" Where Permission_Level_ID=" + Permission_Level_ID +
" and Menu_Item_ID=" + Menu_Item_ID;
SqlCommand SqlCmd = de.Get_Command();
SqlCmd.CommandText = Isql;
SqlCmd.ExecuteNonQuery();

Page 90 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
Label_Info.Text = Functions.Swap_ListBox_Item(ListBox_Selected,
ListBox_Availa ble);
}

protected void DropDownList_Permission_Level_ID_TextChanged(object sender,


EventArgs e)
{
Load_Data(DropDownList_Permission_Level_ID.SelectedValue.ToString());
}

protected void LinkButton_Add_All_Click(object sender, EventArgs e)


{
for (int i = 0; i < ListBox_Available.Items.Count; i++)
{
ListBox_Available.SelectedIndex = 0;
LinkButton_Add_One_Click(sender, e);
}
}
protected void LinkButton_Remove_All_Click(object sender, EventArgs e)
{
for (int i = 0; i < ListBox_Selected.Items.Count; i++)
{
ListBox_Selected.SelectedIndex = 0;
LinkButton_Remove_One_Click(sender, e);
}
}
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{

}
protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
{
LinkButton_Add_One_Click(sender, e);
}
protected void ImageButton4_Click(object sender, ImageClickEventArgs e)
{
LinkButton_Add_All_Click(sender, e);
}
protected void ImageButton1_Click1(object sender, ImageClickEventArgs e)
{
LinkButton_Remove_One_Click(sender, e);
}
protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
{
LinkButton_Remove_All_Click(sender, e);
}
}
}

Page 91 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Annex: #7
Page: login.aspx.cs
Module: WEB administration
Task: Login security

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class login : System.Web.UI.Page
{
protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)
{
DatabaseEngine de = new DatabaseEngine();
String username = Login1.UserName;
String password = Login1.Password;

String Isql =
"Select Count(*)as C, Permission_Level_ID From Tbl_Person Where
User_Name='" + username + "' and User_Password='" + password + "' Group By
Permission_Level_ID";
try
{
SqlDataReader Reader = de.Get_DataReader(Isql);
Reader.Read();

//int RstCount = int.Parse(Reader["C"].ToString());


if (Reader.HasRows==true)
{
//HttpCookie Permission_Level_ID = new
HttpCookie("Permission_Level_ID");
//Permission_Level_ID.Value = Reader["Permission_Level_ID"].ToString();
//Response.Cookies.Add(Permission_Level_ID);
String Permission_Level_ID = Reader["Permission_Level_ID"].ToString();

Session.Add("User_Name", username);
Session.Add("User_Password", password);
Session.Add("Permission_Level_ID", Permission_Level_ID);
Response.Redirect("../");

Page 92 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
}
catch (Exception eo)
{
Functions.Set_Error(eo);
//Functions.Set_Error(eo);
}
finally
{
de = null;
}
}
protected void Login1_Load(object sender, EventArgs e)
{
DatabaseEngine de = new DatabaseEngine();
Login1.TitleText = "Log In System " + de.Get_Version() +
"-" + Request.ServerVariables["Server_Name"].ToUpper();
}
}
}

Annex: #8
Page: logout.aspx.cs
Module: WEB administration
Task: Log out for security

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class pages_Admin_LogOut : System.Web.UI.Page


{
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
Session.Clear();
Response.Cookies.Clear();
Request.Cookies.Clear();
Response.Redirect("login.aspx", true);
}
}

Page 93 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Annex: #9
Page: menu_item.aspx.cs
Module: WEB administration
Task: listing and shorting for update and inserting system menu

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using Syste m.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class Menu_Item : System.Web.UI.Page
{
DatabaseEngine de = new DatabaseEngine();
protected void Page_Load(object sender, EventArgs e)
{
String Isql =
"Select Menu_Item_ID AS ID, Menu_Item_Parent_ID AS P_ID, Menu_Item,
Link, Parameter, Target, Visible from Tbl_Menu_Item Order by Menu_Item_ID";
SqlDataSource_Personal_Info_List = de.Prepare_SqlDataSource(Isql,
SqlDataSource_Personal_Info_List);
}

protected void LinkButton_New_Click(object sender, EventArgs e)


{
//Response.Cookies.Remove("Menu_Ite m_ID");
Response.Cookies["Menu_Item_ID"].Expires = DateTime.Now;
Response.Redirect("Update_Menu_Item.aspx");
}

protected void LinkButton_Edit_Click(object sender, EventArgs e)


{
Label_Info.Text = "";
if (GridView_Person_List.SelectedIndex!= -1)
{
HttpCookie Menu_Item_ID = new HttpCookie("Menu_Item_ID");
Menu_Item_ID.Value = GridView_Person_List.SelectedR ow.Cells[1].Text;
Menu_Item_ID.Expires = DateTime.Now.AddSeconds(20);
Response.Cookies.Add(Menu_Item_ID);
Response.Redirect("Update_Menu_Item.aspx");

Page 94 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
else
{
Label_Info.Text = "Select any one record to edit.";
}
}
}
}

Annex: #10
Page: update_menu_item.aspx.cs
Module: WEB administration
Task: update menu item

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class Update_Menu_Item : System.Web.UI.Page
{
protected String Menu_Item_ID = "";
//protected Boolean AddingNew;
protected String Info = "";
protected String Isql = "";
protected DatabaseEngine de = new DatabaseEngine();

protected bool AddingNew


{
get
{
object o = ViewState["AddingNew"];
return (o == null) ? false : (bool)o;
}
set
{
ViewState["AddingNew"] = value;
}
}

protected void Page_Load(object sender, EventArgs e)

Page 95 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
if (Request.QueryString["mode"]=="new")
{
Response.Cookies["Menu_Item_ID"].Expires = DateTime.Now;
Response.Redirect("Update_Menu_Item.aspx");
AddingNew = true;
}

if (!IsPostBack)
{
Load_Parent();
if (Request.Cookies["Menu_Item_ID"] != null)
{
Menu_Item_ID = Request.Cookies["Menu_Item_ID"].Value.ToString();
Load_Data(Menu_Item_ID);
AddingNew = false;
}
else
{
Load_Data();
AddingNew = true;
}
}
}

protected void Load_Parent()


{
String Isql = "Select Convert(Varchar,Menu_Item_ID) + '.' +
Convert(Varchar,Menu_Item_Parent_ID) + ' ' + Menu_Item as Menu_Item,
Menu_Item_ID from Tbl_Menu_Item Order By Menu_Item";
//DatabaseEngine de = new DatabaseEngine();
DropDow nList_Parent_ID = de.Fill_Combo(DropDownList_Parent_ID, Isql);
DropDownList_Parent_ID.Items.Add(new ListItem("==== Top Menu ====",
"0"));
}

protected void Load_Data()


{
AddingNew = true;

Label_ID.Text = "New Information";


TextBox_Menu_Item.Text = null;
TextBox_Link.Text = null;
TextBox_Parameter.Text = null;
TextBox_Target.Text = null;
}

protected void Load_Data(String ID)


{
if (ID != "")

Page 96 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
//DatabaseEngine de = new DatabaseEngine();
String Isql = "Select * From Tbl_Menu_Item Where Menu_Item_ID=" + ID;
SqlDataReader rs = de.Get_DataReader(Isql);
rs.Read();

// *** Assign Values

Label_ID.Text = ID;
DropDownList_Parent_ID.SelectedValue =
rs["Menu_Item_Parent_ID"].ToString();
TextBox_Menu_Item.Text = rs["Menu_Item"].ToString();
TextBox_Link.Text = rs["Link"].ToString();
TextBox_Parameter.Text = rs["Parameter"].ToString();
TextBox_Target.Text = rs["Target"].ToString();
DropDownList_Visible.SelectedValue = rs["Visible"].ToString();
}
}

protected void LinkButton_Save_Click(object sender, EventArgs e)


{
String Menu_Item_ID = Label_ID.Text;
String Menu_Item_Parent_ID =
DropDownList_Parent_ID.SelectedValue.ToString();
String Menu_Item = TextBox_Menu_Item.Text;
String Link = TextBox_Link.Text;
String Parameter = TextBox_Parameter.Text;
String Target = TextBox_Target.Text;
String Visible = DropDownList_Visible.SelectedValue.ToString();

//DatabaseEngine de = new DatabaseEngine();


try
{
SqlCommand sqlcmd = de.Get_Command();
if (AddingNew == false)
{
Isql =
" Update Tbl_Menu_Item Set " +
" Menu_Item_Parent_ID=@Menu_Item_Parent_ID,
Menu_Item=@Menu_Item " +
", Link=@Link, Parameter=@Parameter, Target=@Target " +
", Visible=@Visible " +
" Where Menu_Item_ID=@Menu_Item_ID";
Info = "Updated Personal Information Record..";
}
else
{
Isql =
" Insert Into Tbl_Menu_Item" +
" (Menu_Item_ID, Menu_Item_Parent_ID, Menu_Item, Link, Parameter,

Page 97 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Target, Visible) " +


" values(@Menu_Item_ID, @Menu_Item_Parent_ID, @Menu_Item,
@Link, @Parameter, @Target, @Visible)";
Info = "New Record of Personal Information Inserted..";
Menu_Item_ID = de.Get_NewID("Tbl_Menu_Item", "Menu_Item_ID");
}

sqlcmd.CommandText = Isql;
//Info = sqlcmd.CommandText;
sqlcmd.Parameters.Add("@Menu_Item_ID", SqlDbType.VarChar, 8).Value =
Menu_Item_ID;
sqlcmd.Parameters.Add("@Menu_Item_Parent_ID",
SqlDbType.VarChar).Value = Menu_Item_Parent_ID;
sqlcmd.Parameters.Add("@Menu_Item", SqlDbType.VarChar).Value =
Menu_Item;
sqlcmd.Parameters.Add("@Link", SqlDbType.VarChar).Value = Link;
sqlcmd.Parameters.Add("@Parameter", SqlDbType.VarChar).Value =
Parameter;
sqlcmd.Parameters.Add("@Target", SqlDbType.VarChar).Value = Target;
sqlcmd.Parameters.Add("@Visible", SqlDbType.VarChar).Value = Visible;

int n = sqlcmd.ExecuteNonQuery();
Load_Data(Menu_Item_ID);
AddingNew = false;
//Info = n.ToString() + " " + Menu_Item_ID + " " + First_Name;
}
catch (Exception eo)
{
//Info = eo.ToString() + "\n\n=================== \n" + Isql + " " +
AddingNew;
Functions.Set_Error(eo);
//Info = "Sorry, There is some error in your data please verfiy and submit
again.";
}
Label_Info.Text = Info;
}
protected void LinkButton_New_Click(object sender, EventArgs e)
{
Response.Cookies["Menu_Item_ID"].Expires = DateTime.Now;
Response.Redirect("Update_Menu_Item.aspx");
}
}
}

Annex: #11
Page: Organisation_history.aspx.cs
Module: Organisation
Task: Data entry of organization

Page 98 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class Organisation_Master : System.Web.UI.Page
{
protected String Organisation_ID = "";
protected String Info = "**";
protected String Isql = "";
protected DatabaseEngine de = new DatabaseEngine();

protected bool AddingNew


{
get
{
object o = ViewState["AddingNew"];
return (o == null) ? false : (bool)o;
}
set
{
ViewState["AddingN ew"] = value;
}
}

protected void Page_Load(object sender, EventArgs e)


{
Label_Title.Text = " ::: Organisation History";

if (Request.QueryString["mode"] == "new")
{
Response.Cookies["Organisation_ID"].Expires = DateTime.Now;
Response.Cookies["Search_Organisation_ID"].Expires = DateTime.Now;
AddingNew = true;
Response.Redirect("Organisation_History.aspx");
}

if (!IsPostBack)
{
//Load_Permission_Level();
//Load_Training_Type();

Page 99 of 121
Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

//Load_Experience_Post_Level();

if (Request.Cookies["Organisation_ID"] != null)
{
String ID = Request.Cookies["Organisation_ID"].Value.ToString();
Load_Data(ID);
Load_Data_Person_List(ID);
Load_Data_Employee(ID);
AddingNew = false;
}
else
{
Load_Data();
AddingNew = true;
}
}

if (Request.Cookies["Organisation_ID"] != null)
{
String ID = Request.Cookies["Organisation_ID"].Value.ToString();
Load_Data_Person_List(ID);
//Label_Show_Time.Text = "[" + DateTime.Now.ToLongTimeString() + "] ";
AddingNew = false;
}

if (Request.Cookies["Search_Organisation_ID"] != null)
{
String Search_Organisation_ID =
Request.Cookies["Search_Organisation_ID"].Value.ToString();
Load_Data_Searched_List(Search_Organisation_ID);
}
else
{
Load_Data_Searched_List("-1");
}
}

protected void ImageButton_ShowHide_Person_Detail_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Person_Detail.Visible == false)
{
MultiView_Person_Detail.Visible = true;
LinkButton_Save.Enabled = true;
}
else
{
MultiView_Person_Detail.Visible = false;

Page 100 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

LinkButton_Save.Enabled = false;
Label_Title.Text = Label_Title.Text + " [" + TextBox_Organisation_Name.Text
+ " " + TextBox_ESTD.Text + "]";
}
}

protected void Load_Data()


{
AddingNew = true;

Label_Organisation_ID.Text = "New Information";


TextBox_Organisation_Name.Text = null;
TextBox_ESTD.Text = null;
TextBox_Contact_Person.Text = null;
TextBox_Phone.Text = null;
TextBox_Email.Text = null;
TextBox_Address.Text = null;
TextBox_District.Text = null;
TextBox_Area_of_Expertise.Text = "";
Label_Info.Text = "Adding new..";
LinkButton_Save.Enabled = true;
}

protected void Load_Data(String ID)


{
try
{
if (ID != "")
{
//DatabaseEngine de = new DatabaseEngine();
String Isql = "Select * From View_Organisation Where Organisation_ID=" +
ID;
SqlDataReader rs = de.Get_DataReader(Isql);
rs.Read();

// *** Assign Values


if (MultiView_Person_Detail.Visible==false)
{
Label_Title.Text = Label_Title.Text + " [" + rs["name"].ToString() +"]";
}
Label_Organisation_ID.Text = rs["Organisation_ID"].ToString();
TextBox_Organisation_Name.Text = rs["Organisation_Name"].ToString();
TextBox_ESTD.Text = rs["ESTD"].ToString();
TextBox_Contact_Person.Text = rs["Contact_Person"].ToString();
TextBox_Phone.Text = rs["Phone"].ToString();
TextBox_Email.Text = rs["Email"].ToString();
TextBox_Address.Text = rs["Address"].ToString();
TextBox_District.Text = rs["District"].ToString();
TextBox_Area_ of_Expertise.Text = rs["Area_of_Expertise"].ToString();
//*** CV Link Processing ****

Page 101 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

if (rs["Profile"].ToString().Trim() != "")
{
String CV_Path = rs["Profile"].ToString();
String CV_File = Functions.Get_FileName(CV_Path);
String CV = "../../org_profile/" + CV_File;
String CV_Text = "<A href='" + CV + "' Target=_new> Download Profile
</A>";
Label_CV.Text = CV_Text;
}
else
{
Label_CV.Text = "";
}
AddingNew = false;
Info = "Loaded..";
}
else
{
AddingNew = true;
Info = "Add New..";
}
LinkButton_Save.Enabled = true;
}
catch (Exception eo)
{
Info = eo.ToString();
}
Label_Info.Text = Info;
}

protected void LinkButton_Save_Click(object sender, EventArgs e)


{
String Organisation_ID = Label_Organisation_ID.Text;
String Organisation_Name = TextBox_Organisation_Name.Text;
String ESTD = TextBox_ESTD.Text;
String Contact_Person = TextBox_Contact_Person.Text;
String Phone = TextBox_Phone.Text;
String Address = TextBox_Address.Text;
String District = TextBox_District.Text;
String Email = TextBox_Email.Text;
String Area_of_Expertise = TextBox_Area_of_Expe rtise.Text;

String CV = FileUpload_Profile.FileName.ToString();
String CV_File_Path = "";
Boolean Save_CV = false;
String CV_Field = "Profile";
String CV_Field_Param = "@Profile";
String CV_Update_String = "," + CV_Field + "=" + CV_Field_Param;

try

Page 102 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

{
if (CV.Length >= 5)
{
Label_CV.Text = CV;
Save_CV = true;
//**** for Insert statement if necessary
CV_Field = "," + CV_Field;
CV_Field_Param = "," + CV_Field_Param;
}
else
{
// **** Not inluding CV file when not exist
CV_Update_String = "";
CV_Field = "";
CV_Field_Param = "";
Save_CV = false;
}

//DatabaseEngine de = new DatabaseEngine();

SqlCommand sqlcmd = de.Get_Command();


if (AddingNew == false)
{
Isql =
" Update Tbl_Organisation set " +
" Organisation_Name=@Organisation_Name, ESTD=@ESTD " +
", Contact_Person=@Contact_Person, Phone=@Phone, Email=@Email " +
", Address=@Address " +
", District=@District " +
", Area_of_Expertise=@Area_of_Expertise " +
CV_Update_String +
" Where Organisation_ID=@Organisation_ID";
Info = "Record Update..";
}
else
{
Isql =
" Insert Into Tbl_Organisation" +
" (Organisation_ID, Organisation_Name, ESTD, Contact_Person, Phone,
Email, Address, District, Area_of_Expertise " + CV_Field + ") " +
" values(@Organisation_ID, @Organisation_Name, @ESTD,
@Contact_Person, @Phone, @Email, @Address, @District, @Area_of_Expertise " +
CV_Field_Param + ")";
Info = "Record Inserted..";
Organisation_ID = de.Get_NewID("Tbl_Organisation", "Organisation_ID");
}

sqlcmd.CommandText = Isql;
//Info = sqlcmd.CommandText;
sqlcmd.Parameters.Add("@Organisation_ID", SqlDbType.VarChar).Value =

Page 103 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Organisation_ID;
sqlcmd.Parameters.Add("@Organisation_Name", SqlDbType.VarChar).Value =
Organisation_Name;
sqlcmd.Parameters.Add("@ESTD", SqlDbType.VarChar).Value = ESTD;
sqlcmd.Parameters.Add("@Contact_Person", SqlDbType.VarChar).Value =
Contact_Person;
sqlcmd.Parameters.Add("@Phone", SqlDbType.VarChar).Value = Phone;
sqlcmd.Parameters.Add("@Email", SqlDbType.VarChar).Value = Email;
sqlcmd.Parameters.Add("@Address", SqlDbType.VarChar).Value = Address;
sqlcmd.Parameters.Add("@District", SqlDbType.VarChar).Value = District;
sqlcmd.Parameters.Add("@Area_of_Expertise", SqlDbType.VarChar).Value =
Area_of_Expertise;

if (Save_CV == true)
{
CV_File_Path =
MapPath("..\\..\\org_profile\\" +
Organisation_ID + "_" +
Organisation_Name + "_" +
ESTD +
"." + Functions.Get_FileExetension(CV));
//CV.Substring(CV.IndexOf("."), 4));

sqlcmd.Parameters.Add("@Profile", SqlDbType.VarChar).Value =
CV_File_Path;
FileUpload_Profile.SaveAs(CV_File_Path);
}
int n = sqlcmd.ExecuteNonQuery();
//Load_Data(Organisation_ID);
AddingNew = false;
//Info = n.ToString() + " " + Organisation_ID + " " + First_Name;
}
catch (Exception eo)
{
//Info = eo.ToString() + "\n\n=================== \n" + Isql + " " +
AddingNew;
Functions.Set_Error(eo);
//Info = "Sorry, There is some error in your data please ve rfiy and submit
again.";
}
Label_Info.Text = Info;
}

protected void LinkButton_New_Click(object sender, EventArgs e)


{
Response.Cookies["Organisation_ID"].Expires = DateTime.Now;
Loa d_Data();
Load_Data_Person_List("-1");

Page 104 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

MultiView1.ActiveViewIndex = 0;
MultiView_Person_Detail.Visible = true;

MultiView2.Visible = false;

//Response.Cookies["Organisation_ID"].Expires = DateTime.Now;
//Response.Redirect("Update_Recruitment_Master.aspx");
}

protected void LinkButton_Tab_New_Click(object sender, EventArgs e)


{
LinkButton_New_Click(sender, e);
}

protected void LinkButton_Tab_Help_Click(object sender, EventArgs e)


{
MultiView1.ActiveViewIndex = 2;
}

protected void GridView1_RowCommand(object sender,


GridViewComma ndEventArgs e)
{
Label_Info2.Text = e.CommandName;
switch (e.CommandName.ToLower())
{
case "select":
LinkButton_Person_Delete.Text = "Delete";
break;
}
}

/// <summary>
/// Search Section Functions ///
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void LinkButton_Search_Click(object sender, EventArgs e)
{
Response.Cookies["Organisation_ID"].Expires = DateTime.Now;
Response.Cookies["Search_Organisation_ID"].Expires = DateTime.Now;
TextBox_Search_Value.Text = null;
Load_Data_Searched_List("-1");
//Load_Data();
//Load_Data_Recruitment_Detail("-1");
MultiView1.ActiveViewIndex = 1;
}

protected void Load_Data_Searched_List(String ID)


{

Page 105 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

try
{
String StringCtriteria = "";
String[] Arg = new String[3];
String Isql = "";

Arg[0] = " Hello ";


Arg[1] = " Where Organisation_ID=?";
Arg[2] = " Where Organisation_Name Like '%?%'";

ID.Trim();
if ((ID.CompareTo("") == 0) || (ID == null))
{
StringCtriteria = "";
Isql =
" Select Organisation_ID as Code, Organisation_Name, Address, ESTD" +
" From VIEW_Organisation" +
StringCtriteria;
//DatabaseEngine de = new DatabaseEngine();
SqlDataSource1 = de.Prepare_SqlDataSource(Isql, SqlDataSource1);
//GridView2.DataBind();
}
else
{
for (int i = 2; i < Arg.Length; i++)
{
StringCtriteria = Arg[i].Replace("?", ID);
Isql =
" Select Organisation_ID as Code, Organisation_Name, Address, ESTD" +
" From VIEW_Organisation" +
StringCtriteria;
//DatabaseEngine de = new DatabaseEngine();
SqlDataSource1 = de.Prepare_SqlDataSource(Isql, SqlDataSource1);
//GridView2.DataBind();
if (GridView_Search.Rows.Count >= 1)
{
break;
}
}
}
if (GridView_Search.Rows.Count >= 1)
{
Label_Search_Info.Text = "Search Completed..";
}
else
{
Label_Search_Info.Text = "Record not found.";
}
//Label_Search_ Info.Text = Isql + " (ID=" + ID + ")";
}

Page 106 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

catch (Exception eo)


{
Label_Search_Info.Text = "Error: "+eo.ToString();
}
}

protected void LinkButton_Search_Data_Click(object sender, EventArgs e)


{
try
{
Response.Cookies["Search_Organisation_ID"].Expires = DateTime.Now;
HttpCookie Search_Organisation_ID = new
HttpCookie("Search_Organisation_ID");
Search_Organisation_ID.Value = TextBox_Search_Value.Text;
Response.Cookies.Add(Search_Organisation_ID);
Load_Data_Searched_List(TextBox_Search_Value.Text);
}
catch (Exception eo)
{
Label_Search_Info.Text = "Error on search.";
}
}
protected void LinkButton_Search_Show_Detail_Click(object sender, EventArgs e)
{
try
{
if (GridView_Search.SelectedIndex >= 0)
{
HttpCookie Organisation_ID1 = new HttpCookie("Organisation_ID");
Organisation_ID1.Value = GridView_Search.SelectedRow.Cells[1].Text;
Response.Cookies.Add(Organisation_ID1);
MultiView1.ActiveViewIndex = 0;
Load_Data(Organisation_ID1.Value);
Load_Data_Person_List(Organisation_ID1.Value);
Load_Data_Employee(Organisation_ID1.Value);
}
else
{
Label_Search_Info.Text = "Select any row for details.";
}
}
catch (Exception eo)
{
Label_Search_Info.Text = "Error on Search..";
}
}
/// <summary>
/// Search Section Functions
/// </summary>
/// <param name="ID"></param>

Page 107 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

///
/// Qualification Section
///

protected void GridView2_SelectedIndexChanged(object sender, EventArgs e)


{
if (MultiView2.Visible == true)
{
LinkButton_Person_Edit_Click(sender, e);
}
}

protected void LinkButton_Update_Person_Cancel_Click(object sender, EventArgs


e)
{
Response.Cookies["Person_ID"].Expires = DateTime.Now;
MultiView2.Visible = false;
}

protected void LinkButton_Person_New_Click(object sender, EventArgs e)


{
Response.Cookies["Person_ID"].Expires = DateTime.Now;
MultiView2.Visible = true;
MultiView2.ActiveViewIndex = 0;
}

protected void LinkButton_Person_Edit_Click(object sender, EventArgs e)


{
try
{
if (GridView2.SelectedIndex != -1)
{
HttpCookie Person_ID = new HttpCookie("Person_ID");
Person_ID.Value = GridView2.SelectedRow.Cells[1].Text;
Response.Cookies.Add(Person_ID);
MultiView2.Visible = true;
}
else
{
Label_Info2.Text = "Please, Select any record of the table.";
MultiView2.Visible = false;
}
}catch(Exception eo)
{
Label_Info2.Text = "Error on selection.";

Page 108 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

}
}

protected void Load_Data_Person_List(String ID)


{
try
{
if ((Organisation_ID == "") || (Organisation_ID == null))
{
Organisation_ID = "-1";
}

String Isql =
" Select Person_ID as Code, (First_Name+' '+Last_Name) as Name,
Person_Address as Address, Sex, Ethnicity, Person_Email as Email" +
" From VIEW_Employeement" +
" Where Organisation_ID=" + ID;

//DatabaseEngine de = new DatabaseEngine();


SqlDataSource2 = de.Prepare_SqlDataSource(Isql, SqlDataSource2);
GridView2.DataBind();
Label_Info2.Text = "Loaded.. ";// +DateTime.Now.ToShortTimeString();

//MultiView_Qualification_List.Visible = true;
//LinkButton_Qualification_Delete.Enabled = true;
}
catch (Exception eo)
{
Label_Info2.Text = eo.ToString(); // "Error on Loading " + Organisation_ID;
}
}

protected void LinkButton_Person_Delete_Click(object sender, EventArgs e)


{
try
{
LinkButton btn = LinkButton_Person_Delete;
if (GridView2.SelectedIndex != -1)
{
if (btn.Text.CompareTo("[Confirm Delete]") == 0)
{
String Person_ID = GridView2.SelectedRow.Cells[1].Text;
//DatabaseEngine de = new DatabaseEngine();
if (de.Delete_Data("Tbl_Person", "Person_ID", Person_ID) == true)
{
Load_Data_Person_List(Label_Organisation_ID.Text);
//Load_Data_Recruitment_Detail(Organisation_ID);
Label_Info2.Text = "Record Deleted.";
btn.Text = "Delete";
}

Page 109 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

else
{
Label_Info2.Text = "Error on Deletion.";
};
}
else
{
btn.Text = "[Confirm Delete]";
Label_Info2.Text = "Confirm your deletion of record pressing [Delete
Confirm] Button.";
}
}
else
{
Label_Info2.Text = "Select any one record to delete.";
}
}
catch (Exception eo)
{
Label_Info2.Text = "Error on Deletion.";
}
}
protected void LinkButton_update_Qualification_New_Click(object sender,
EventArgs e)
{
LinkButton_Person_New_Click(sender,e);
}

protected void Ima geButton_HideShow_Qualification_List_Click(object sender,


ImageClickEventArgs e)
{
if (MultiView_Person_List.Visible == false)
{
MultiView_Person_List.Visible = true;
LinkButton_Person_Delete.Enabled = true;
}
else
{
MultiView_Person_List.Visible = false;
LinkButton_Person_Delete.Enabled = false;
}
}

/// End of Qualification

///***** Adding Employee List


protected void LinkButton_Add_Employee_Click(object sender, EventArgs e)
{

Page 110 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

MultiView2.Visible = true;
MultiView2.ActiveViewIndex = 1;
}

protected void AddOne()


{
if (ListBox_Available.SelectedIndex >= 0)
{
ListItem item = ListBox_Available.SelectedItem;
Organisation_ID = Request.Cookies["Organisation_ID"].Value.ToString();
String Person_ID = item.Value.ToString();
//DatabaseEngine de = new DatabaseEngine();
Isql =
" Insert Into Tbl_Employeement(Ogranisation_ID, Person_ID)" +
" Values(" + Organisation_ID + ", " + Person_ID + ")";
SqlCommand SqlCmd = de.Get_Command();
SqlCmd.CommandText = Isql;
SqlCmd.ExecuteNonQuery();
}
Label_AddEmployee_Info.Text =
Functions.Swap_ListBox_Item(ListBox_Available, ListBox_Selected);
}

protected void ImageButton_AddOne_Click(object sender, ImageClickEventArgs e)


{
AddOne();
}

protected void Load_Data_Employee(String ID)


{
if (ID != "")
{
String Isql =
" Select Convert(varchar,Person_ID)+'. '+[Person_Name]+', '+left(Sex,1)+',
'+[Person_Address], Person_ID " +
" From VIEW_Employeement Where Organisation_ID=" + ID + " Order By
[Person_Name]";
de.Fill_ListBox(ListBox_Selected, Isql);

Isql =
" Select Convert(varchar,Person_ID)+'. '+[Name]+', '+left(Sex,1)+', '+[Address],
Person_ID " +
" From VIEW_Person Where Person_ID not in (Select Person_ID From
VIEW_Employeement Where Organisation_ID=" + ID + ") Order By [Name]";
de.Fill_ListBox(ListBox_Available, Isql);
}
}

protected void RemoveOne()


{

Page 111 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

if (ListBox_Selected.SelectedIndex >= 0)
{
ListItem item = ListBox_Selected.SelectedItem;
Organisation_ID = Request.Cookies["Organisation_ID"].Value.ToString();
String Person_ID = item.Value.ToString();
String Isql =
" Delete From Tbl_Employeement " +
" Where Ogranisation_ID=" + Organisation_ID +
" and Person_ID=" + Person_ID;
SqlCommand SqlCmd = de.Get_Command();
SqlCmd.CommandText = Isql;
SqlCmd.ExecuteNonQuery();
}
Label_AddEmployee_Info.Text =
Functions.Swap_ListBox_Item(ListBox_Selected, ListBox_Available);
}

protected void ImageButton_RemoveOne_Click(object sender, ImageClickEventArgs


e)
{
RemoveOne();
}

}
}

Annex: #12
Page: Search_Organisation.aspx.cs
Module: Organisation
Task: Search organizations with the criteria of user input.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace sahara
{
public partial class pages_Search_Organisation : System.Web.UI.Page
{
protected String iTitle_Heading = "Sahara Pvt. Ltd.";
protected String iBody = "";

Page 112 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

protected String iOthers = "";


static int i = 0;
protected DatabaseEngine de = new DatabaseEngine();
string Info = "";
String Isql = "";
protected void Page_Load(object sender, EventArgs e)
{
//QueryStringParameter QueryString = new QueryStringParameter();
if (Request.QueryString["mode"] == "search")
{
if (Request.Cookies["Where"] != null)
{
String Where = Request.Cookies["Where"].Value.ToString();
//Response.Write("<b>Avalon Searching..</b><br>");
Search_Data(Where);
}
else
{
Search_Data(" Where Organisation_ID=-1");
}
}
else
{
//Response.Write("::: No Search Now..");
}
}

protected void Search_Data(String CtrString)


{
try
{
//DatabaseEngine de = new DatabaseEngine();

//***** Deleting Tmp table


//SqlCommand sqlcmd_tmp = de.Get_Command();
//Isql = "Delete from Tbl_tmp_Search";
//sqlcmd_tmp.CommandText = Isql;
//sqlcmd_tmp.ExecuteNonQuery();
//***** Deleting Tmp table

if (CtrString.Trim().Length >= 1 &&


CtrString.Trim().StartsWith("Where") == false)
{
CtrString = "Where " + CtrString; // +" And Person_Type='Roster'";
}
else
{
CtrString = ""; //" Where Person_Type='Roster'";
}

Page 113 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Isql =
" Select Organisation_ID, Organisation_Name+'
(ESTD:'+ESTD+')'+',<BR><Font size=1 color=green>Contact
Person:</Font>'+Contact_Person as iTitle," +
" '<B><Font color=green>Address: </Font></B>'+ Address +', Ph. '+ Phone+',
Email: '+ Email +', Location. '+ District+'<BR><B><Font color=green>Keyword:
</Font></B>'+Area_of_Expertise as iBody, " +
" '<A href=''../../'+
subString(Replace(Profile,' \\','/'),CHARINDEX('org_profile',Replace(Profile,' \\','/')),len(Re
place(Profile,'\\','/')))+'''>Download Org. Profile </a>' as iCV, " +
" '<A href=Preview_Personnel_History.aspx?pid='+
Convert(Varchar,Organisation_ID) +'> More..</A>' as iMore" +
" From VIEW_Organisation " + CtrString;

////CtrString = " Where " + CtrString;


//Isql = "Select * From View_Person " + CtrString;
//SqlDataReader rs = de.Get_DataReader(Isql);
////Label_Info.Text = Isql;
//if (rs.HasRows == true)
//{
// while (rs.Read() != false)
// {
// String iTitle = rs["name"].ToString() + ", " + rs["Sex"].ToString() + ", " +
rs["Ethnicity"].ToString();
// String Keyword = "";
// if (rs["keyword"].ToString() != "")
// {
// Keyword = "<b> <Font color=green>Areaes of Experties</font>:</b> "
+ rs["keyword"].ToString();
// }
// else
// {
// Keyword = "";
// }
// String Person_ID = rs["Person_ID"].ToString();
// String CV = rs["CV"].ToString();
// String CV_Text = "";
// Isql = "Insert Into Tbl_tmp_Search(Person_ID, iTitle, iCV, iDetail_Page,
keyword) Values(@Person_ID, @iTitle, @CV, @iDetail_Page, @keyword)";

// SqlCommand sqlcmd = de.Get_Command();


// sqlcmd.CommandText = Isql;
// sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
// sqlcmd.Parameters.Add("@Keyword", SqlDbType.VarChar).Value =
Keyword;
// sqlcmd.Parameters.Add("@ITitle", SqlDbType.VarChar).Value = iTitle;
// if (CV == "")
// {

Page 114 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

// CV_Text = "";
// }
// else
// {
// CV = "..//cv_profile//" + Functions.Get_FileName(CV);
// CV_Text = "<A href='" + CV + "' Target=_new> Download CV </A>";
// }
// sqlcmd.Parameters.Add("@CV", SqlDbType.VarChar).Value = CV_Text;
// //"<A href='Personnel_History.aspx?Person_ID=" + Person_ID + "'
Target=main> More.. </A>"
// sqlcmd.Parameters.Add("@iDetail_Page", SqlDbType.VarChar).Value =
"";
// sqlcmd.ExecuteNonQuery();
// }
//}
//else
//{
// Label_Info.Text = "No Record Found..";
//}
//*** Personal History Information Processiong

////*** Academic Information Processiong


// Isql = "Select * From VIEW_Qualification " + CtrString;
// rs = de.Get_DataReader(Isql);
// //Label_Info.Text = Isql + " ->> " + rs.HasRows;
// if (rs.HasRows == true)
// {
// String Qualification_Text = "";
// String Person_ID = "";
// while (rs.Read() != false)
// {
// Qualification_Text = rs["Qualification_Name"].ToString() + " (" +
rs["Description"].ToString() + ") in " + rs["Passed_Year"].ToString();
// Person_ID = rs["Person_ID"].ToString();

// String tmp = de.Get_FieldValue("Tbl_tmp_Search", "Qualification",


"Person_ID", Person_ID);
// if (tmp == "")
// {
// Qualification_Text = "<B><font color=green>Qualification:
</font></B> "+Qualification_Text;
// }
// else
// {
// Qualification_Text =tmp +", "+ Qualification_Text;
// }
// Isql = "Update Tbl_tmp_search set Qualification=@Qualification
Where Person_ID=@Person_ID";
// SqlCommand sqlcmd = de.Get_Command();

Page 115 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

// sqlcmd.CommandText = Isql;
// sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
// sqlcmd.Parameters.Add("@Qualification", SqlDbType.VarChar).Value
= Qualification_Text;
// sqlcmd.ExecuteNonQuery();

// //Label_Info.Text = Label_Info.Text + " " + get_tmp;


// }
// }
////*** Academic History Information Processiong

////*** Training Information Processiong


// Isql = "Select * From VIEW_Training " + CtrString;
// rs = de.Get_DataReader(Isql);
// //Label_Info.Text = Isql + " ->> " + rs.HasRows;
// if (rs.HasRows == true)
// {
// String Training_Text = "";
// String Person_ID = "";
// while (rs.Read() != false)
// {
// Training_Text = rs["Training_Name"].ToString() + " (" +
rs["Training_Type"].ToString() + ") for " + rs["Duration"].ToString();
// Person_ID = rs["Person_ID"].ToString();

// String tmp = de.Get_FieldValue("Tbl_tmp_Search", "Training",


"Person_ID", Person_ID);
// if (tmp == "")
// {
// Training_Text = "<B><font color=green>Training:</font></B> " +
Training_Text;
// }
// else
// {
// Training_Text = tmp + ", " + Training_Text;
// }
// Isql = "Update Tbl_tmp_search set Training=@Training Where
Person_ID=@Person_ID";
// SqlCommand sqlcmd = de.Get_Command();
// sqlcmd.CommandText = Isql;
// sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
// sqlcmd.Parameters.Add("@Training", SqlDbType.VarChar).Value =
Train ing_Text;
// sqlcmd.ExecuteNonQuery();

// //Label_Info.Text = Label_Info.Text + " " + get_tmp;


// }

Page 116 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

// }
// //*** Training Information Processiong

// //*** Experience Information Processiong


// Isql = "Select * From VIEW_Experience " + CtrString;
// rs = de.Get_DataReader(Isql);
// //Label_Info.Text = Isql + " ->> " + rs.HasRows;
// if (rs.HasRows == true)
// {
// String Experience_Text = "";
// String Person_ID = "";
// while (rs.Read() != false)
// {
// Experience_Text = rs["Post"].ToString() + " in " +
rs["Organization"].ToString() + " for " + rs["Duration"].ToString();
// Person_ID = rs["Person_ID"].ToString();

// String tmp = de.Get_FieldValue("Tbl_tmp_Search", "Experience",


"Person_ID", Person_ID);
// if (tmp == "")
// {
// Experience_Text = "<B><font color=green>Experience:</font></B>
" + Experience_Text;
// }
// else
// {
// Experience_Text = tmp + ", " + Experience_Text;
// }
// Isql = "Update Tbl_tmp_search set Experience=@Experience Where
Person_ID=@Person_ID";
// SqlCommand sqlcmd = de.Get_Command();
// sqlcmd.CommandText = Isql;
// sqlcmd.Parameters.Add("@Person_ID", SqlDbType.VarChar).Value =
Person_ID;
// sqlcmd.Parameters.Add("@Experience", SqlDbType.VarChar).Value =
Experience_Text;
// sqlcmd.ExecuteNonQuery();

// //Label_Info.Text = Label_Info.Text + " " + get_tmp;


// }
// }
// //*** Experience Information Processiong

//Isql = "Select *, iDetail_Page as iMore From View_tmp_Search Order By


iTitle";

SqlDataSource1 = de.Prepare_SqlDataSource(Isql, SqlDataSource1);


}

Page 117 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

catch (Exception eo)


{
Functions.Set_Error(eo);
//Info = eo.Message.ToString();
}
//Info = Info + " <HR>(" + Isql + ")";
Label_Info.Text = Info;
}

protected void LinkButton_Search_Click(object sender, EventArgs e)


{
try
{
String CtrString = "";

String Keyword = TextBox_Keyword.Text;


//String Sex = DropDownList_Gender.SelectedItem.Text;
//String Ethnicity = DropDownList_Ethnicity.SelectedItem.Text;

//*** Personal History Information Processiong


CtrString = " ([Area_of_Expertise] like '%" + Keyword + "%')";
//if (Sex.CompareTo("No Selection") != 0)
//{
// CtrString = CtrString + " And ([Sex] like '%" + Sex + "%')";
//}
//if (Ethnicity.CompareTo("No Selection") != 0)
//{
// CtrString = CtrString + " And ([Ethnicity] like '%" + Ethnicity + "%')";
//}
HttpCookie Where = new HttpCookie("Where");
Where.Value = CtrString;
Response.Cookies.Add(Where);

//Response.Redirect("Search_Personal_History_Result.aspx?mode=search");
Response.Redirect("Search_Organisation.aspx?mode=search");
}
catch (Exception eo)
{
Functions.Set_Error(eo);
}
}
protected void DataList1_ItemCreated(object sender, DataListItemEventArgs e)
{
//e.Item.Controls[1]
}
}
}

Page 118 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

Annex #13

Table Metadata Structure:


Database on : Microsoft SQL Server 2000

CREATE TABLE [dbo].[Tbl_Employeement] (


[Employeement_ID] [int] IDENTITY (1, 1) NOT NULL ,
[Ogranisation_ID] [int] NULL ,
[Person_ID] [int] NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[Tbl_Menu_Item] (


[Menu_Item_ID] [int] NOT NULL ,
[Menu_Item_Parent_ID] [int] NULL ,
[Menu_Item] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Link] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Parameter] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[Target] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Visible] [int] NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[Tbl_Menu_Configuration] (


[Menu_Configuration_ID] [int] IDENTITY (1, 1) NOT NULL ,
[Permission_Level_ID] [int] NULL ,
[Menu_Item_ID] [int] NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[Tbl_Organisation] (


[Organisation_ID] [int] NOT NULL ,
[Organisation_Name] [varchar] (255) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL ,
[ESTD] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Contact_Person] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Phone] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Email] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Address] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[District] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Profile] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Area_of_Expertise] [varchar] (1000) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

Page 119 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

CREATE TABLE [dbo].[Tbl_Permission_Level] (


[Permission_Level_ID] [int] IDENTITY (1, 1) NOT NULL ,
[Permission_Level_Name] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[Tbl_Person] (


[Person_ID] [int] NOT NULL ,
[First_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[Last_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[User_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[User_Password] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Person_Type] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Sex] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[DOB] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Ethnicity] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Address] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Phone] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Mobile] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Email] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Keyword] [varchar] (1000) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[CV] [varchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Permission_Level_ ID] [int] NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[Tbl_Post] (


[Post_ID] [int] IDENTITY (1, 1) NOT NULL ,
[Post] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[tbl_Experience] (


[Experience_ID] [int] NOT NULL ,
[Person_ID] [int] NULL ,
[From_Date] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[To_Date] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,

Page 120 of 121


Connecting Avalon ::: Exclusive Empower of ASP.NET (C#) for Roster Management
Makhanlal Chaturvedhi National Journalism and Communication University, Bhopal, India

[Duration] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,


[Orga nization] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Post_ID] [int] NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[tbl_Qualification] (


[Qualification_ID] [int] NOT NULL ,
[Person_ID] [int] NULL ,
[Qualification_Name_ID] [int] NULL ,
[Description] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[Passed_Year] [int] NULL ,
[Institute_Name] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[tbl_Qualification_Name] (


[Qualification_Name_ID] [int] NOT NULL ,
[Qualification_Name] [varchar] (50) COLLATE
SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[tbl_training] (


[Training_ID] [int] NOT NULL ,
[Person_ID] [int] NULL ,
[Training_Name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL ,
[Training_Type_ID] [int] NULL ,
[From_Date] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
,
[To_Date] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
[Duration] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]

CREATE TABLE [dbo].[tbl_training_Type] (


[Training_Type_ID] [int] IDENTITY (1, 1) NOT NULL ,
[Training_Type] [varchar] (500) COLLATE SQL_Latin1_General_CP1_CI_AS
NULL
) ON [PRIMARY]

End of Annex #13

Page 121 of 121

Das könnte Ihnen auch gefallen