Sei sulla pagina 1di 56

INTRODUCTION:-

The basic idea of this project is to make the data management process easy. In the past, it was
difficult for the organizations to maintain a complete record of details of the employees at a
single place, with their leaves account. It was very difficult to maintain the details and resulted in
the creation of different departments just to maintain these records which led to the generation of
a large number of hard copies of the records of all the employees of the organization.

With the help of computers, these hard copies of records were converted into soft copies. But
still, different details of a particular employee were maintained at the different department. The
haphazard arrangement of data resulted in many loopholes. Most of all, it consumed a lot of time
and often lacked transparency.

Nowadays, running a company has become more difficult. Demands on the time and effort of
company executives as well as the employee needs are increased day by day. We are trying to
make an application which can meet these demands efficiently.

In a nutshell, our goal is to develop a system which has a central database which would maintain
all the records of each and every employee. This will increase clarity, reduce expenses and
maintain a high level of service within and outside the organization.

An employer can use the system to combine all of that data into a single and simple employee
profile system in spite of keeping attendance record in one database program and performance
reviews of the employees in another word processing program. This is how the modern
technology can be helpful to fulfill the new needs.
THE EXISTING SYSTEM

The current system works manually. It has got a lot of intricacies within itself and needs a lot of
human effort and paper works. Also, the data needs to be maintained on ledgers and this is a
tedious and risky process.

As the usage of the system increases, data increases exponentially which makes managing it
more and more difficult. For viewing a single entry, a lot of papers need to be searched
which consumes much amount of time.

Some of the negative aspects of the current system are given below:

1) The process consumes a lot of time. All the paper records needed to be searched while a
query is brought.

2) Readability can be compromised. Since they are paper records, different people may have
written them causing various writing formats resulting in difficulty to understand.

3) Paper records are not reliable. If the paper is damaged, it can result in loss of records.

4) As many people are involved in the maintenance of records, this may lead to high
expenses for adding manpower.

5) Access by illegitimate users can lead to distortion of records. Security of the manual
system is not fully guaranteed. Inaccuracy can be expected and data can easily get
corrupted or damaged.
Data Flow Diagram
‘0’ Level

Leaves Leave Mgmt Report

‘1’ level

Employee

Logi
n
Apply View

Statu
Leaves
s
‘2’ Level

Employee

Verify user Employee

Login view

applies Check
Application
Status
Check Update
Leave
Application

Update
View Leaves Status
Leave
Report
HR
E-R Diagram

Employee

Appli
es for

Leaves Update HR
s
Database Structure

Employee
Attributes Datatype Features
EmpId Numeric(10) Primary Key
FirstName Varchar(50)
LastName Varchar(50)
Address Varchar(300)
DateOfBirth Datetime
DateOfJoin Datetime
Status Varchar(10)

Leaves
Attributes Datatype Features
EmpId Numeric(10) Foreign Key
FromDate Datetime
ToDate Datetime
Reason Varchar(300)
ApprovalStatus Varchar(50)
Software Requirement:

Operating System : Windows NT/Windows 2000/Windows


Professional/Windows 2000 Server/
Windows XP Professional.
Front End Tool : ASP.NET 2010
Back End Tool : SQL Server 2008
Microsoft .Net framework
IIS (Internet information service) I.E 7

Hardware Requirement:

Processor Type : Pentium III Processor 1GHz


Primary Memory : Min 1 GB
Secondary Memory : 20 GB Hard disk
Display Type : SVGA Digital Color Monitor
(800X600 Pixel Resolution)
About the Technology - Platform Overview

C# .Net

C# is an elegant and type-safe object-oriented language that enables developers to build a


wide range of secure and robust applications that run on the .NET Framework. You can use C# to
create traditional Windows client applications, XML Web services, distributed components,
client-server applications, database applications, and much, much more. Microsoft Visual C#
2005 provides an advanced code editor, convenient user interface designers, integrated debugger,
and many other tools to facilitate rapid application development based on version 2.0 of the C#
language and the .NET Framework.

C# Language

C# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy
to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C,
C++ or Java. Developers who know any of these languages are typically able to begin working
productively in C# within a very short time. C# syntax simplifies many of the complexities of C+
+ while providing powerful features such as null able value types, enumerations, delegates,
anonymous methods and direct memory access, which are not found in Java. C# also supports
generic methods and types, which provide increased type safety and performance, and iterators,
which enable implementers of collection classes to define custom iteration behaviors that are
simple to use by client code.
As an object-oriented language, C# supports the concepts of encapsulation, inheritance
and polymorphism. All variables and methods, including the Main method, the application's
entry point, are encapsulated within class definitions. A class may inherit directly from one
parent class, but it may implement any number of interfaces. Methods that override virtual
methods in a parent class require the override keyword as a way to avoid accidental redefinition.
In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces
but does not support inheritance.
In addition to these basic object-oriented principles, C# facilitates the development of
software components through several innovative language constructs, including:
 Encapsulated method signatures called delegates, which enable type-safe event
notifications.
 Properties, which serve as accessors for private member variables.
 Attributes, which provide declarative metadata about types at run time.
 Inline XML documentation comments.
If you need to interact with other Windows software such as COM objects or native
Win32 DLLs, you can do this in C# through a process called "Interop." Interop enables C#
programs to do just about anything that a native C++ application can do. C# even supports
pointers and the concept of "unsafe" code for those cases in which direct memory access is
absolutely critical.
The C# build process is simple compared to C and C++ and more flexible than in Java.
There are no separate header files, and no requirement that methods and types be declared in a
particular order. A C# source file may define any number of classes, structs, interfaces, and
events.

.NET Framework Platform Architecture


C# programs run on the .NET Framework, an integral component of Windows that
includes a virtual execution system called the common language runtime (CLR) and a unified set
of class libraries. The CLR is Microsoft's commercial implementation of the common language
infrastructure (CLI), an international standard that is the basis for creating execution and
development environments in which languages and libraries work together seamlessly.
Source code written in C# is compiled into an intermediate language (IL) that conforms
to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored
on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An
assembly contains a manifest that provides information on the assembly's types, version, culture,
and security requirements.
When the C# program is executed, the assembly is loaded into the CLR, which might
take various actions based on the information in the manifest. Then, if the security requirements
are met, the CLR performs just in time (JIT) compilation to convert the IL code into native
machine instructions. The CLR also provides other services related to automatic garbage
collection, exception handling, and resource management. Code that is executed by the CLR is
sometimes referred to as "managed code," in contrast to "unmanaged code" which is compiled
into native machine language that targets a specific system. The following diagram illustrates the
compile-time and run time relationships of C# source code files, the base class libraries,
assemblies, and the CLR.

Language interoperability is a key feature of the .NET Framework. Because the IL code
produced by the C# compiler conforms to the Common Type Specification (CTS), IL code
generated from C# can interact with code that was generated from the .NET versions of Visual
Basic, Visual C++, Visual J#, or any of more than 20 other CTS-compliant languages. A single
assembly may contain multiple modules written in different .NET languages, and the types can
reference each other just as if they were written in the same language.
In addition to the run time services, the .NET Framework also includes an extensive
library of over 4000 classes organized into namespaces that provide a wide variety of useful
functionality for everything from file input and output to string manipulation to XML parsing, to
Windows Forms controls. The typical C# application uses the .NET Framework class library
extensively to handle common "plumbing" chores.
Managed Execution

To understand how your ASP.NET applications work, and just how much the code differs
from the C# code that Dorothy wrote in Kansas, it’s important to understand managed code and
how it works. To use managed execution and get the benefits of the CLR, you must use a
language that was built for, or targets, the runtime. Fortunately for you, this includes C#.NET. In
fact, Microsoft wanted to make sure that C#.NET was a premier language on the .NET platform,
meaning that C# could no longer be accused of being a “toy” language .The runtime is a
language-neutral environment, which means that any vendor can create a language that takes
advantage of the runtime’s features. Different compiler scan expose different amounts of the
runtime to the developer, so the tool you use and the language in which you write might still
appear to work somewhat differently. The syntax of each language is different, of course, but
when the compilation process occurs, all code should be compiled into something
understandable to the runtime.

