Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 142

[COMPANY MANAGEMENT SYSTEM] 1

COMPANY MANAGEMENT
SYSTEM
[An Asp.Net Website]

0/0/2014
Conjoinix, Chandigarh

71
Company Management System
A
Project Report
Submitted
In the partial fulfillment
For the award of degree of
Master of Computer Applications
(2011-2014)

Undertaken at
Conjoinix, Chandigarh

Submitted by

Under Supervision of

Internal Supervisor(s): - External Supervisor: -

Assistant Professor Assistant Professor


COMPANY MANAGEMENT SYSTEM 0/0/2014

Declaration

I hereby declare that the project work entitled “Company Management System” is

Authentic record of our own work carried out at Conjoinix, Chandigarh as

Requirement of Industry Internship project for award of degree of M.C.A

Under the guidance of Mrs. Poonam (Project Officer, Conjoinix) (External Faculty

Advisor

During January-May 2014.

Date: Signature: -

3
ACKNOWLEDGEMENT

It is a pleasure for us to find ourselves penning down these lines to express our sincere thanks to all
our coordinators to give me this opportunity of preparing this project, to enhance my
professional practice. I express my deep sense of gratitude to my project officer Mrs Poonam to
give us knowledge about the topic and concept related to this particular project. Without this guidance
we cannot imagine to complete our project on time.

I present my deepest gratitude to all our coordinators and teachers for always boosting
up our moral and providing us encouraging environment. In the last, we want to thank our
parents, without whom nothing was possible.

This application is the individual work of mine. Without helps of the particular
that mentioned above, I would face many difficulties while doing this project.

Name:
COMPANY MANAGEMENT SYSTEM 0/0/2014

INDEX
Sr.No. Tilte Page No.
1. Organization Overview 7-8
2. Introduction 9
3. Features of the Application 10
4. Hardware and Software to be used 11-12
5. Feasibility Analysis
6. Module in this project
7. Software Requirement Specification
8. System Design
9. Database Diagrams
10. ER diagram
11. Testing
12. Implementation
13. Project Legacy
14. Source Code of Activities

ACTIVITIES PAGE NO.

5
15. Source Code of aspx files

16. Snapshots
17. Conclusion
18. Biblography
COMPANY MANAGEMENT SYSTEM 0/0/2014

Organization Overview

Conjoinix Technologies - IT service provider

About our services you can refer www.conjoinix.com. We are one of the Leading ISO 9001:2008
certified Companies in Chandigarh, North India. Conjoinix, with an aim to develop World-class,
competent High Quality solutions at competitive low cost price through its competent, focused,
dynamic, hard working and prosperous team of Professionals currently operates from Chandigarh, India
and has been listed amongst Top 100 Small Businesses of the Year 2011.

Our Services include:

:: Dedicated Leased Line & Broadband :: Data Center Services

:: Web Designing :: Software Development

:: Web Hosting :: Server Co-locations

:: Security & Firewall Solutions :: Bandwidth Management

:: Network Integration :: System Integration

:: Internet Telephony / VoIP :: Video Surveillance

:: Interoffice Connectivity :: Virtual Private Networking

:: Corporate Email Solutions :: Website Security Auditing & Monitoring

:: Video Conferencing :: Satellite Broadband

:: Anti-virus & Anti-spam :: IT Hardware & Software

:: Training & Consultancy :: Call Center Dialers & Solutions

7
Conjoinix is pleased to announce 6 weeks Professional IT Foundation Programes at ñ XSCademy,
through which young talent shall get trained & benefited in their respective Careers. Conjoinix-
XSCademy is a unique Professional initiative by Conjoinix and will help your students in making a
bright future and get Professionaly Trained.

Programme Cycle:
Training Application & Selection ---> Training Confirmation ---> Training ---> Option for Part-time Job
during Training ---> Soft-skill Development ---> Finishing & Grooming Program ---> Placement --->
Job Selection ---> Job

Salient Features:
- 100% Live On-Job Training

- Sessions delivered directly by In-Industry Professionals

- Multi-profiled Parrallel Programmes in the fields in Software / Web Development, Linux / Open
Source, Networking Security & Administration, System & Data Center Administration, and IT & ITeS
Services

- 6 weeks Training, including Workshop Sessions followed by On-Job / On-Field Training

- Guaranteed Exposure to Live Industry environment, Project Management & innovative Technologies

- Free Personality Development & Professional Development Programmes.

- 100% Job Opportunity for deserving candidates.

Foundation level Programmes (6 weeks) are also available for:


- Software & Internet Application Development: PHP, .Net & Java (Core), Objective C

- Windows & Networking: MCITP, CCNA

- On-Job Training Programme - Online Training Programm


COMPANY MANAGEMENT SYSTEM 0/0/2014

INTRODUCTION

This project ‘Company Management System’ is an Asp.Net website. As the name suggests, this
website helps to manage IT companies data in easy manner. It is very easy to use. InAdmin Panel of the
website the administrator of the company can check every single detail about company. Because of
security factor, administrator can provide certain privilages to different users. We can see our company’s
workin progress like Completed tasks, Incompleted tasks and pending tasks. We can see everey single
updation about company’s data in this website. Administartor can work as task manager, as he can
assign various tasks and can abandon these tasks, can also see progress of various tasks.

Motivation & Objective


 To provide different services to the admin and employees.
 To give the best help in company management.
 They can provide access to users according to their need.
 The administrator can check daily updates about company.
 Changes will be done time to time if at backend any changes occur.
 Admin can add many things dynamically in website.

9
HARDWARE AND SOFTWARE TO BE USED

The system must have the following hardware requirements:-

Software Environment:

1. Microsoft Visual studio 2008


2. Photoshop CS5
3. Sqlserver Management studio 2008

Hardware Environment:

1. PC with Intel Core i5 Processor, 2.66 GHz


2. 2GB RAM
3. Minimum 10 GB free Hard Disk space.
4. Mouse or Similar Pointing device.

Technology Used:

1. Asp.Net
2. Code-Behind file –C#
COMPANY MANAGEMENT SYSTEM 0/0/2014

Technical Requirements

S. Name Description
No.

1. Microsoft Visual Studio 2008 A complete kit for developing Asp.Net sites

2. C# Code-Behind files are written in C#

3. SqlServer Management Studio For Creating Database

4. HTML The source of Design is written in HTML by-


default in Asp.Net. Its extension is .aspx i.e.
form.aspx .

11
FEASIBILITY ANALYSIS

The feasibility study revolves around investigation and evaluation of the problem, identification and
description of candidate system, specification of performance and the cost of each system, and the final
selection of best system. The objective of the feasibility study is not to solve the problem but to acquire
a sense of its scope.

Feasibility study is broadly divided into the following categories. Each category attempts to cover all
the aspects of a civilized society and provide a clear understanding of all solutions chosen. These are:

 Economic feasibility
 Technical feasibility
 Operational feasibility
 Time feasibility

Let’s take each one of them separately and try to understand what these different types of feasibility
study cover:

Technical feasibility-
Technical feasibility determines whether the work for the project can be done with the existing
equipment, software technology and available personnel. Technical feasibility is concerned with
specifying equipment and software that will satisfy the user requirement. Open leaf is technically
feasible as the technical requirements are completely available in the present scenario.

The technical requirements for open leaf are:

 Microsoft Visual Studio 2008


 SqlServer Management Studio 2008
 Code-Behind Files: - C#

All the above-mentioned requirements are available in the market thereby making Open Leaf
technical feasible.
COMPANY MANAGEMENT SYSTEM 0/0/2014

Economic Feasibility-
Economic feasibility determines whether there are sufficient benefits in creating to make the cost
acceptable, or is the cost of the system too high. This signifies cost-benefit analysis and savings. On the
behalf of the cost-benefit analysis, the proposed system is feasible and is economical regarding its pre-
assumed cost for making a system. The cost of the system is dependent upon the following factors:-

 Personal costs
 Computer usage
 Supply and equipments costs
 Cost of any new computer equipments and software.

Operational Feasibility-
It is mainly related to human organizational and political aspects. The points to be considered are:

 What changes will be brought with the system?


 What organizational structures are disturbed?
 What new skills will be required? Do the existing staff members have these skills?

Time Feasibility-

Time feasibility is a determination of whether a proposed project can be implemented fully within a
stipulated time frame. If a project takes too much time it is likely to be rejected.

13
Module in this project

 Administrator
 Employee

Brief description on the modules:

Administrator: -
 Administrator has the full authority over the Application.
 He/she can fully check the site on back end. And as well as he can update information if is
there is any change occurred in company schedule.
 He/she checks incomplete tasks, complete tasks and pending tasks.which is assigned to
various employees.
 Admin can check and edit profiles of different employees.

Employees: -
 Employees can use it for according to their need.
 Employee can edit his or her own profile only.
 He/she can check its completed tasks ans pending tasks.
 Employee can submit its completed tasks.
 Employee can change its account login password.
COMPANY MANAGEMENT SYSTEM 0/0/2014

Software Requirement Specification

Introduction:
This requirement specification is for mentioning the detail view of  “Company Management
System” website which is helpful in IT companies. This website is providing support to the
Administrator and Employees. It can give a good profitable dimension to that organization as the
number of employees will increase day by day in the company .This website is meant for
company, if we want to manage our company without company management software, then we have to
use varoius kind of tools like, different files for storing and visualizing data. but this software is only
meant for company management system. It make ease in managing company. All types of
functionalities of this Website have been mentioned here accordingly.

Overall Description:
In this Website Admin can easily add anything dynamically and use it accordingly.This website
contains all the functions or Data related to IT companies. Admin can add country names,state names,
departments, designation according to specific department, registration of employee,view any
employee’s profile, Task managing,assigning task and checking incomplete ,complete and pending task
of every employee. Employee can change its Password,view his/her profile,edit profile,submit
completed task,view pending and completed tasks.

Functionalities:
Employee’s can Login into their account and then their session starts and accordingly they can logout
from thir accounts whenever they want. Also any Employee can change his/her account’s password.

15
Employee’s Home Page:
Here he/she is provided with 4 options. There are facilities

 View his/her profile.


 Edit profile.
 Can change its Account password.
 Can submitt completed tasks.
 Can check its incomplete and pending tasks.

Administrator’s Home Page:


He can manage all the data. He has the solo authority to delete any data , to update the database .
COMPANY MANAGEMENT SYSTEM 0/0/2014

System Design

FLOW CHARTS
A flowchart is a type of diagram that represents an algorithm or process, showing the
steps as boxes of various kinds, and their order by connecting them with arrows . This
diagrammatic [Knowledge representation and reasoning representation solution to a given problem
. Process operations are represented in these boxes and aerogram]]; rather, they are implied by
the sequencing of operations. Flowcharts are used in analyzing, designing, documenting or
managing a process or program in various fields.

Symbols Description

Start or End of the Program

Used to show Processing Function of the Program

Input or Output Operation

Decision making and Branching

Connector or Joining of Two Parts of the Program

Off-Page Connector

Flow Lines

17
Admin Flow Chart
Add Country Names Country Names
Update/Delete

States Address
Add State Names
Update/Delete

Add Departments Department


Update/Edit

Add Designation Designation


Update/Edit

FrontEnd Technology
Add FrontEnd Technology
Update/Delete

Add Backend Technology BackEnd Technology


Update/Delete

Admin Register Employees

View Employees Employee Profile


Edit/Delete

Task Manager
Update/Delete Tasks Name

Assigning Task

Incomplete tasks

Completed Tasks

Pending tasks
COMPANY MANAGEMENT SYSTEM 0/0/2014

Employee’s Flow Chart

Change Password

Edit Profile

Submitt Task
Employee
Login
View Completed Tasks

View Pending Tasks

19
Data Flow Diagrams