Microsoft Intermediate Language (MSIL)

One of the more interesting aspects of .NET is that when we compile our code, we do not
compile to native code. Before you VB developers panic and fear that we are returning to the
days of interpreted code, realize that the compilation process translates our code into something
called Microsoft intermediate language, which is also called MSIL or just IL. The compiler also
creates the necessary metadata and compiles it into the component. This IL is CPU independent.
After the IL and metadata are in a file, this compiled file is called the PE, which stands for either
portable executable or physical executable, depending on whom we ask. Because the PE contains
your IL and metadata, it is therefore self-describing, eliminating the need for a type library or
interfaces specified with the Interface Definition Language (IDL).

The Just-In-Time Compiler

Our code does not stay IL for long, however. It is the PE file, containing the IL that can
be distributed and placed with the CLR running on the .NET Framework on any operating
system for which the .NET Framework exists, because the IL is platform independent. When we
run the IL, however, it is compiled to native code for that platform. Therefore, you are still
running native code; you are not going back to the days of interpreted code at all. The
compilation to native code occurs via another tool of the .NET Framework: the Just-In-Time
(JIT) compiler. With the code compiled, it can run within the Framework and take advantage of
low level features such as memory management and security. The compiled code is native code
for the CPU, on which the .NET Framework is running, meaning that you are indeed running
native code instead of interpreted code. A JIT compiler will be available for each platform on
which the .NET Framework runs, so you should always begetting native code on any platform
running the .NET Framework. Remember, today this is just Windows, but this could change in
the future.

Executing Code

Interestingly, the JIT complier doesn’t compile the entire IL when the component is first
called. Instead, each method is compiled the first time it is called. This keeps us from having to
compile sections of code that are never called. After the code is compiled, of course, subsequent
calls use the compiled version of the code. This natively compiled code is stored in memory in
Beta 2. However, Microsoft has provided a PreJIT compiler that will compile all the code at once
and store the compiled version on disk, so the compilation will persist over time. This tool is
calledngen.exe and can be used to precompile the entire IL. If the CLR cannot find a
precompiled version of the code, it begins to JIT compile it on-the-fly. After the code starts
executing, it can take full advantage of the CLR, with benefits such as the security model,
memory management, debugging support, and profiling tools. Most of these benefits will be
mentioned throughout the book.

Security

If you create a VB component today, your choices for implementing security are
somewhat limited. We can use NTFS to set permissions on the file itself. We can place it in
MTS/COM+ Component Services and turn on role-based security. We can call it over DCOM
and use DCOMCNFG to set permissions. We can always just code your own security. One of the
runtime’s main benefits is that an entire security infrastructure is built right in. In fact, two major
security models are set up in the .NET Framework: code access security and role-based security.
Code Access Security (CAS)

This security does not control who can access the code; rather, it controls what the code
itself can access. This is important because it allows us to build components that can be trusted to
varying degrees. If we build a VB component today and want to perform database access, we are
free to call ADO and connect to a database (provided, of course, that we have a valid user ID and
password). With .NET, however, we can actually specify, with the tools in the .NET Framework,
what actions our component can and, more importantly, cannot perform. This has the benefit of
preventing others from using the code in ways that we did not intend. Perhaps the main benefit of
CAS is that we can now trust code that is downloaded from the Internet. Security can be set up
so that it becomes impossible for the code toper form any mischievous actions. This would
prevent most of the macro viruses that are spread via e-mail today.

Role-Based Security

Role-based security is the same type of security we get when we use MTS or COM+
Component Services. In .NET, the Framework determines the caller, called a principal, and
checks the principal’s individual and group permissions. Unlike COM/COM+ role-based
security, however, .NET cannot make an assumption that the user will have a valid NT user
account and token to pass in. Therefore, .NET allows for generic and custom principals, as well
as standard Windows principals. We can define new roles for each application if we want.

Microsoft SQL Server

A high-performance client/server relational database–management system (RDBMS) for


the Microsoft Windows NT and Windows 2000 operating systems. Microsoft SQL Server is part
of the Microsoft BackOffice family of server products. RDBMS’s are used in high-volume
transaction-processing environments such as online order entry systems, data warehousing,
decision-support applications, and e-commerce.
SQL Server includes the following features:
 A distributed management framework for centrally managing all servers running SQL
Server in an organization
 Built-in data replication to copy information throughout an enterprise not only to SQL
Server databases but also to Oracle, IBM DB2, Sybase, and other databases
 The Web Assistant for populating a Web server with SQL data for Internet or private
intranet use
 Microsoft Distributed Transaction Coordinator for creating distributed transaction-based
applications across multiple servers
 Integration with the security features of the Windows NT platform
 A high-performance, scalable, multithreaded parallel architecture
 Scalable dynamic locking architecture for page-level and row-level locking
 Data warehousing and online analytical processing (OLAP) enhancements
 Support for OLE Automation stored procedures
 Integration with Microsoft Exchange through the SQL Mail utility
 Support for Windows 2000, Windows NT, Windows 98, and Windows 95
 A query processor that supports the complex queries used in decision support, data
warehousing, and OLAP applications
 Wizards that ease tasks for administrators and programmers
 Support for Microsoft Management Console (MMC)
 Tools for profiling and tuning a server’s performance
 Integration with Microsoft Proxy Server and Microsoft Office 2000

How It Works?

SQL Server is a client/server database system. The server runs the SQL Server database
software, which processes requests submitted by the database client software and sends the
results back to the client. The SQL Executive and the SQL Server Database Engine service are
examples of database services performed by SQL Server.
The SQL Server software is arranged in multiple layers. The Net-Library layer, which
accepts connections from clients, hides the network connectivity details when a client
communicates with a server running SQL Server. Net-Libraries use interprocess communication
(IPC) mechanisms such as named pipes, remote procedure calls (RPCs), and Windows Sockets.
Several Net-Libraries are included with SQL Server for both the server and the client. Net-
Libraries on the server listen for client connection attempts.
A client computer runs the database client software, which is used to connect to the server
running SQL Server, make requests, receive results, and display the results on the user’s screen.
Examples of database client software that can connect to SQL Server include SQL Server
Enterprise Manager, ISQL/w, and Microsoft Access. The database client software is also made
up of multiple layers. Users interact directly with the client application, which might present a
form such as an order entry form. When the user submits the form, the client software interacts
with the server running SQL Server using open database connectivity (ODBC) or DB-Library
application programming interfaces (APIs). The server processes the request and returns
information to the client.
.Net and Its Implementation

Creating a New Project

Select File->New Project within the Visual Studio 2005 IDE. This will bring up the New Project
dialog. Click on the “Visual C#” node in the tree-view on the left hand side of the dialog box
and choose the "ASP.NET Web Application" icon:

Choose where you want the project to be created on disk (note that there is no longer a
requirement for web projects to be created underneath the inetpub\wwwroot directory -- so
you can store the project anywhere on your filesystem). Then name it and hit ok.

Visual Studio will then create and open a new web project within the solution explorer. By
default it will have a single page (Default.aspx), an AssemblyInfo.cs file, as well as a
web.config file. All project file-meta-data is stored within a MSBuild based project file.
Opening and Editing the Page

Double click on the Default.aspx page in the solution explorer to open and edit the page. You can
do this using either the HTML source editor or the design-view. Add a "Hello world" header
to the page, along with a calendar server control and a label control (we'll use these in a later
tutorial):

Build and Run the Project