A DFD, also known as “bubble chart” has the purpose of clarifying system requirements and
identifying major transformations that will become programs in system design. So it is the
starting point of the design phase that functionally decomposes the requirements specifications
down to the lowest level of detail. A DFD consists of a series of bubbles joined by lines. The
bubbles represent data transformations and the lines represent data flows in the system.

A Data-flow diagram (DFD) is a graphical representation of the "flow" of data


between external entities and the processes and data stores within a system.

DFD Symbols:

1. Process

2. Data Flow

3. Data Store

4. External Entity

Context Diagram:
Context Diagrams Shows the system boundaries, external entities that interact with the
systems and major information flows between entities and the system.
COMPANY MANAGEMENT SYSTEM 0/0/2014

Zero Level DFD

Admin

Company Mgt. Login:


Employee System
Username
Password

Data Base

21
1 Level DFD
Admin

Add Department

Add Designation

Database

Register
Employees

Assigning
tasks
COMPANY MANAGEMENT SYSTEM 0/0/2014

Entity-Relationship Diagram

An entity –relationship (ER) diagram is a specialized graphic that illustrates the  


relationships between entities in a database. ER diagrams often use symbols to represent three
different types of information. Boxes are commonly used to represent entities. Diamonds are
normally used to represent relationships and ovals are used to represent attributes.

Entity:
An entity is an object or concept about which you want to store information.

Key attributes:
A key attribute is the unique, distinguishing characteristic of the entity. For example, an
Employee's ID number.

Multi-valued attribute:
A multi-valued attribute can have more than one value. For example, an employee entity
can have multiple skill values.

Derived attribute:
A derived attribute is based on another attribute. For example, an Country ID

23
Relationships:
Relationships illustrate how two entities share information in the database structure.

Cardinality:
Cardinality specifies how many instances of an entity relate to one instance of
another entity.
COMPANY MANAGEMENT SYSTEM 0/0/2014

ER Diagram

Login

Admin

25
TESTING

Employee
In general, testing is finding out how well something works. In computer hardware
and software development, testing is used at key checkpoints in the overall
process to determine whether objectives are being met . Testing is a vital to
success of project. Project testing makes a logical
assumption that if all the parts of the project are Username Passwor
Username d
correct, the goalPasswor
will be successfully achieved .Inadequate
d
testing or non –testing leads to errors that may not appear until months later.

There are two method of testing:


ID Password
 Functional
 Structural
Edit Submit
Change
Functional Testing Profile
Passwor
Completed
Tasks
Functional Testing means using a set of tests to determine performance abilities or functional
ID Name
limitations. In functional testing, the internal logic of the system under testing is not considered
and the test cases are decided from the specification or the requirements. It is often called
“Black Box Testing” . Datalist View

Functional testing typically involves five steps


Update
 The identification of functions that the software is expected to perform
 The creation of input data based on the function's specifications
 The determination of output based on the function's specifications
 The execution of the test case
Password
Username
 The comparison of actual and expected outputs.

Structural Testing
Structural Data
testing is also known as ” White Box Testing”, Clear Box Testing and Glass Box
Testing. In structural testing, the test cases are decided entirely on the internal logic of the
program or module being tested. While white-box testing can be applied at the  unit,  integration  and 
system  levels of the  software testing  process, it is usually done at the unit level.
COMPANY MANAGEMENT SYSTEM 0/0/2014

Levels of Testing

Unit testing
It is a method by which individual units of source code are tested to determine if they
are fit for use. Unit tests are created by programmers during the development process. The goal
of unit testing is to isolate each part of the program and show that the individual parts are
correct. Unit testing allows the programmer to restructure code at a later date, and make sure the
module still works correctly. Talking about the limitations unit testing cannot catch any integration
since it focuses on individual units.

Integration testing
In simple words integration testing is testing of combined parts of an application to
determine if they function together correctly. It is a phase in software testing in which individual
software modules are combined and tested as a group.

Some types of integration testing are: Big Bang, Top-Down, and Bottom- Up

In Big Bang approach all or most of the developed modules are coupled together to form a
complete software system or major part of the system and then used for integration testing

In Top-Down approach the top integrated modules are tested and the branch of the module is
tested step by step until the end of the related module

In Bottom-Up approach the lowest level components are tested first, then used to facilitate the
testing of higher level components. The process is repeated until the component at the top of the
hierarchy is tested.

System Testing
Testing the behaviour of the whole s oftware/system as defined in the SRS is known as
system testing. Its main focus is to verify that the customer requirements are fulfilled. System
testing falls within the scope of Black Box testing. System testing is done after integration testing is
complete. It should test functional and non functional requirements of the software.

27
Acceptance Testing
Acceptance testing is a final stage of testing that is performed on a system prior to the
system being delivered to a live environment. Acceptance testing is often made up of many
individual test cases which are Individually documented test scenarios.

Regression Testing
If a piece of software is modified for any reason testing needs to be done to
ensure that it works as specified and that it has not negatively impacted any functionality tha t
it offered previously. This is known as Regression Testing. Regression testing plays an important
role in any scenario where a change has been made to a previously tested software code.
Regression Testing is hence an important aspect in various software methodologies where software
changes enhancements occur frequently.
COMPANY MANAGEMENT SYSTEM 0/0/2014

IMPLEMENTATION

Implementation is a process, which is used for converting a new system into an operational one.

Implementation of software is to replace a existing/manual system; the problems encountered are


training user, creating accurate files etc. System implementation is the stage when the user has
thoroughly tested the system and approves all the features provided by the system. The various tests are
performed and the system is approved only after all the requirements are met and the user is satisfied.

The new system may be totally new; replacing an existing manual or automated system, or it may a
major modification to an existing system. In the either case, proper implementation is essential to
provide a reliable system to meet organization requirements

Successful implementation may not guarantee improvement in the organization using the new system
(that is a design question) ,but improper will prevent it.

Implementation is the process of having systems personal check out and put new equipment to use,
train users, install the new application and construct any files of data needed to use it.

This phase is less creative than system design. Depending on the size of the organization that will be
involve in using the application and the risk involved in its use, system developer may choose to test the
operation in only one area of the firm with only one or two persons. Sometimes, they will run both old
and new system in parallel way to compare the results. In steel other situations, system developers stop
using the old systems one day and start using the new one the next.

The implementation of the web based or LAN base network project has some extra steps at the time
of implementation. We need to configure the system according the requirement of the software.

29
Conversion Plan
The conversion plan describes the strategies involved in converting data from an existing system to
another hardware or software environment. It is appropriate to reexamine the original system’s
functional requirements for the condition of the system before conversion to determine if the original
requirements are still valid.

Post Implementation and Software Maintenance


In order for a software system to remain useful in its environment it may be necessary to carry out a
wide range of maintenance activities upon it. There are bugs to fix, enhancement to add and
optimization to make, changes has to be done in older version to make it application for current use of
current version to cater the need of future.
Maintenance can be of three types: -

Corrective Maintenance

Changes necessitated by actual errors (defects or residual "bugs") in a system are termed corrective
maintenance. These defects manifest themselves when the system does not operate as it was designed or
advertised to do. A defect or “bug” can result from design errors, logic errors and coding errors. Design
errors occur when for example changes made to the software are incorrect, incomplete, wrongly
communicated or the change request misunderstood. In the event of a system failure due to an error,
actions are taken to restore operation of the software system. The approach here is to locate the original
specifications in order to determine what the system was originally designed to do.

Adaptive Maintenance

Any effort that is initiated as a result of changes in the environment in which a software system must
operate is termed adaptive change. Adaptive change is a change driven by the need to accommodate
modifications in the environment of the software system, without which the system would become
increasingly less useful until it became obsolete.
The term environment in this context refers to all the conditions and influences which act from
outside upon the system, for example business rules, government policies, work patterns, software and
hardware operating platforms. A change to the whole or part of this environment will warrant a
corresponding modification of the software.
COMPANY MANAGEMENT SYSTEM 0/0/2014

Perfective Maintenance
This is actually the most common type of maintenance encompassing enhancements both to the
function and the efficiency of the code and includes all changes, insertions, deletions, modifications,
extensions, and enhancements made to a system to meet the evolving and/or expanding needs of the
user. A successful piece of software tends to be subjected to a succession of changes resulting in an
increase in its requirements. This is based on the premise that as the software becomes useful, the users
tend to experiment with new cases beyond the scope for which it was initially developed. Expansion in
requirements can take the form of enhancement of existing system functionality or improvement in
computational efficiency.

Though efforts have been made to develop error free systems, but no system is perfect, room for
improvement is always there. Thus proper documentation for the system has been done so that it will be
easy to handle any breakdown or any other type of system maintenance activity.

31
PROJECT LEGACY
Current Status of the Project
The target decided has been achieved successfully with all the core functionalities and user interface
requirements.
There is no clear and well defined boundary for a project which incorporates the term social.
Because the social means connecting people and this implies unlimited number of attractive features,
ease of use, good looking design and smooth and durable functionality.
This is a Social Application so its needs more attractive features to be embedded in order to attract
more and more audience, more robust and dignified user interface design, highly smooth and enhanced
user experience. All these factors turn this project a life time maintainable and the one which requires
undefined limits of improvement.
That’s why it’s more appropriate to mark the status of the project as underdevelopment. Project had
achieved its core functionality and features. As development process of the project is based on the agile
development model there are many regions with the sign of improvements.

Remaining areas of concern


User interface and enhanced user experience is the major concern of this project to be improved. The
user interface of the project can be enhanced more in order to give a smooth experience to user of the
system. Also in order to make the user's time more useful while surfing through our application and
provide user more relevant information regarding his content and people in his circle we can add tools
which provide them latest updates of activities and notification of the latest concerned activities. A more
advance model to represent the bookmark and tags in our system to make them more meaningful, and
useful for analysis purpose of the user.

Technical and Managerial lessons learnt


Throughout the development process of this Asp.Net based project had taught so many meaningful
lessons of the software development process which covers both the technical and managerial fields.

Technical Lessons
 Learned the basics of the web development components such as HTML,C#,Asp.Net,Sqlserver and
many others and get familiarized with its power and loopholes.
 The market leading technology Asp.Net in web world, have an advanced experience with it.
 Sqlserver Management Studio for our database at the backend.
COMPANY MANAGEMENT SYSTEM 0/0/2014

Managerial lessons

 Managing product development process of the software (Asp.Net websites).


 Incorporating changes in between the development period of the modules.
 Component based development.
 Developing website in an environment with multiple developers and tracking all the changes and
keeping the project synchronized throughout among the development team.
 Keeping the project up-to-date as per the time line.
 Full testing and verification of the components and its correction before the deadlines.
 Time management in a cross developer environment.
 Managing the consistency of quality and quantity of product throughout the development among the
developers.
 Risk management for the project and appropriate majors to avoid the risk and is case it happens then
to correct it.
 Adhering to the guidelines and regulatory standards.