Hit F5 to build and run the project in debug mode. By default, ASP.NET Web Application
projects are configured to use the built-in VS web-server (aka Cassini) when run. The
default project templates will run on a random port as a root site (for example:
http://localhost:12345/):
You can end the debug session by closing the browser window, or by choosing the Debug->Stop
Debugging (Shift-F5) menu item.

Coding against controls in our Default.aspx page

In the first Hello World Tutorial we edited the Default.aspx page that is added automatically
when we create a new VS 2005 Web Application project.

Specifically we added an <asp:calendar> and <asp:label> control to the page:

You can then program against these controls using your event-handlers within the code-behind
file. For example:
You can then set a breakpoint (press the F9 key on the line to set it on), and then hit F5 to
compile, run and debug the page:
Adding Classes to the Web Project

In this sample we'll be data-binding a GridView control on a page to a set of classes in our web
application project.

To begin, right-click on the project and select Add->Add New Item to add a new class called
"Author" to the project:

Note that classes can be added into any directory of the web project. There is no requirement that
they live under the /app_code directory.
Make the new Author class public and then add some properties and constructors to it:

Then add a new class file called "Publisher.cs" to the project and have it implement a method
called "GetAuthorsByState":
Screen Shot

Login Screen
Leave Display Screen
Employee Register Screen
Leave Application Screen
Status Check Screen
Code
LoginPage
<%@ Page Title="" Language="C#"
MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="LoginPage.aspx.cs"
Inherits="LoginPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head"


Runat="Server">
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content3"
ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<table style="width:100%;">
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Employee Id<asp:RequiredFieldValidator
ID="RequiredFieldValidator1"
runat="server" ErrorMessage="RequiredFieldValidator"
ForeColor="Red"
SetFocusOnError="True" ValidationGroup="login"

ControlToValidate="TextBox1">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Password<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ErrorMessage="RequiredFieldValidator" ForeColor="Red"
SetFocusOnError="True"
ValidationGroup="login"
ControlToValidate="TextBox2">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td align="right">
<asp:RequiredFieldValidator ID="RequiredFieldValidator3"
runat="server"
ControlToValidate="RadioButtonList1"
ErrorMessage="RequiredFieldValidator"
ForeColor="Red" SetFocusOnError="True"
ValidationGroup="login">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:RadioButtonList ID="RadioButtonList1"
runat="server"
RepeatDirection="Horizontal">
<asp:ListItem>HR</asp:ListItem>
<asp:ListItem>Employee</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td valign="top">

<asp:LinkButton ID="LinkButton1"
runat="server" onclick="LinkButton1_Click"
CausesValidation="False">New
Employee</asp:LinkButton>
</td>
<td valign="top">
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="Login"
ValidationGroup="login" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT * FROM [EmpReg] WHERE
(([EmpID] = @EmpID) AND ([Password] = @Password))">
<SelectParameters>
<asp:ControlParameter ControlID="TextBox1"
Name="EmpID" PropertyName="Text"
Type="Decimal" />
<asp:ControlParameter ControlID="TextBox2"
Name="Password" PropertyName="Text"
Type="String" />
</SelectParameters>
</asp:SqlDataSource>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Label ID="Label1" runat="server"
ForeColor="Red"></asp:Label>
</td>
<td>
&nbsp;</td>
</tr>
</table>
</asp:Content>

HRLogin

<%@ Page Title="" Language="C#"


MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="HRLogin.aspx.cs"
Inherits="HRLogin" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head"


Runat="Server">
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content3"
ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:LinkButton ID="LinkButton2" runat="server"
onclick="LinkButton2_Click">Logout</asp:LinkButton>
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<asp:MultiView ID="MultiView1" runat="server"
ActiveViewIndex="0">
<asp:View ID="View1" runat="server">
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="LeaveId"
DataSourceID="SqlDataSource1"
onrowcommand="GridView1_RowCommand"
BackColor="#DEBA84" BorderColor="#DEBA84"
BorderStyle="None" BorderWidth="1px"
CellPadding="3" CellSpacing="2">
<Columns>
<asp:BoundField DataField="LeaveId"
HeaderText="LeaveId" InsertVisible="False"
ReadOnly="True" SortExpression="LeaveId"
Visible="False" />
<asp:BoundField DataField="EmpId" HeaderText="Emp Id"
SortExpression="EmpId" />
<asp:BoundField DataField="StartDate"
DataFormatString="{0:d}"
HeaderText="Start Date" SortExpression="StartDate" />
<asp:BoundField DataField="EndDate"
DataFormatString="{0:d}"
HeaderText="End Date" SortExpression="EndDate" />
<asp:BoundField DataField="LeaveReason"
HeaderText="Reason"
SortExpression="LeaveReason" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
<asp:TemplateField ShowHeader="False">
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"
CausesValidation="False"
CommandArgument='<%# Eval("LeaveId") %>'
CommandName="accept" Text="Accept"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True"
ForeColor="White" />
<PagerStyle ForeColor="#8C4510"
HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True"
ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString
%>"
SelectCommand="SELECT * FROM [Leaves] ORDER BY
[LeaveId] DESC"
UpdateCommand="UPDATE Leaves SET Status = 'Accepted'
WHERE (LeaveId = @LeaveId)">
<UpdateParameters>
<asp:Parameter Name="LeaveId" />
</UpdateParameters>
</asp:SqlDataSource>
</asp:View>
</asp:MultiView>
</asp:Content>
EmpReg

<%@ Page Title="" Language="C#"


MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="EmpReg.aspx.cs"
Inherits="EmpReg" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head"


Runat="Server">
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content3"
ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<asp:LinkButton ID="LinkButton1" runat="server"
onclick="LinkButton1_Click">Home</asp:LinkButton>
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<table style="width:100%;">
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Employee First Name<asp:RequiredFieldValidator
ID="RequiredFieldValidator1"
runat="server" ErrorMessage="RequiredFieldValidator"
ForeColor="Red"
SetFocusOnError="True" ValidationGroup="submit"

ControlToValidate="TextBox1">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Employee Last Name<asp:RequiredFieldValidator
ID="RequiredFieldValidator2"
runat="server" ErrorMessage="RequiredFieldValidator"
ForeColor="Red"
SetFocusOnError="True" ValidationGroup="submit"

ControlToValidate="TextBox2">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Contact No<asp:RegularExpressionValidator
ID="RegularExpressionValidator1"
runat="server"
ErrorMessage="RegularExpressionValidator" ForeColor="Red"
SetFocusOnError="True" ValidationExpression="\d{10}"
ValidationGroup="submit"
ControlToValidate="TextBox3">*</asp:RegularExpressionValidat
or>
</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"
MaxLength="10"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Blood Group</td>
<td>
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>A+</asp:ListItem>
<asp:ListItem>A-</asp:ListItem>
<asp:ListItem>B+</asp:ListItem>
<asp:ListItem>B-</asp:ListItem>
<asp:ListItem>O+</asp:ListItem>
<asp:ListItem>O-</asp:ListItem>
</asp:DropDownList>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td valign="top">
Address<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ErrorMessage="RequiredFieldValidator" ForeColor="Red"
SetFocusOnError="True"
ValidationGroup="submit"
ControlToValidate="TextBox4">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox4" runat="server"
TextMode="MultiLine"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Employee ID<asp:RequiredFieldValidator
ID="RequiredFieldValidator4"
runat="server" ErrorMessage="RequiredFieldValidator"
ForeColor="Red"
SetFocusOnError="True" ValidationGroup="submit"

ControlToValidate="TextBox5">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox>
<asp:Label ID="Label1" runat="server" Font-Size="11px"
ForeColor="Red"></asp:Label>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Password<asp:RequiredFieldValidator
ID="RequiredFieldValidator5" runat="server"
ErrorMessage="RequiredFieldValidator" ForeColor="Red"
SetFocusOnError="True"
ValidationGroup="submit"
ControlToValidate="TextBox6">*</asp:RequiredFieldValidator>
</td>
<td>
<asp:TextBox ID="TextBox6" runat="server"
TextMode="Password"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server" Text="Submit"
onclick="Button1_Click"
ValidationGroup="submit" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [EmpReg] WHERE
[EmpID] = @EmpID"
InsertCommand="INSERT INTO [EmpReg] ([EmpID],
[Password], [EmpName], [EmpLast], [Contact], [BloodGroup],
[Address]) VALUES (@EmpID, @Password, @EmpName,
@EmpLast, @Contact, @BloodGroup, @Address)"
SelectCommand="SELECT * FROM [EmpReg] WHERE
([EmpID] = @EmpID)"
UpdateCommand="UPDATE [EmpReg] SET [Password] =
@Password, [EmpName] = @EmpName, [EmpLast] = @EmpLast,
[Contact] = @Contact, [BloodGroup] = @BloodGroup, [Address] =
@Address WHERE [EmpID] = @EmpID">
<DeleteParameters>
<asp:Parameter Name="EmpID" Type="Decimal" />
</DeleteParameters>
<InsertParameters>
<asp:ControlParameter ControlID="TextBox5"
Name="EmpID" PropertyName="Text"
Type="Decimal" />
<asp:ControlParameter ControlID="TextBox6"
Name="Password" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="TextBox1"
Name="EmpName" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="TextBox2"
Name="EmpLast" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="TextBox3"
Name="Contact" PropertyName="Text"
Type="String" />
<asp:ControlParameter ControlID="DropDownList1"
Name="BloodGroup"
PropertyName="SelectedValue" Type="String" />
<asp:ControlParameter ControlID="TextBox4"
Name="Address" PropertyName="Text"
Type="String" />
</InsertParameters>
<SelectParameters>
<asp:ControlParameter ControlID="TextBox5"
Name="EmpID" PropertyName="Text"
Type="Decimal" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="Password" Type="String" />
<asp:Parameter Name="EmpName" Type="String" />
<asp:Parameter Name="EmpLast" Type="String" />
<asp:Parameter Name="Contact" Type="String" />
<asp:Parameter Name="BloodGroup" Type="String" />
<asp:Parameter Name="Address" Type="String" />
<asp:Parameter Name="EmpID" Type="Decimal" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Label ID="Label2" runat="server" Font-Size="12px"
ForeColor="Red"></asp:Label>
</td>
<td>
&nbsp;</td>
</tr>
</table>
</asp:Content>

LeaveEntry
<%@ Page Title="" Language="C#"
MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="LeaveEntry.aspx.cs"
Inherits="LeaveEntry" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head"


Runat="Server">
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<table style="width:100%;">
<tr>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
Start Date</td>
<td>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
End Date</td>
<td>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td valign="top">
Reason for Leave</td>
<td>
<asp:TextBox ID="TextBox3" runat="server"
TextMode="MultiLine"></asp:TextBox>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Button ID="Button1" runat="server"
onclick="Button1_Click" Text="Submit"
style="height: 26px" />
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$
ConnectionStrings:ConnectionString %>"
DeleteCommand="DELETE FROM [Leaves] WHERE
[LeaveId] = @LeaveId"
InsertCommand="INSERT INTO [Leaves] ([EmpId],
[StartDate], [EndDate], [LeaveReason], [Status]) VALUES
(@EmpId, @StartDate, @EndDate, @LeaveReason, @Status)"
SelectCommand="SELECT * FROM [Leaves] WHERE
([EmpId] = @EmpId)"
UpdateCommand="UPDATE [Leaves] SET [EmpId] =
@EmpId, [StartDate] = @StartDate, [EndDate] = @EndDate,
[LeaveReason] = @LeaveReason, [Status] = @Status WHERE
[LeaveId] = @LeaveId">
<DeleteParameters>
<asp:Parameter Name="LeaveId" Type="Decimal" />
</DeleteParameters>
<InsertParameters>
<asp:SessionParameter Name="EmpId"
SessionField="empid" Type="Decimal" />
<asp:ControlParameter ControlID="TextBox1"
Name="StartDate" PropertyName="Text"
Type="DateTime" />
<asp:ControlParameter ControlID="TextBox2"
Name="EndDate" PropertyName="Text"
Type="DateTime" />
<asp:ControlParameter ControlID="TextBox3"
Name="LeaveReason"
PropertyName="Text" Type="String" />
<asp:Parameter DefaultValue="N.A." Name="Status"
Type="String" />
</InsertParameters>
<SelectParameters>
<asp:SessionParameter Name="EmpId"
SessionField="empid" Type="Decimal" />
</SelectParameters>
<UpdateParameters>
<asp:Parameter Name="EmpId" Type="Decimal" />
<asp:Parameter Name="StartDate" Type="DateTime" />
<asp:Parameter Name="EndDate" Type="DateTime" />
<asp:Parameter Name="LeaveReason" Type="String" />
<asp:Parameter Name="Status" Type="String" />
<asp:Parameter Name="LeaveId" Type="Decimal" />
</UpdateParameters>
</asp:SqlDataSource>
</td>
<td>
&nbsp;</td>
</tr>
<tr>
<td>
&nbsp;</td>
<td>
<asp:Label ID="Label1" runat="server" Font-Size="12px"
ForeColor="Red"></asp:Label>
</td>
<td>
&nbsp;</td>
</tr>
</table>
</asp:Content>