33
SOURCE CODE OF THE PROJECT
LIST OF FILES: -
{{{{

Snapshot}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
COMPANY MANAGEMENT SYSTEM 0/0/2014

 App-Code Files (Classes and Functions): -


Container.cs File
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.SqlClient;

namespace connection
{
public interface dbParm
{
string dbHostName
{
get;
set;
}
string dbName
{
get;
set;
}
string dbUserName
{
get;
set;
}
string dbPassword
{
get;
set;
}
}

public class dbConnection : dbParm


{

35
string dbStrHostName, dbStrName, dbStrUserName, dbStrPassword;
public SqlConnection con;

public string dbHostName


{
get
{
return dbStrHostName;
}
set
{
dbStrHostName = value;
}
}

public string dbName


{
get
{
return dbStrName;
}
set
{
dbStrName = value;
}
}

public string dbUserName


{
get
{
return dbStrUserName;
}
set
{
dbStrUserName = value;
}
}

public string dbPassword


{
get
{
return dbStrPassword;
}
set
COMPANY MANAGEMENT SYSTEM 0/0/2014

{
dbStrPassword = value;
}
}
}

public abstract class clsCon : dbConnection


{
public clsCon()
{
}

public void dbDetails()


{
dbHostName = "PC-6072475B7D7E\\SQLEXPRESS";
dbName = "cmpnymgtsysDB";
dbUserName = "sa";
dbPassword = "k@maldeep123";
}

public void clsCon1()


{
dbDetails();
string constr = "server=" + dbHostName + ";database=" + dbName + ";user id=" + dbUserName
+ ";password=" + dbPassword + "";
ConnectionStringSettings connstr = new ConnectionStringSettings("connstring", constr,
"SQLClient");
con = new SqlConnection(constr);
}
}
public class getConnection : clsCon
{
string returnDBStringValue = string.Empty;
int returnDBIntValue = 0;
DataTable dt;
DataSet ds;
bool flag = false;

/****************Open Data Base Connection ****************************/


public bool openConnection()
{
clsCon1();
if (con.State == ConnectionState.Closed)
{
con.Open();
return true;

37
}
return false;
}

/************ Close Data Base Connection ******************************/


public bool closeConnection()
{
if (con.State == ConnectionState.Open)
{
con.Close();
return true;
}
return false;
}

/************Return Data Base String Value ****************************/


public string getDBString(string spName, SqlCommand cmd)
{
flag = openConnection();
if (flag == true)
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = spName;
cmd.Connection = con;
returnDBStringValue = Convert.ToString(cmd.ExecuteScalar());
cmd.Dispose();
return returnDBStringValue;
}
else
return returnDBStringValue;
}

/***********Return Data Base Integer Value ****************************/


public int getDBInteger(string spName, SqlCommand cmd)
{
flag = openConnection();
if (flag == true)
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.CommandText = spName;
cmd.Connection = con;
SqlParameter sqlprm = new SqlParameter("@returnIntValue", SqlDbType.Int);
sqlprm.Direction = ParameterDirection.ReturnValue;
cmd.Parameters.Add(sqlprm);
cmd.ExecuteNonQuery();
returnDBIntValue = Convert.ToInt32(cmd.Parameters["@returnIntValue"].Value);
COMPANY MANAGEMENT SYSTEM 0/0/2014

cmd.Dispose();
return returnDBIntValue;
}
else
return returnDBIntValue;
}

/*******************Return a Bollean Value ****************************/


public bool getDBBool(string spName, SqlCommand cmd)
{
bool flag = openConnection();
if (flag == true)
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.CommandText = spName;
cmd.ExecuteReader();
cmd.Dispose();
return true;
}
else
return false;
}

/*************************Return a Data Table *************************/


public DataTable getDBDatatable(string spName, SqlCommand cmd)
{
bool flag = openConnection();
if (flag == true)
{
try
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.CommandText = spName;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
dt = new DataTable();
adp.Fill(dt);
cmd.Dispose();
return dt;
}
catch (Exception ex)
{
System.Web.HttpContext.Current.Response.Write(ex.Message);
return dt;
}

39
}
else
{
return dt;
}
}

/***********************Return a Data Set *****************************/


public DataSet getDBDataSet(string spName, SqlCommand cmd)
{
bool flag = openConnection();
if (flag == true)
{
cmd.CommandType = CommandType.StoredProcedure;
cmd.Connection = con;
cmd.CommandText = spName;
SqlDataAdapter adp = new SqlDataAdapter(cmd);
ds = new DataSet();
adp.Fill(ds);
cmd.Dispose();
return ds;
}
else
return ds;
}
/**********************************************************************/
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

module.cs File
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace module1
{
public class clsmodule
{
connection.getConnection cn = new connection.getConnection();
SqlCommand cmd;
DataTable dt;
//DataSet ds;
Int32 returnIntValue = 0;
string returnstring;
//string returnStrinValue = string.Empty;
// bool flag = false;

public Int32 addcountry(int op, int c_id, int country_id, string contry_name, string status, int
admin_id, int company_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@c_id", SqlDbType.Int).Value = c_id;
cmd.Parameters.Add("@country_id", SqlDbType.NVarChar, 50).Value = country_id;
cmd.Parameters.Add("@country_name", SqlDbType.NVarChar, 50).Value = contry_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar, 50).Value = status;
cmd.Parameters.Add("@admin_id", SqlDbType.Int).Value = admin_id;
cmd.Parameters.Add("@company_id", SqlDbType.NVarChar, 50).Value = company_id;
returnIntValue = cn.getDBInteger("country", cmd);
return returnIntValue;
}
catch (Exception ex)
{

41
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 addstate(int op, int state_id, string state_name, int country_id, int admin_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@state_id", SqlDbType.Int).Value = state_id;
cmd.Parameters.Add("@state_name", SqlDbType.NVarChar).Value = state_name;
cmd.Parameters.Add("@country_id", SqlDbType.NVarChar).Value = country_id;
cmd.Parameters.Add("@admin_id", SqlDbType.NVarChar).Value = admin_id;
returnIntValue = cn.getDBInteger("state", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int addCompany(string cmpny_name, string cmpny_username, string pwd, string address,
string contact, string pincode)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = 1;
cmd.Parameters.Add("@company_name", SqlDbType.NVarChar).Value = cmpny_name;
cmd.Parameters.Add("@cmpny_usrname", SqlDbType.NVarChar).Value = cmpny_username;
cmd.Parameters.Add("@password", SqlDbType.NVarChar).Value = pwd;
cmd.Parameters.Add("@Address", SqlDbType.NVarChar).Value = address;
cmd.Parameters.Add("@ContactNo", SqlDbType.NVarChar).Value = contact;
cmd.Parameters.Add("@Pincode", SqlDbType.NVarChar).Value = address;

returnIntValue = cn.getDBInteger("company", cmd);


return returnIntValue;
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

catch (Exception ex)


{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int company_row_deleting(int op, int d_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("company_id", SqlDbType.Int).Value = d_id;
returnIntValue = cn.getDBInteger("company", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int company_updating(int op, int c_id, string c_name, string cu_name, string role, string
status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = c_id;
cmd.Parameters.Add("@company_name", SqlDbType.NVarChar).Value = c_name;
cmd.Parameters.Add("cmpny_usrname", SqlDbType.NVarChar).Value = cu_name;
cmd.Parameters.Add("@role", SqlDbType.NVarChar).Value = role;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("company", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;

43
}
finally
{
cn.closeConnection();
}
}
public int company_updating1(int op, int company_id, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = company_id;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("company", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 add_department(int op, int dept_id, int admin_id, string dep_name, int ScompanyID)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("op", SqlDbType.Int).Value = 1;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = dept_id;
cmd.Parameters.Add("@admin_id", SqlDbType.Int).Value = admin_id;
cmd.Parameters.Add("@ScompanyID", SqlDbType.Int).Value = ScompanyID;
//cmd.Parameters.Add("@company_name", SqlDbType.NVarChar).Value = company_name;
cmd.Parameters.Add("@dept_name", SqlDbType.NVarChar).Value = dep_name;
// cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = company_id;
returnIntValue = cn.getDBInteger("department", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
COMPANY MANAGEMENT SYSTEM 0/0/2014

{
cn.closeConnection();
}
}
public DataTable login(string username, string password)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@login_name", SqlDbType.NVarChar).Value = username;
cmd.Parameters.Add("@password", SqlDbType.VarChar).Value = password;
dt = cn.getDBDatatable("proc_login", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_country(int op, int c_id, int country_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@c_id", SqlDbType.Int).Value = c_id;
cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("country", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_country1(int op, int country_id)
{
try

45
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("country", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int country_row_deleting(int op, int c_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("country_id", SqlDbType.Int).Value = c_id;
returnIntValue = cn.getDBInteger("country", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int country_updating(int op, int c_id, int country_id, string c_name, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@c_id", SqlDbType.Int).Value = c_id;
cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@country_name", SqlDbType.NVarChar).Value = c_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("country", cmd);
COMPANY MANAGEMENT SYSTEM 0/0/2014

return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int country_updating1(int op, int c_id, int country_id, string c_name)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@c_id", SqlDbType.Int).Value = c_id;
cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = c_name;
returnIntValue = cn.getDBInteger("country", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_state(int op, int c_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@state_id", SqlDbType.Int).Value = c_id;
//cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("state", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;

47
}
finally
{
cn.closeConnection();
}
}
public int state_row_deleting(int op, int c_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@state_id", SqlDbType.Int).Value = c_id;
returnIntValue = cn.getDBInteger("state", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int state_updating(int op, int s_id, string s_name, string status, int country)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@state_id", SqlDbType.Int).Value = s_id;
cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country;
cmd.Parameters.Add("@state_name", SqlDbType.NVarChar).Value = s_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("state", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

}
public int state_updating1(int op, int state_id, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@state_id", SqlDbType.Int).Value = state_id;
// cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("state", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_company(int op, int c_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = c_id;
//cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("company", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_dept(int op, int d_id)
{
try
{

49
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = d_id;
//cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("department", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int dept_row_deleting(int op, int d_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("dept_id", SqlDbType.Int).Value = d_id;
returnIntValue = cn.getDBInteger("department", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int dept_updating(int op, int d_id, string d_name, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = d_id;
// cmd.Parameters.Add("@company_name", SqlDbType.NVarChar).Value = company_name;
cmd.Parameters.Add("@dept_name", SqlDbType.NVarChar).Value = d_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("department", cmd);
COMPANY MANAGEMENT SYSTEM 0/0/2014

return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int dept_updating1(int op, int dept_id, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = dept_id;
// cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("department", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 add_designation(int op, int desig_id, int admin_id, string desig_name, int dept_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = 1;
cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = desig_id;
cmd.Parameters.Add("@admin_id", SqlDbType.Int).Value = admin_id;
// cmd.Parameters.Add("@ScompanyID", SqlDbType.Int).Value = ScompanyID;
//cmd.Parameters.Add("@company_name", SqlDbType.NVarChar).Value = company_name;
cmd.Parameters.Add("@designation_name", SqlDbType.NVarChar).Value = desig_name;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = dept_id;
//cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = company_id;
returnIntValue = cn.getDBInteger("designation", cmd);

51
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_desig(int op, int d_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = d_id;
//cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = dept_id;
dt = cn.getDBDatatable("designation", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_desig1(int op, int dept_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
//cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = d_id;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = dept_id;
dt = cn.getDBDatatable("designation", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

finally
{
cn.closeConnection();
}
}

public int desig_row_deleting(int op, int desig_id)


{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = desig_id;
returnIntValue = cn.getDBInteger("designation", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int desig_updating(int op, int desig_id,int deptid, string desig_name, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = desig_id;
cmd.Parameters.Add("@dept_id", SqlDbType.Int).Value = deptid;
cmd.Parameters.Add("@designation_name", SqlDbType.NVarChar).Value = desig_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("designation", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}

53
}
public int desig_updating1(int op, int desig_id, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = desig_id;
//cmd.Parameters.Add("@designation_name", SqlDbType.NVarChar).Value = desig_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("designation", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int add_frontend(int op, int front_id, string frontend_name)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@fronttech_id", SqlDbType.Int).Value = front_id;
cmd.Parameters.Add("@fronttech_name", SqlDbType.NVarChar).Value = frontend_name;
returnIntValue = cn.getDBInteger("fronttech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_frontend(int op, int f_id)
{
try
{
COMPANY MANAGEMENT SYSTEM 0/0/2014

cmd = new SqlCommand();


cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@fronttech_id", SqlDbType.Int).Value = f_id;
//cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("fronttech", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int frontend_row_deleting(int op, int f_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("fronttech_id", SqlDbType.Int).Value = f_id;
returnIntValue = cn.getDBInteger("fronttech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int frontend_updating(int op, int f_id, string f_name, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@fronttech_id", SqlDbType.Int).Value = f_id;
//cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@fronttech_name", SqlDbType.NVarChar).Value = f_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("fronttech", cmd);

55
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int frontend_updating1(int op, int front_id, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@fronttech_id", SqlDbType.Int).Value = front_id;
// cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("fronttech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int add_backend(int op, int backend_id, string backend_name)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@backtech_id", SqlDbType.Int).Value = backend_id;
cmd.Parameters.Add("@backtech_name", SqlDbType.NVarChar).Value = backend_name;
// cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = company_id;
returnIntValue = cn.getDBInteger("backtech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
COMPANY MANAGEMENT SYSTEM 0/0/2014

throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_backend(int op, int b_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@backtech_id", SqlDbType.Int).Value = b_id;
//cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
dt = cn.getDBDatatable("backtech", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int backend_row_deleting(int op, int b_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("backtech_id", SqlDbType.Int).Value = b_id;
returnIntValue = cn.getDBInteger("backtech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}

57
public int backend_updating(int op, int b_id, string backend_name, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@backtech_id", SqlDbType.Int).Value = b_id;
cmd.Parameters.Add("@backtech_name", SqlDbType.NVarChar).Value = backend_name;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("backtech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int backend_updating1(int op, int back_id, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@backtech_id", SqlDbType.Int).Value = back_id;
// cmd.Parameters.Add("@country_id", SqlDbType.Int).Value = country_id;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("backtech", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_empreg(int op, int emp_id)
{
try
{
COMPANY MANAGEMENT SYSTEM 0/0/2014

cmd = new SqlCommand();


cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
// cmd.Parameters.Add("@company_id", SqlDbType.Int).Value = compnyID;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = emp_id;
dt = cn.getDBDatatable("emp_registration", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 add_empregform(int op, int emp_id, string f_name, string l_name, string dob, string
father_name, string mother_name, int department_id, int designation_id, int fronttech_id, int
backtech_id, string doj, string experiance, string address, string mobile, string landline, string email,
string gender, string hobbies, string passwd,string img)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = 1;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = emp_id;
cmd.Parameters.Add("@First_name", SqlDbType.NVarChar).Value = f_name;
cmd.Parameters.Add("@Last_name", SqlDbType.NVarChar).Value = l_name;
cmd.Parameters.Add("@DOB", SqlDbType.NVarChar).Value = dob;
cmd.Parameters.Add("@Father_name", SqlDbType.NVarChar).Value = father_name;
cmd.Parameters.Add("@Mother_name", SqlDbType.NVarChar).Value = mother_name;
cmd.Parameters.Add("@department_id", SqlDbType.Int).Value = department_id;
cmd.Parameters.Add("@designation_id", SqlDbType.Int).Value = designation_id;
cmd.Parameters.Add("@fronttech_id", SqlDbType.Int).Value = fronttech_id;
cmd.Parameters.Add("@backtech_id", SqlDbType.Int).Value = backtech_id;
cmd.Parameters.Add("@date_of_joining", SqlDbType.NVarChar).Value = doj;
cmd.Parameters.Add("@Experiance", SqlDbType.NVarChar).Value = experiance;
cmd.Parameters.Add("@permanent_add", SqlDbType.NVarChar).Value = address;
cmd.Parameters.Add("@Mobile", SqlDbType.NVarChar).Value = mobile;
cmd.Parameters.Add("@LandLine", SqlDbType.NVarChar).Value = landline;
cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = email;
cmd.Parameters.Add("@Gender", SqlDbType.NVarChar).Value = gender;
cmd.Parameters.Add("@hobbies", SqlDbType.NVarChar).Value = hobbies;
cmd.Parameters.Add("@password", SqlDbType.NVarChar).Value = passwd;
cmd.Parameters.Add("@image", SqlDbType.VarChar).Value = img;
returnIntValue = cn.getDBInteger("emp_registration", cmd);

59
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 update_emp(int op, int empid, string firstname, string lastname, string address, string
email, string mobile, string hobbies)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = empid;
cmd.Parameters.Add("@First_name", SqlDbType.NVarChar).Value = firstname;
cmd.Parameters.Add("@Last_name", SqlDbType.NVarChar).Value = lastname;
cmd.Parameters.Add("@permanent_add", SqlDbType.NVarChar).Value = address;
cmd.Parameters.Add("@Email", SqlDbType.NVarChar).Value = email;
cmd.Parameters.Add("@Mobile", SqlDbType.NVarChar).Value = mobile;
cmd.Parameters.Add("@hobbies", SqlDbType.NVarChar).Value = hobbies;
returnIntValue = cn.getDBInteger("emp_registration", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 add_task(int op, int taskid, string taskname, string beinning, string ending)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = taskid;
cmd.Parameters.Add("@Task_Name", SqlDbType.NVarChar).Value = taskname;
cmd.Parameters.Add("@Begining_Date", SqlDbType.VarChar).Value = beinning;
COMPANY MANAGEMENT SYSTEM 0/0/2014

cmd.Parameters.Add("@Ending_Date", SqlDbType.VarChar).Value = ending;


returnIntValue = cn.getDBInteger("Task_register", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_task(int op, int taskid)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = taskid;

dt = cn.getDBDatatable("Task_register", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}

public DataTable select_task_emp(int op, int taskid, int emp_id)


{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@taskassign_id", SqlDbType.Int).Value = taskid;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = emp_id;
// cmd.Parameters.Add("@current_date", SqlDbType.VarChar).Value = currntdate;
// cmd.Parameters.Add("@Ending_Date", SqlDbType.VarChar).Value = end_date;
dt = cn.getDBDatatable("Task_register", cmd);
return dt;

61
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}

public int task_row_deleting(int op, int taskid)


{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = taskid;
returnIntValue = cn.getDBInteger("Task_register", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}

//---------------------------------------------------
// pas_change function
//---------------------------------------------------

public string change_pwd(int op, int empid, string pwd, string new_pwd)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = empid;
cmd.Parameters.Add("@pwd", SqlDbType.VarChar).Value = pwd;
cmd.Parameters.Add("@new_pwd", SqlDbType.VarChar).Value = new_pwd;
returnstring = cn.getDBString("change_pwd", cmd);
return returnstring;
COMPANY MANAGEMENT SYSTEM 0/0/2014

}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int task_updating(int op, int t_id, string tskname, string begin, string end, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = t_id;
cmd.Parameters.Add("@Task_Name", SqlDbType.NVarChar).Value = tskname;
cmd.Parameters.Add("@Begining_Date", SqlDbType.VarChar).Value = begin;
cmd.Parameters.Add("@Ending_Date", SqlDbType.VarChar).Value = end;
cmd.Parameters.Add("@Status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("Task_register", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public int task_updating1(int op, int taskid, string status)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = taskid;
cmd.Parameters.Add("@status", SqlDbType.NVarChar).Value = status;
returnIntValue = cn.getDBInteger("Task_register", cmd);
return returnIntValue;
}
catch (Exception ex)
{

63
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_emp(int op, int emp_id)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = emp_id;
dt = cn.getDBDatatable("emp_registration", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_TaskRegister(int op, int tskid)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = tskid;
dt = cn.getDBDatatable("task_register", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 add_TaskAssign(int op, int taskassignid, int taskid, int empid, string begin, string end)
COMPANY MANAGEMENT SYSTEM 0/0/2014

{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@taskassign_id", SqlDbType.Int).Value = taskassignid;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = empid;
cmd.Parameters.Add("@task_id", SqlDbType.Int).Value = taskid;
cmd.Parameters.Add("@Begining_Date", SqlDbType.NVarChar).Value = begin;
cmd.Parameters.Add("@Ending_Date", SqlDbType.NVarChar).Value = end;
returnIntValue = cn.getDBInteger("taskAssign", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public DataTable select_taskAssign(int op, int taskAssignid, int empid)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@taskassign_id", SqlDbType.Int).Value = taskAssignid;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = empid;
dt = cn.getDBDatatable("taskAssign", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 delete_row_taskasign(int op, int tskasnid)
{
try
{

65
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@taskassign_id", SqlDbType.Int).Value = tskasnid;
returnIntValue = cn.getDBInteger("taskAssign", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 update_image(int op,int eID, string img)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@op", SqlDbType.Int).Value = op;
cmd.Parameters.Add("@emp_id", SqlDbType.Int).Value = eID;
cmd.Parameters.Add("@image", SqlDbType.VarChar).Value = img;
returnIntValue = cn.getDBInteger("emp_registration", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}
public Int32 add_que(int que_id, string que_name, string opt_a, string opt_b, string opt_c, string
opt_d, string ans)
{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("queid", SqlDbType.NVarChar, (50)).Value = que_id;
cmd.Parameters.Add("@quename", SqlDbType.NVarChar, (50)).Value = que_name;
cmd.Parameters.Add("opt_a", SqlDbType.NVarChar, (50)).Value = opt_a;
cmd.Parameters.Add("opt_b", SqlDbType.NVarChar, (50)).Value = opt_b;
cmd.Parameters.Add("opt_c", SqlDbType.NVarChar, (50)).Value = opt_c;
COMPANY MANAGEMENT SYSTEM 0/0/2014

cmd.Parameters.Add("opt_d", SqlDbType.NVarChar, (50)).Value = opt_d;


cmd.Parameters.Add("ans_id", SqlDbType.NVarChar).Value = ans;
returnIntValue = cn.getDBInteger("ADD_QUE", cmd);
return returnIntValue;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}

// ========================================================
// forgot_pwd
//========================================================

public DataTable forgot_pwd(string email)


{
try
{
cmd = new SqlCommand();
cmd.Parameters.Add("@email", SqlDbType.VarChar, 30).Value = email; ;
dt = cn.getDBDatatable("forgot_pwd", cmd);
return dt;
}
catch (Exception ex)
{
throw ex;
}
finally
{
cn.closeConnection();
}
}

}
}

67
 Admin

SuperAdminMaster.master.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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;
using System.Xml.Linq;

public partial class SuperAdmin_SuperAdminMaster : System.Web.UI.MasterPage


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
string status = "";
string enddate = "";
int retrnint = 0;
protected void Page_Load(object sender, EventArgs e)
{
string currentdate = DateTime.Now.ToString("dd/MM/yyyy");
dt = cmod.select_TaskRegister(2, 0);
IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-GB", true);
DateTime Current_date = DateTime.ParseExact(currentdate, "dd/MM/yyyy", theCultureInfo);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
int taskID = Convert.ToInt32(dt.Rows[i]["task_id"]);
status = dt.Rows[i]["status"].ToString();
enddate = Convert.ToString(dt.Rows[i]["Ending_Date"]);
DateTime End_date = DateTime.ParseExact(enddate, "dd/MM/yyyy", theCultureInfo);
int diff = Convert.ToInt32((Current_date - End_date).TotalDays);
if (status == "pending")
{
if (diff > 0)
{
string status1 = "Incomplete";
retrnint = cmod.task_updating1(4, taskID, status1);
COMPANY MANAGEMENT SYSTEM 0/0/2014

}
}
}
}
}
}

AddBackend.aspx.cs

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

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


{
module1.clsmodule cmod = new module1.clsmodule();
int returnint = 0;
int adminID;
int companyID;
int cmpny_id;
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["loginId"] == null)
{
Response.Redirect("../login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginId"]);
companyID = Convert.ToInt32(Session["companyID"]);
}
if (!Page.IsPostBack)
{
bind_gridview();
}
}
public void bind_gridview()
{
dt = cmod.select_backend(2, 0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

protected void btnSubmit_Click(object sender, EventArgs e)


{
returnint = cmod.add_backend(1, 0,txtback.Text);
if (returnint == 1)
{
lblmsg.Text = "insertd";
bind_gridview();
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string status1;
if (e.CommandName == "chngestatus")
{
int backtech_id = Convert.ToInt32(e.CommandArgument);
dt = cmod.select_backend(2, backtech_id);
if (dt.Rows.Count > 0)
{
string status = dt.Rows[0]["status"].ToString();
if (status == "enable")
{
status1 = "disable";

}
else
{
status1 = "enable";
}
returnint = cmod.backend_updating1(4, backtech_id, status1);
if (returnint == 1)
{
lblmsg.Text = "succes";
}
bind_gridview();
}
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int b_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint = cmod.backend_row_deleting(3, b_id);
if (returnint == 1)
{
lblmsg.Text = "deletd";
bind_gridview();
}

71
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int b_id=Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
TextBox b_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtback");
TextBox status=(TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");
returnint=cmod.backend_updating(1,b_id,b_name.Text,status.Text);
if (returnint == 1)
{
lblmsg.Text = "updated";
GridView1.EditIndex = -1;
bind_gridview();
}
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind_gridview();
}
}
7
[COMPANY MANAGEMENT SYSTEM] 3

AddCountry.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
int returnint = 0;
int adminID;
int companyID;
string status1;
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("../login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);

}
if (!Page.IsPostBack)
{
bind_gridviw();
}
}
public void bind_gridviw()
{
dt = cmod.select_country(2, 0, 0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;

71
GridView1.DataBind();
}

}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int coutryID = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());

returnint = cmod.country_row_deleting(3, coutryID);


if (returnint == 1)
{
lblmsg.Text = "succeful";
bind_gridviw();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int countryID = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
TextBox c_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtname");
TextBox status = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");
String country_name = c_name.Text;
string country_status = status.Text;

returnint = cmod.country_updating(1, 0, countryID, country_name, country_status);


if (returnint == 1)
{
lblmsg.Text = "suucess";
GridView1.EditIndex = -1;
bind_gridviw();
}

}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind_gridviw();
}

protected void btnSubmit_Click(object sender, EventArgs e)


{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
companyID = Convert.ToInt32(Session["companyID"]);
COMPANY MANAGEMENT SYSTEM 0/0/2014

returnint = cmod.addcountry(1, 0, 0, txtCountry.Text, "Enabled", adminID, companyID);


if (returnint == 1)
{
lblmsg.Text = "insrtd";
bind_gridviw();
}

protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)


{
if (e.CommandName == "chngestatus")
{
int country_id = Convert.ToInt32(e.CommandArgument);
//int op = 5;
// dt = cmod.select_country1(op,country_id);
dt = cmod.select_country(2, 1, country_id);
if (dt.Rows.Count > 0)
{
string status = dt.Rows[0]["status"].ToString();
if (status == "enable")
{
status1 = "disable";

}
else
{
status1 = "enable";
}
returnint = cmod.country_updating1(1, 2, country_id, status1);
if (returnint == 1)
{
lblmsg.Text = "succes";
}
bind_gridviw();
}
}
}
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{

}
}

75
AddDepartment.apsx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
int returnint = 0;
int adminID;
int companyID;
String status1="";
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
}
}
if (!Page.IsPostBack)
{
bind_gridviw();
}
}
public void bind_gridviw()
{
dt = cmod.select_dept(2, 0);
COMPANY MANAGEMENT SYSTEM 0/0/2014

if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}

}
protected void btnSubmit_Click(object sender, EventArgs e)
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
companyID = Convert.ToInt32(Session["companyID"]);
int dept_id = 0;
returnint = cmod.add_department(1, dept_id, adminID,txtDept.Text, companyID);
if (returnint == 1)
{
lblmsg.Text = "success";
bind_gridviw();
}
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind_gridviw();

}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "chngestatus")
{
int d_id = Convert.ToInt32(e.CommandArgument);
dt = cmod.select_dept(2,d_id);
if (dt.Rows.Count > 0)
{
string status = dt.Rows[0]["status"].ToString();
if (status == "enable")
{
status1 = "disable";

}
else
{
status1 = "enable";
}
returnint = cmod.dept_updating1(4, d_id, status1);
if (returnint == 1)
{
lblmsg.Text = "succes";

77
}
bind_gridviw();
}
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int dept_id=Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint = cmod.dept_row_deleting(3, dept_id);
if (returnint == 1)
{
lblmsg.Text = "deleted";
bind_gridviw();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int deptid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
TextBox dept_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtdeptname");
TextBox status = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");
String d_name = dept_name.Text;
String dept_status = status.Text;
returnint = cmod.dept_updating(1,deptid,d_name,dept_status);
if(returnint==1)
{
lblmsg.Text = "suucess";
GridView1.EditIndex = -1;
bind_gridviw();
}
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

AddDesignation.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt = new DataTable();
String status1 = "";
int adminID;
int returnint;
int dept_id;
protected void Page_Load(object sender, EventArgs e)
{
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
}
}
if (!Page.IsPostBack)
{
bind_dropdownlist_department();
bind_gridview();
}
}

79
public void bind_dropdownlist_department()
{
dt = cmod.select_dept(2, 0);
if (dt.Rows.Count > 0)
{
drp_dept.DataSource = dt;
drp_dept.DataValueField = "dept_id";
drp_dept.DataTextField = "dept_name";
drp_dept.DataBind();
}
else
drp_dept.Items.Clear();
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
dept_id = Convert.ToInt32(drp_dept.SelectedValue);

returnint = cmod.add_designation(1, 0, adminID, txtdesig.Text, dept_id);


if (returnint == 1)
{
lblmsg.Text = "added";
bind_gridview();
}
}
public void bind_gridview()
{
dt = cmod.select_desig(5, 0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind_gridview();
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "chngestatus")
{
int desig_id = Convert.ToInt32(e.CommandArgument);
dt = cmod.select_desig(2, desig_id);
if (dt.Rows.Count > 0)
{
COMPANY MANAGEMENT SYSTEM 0/0/2014

string status = dt.Rows[0]["status"].ToString();


if (status == "enable")
{
status1 = "disable";
}
else
{
status1 = "enable";
}
returnint = cmod.desig_updating1(4, desig_id, status1);
if (returnint == 1)
{
lblmsg.Text = "updated";
bind_gridview();
}

}
}

}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int desig_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint = cmod.desig_row_deleting(3, desig_id);
if (returnint == 1)
{
lblmsg.Text = "deleted";
bind_gridview();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
bind_gridview();
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int desig_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
DropDownList dept_name =
(DropDownList)GridView1.Rows[e.RowIndex].FindControl("drpdeptname");
TextBox desig_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtdesigname");
TextBox status = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");
string d_name = desig_name.Text;
string Status = status.Text;
returnint = cmod.desig_updating(1, desig_id,Convert.ToInt32(dept_name.SelectedValue), d_name,
Status);
if (returnint == 1)

81
{
lblmsg.Text = "updated";
GridView1.EditIndex = -1;
bind_gridview();
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if ((e.Row.RowState & DataControlRowState.Edit) > 0)
{
//DropDownList ddl = (DropDownList)e.Row.FindControl("drpcountryname");
//dt = cmod.select_country(2, 0, 0);
//if (dt.Rows.Count > 0)
//{
// ddl.DataSource = dt;
// ddl.DataTextField = "country_name";
// ddl.DataValueField = "country_id";
// ddl.DataBind();

//}
//DataRowView dr = e.Row.DataItem as DataRowView;
//ddl.SelectedValue = dr["country_id"].ToString();
}
}
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

AddEmployee.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule md = new module1.clsmodule();
int returnint = 0;
DataTable dt;
int adminID;
protected void Page_Load(object sender, EventArgs e)
{
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
}
}
if (!Page.IsPostBack)
{
bind_dropdownlist_department();
bind_dropdownlist_designation();
bind_dropdownlist_fronttech();
bind_dropdownlist_backtech();
}
}
public void bind_dropdownlist_department()
{
dt = md.select_dept(2, 0);
if (dt.Rows.Count > 0)
{

83
drp_dept.DataSource = dt;
drp_dept.DataValueField = "dept_id";
drp_dept.DataTextField = "dept_name";
drp_dept.DataBind();
}
else
drp_dept.Items.Clear();
}
public void bind_dropdownlist_designation()
{
}
public void bind_dropdownlist_fronttech()
{
dt = md.select_frontend(2, 0);
if (dt.Rows.Count > 0)
{
drp_front.DataSource = dt;
drp_front.DataValueField = "fronttech_id";
drp_front.DataTextField = "fronttech_name";
drp_front.DataBind();
}
}
public void bind_dropdownlist_backtech()
{
dt = md.select_backend(2, 0);
if (dt.Rows.Count > 0)
{
drp_back.DataSource = dt;
drp_back.DataValueField = "backtech_id";
drp_back.DataTextField = "backtech_name";
drp_back.DataBind();
}
}
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
System.DateTime myDate = new System.DateTime();
myDate = Calendar1.SelectedDate;
doj.Text = myDate.ToString("dd/MM/yyyy");
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
string savepath = "EmployeePics/";
string filename = FileUpload1.FileName;
savepath += filename;
FileUpload1.SaveAs(Server.MapPath(savepath));
string str = "";
COMPANY MANAGEMENT SYSTEM 0/0/2014

string Password = "";


int dept_id = Convert.ToInt32(drp_dept.SelectedValue);
int desig_id = Convert.ToInt32(drp_desig.SelectedValue);
int front_id = Convert.ToInt32(drp_front.SelectedValue);
int back_id = Convert.ToInt32(drp_back.SelectedValue);
string Mobile_no = txtmobile.Text;
string Landline_no = txtland.Text;

for (int i = 0; i < hobbies.Items.Count; i++)


{
if (hobbies.Items[i].Selected)
{
if (str == "")
{
str = hobbies.Items[i].Text;
}
else
{
str += "," + hobbies.Items[i].Text;
}
}
}
if (txtpasswd.Text == txtcnfrmpasswd.Text)
{
Password = txtpasswd.Text;
}

returnint = md.add_empregform(1, 0, txtfirst.Text, txtlast.Text, DOB.Text, txtFather.Text,


txtmother.Text, dept_id, desig_id, front_id, back_id, doj.Text, txtexperiance.Text, txtaddress.Text,
Mobile_no, Landline_no, txtemail.Text, gender.SelectedItem.Text, str, Password,savepath);
if (returnint == 1)
{
lblmsg.Text = "inserted";
txt_clear();
}
}
public void txt_clear()
{
txtfirst.Text = "";
txtlast.Text = "";
DOB.Text = "";
txtFather.Text = "";
txtmother.Text = "";
doj.Text = "";
txtexperiance.Text = "";
txtaddress.Text = "";

85
txtmobile.Text = "";
txtland.Text = "";
txtemail.Text = "";
txtpasswd.Text = "";
txtcnfrmpasswd.Text = "";
for (int i = 0; i < hobbies.Items.Count; i++)
{
if (hobbies.Items[i].Selected)
{
hobbies.Items[i].Selected = false;
}
}

}
protected void drp_dept_SelectedIndexChanged(object sender, EventArgs e)
{
dt = md.select_desig1(6,Convert.ToInt32(drp_dept.SelectedValue));
if (dt.Rows.Count > 0)
{
drp_desig.DataSource = dt;
drp_desig.DataValueField = "designation_id";
drp_desig.DataTextField = "designation_name";
drp_desig.DataBind();
}
else
drp_desig.Items.Clear();

}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

AddFront.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt = new DataTable();
int adminID;
int returnint;
protected void Page_Load(object sender, EventArgs e)
{
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
}
}
if (!Page.IsPostBack)
{
bind_gridview();
}
}
public void bind_gridview()
{
dt = cmod.select_frontend(2, 0);
if (dt.Rows.Count > 0)

87
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
returnint = cmod.add_frontend(1, 0, txtfront.Text);
if (returnint == 1)
{
lblmsg.Text = "insertd";
bind_gridview();
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string status1;
if (e.CommandName == "chngestatus")
{
int fronttech_id = Convert.ToInt32(e.CommandArgument);
dt = cmod.select_frontend(2, fronttech_id);
if (dt.Rows.Count > 0)
{
string status = dt.Rows[0]["status"].ToString();
if (status == "enable")
{
status1 = "disable";

}
else
{
status1 = "enable";
}
returnint = cmod.frontend_updating1(4, fronttech_id, status1);
if (returnint == 1)
{
lblmsg.Text = "succes";
}
bind_gridview();
}
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int f_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint = cmod.frontend_row_deleting(3, f_id);
COMPANY MANAGEMENT SYSTEM 0/0/2014

if (returnint == 1)
{
lblmsg.Text = "deletd";
bind_gridview();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int f_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
TextBox f_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtfront");
TextBox status = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");
returnint = cmod.frontend_updating(1, f_id, f_name.Text, status.Text);
if (returnint == 1)
{
lblmsg.Text = "updated";
GridView1.EditIndex = -1;
bind_gridview();
}
}
}

89
AddState.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
int returnint = 0;
int adminID;
string status1;
DataTable dt;

protected void Page_Load(object sender, EventArgs e)


{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("../login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
}
if (!Page.IsPostBack)
{
bind_gridviw();
bind_dropdownlist();
}
}
public void bind_dropdownlist()
{

dt = cmod.select_country(2, 0, 0);
if (dt.Rows.Count > 0)
{
drp_country.DataSource = dt;
COMPANY MANAGEMENT SYSTEM 0/0/2014

drp_country.DataValueField = "country_id";
drp_country.DataTextField = "country_name";
drp_country.DataBind();
}
else
drp_country.Items.Clear();
}

public void bind_gridviw()


{
dt = cmod.select_state(5,0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}

}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int StateID = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint = cmod.state_row_deleting(3, StateID);
if (returnint == 1)
{
lblmsg.Text = "succeful";
bind_gridviw();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
bind_gridviw();
//DropDownList ddl=
((DropDownList)GridView1.Rows[e.NewEditIndex].Cells[0].FindControl("drpcountryname"));
//dt = cmod.select_country(2, 0, 0);
//if (dt.Rows.Count > 0)
//{
// ddl.DataSource = dt;
// ddl.DataTextField = "country_name";
// ddl.DataValueField = "country_id";
// ddl.DataBind();
//}

}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{

91
int stateID = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
DropDownList country_name =
(DropDownList)GridView1.Rows[e.RowIndex].FindControl("drpcountryname");
TextBox s_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatename");
TextBox status = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");

returnint=cmod.state_updating(1,stateID,s_name.Text,status.Text,Convert.ToInt32(country_name.
SelectedValue));
if (returnint == 1)
{
lblmsg.Text = "suucess";
GridView1.EditIndex = -1;
bind_gridviw();
}

}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind_gridviw();
}

protected void btnSubmit_Click(object sender, EventArgs e)


{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
returnint = cmod.addstate(1,0,txtCountry.Text,Convert.ToInt32(drp_country.SelectedValue),
adminID);
if (returnint == 1)
{
lblmsg.Text = "state added";
bind_gridviw();
}

}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "chngestatus")
{
int st_id = Convert.ToInt32(e.CommandArgument);
dt = cmod.select_state(2, st_id);
if (dt.Rows.Count > 0)
{
string status = dt.Rows[0]["status"].ToString();
if (status == "enable")
{
status1 = "disable";
COMPANY MANAGEMENT SYSTEM 0/0/2014

}
else
{
status1 = "enable";
}
returnint = cmod.state_updating1(4, st_id, status1);
if (returnint == 1)
{
lblmsg.Text = "succes";
}
bind_gridviw();
}
}
}
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
if((e.Row.RowState & DataControlRowState.Edit)>0)
{
//DropDownList ddl = (DropDownList)e.Row.FindControl("drpcountryname");
//dt = cmod.select_country(2, 0, 0);
//if (dt.Rows.Count > 0)
//{
// ddl.DataSource = dt;
// ddl.DataTextField = "country_name";
// ddl.DataValueField = "country_id";
// ddl.DataBind();

//}
//DataRowView dr = e.Row.DataItem as DataRowView;
//ddl.SelectedValue = dr["country_id"].ToString();
}
}
}
//public void chnge_index()
//{
// int cID=Convert.ToInt32(
//}

AddTaskAssign.aspx.cs

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

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


{
module1.clsmodule cmod = new module1.clsmodule();
int returnint = 0;
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
bind_drpemployee();
bind_drpTaskAssign();
bind_gridview();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
int empid = Convert.ToInt32(drp_emp.SelectedValue);
int taskname = Convert.ToInt32(drp_taskassign.SelectedValue);
returnint = cmod.add_TaskAssign(1, 0, taskname, empid, txtbegin.Text, txtend.Text);
if (returnint == 1)
{
lblmsg.Text = "inserted";
bind_gridview();
}
}
public void bind_drpemployee()
{
dt = cmod.select_emp(2, 0);
if (dt.Rows.Count > 0)
{
drp_emp.DataSource = dt;
drp_emp.DataTextField = "First_name";
drp_emp.DataValueField = "emp_id";
COMPANY MANAGEMENT SYSTEM 0/0/2014

drp_emp.DataBind();
}
}
public void bind_drpTaskAssign()
{
dt = cmod.select_task(2, 0);
if (dt.Rows.Count > 0)
{
drp_taskassign.DataSource = dt;
drp_taskassign.DataTextField = "Task_Name";
drp_taskassign.DataValueField = "task_id";
drp_taskassign.DataBind();
}
}
protected void drp_taskassign_SelectedIndexChanged(object sender, EventArgs e)
{
int TaskNameID = Convert.ToInt32(drp_taskassign.SelectedValue);
dt = cmod.select_TaskRegister(2, TaskNameID);
if (dt.Rows.Count > 0)
{
txtbegin.Text = dt.Rows[0]["Begining_Date"].ToString();
txtend.Text = dt.Rows[0]["Ending_Date"].ToString();
}
else
{
txtbegin.Text = "";
txtend.Text = "";
}
}
public void bind_gridview()
{
dt = cmod.select_taskAssign(4, 0,0);
if(dt.Rows.Count>0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}

}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
int tskassignID=Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint = cmod.delete_row_taskasign(3, tskassignID);
if (returnint == 1)
{
lblmsg.Text = "deleted";

95
bind_gridview();
}
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

AddTaskManager.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
int returnint = 0;
int adminID;
int companyID;
string status1;
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{

if (Request.QueryString["loginId"] == null)
{
Response.Redirect("../login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginId"]);
}
if (!Page.IsPostBack)
{
bind_gridview();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
returnint = cmod.add_task(1, 0, txtname.Text, txtbegin.Text, txtend.Text);
if (returnint == 1)
{
lblmsg.Text = "inserted";

97
bind_gridview();
}
}
public void bind_gridview()
{
dt = cmod.select_task(2, 0);
if(dt.Rows.Count>0)
{
GridView1.DataSource=dt;
GridView1.DataBind();

}
}
protected void GridView1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
GridView1.EditIndex = -1;
bind_gridview();
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "chngestatus")
{
int taskid = Convert.ToInt32(e.CommandArgument);
dt = cmod.select_task(2, taskid);
if (dt.Rows.Count > 0)
{
string status = dt.Rows[0]["status"].ToString();
if (status == "pending")
{
status1 = "complete";

}
else
{
status1 = "pending";
}
returnint = cmod.task_updating1(4, taskid, status1);
if (returnint == 1)
{
lblmsg.Text = "succes";
}
bind_gridview();
}
}
}
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
{
COMPANY MANAGEMENT SYSTEM 0/0/2014

int taskid=Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
returnint=cmod.task_row_deleting(3,taskid);
if(returnint==1)
{
lblmsg.Text="row deleted";
bind_gridview();
}
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
GridView1.EditIndex = e.NewEditIndex;
}
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
{
int tskid = Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value.ToString());
TextBox t_name = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtname");
TextBox begin = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtbeginingdate");
TextBox end = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtendingdate");
TextBox status = (TextBox)GridView1.Rows[e.RowIndex].FindControl("txtstatus");
returnint = cmod.task_updating(1,tskid, t_name.Text, begin.Text, end.Text,status.Text);
if (returnint == 1)
{
lblmsg.Text = "suucess";
GridView1.EditIndex = -1;
bind_gridview();
}
}
}

99
viewEmployees.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
int adminID;
protected void Page_Load(object sender, EventArgs e)
{
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
}
}
dt = cmod.select_emp(5, 0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "viewprofile")
{
int empid = Convert.ToInt32(e.CommandArgument);
Session["emp_id"] = empid;
Response.Redirect("viewform.aspx?loginID="+adminID);
COMPANY MANAGEMENT SYSTEM 0/0/2014

}
}
}

viewCompletedTask.aspx.cs
101
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
dt = cmod.select_taskAssign(6, 0,0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}

viewIncompleteTasks.apsx.cs
COMPANY MANAGEMENT SYSTEM 0/0/2014

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

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
dt = cmod.select_taskAssign(7, 0, 0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}

viewPendingTasks.aspx.cs

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

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
dt = cmod.select_taskAssign(5,0,0);
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}

Employee
COMPANY MANAGEMENT SYSTEM 0/0/2014

Dashboard.aspx.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
int retrnint;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
bind_datalist();
}
dt = cmod.select_emp(2, Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
Label1.Text = dt.Rows[0]["First_name"].ToString();
}
}
public void bind_datalist()
{
dt = cmod.select_emp(2, Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
// string img = dt.Rows[0]["image"].ToString();
DataList1.DataSource = dt;
DataList1.DataBind();
}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
105
string savepath = "EmployeePics/";
string filename = FileUpload1.FileName;
savepath += filename;
FileUpload1.SaveAs(Server.MapPath(savepath));
int empid = Convert.ToInt32(Session["empID"]);
retrnint = cmod.update_image(6, empid, savepath);
if (retrnint == 1)
{
lblmsg.Text = "picUpdated";
bind_datalist();
}
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

EmployeeMasterPage.master.cs
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
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;
using System.Xml.Linq;

public partial class Employee_EmplyeeMasterPage : System.Web.UI.MasterPage


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
dt= cmod.select_emp(2,Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
Label1.Text = dt.Rows[0]["First_name"].ToString();
}
}
}

Pwd.aspx.cs
using System;

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

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


{
module1.clsmodule cmod = new module1.clsmodule();
string returnstring;
int adminID;

protected void Page_Load(object sender, EventArgs e)


{
if (Request.QueryString["loginId"] == null)
{
Response.Redirect("../login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginId"]);
//companyID = Convert.ToInt32(Session["companyID"]);
}

protected void btn_update_Click(object sender, EventArgs e)


{
try
{
returnstring = cmod.change_pwd(1, Convert.ToInt32(Session["empID"]), null, null);
if (returnstring != txt_currnt.Text)
{
lbl_msg.Text = "you have entered wrong password";

}
COMPANY MANAGEMENT SYSTEM 0/0/2014

else
{
if (txt_new.Text == txt_cnfm.Text)
{
returnstring = cmod.change_pwd(2, Convert.ToInt32(Session["empID"]), null,
txt_new.Text);
lbl_msg.Text = "password updated";

}
else
{
lbl_msg.Text = "new password not match";
}
}
}
catch (Exception ex)
{
lbl_msg.Text = ex.Message;
}
}
protected void Button2_Click(object sender, EventArgs e)
{

}
}

viewemployee.aspx.cs
109
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
int returnint;
int adminID;
int empID;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.QueryString["loginID"] == null)
{
Response.Redirect("login.aspx");
}
else
{
adminID = Convert.ToInt32(Request.QueryString["loginID"]);
empID = Convert.ToInt32(Session["empID"]);
}
bind_employee();
}
}

public void bind_employee()


{
dt = cmod.select_emp(4, Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
DetailsView1.DataSource = dt;
DetailsView1.DataBind();
}
}
COMPANY MANAGEMENT SYSTEM 0/0/2014

protected void DetailsView1_PageIndexChanging(object sender, DetailsViewPageEventArgs e)


{

}
protected void DetailsView1_ItemCommand(object sender, DetailsViewCommandEventArgs e)
{
if (e.CommandName == "Edit")
{
DetailsView1.ChangeMode(DetailsViewMode.Edit);
}
}
protected void DetailsView1_ModeChanging(object sender, DetailsViewModeEventArgs e)
{

}
protected void DetailsView1_ItemUpdating(object sender, DetailsViewUpdateEventArgs e)
{
empID = Convert.ToInt32(Session["empID"]);
TextBox Empname = (TextBox)(DetailsView1).FindControl("txtfname");
TextBox Lastname = (TextBox)(DetailsView1).FindControl("txtlname");
TextBox address = (TextBox)(DetailsView1).FindControl("txtaddress");
TextBox Email = (TextBox)(DetailsView1).FindControl("txtemail");
TextBox MobileNo=(TextBox)(DetailsView1).FindControl("txtmobile");
TextBox Hobbies = (TextBox)(DetailsView1).FindControl("txthobbies");
returnint = cmod.update_emp(1, empID, Empname.Text, Lastname.Text , address.Text ,
Email.Text , MobileNo.Text , Hobbies.Text);
if (returnint == 1)
{
DetailsView1.ChangeMode(DetailsViewMode.ReadOnly);
bind_employee();
}
}
}

viewPendingTask.aspx.cs
111
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
dt = cmod.select_taskAssign(5, 1, Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}

viewCompletedTask.aspx.cs
COMPANY MANAGEMENT SYSTEM 0/0/2014

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

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt;
protected void Page_Load(object sender, EventArgs e)
{
dt = cmod.select_taskAssign(6, 1,Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}
}
}

viewtask.aspx.cs
113
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

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


{
module1.clsmodule cmod = new module1.clsmodule();
DataTable dt,dt1;
int returnint;
int loginid = 0;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
bind_employee();
}

}
public void bind_employee()
{
// string currentdate = DateTime.Now.ToString("dd/MM/yyyy");
//string enddate = ViewState["end_date"].ToString();
dt = cmod.select_task_emp(5, 0,Convert.ToInt32(Session["empID"]));
if (dt.Rows.Count > 0)
{
drp_taskcompleted.DataSource = dt;
drp_taskcompleted.DataTextField = "Task_Name";
drp_taskcompleted.DataValueField = "taskassign_id";
drp_taskcompleted.DataBind();

}
}
protected void btnSubmit_Click(object sender, EventArgs e)
{
dt1 = cmod.select_task_emp(5, Convert.ToInt32(drp_taskcompleted.SelectedValue),
Convert.ToInt32(Session["empID"]));
string status = dt1.Rows[0]["Status"].ToString();
int taskID=Convert.ToInt32(dt1.Rows[0]["task_id"]);
COMPANY MANAGEMENT SYSTEM 0/0/2014

if(status=="pending")
{
string status1;
status1 = "complete";
returnint = cmod.task_updating1(4, taskID, status1);
if (returnint == 1)
{
lblmsg.Text = "updated";
}
GridView1.DataBind();
}
}
protected void drp_taskcompleted_SelectedIndexChanged(object sender, EventArgs e)
{
dt1 = cmod.select_task_emp(5, Convert.ToInt32(drp_taskcompleted.SelectedValue),
Convert.ToInt32(Session["empID"]));
if (dt1.Rows.Count > 0)
{
ViewState["end_date"] = dt1.Rows[0]["Ending_Date"].ToString();

GridView1.DataSource = dt1;
GridView1.DataBind();
}
}
}

SOURCE CODE OF XML FILES


Admin
115
AddBackend.aspx
<%@ Page Language="C#" MasterPageFile="~/Admin/SuperAdminMaster.master"
AutoEventWireup="true" CodeFile="AddBackend.aspx.cs" Inherits="SuperAdmin_Default"
Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<table style="width: 100%">
<tr>
<td>
&nbsp;</td>
</tr>
<tr>
<td>

<div class="niceform">
<fieldset>

<dl>

<dt><label for="email">Backend_technology:</label></dt>

<dd><asp:TextBox ID="txtback" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl class="submit">

<asp:Button ID="btnSubmit" Text="Submit" runat="server" CssClass="bt_blue"

onclick="btnSubmit_Click"/>

<asp:Label ID="lblmsg" runat="server" Text="Label"></asp:Label>

</dl>

</fieldset>
</div>
</td>

</tr>

<tr>
COMPANY MANAGEMENT SYSTEM 0/0/2014

<td>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

DataKeyNames="backtech_id" CssClass="rounded-corner"

CellPadding="4" onrowcancelingedit="GridView1_RowCancelingEdit"

onrowcommand="GridView1_RowCommand" onrowdeleting="GridView1_RowDeleting"

onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating">

<Columns>

<asp:TemplateField HeaderText="backtech_name">

<EditItemTemplate>

<asp:TextBox ID="txtback" Text='<%#Eval("backtech_name")%>' runat="server">


</asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblback" Text='<%#Eval("backtech_name")%>' runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Status">

<EditItemTemplate>

<asp:TextBox ID="txtstatus" Text='<%#Eval("status")%>' runat="server" ></asp:TextBox>

</EditItemTemplate>
<ItemTemplate>

<asp:Label ID="lblstatus" Text='<%#Eval("status")%>' runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

117
<asp:TemplateField HeaderText="change_status">

<ItemTemplate>

<asp:LinkButton ID="btnchngestatus" Text="Change Status" CommandName="chngestatus"


CommandArgument='<%#Eval("backtech_id")%>' runat="server"></asp:LinkButton>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Edit">

<EditItemTemplate>

<asp:Button ID="btnUpdate" Text="Update" CommandName="Update"


CommandArgument='<%#Eval("backtech_id")%>' runat="server" />

<asp:Button ID="Btncancel" Text="Cancel" CommandName="Cancel"


CommandArgument='<%#Eval("backtech_id")%>' runat="server" />

</EditItemTemplate>

<ItemTemplate>

<asp:ImageButton ID="btnEdit" ImageUrl="~/Admin/images/user_edit.png"


CommandArgument='<%#Eval("backtech_id")%>' runat="server" CommandName="Edit" />

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Delete">

<ItemTemplate>

<asp:ImageButton ID="btnDelete" ImageUrl="~/Admin/images/trash.png"


CommandName="Delete" runat="server" />

</ItemTemplate>

</asp:TemplateField>
COMPANY MANAGEMENT SYSTEM 0/0/2014

</Columns>

</asp:GridView>
</td>

</tr>

</table>

</asp:Content>

AddCountry.aspx

119
<%@ Page Language="C#" MasterPageFile="~/Admin/SuperAdminMaster.master"
AutoEventWireup="true" CodeFile="AddCountry.aspx.cs" Inherits="SuperAdmin_Default2"
Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table style="width: 100%">

<tr>

<td>

&nbsp;</td>

</tr>

<tr>

<td>

<div class="niceform">

<fieldset>

<dl>

<dt><label for="email">Add Country:</label></dt>

<dd><asp:TextBox ID="txtCountry" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl class="submit">

<asp:Button ID="btnSubmit" Text="Submit" runat="server" CssClass="bt_blue"

onclick="btnSubmit_Click"/>

<asp:Label ID="lblmsg" runat="server" Text="Label"></asp:Label>

</dl>
COMPANY MANAGEMENT SYSTEM 0/0/2014

</fieldset>

</div>

</td>

</tr>

<tr>

<td>

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

CssClass="rounded-corner" CellPadding="4" onrowcommand="GridView1_RowCommand"

DataKeyNames="country_id" onrowcancelingedit="GridView1_RowCancelingEdit"

onrowdeleting="GridView1_RowDeleting" onrowediting="GridView1_RowEditing"

onrowupdating="GridView1_RowUpdating">

<Columns>

<asp:TemplateField HeaderText="Country_Name">

<EditItemTemplate>

<asp:TextBox ID="txtname" Text='<%#Eval("country_name")%>' runat="server"


></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblname" Text='<%#Eval("country_name")%>' runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="status">

<EditItemTemplate>

<asp:TextBox ID="txtstatus" Text='<%#Eval("status")%>' runat="server" ></asp:TextBox>

121
</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblstatus" Text='<%#Eval("status")%>' runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="change_status">

<ItemTemplate>

<asp:LinkButton ID="btnchngestatus" Text="Change Status" CommandName="chngestatus"


CommandArgument='<%#Eval("country_id")%>' runat="server"></asp:LinkButton>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Edit">

<EditItemTemplate>

<asp:Button ID="btnUpdate" Text="Update" CommandName="Update"


CommandArgument='<%#Eval("country_id")%>' runat="server" />

<asp:Button ID="Btncancel" Text="Cancel" CommandName="Cancel"


CommandArgument='<%#Eval("country_id")%>' runat="server" />

</EditItemTemplate>

<ItemTemplate>

<asp:ImageButton ID="btnEdit" ImageUrl="~/Admin/images/user_edit.png"


CommandArgument='<%#Eval("country_id")%>' runat="server" CommandName="Edit" />

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Delete">
COMPANY MANAGEMENT SYSTEM 0/0/2014

<ItemTemplate>

<asp:ImageButton ID="btnDelete" ImageUrl="~/Admin/images/trash.png"


CommandName="Delete" runat="server" />

</ItemTemplate>

</asp:TemplateField>

</Columns>

</asp:GridView>

</td>

</tr>

</table>

</asp:Content>

AddDepartment.aspx

123
<%@ Page Language="C#" MasterPageFile="~/Admin/SuperAdminMaster.master"
AutoEventWireup="true" CodeFile="AddDepatment.aspx.cs" Inherits="SuperAdmin_Default"
Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table style="width: 100%">

<tr>

<td>

&nbsp;</td>

</tr>

<tr>

<td>

<div class="niceform">
<fieldset>

<dl>

<dt><label for="email">Add Department:</label></dt>

<dd><asp:TextBox ID="txtDept" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl class="submit">

<asp:Button ID="btnSubmit" Text="Submit" runat="server" CssClass="bt_blue"

onclick="btnSubmit_Click"/>

<asp:Label ID="lblmsg" runat="server" Text="Label"></asp:Label>


</dl>
</fieldset>
</div>
</td>
</tr>
COMPANY MANAGEMENT SYSTEM 0/0/2014

<tr> <td>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

DataKeyNames="dept_id" CssClass="rounded-corner"

CellPadding="4" onrowcancelingedit="GridView1_RowCancelingEdit"

onrowcommand="GridView1_RowCommand" onrowdeleting="GridView1_RowDeleting"

onrowediting="GridView1_RowEditing" onrowupdating="GridView1_RowUpdating">

<Columns>

<asp:TemplateField HeaderText="Dept_name">

<EditItemTemplate>

<asp:TextBox ID="txtdeptname" Text='<%#Eval("dept_name")%>' runat="server"


></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lbldeptname" Text='<%#Eval("dept_name")%>'


runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Status">

<EditItemTemplate>

<asp:TextBox ID="txtstatus" Text='<%#Eval("status")%>' runat="server" ></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblstatus" Text='<%#Eval("status")%>' runat="server"></asp:Label>

</ItemTemplate>

125
</asp:TemplateField>

<asp:TemplateField HeaderText="change_status">

<ItemTemplate>

<asp:LinkButton ID="btnchngestatus" Text="Change Status" CommandName="chngestatus"


CommandArgument='<%#Eval("dept_id")%>' runat="server"></asp:LinkButton>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Edit">

<EditItemTemplate>

<asp:Button ID="btnUpdate" Text="Update" CommandName="Update"


CommandArgument='<%#Eval("dept_id")%>' runat="server" />

<asp:Button ID="Btncancel" Text="Cancel" CommandName="Cancel"


CommandArgument='<%#Eval("dept_id")%>' runat="server" />

</EditItemTemplate>

<ItemTemplate>

<asp:ImageButton ID="btnEdit" ImageUrl="~/Admin/images/user_edit.png"


CommandArgument='<%#Eval("dept_id")%>' runat="server" CommandName="Edit" />

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Delete">

<ItemTemplate>

<asp:ImageButton ID="btnDelete" ImageUrl="~/Admin/images/trash.png"


CommandName="Delete" runat="server" />
</ItemTemplate>
</asp:TemplateField> </Columns>
COMPANY MANAGEMENT SYSTEM 0/0/2014

</asp:GridView> </td></tr></table>
</asp:Content>

127
AddEmployee.aspx
<%@ Page Language="C#" MasterPageFile="~/Admin/SuperAdminMaster.master"
AutoEventWireup="true" CodeFile="AddEmployee.aspx.cs" Inherits="SuperAdmin_Default"
Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table style="width: 100%">

<tr>
<td>

&nbsp;</td>

</tr>

<tr>

<td>

<div class="niceform">
<fieldset>

<dl><dt><label for="email">ImageUpload:</label></dt>

<dd><asp:FileUpload ID="FileUpload1" runat="server" /></dd>

</dl>

<dl>

<dt><label for="email">FirstName:</label></dt>

<dd><asp:TextBox ID="txtfirst" runat="server" CssClass="NFText"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"

ControlToValidate="txtfirst" ErrorMessage="must enter value/cant b


empty"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>
COMPANY MANAGEMENT SYSTEM 0/0/2014

<dt><label for="email">LastName:</label></dt>

<dd><asp:TextBox ID="txtlast" runat="server" CssClass="NFText"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server"

ControlToValidate="txtlast" ErrorMessage="must enter 1 value/cant b


empty"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">DateOfBirth:</label></dt>

<dd><asp:TextBox ID="DOB" runat="server" CssClass="NFText"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"

ControlToValidate="DOB"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">Father Name:</label></dt>

<dd><asp:TextBox ID="txtFather" runat="server" CssClass="NFText"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"

ControlToValidate="txtFather"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">Mother Name:</label></dt>

129
<dd><asp:TextBox ID="txtmother" runat="server" CssClass="NFText"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"

ControlToValidate="txtmother"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">Choose Department:</label></dt>

<dd><asp:DropDownList ID="drp_dept" runat="server"


AppendDataBoundItems="true"

AutoPostBack="True"
onselectedindexchanged="drp_dept_SelectedIndexChanged">

<asp:ListItem Value="0" Text="-----Select-------"></asp:ListItem>

</asp:DropDownList>

<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"

ControlToValidate="drp_dept"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">Choose Designation:</label></dt>

<dd><asp:DropDownList ID="drp_desig" runat="server"

AutoPostBack="True" AppendDataBoundItems="true">

<asp:ListItem Value="0" Text="-----Select-------"></asp:ListItem>

</asp:DropDownList>
COMPANY MANAGEMENT SYSTEM 0/0/2014

<asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"

ControlToValidate="drp_desig"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">FrontEnd_Technology:</label></dt>

<dd><asp:DropDownList ID="drp_front" runat="server"

AutoPostBack="True" AppendDataBoundItems="true">

<asp:ListItem Value="0" Text="-----Select-------"></asp:ListItem>

</asp:DropDownList>

<asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"

ControlToValidate="drp_front"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">BackEnd_Technology:</label></dt>

<dd><asp:DropDownList ID="drp_back" runat="server"

AutoPostBack="True" AppendDataBoundItems="true">

<asp:ListItem Value="0" Text="-----Select-------"></asp:ListItem>

</asp:DropDownList>

<asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"

131
ControlToValidate="drp_back"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

</dd>

</dl>

<dl>

<dt><label for="email">Date_Of_Joining:</label></dt>

<dd> <asp:TextBox ID="doj" runat="server" Height="23px"


Width="107px"></asp:TextBox>

<asp:Calendar ID="Calendar1" runat="server" TitleFormat="Month"

onselectionchanged="Calendar1_SelectionChanged"></asp:Calendar></dd>

</dl>

<dl>

<dt><label for="email">Experiance:</label></dt>

<dd><asp:TextBox ID="txtexperiance" runat="server"


CssClass="NFText"></asp:TextBox>

<asp:Label ID="Label1" runat="server" Text="in years"></asp:Label>

</dd>

</dl>

<dl>

<dt><label for="email">Address:</label></dt>

<dd><asp:TextBox ID="txtaddress" runat="server" CssClass="NFText"

TextMode="MultiLine"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server"

ControlToValidate="txtaddress"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>
COMPANY MANAGEMENT SYSTEM 0/0/2014

</dd>

</dl>

<dl>

<dt><label for="email">MobileNo:</label></dt>

<dd><asp:TextBox ID="txtmobile" runat="server" CssClass="NFText"></asp:TextBox>

<asp:RequiredFieldValidator ID="RequiredFieldValidator12" runat="server"

ControlToValidate="txtmobile"
ErrorMessage="mandatory"></asp:RequiredFieldValidator>

<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"

ControlToValidate="txtmobile" ErrorMessage="enter 10 digit"

ValidationExpression="^[0-9]{10}"></asp:RegularExpressionValidator>

</dd>

</dl>

<dl>

<dt><label for="email">LandLine No:</label></dt>

<dd><asp:TextBox ID="txtland" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl>

<dt><label for="email">EmailID:</label></dt>

<dd><asp:TextBox ID="txtemail" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl>

<dt><label for="email">Gender:</label></dt>

133
<dd><asp:RadioButtonList ID="gender" runat="server">

<asp:ListItem Value="male" Selected="True"></asp:ListItem>

<asp:ListItem Value="female"></asp:ListItem>

</asp:RadioButtonList></dd>

</dl>

<dl>

<dt><label for="email">Hobbies:</label></dt>

<dd><asp:CheckBoxList ID="hobbies" runat="server">

<asp:ListItem Value="singing" Selected="True"></asp:ListItem>

<asp:ListItem Value="dancing"></asp:ListItem>

<asp:ListItem Value="music"></asp:ListItem>

<asp:ListItem Value="web surfing"></asp:ListItem>

</asp:CheckBoxList></dd>

</dl>

<dl>

<dt><label for="email">Password:</label></dt>

<dd><asp:TextBox ID="txtpasswd" runat="server" CssClass="NFText"

TextMode="Password"></asp:TextBox></dd>

</dl>

<dl>

<dt><label for="email">Confirm Password:</label></dt>

<dd><asp:TextBox ID="txtcnfrmpasswd" runat="server" CssClass="NFText"

TextMode="Password"></asp:TextBox>
COMPANY MANAGEMENT SYSTEM 0/0/2014

<asp:CompareValidator ID="CompareValidator1" runat="server"

ControlToCompare="txtcnfrmpasswd" ControlToValidate="txtpasswd"

ErrorMessage="no match"></asp:CompareValidator>

</dd>

</dl>

<dl class="submit">

<asp:Button ID="btnSubmit" Text="Submit" runat="server" CssClass="bt_blue"

onclick="btnSubmit_Click"/>

<asp:Label ID="lblmsg" runat="server" Text="Label"></asp:Label>

</dl>

</fieldset>

</div>

</td>

</tr>

</table>

</asp:Content>

135
AddTaskAssign.aspx

<%@ Page Language="C#" MasterPageFile="~/Admin/SuperAdminMaster.master"


AutoEventWireup="true" CodeFile="AddTaskAssign.aspx.cs" Inherits="Admin_Default2"
Title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<table style="width: 100%">

<tr>

<td style="width: 519px">

&nbsp;</td>

</tr>

<tr>

<td style="width: 519px">

<div class="niceform">
<fieldset>
<dl><dt><label for="email">Select Employee:</label></dt>

<dd><asp:DropDownList ID="drp_emp" runat="server" AppendDataBoundItems="true">

<asp:ListItem Value="0" Text="-----Select-------"></asp:ListItem>

</asp:DropDownList></dd>

</dl>

<dl>

<dt><label for="email">Assign Task:</label></dt>

<dd><asp:DropDownList ID="drp_taskassign" runat="server" AutoPostBack="True"

onselectedindexchanged="drp_taskassign_SelectedIndexChanged"
AppendDataBoundItems="true">

<asp:ListItem Value="0" Text="-----Select-------"></asp:ListItem>

</asp:DropDownList></dd>
COMPANY MANAGEMENT SYSTEM 0/0/2014

</dl>

<dl>

<dt><label for="email">beginning_Date:</label></dt>

<dd><asp:TextBox ID="txtbegin" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl>

<dt><label for="email">Ending_Date of Task:</label></dt>

<dd><asp:TextBox ID="txtend" runat="server"


CssClass="NFText"></asp:TextBox></dd>

</dl>

<dl class="submit">

<asp:Button ID="btnSubmit" Text="Submit" runat="server" CssClass="bt_blue"

onclick="btnSubmit_Click"/>

<asp:Label ID="lblmsg" runat="server" Text="Label"></asp:Label>

</dl>
</fieldset>
</div>
</td>
</tr>

<tr>

<td style="width: 519px">

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"

CssClass="rounded-corner" CellPadding="4" DataKeyNames="taskassign_id"

Height="10px" Width="420px"

onrowdeleting="GridView1_RowDeleting">

137
<Columns>

<asp:TemplateField HeaderText="Emp_name">

<EditItemTemplate>

<asp:TextBox ID="txtname" Text='<%#Eval("First_name")%>' runat="server"


></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblname" Text='<%#Eval("First_name")%>' runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Task_Name">

<EditItemTemplate>

<asp:TextBox ID="txttaskname" Text='<%#Eval("Task_Name")%>' runat="server"


></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lbltaskname" Text='<%#Eval("Task_Name")%>'


runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Beginning_Date">

<EditItemTemplate>

<asp:TextBox ID="txtbeginingdate" Text='<%#Eval("Begining_Date")%>' runat="server"


></asp:TextBox>

</EditItemTemplate>
COMPANY MANAGEMENT SYSTEM 0/0/2014

<ItemTemplate>

<asp:Label ID="lblbeginingdate" Text='<%#Eval("Begining_Date")%>'


runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Ending_Date">

<EditItemTemplate>

<asp:TextBox ID="txtendingdate" Text='<%#Eval("Ending_Date")%>' runat="server"


></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblendingdate" Text='<%#Eval("Ending_Date")%>'


runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Status">

<EditItemTemplate>

<asp:TextBox ID="txtstatus" Text='<%#Eval("Status")%>' runat="server" ></asp:TextBox>

</EditItemTemplate>

<ItemTemplate>

<asp:Label ID="lblstatus" Text='<%#Eval("Status")%>' runat="server"></asp:Label>

</ItemTemplate>

</asp:TemplateField>

<asp:TemplateField HeaderText="Delete">

139
<ItemTemplate>

<asp:ImageButton ID="btnDelete" ImageUrl="~/Admin/images/trash.png"


CommandName="Delete" runat="server" />

</ItemTemplate>
</asp:TemplateField> </Columns>

</asp:GridView>

</td>

</tr>

</table>

</asp:Content>
COMPANY MANAGEMENT SYSTEM 0/0/2014

Conclusion

“Company Management System” project has done successfully. The main reason has to
developed this project was to provide the full knowledge of IT company.Admin having all the
privilages .He/she can give privileges to employee’s. In this way save the time of Employees.
Employee’s know the exact modules and their time in which the module should be complete. This
Website give details of each and every single information related to Employee in company. And
the modules which are assigned to Employee. Administrator can do any change at the back-end as well
as at the front-end.

141
BIBLIOGRAPHY
 www.w3school.com
 www.codeproject.com
 stackoverflow.com
 Asp.Net Book

You might also like