StatusCheck

<%@ Page Title="" Language="C#"


MasterPageFile="~/MasterPage.master"
AutoEventWireup="true" CodeFile="StatusCheck.aspx.cs"
Inherits="StatusCheck" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head"


Runat="Server">
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
</asp:Content>
<asp:Content ID="Content4"
ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<asp:GridView ID="GridView1" runat="server"
AllowPaging="True"
AutoGenerateColumns="False" DataKeyNames="LeaveId"
DataSourceID="SqlDataSource1" BackColor="#DEBA84"
BorderColor="#DEBA84"
BorderStyle="None" BorderWidth="1px" CellPadding="3"
CellSpacing="2">
<Columns>
<asp:BoundField DataField="LeaveId" HeaderText="LeaveId"
InsertVisible="False"
ReadOnly="True" SortExpression="LeaveId" />
<asp:BoundField DataField="EmpId" HeaderText="EmpId"
SortExpression="EmpId"
Visible="False" />
<asp:BoundField DataField="StartDate"
DataFormatString="{0:d}"
HeaderText="StartDate" SortExpression="StartDate" />
<asp:BoundField DataField="EndDate"
DataFormatString="{0:d}"
HeaderText="EndDate" SortExpression="EndDate" />
<asp:BoundField DataField="LeaveReason"
HeaderText="LeaveReason"
SortExpression="LeaveReason" />
<asp:BoundField DataField="Status" HeaderText="Status"
SortExpression="Status" />
</Columns>
<FooterStyle BackColor="#F7DFB5" ForeColor="#8C4510" />
<HeaderStyle BackColor="#A55129" Font-Bold="True"
ForeColor="White" />
<PagerStyle ForeColor="#8C4510" HorizontalAlign="Center" />
<RowStyle BackColor="#FFF7E7" ForeColor="#8C4510" />
<SelectedRowStyle BackColor="#738A9C" Font-Bold="True"
ForeColor="White" />
<SortedAscendingCellStyle BackColor="#FFF1D4" />
<SortedAscendingHeaderStyle BackColor="#B95C30" />
<SortedDescendingCellStyle BackColor="#F1E5CE" />
<SortedDescendingHeaderStyle BackColor="#93451F" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString
%>"
SelectCommand="SELECT * FROM [Leaves] WHERE ([EmpId] =
@EmpId)">
<SelectParameters>
<asp:SessionParameter Name="EmpId" SessionField="empid"
Type="Decimal" />
</SelectParameters>
</asp:SqlDataSource>
</asp:Content>
SWOT ANALYSIS

Strength
The strength of project is that it provides the solution for having leave managed
in an online system.
As it is developed in .NET it provides security and it is reliable.
Microsoft SQL Server has a high performance, scalable, supports complex
queries and multithreaded parallel architecture.

Weakness
The fake information related to employee cannot be detected.

Opportunity
This project will be extended in future to implement on mobile systems.

Threats
If any trouble occur in this software all the data and information of the suspect is
lost.
Conclusion

The project “Leave Management System” which shall be developed using


ASP.Net as a front-end tool shall meet the requirement of the organization. The main
objective of the system developed is the registration of employee and take their leaves
online and report generation then and there. User friendliness is another feature of this
system that offers enhanced convenience to the user working with the system.

Developing this software shall be a good experience for me. During the
development of the project I had got enough to learn and got the chance to increase my
knowledge in the field of software. I am satisfied that the system meets all the
requirements.

Potrebbero piacerti anche