0% found this document useful (0 votes)
145 views

Employee Management System Report

This document provides an overview of a mini project on an employee management system. It includes an introduction, objectives, limitations of existing systems, hardware and software requirements, data flow diagrams, entity relationship diagrams, and operations of the current system. The project aims to develop a simple yet useful system for managing employee records and payroll through an interface that is easy for anyone to use.

Uploaded by

vishal sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views

Employee Management System Report

This document provides an overview of a mini project on an employee management system. It includes an introduction, objectives, limitations of existing systems, hardware and software requirements, data flow diagrams, entity relationship diagrams, and operations of the current system. The project aims to develop a simple yet useful system for managing employee records and payroll through an interface that is easy for anyone to use.

Uploaded by

vishal sharma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 60

A

MINI PROJECT
ON
EMPLOYEE
MANAGEMENT
SYSTEM

Project Report submitted for the partial fulfillment of the degree of


Bachelor of Computer Application (BCA)

SUBMITTED BY Under the Guidance of


Beenu Singh (1708551836) Mr. Sanjay Kant Tyagi
Ekta Pundir (1708551808) (Assistant Proffersor of Department
Computer Application)

SHRI RAM COLLEGE MUZAFFARNAGAR


(Affiliated to Ch.Charan Singh University MEERUT)

i
ACKNOWLEDGEMENT

It gives me a great pleasure to present the report file of the project work undertaken
during BCA final year. I owe special dept of gratitude to MR. SANJAY KANT TYAGI
Department of Computer Application, Shri Ram College, Muzaffarnagar for his constant
support and guidance throughout the course of our work.His sincerity thoroughness and
preservence have been a constant source of inspiration for us.

I acknowledge the contribution of all faculty members of the department for their kind
assistance and coorperation during the development of our project.

i
CERTIFICATE

This is certify that this Project Report entilted “EMPLOYEE MANAGEMENT


SYSTEM” which is submitted by BEENU SINGH(1708551836) and EKTA
PUNDIR(1708551808) in the partial fulfilment, for the award of degree of Bachelor of
Computer Application from Shri Ram College,Muzaffarnagar affiiliated to C.C.S
University,Meerut is carried out by him/her under my supervision.

The matter emboided in thus Project Work has not beensubmitted earlier for award of any
degree or diploma in any University/Institution to the best of our knowledge and belief.

i
ABSTRACT

EMPLOYEE MANAGEMENT SYSTEM is a distribution application, developed to


maintain the details of employees working in any organisation. It maintains the
information about the personal details of their employees, also the details about payroll
system which enable to generate the payslip. The application is actually a suite of
applications developed using Java.

It is simple to understand and can be used by anyone who is not even familier with
simple employees system. It is user friendly and just asks the user to follow step by step
operations by giving him few options. It is fast and can perform many operations of a
company.

i
DECLARATION

We Beenu Singh, Ekta Pundir hereby declare that the project report title “ Employee
Management System” is an original work carried out by our under the supervision of
“Mr. Sanjay Kant Tyagi ” We further declare that this work has not been submitted to
any other Institute/University for the award of the degree of Bachelor of Computer
Applications.

Beenu Singh

Ekta Pundir

i
INTRODUCTION

The aim of this project EMPLOYEE INFORMATION SYSTEM is to maintain the


employee, salary, and their department. There is only one type of user in this system,
known as registered user. The user first inserts the data of the entire employee, salary and
department whose data is to be maintained. In this project, we can maintain the employee
data, salary data and department of employee.This software provides that we can search the
employee and department details of a particular employee which helps in time saving.

Employee Management System is an application that enables users to create and store
Employee Records. The application also provides facilities of a payroll system which
enables user to generate pay slip too. This application is helpful to department of the
organization which maintains data of employees related to an organization.

i
OBJECTIVE OF THE PROJECT

In this world of growing technologies everything has been computerized. With large
number of work oppurtunities the Human workforce has increased. Thus there is a need
of a system which can handle the data of such a large number of Employees in an
organization. This project simplifies the task of maintain records because of its user
friendly nature.

i
LIMITATIONS OF EXISTING SYSTEM

When the existing system of the Employee Management System, we found that some
add on were required there so that problems could be solved. Some of the problems or
limitations in the present system are: -
To update each employee with their company name
While preparing the Reports statements the employee have to manually go through the
Records Mannually.
There is no security of the database register i.e. any other person can make changes in the
database.It is a time consuming task to maintain the data of previous employee.

i
HARDWARE REQUIREMENTS

In order to implement a new system the choice of processor with maximum possible
speed is made. There should be sufficient memory to store data and software tools for
efficient processing.

System : IBM-Compatible PC

Processor : Pentium IV

Speed : 2.0 GHz

Memory : 256 MB RAM

Hard Disk Drive : 40 GB

2.2 SOFTWARE REQUIREMENTS

Platform : Window 10
Language used : J2EE

Back end : MS-ACCESS 2010

Technologies used : JDBC

i
FRONT END & BACK END USED

WINDOWS 10 used as PLATFORM

Windows 10 is latest version of window and also GUI.This is best then


another Operating system and easy.

Windows 10 has come up with another bonanza that is Network


Communication with other users.The users can connect with other users to
share data, file send peripheral devices like Printers.

JAVA used as FRONT END

Java uses front end programming because JAVA use back end as like
ACCESS DATABASE.

In JAVA we can use easy database connectivity and design the Form, Report
and other MDI application with the help of Database.

i
DATA FLOW DIAGRAM

DFD FOR LOGIN

Searche
Username d data
USER1
User Detail

Password

CHECK
THE
VALID
USER2 USER

Invalid
message

i
DFD OF EMPLOYEE MANAGEMENT SYSTEM

SALARY
.

EMPLOYEE

Paid Salary
Employee data

Salary data

Employee
Management
System

Employee Employee data Employee


And
Salary
List

i
E-R DIAGRAM

Dno.
Dname

Login

HOD

Password
User Id

Login

Employee Department
&
Salary

Sno Phone

Employee

Addres
Name
s

i
OPERATIONS OF PRESENT SYSTEM

The Employee Management is further the integration of various sub-systems. Broadly


speaking these sub-systems are based on following broadly classified activities.

A. Employee management
 Add new employee
 Delete employee
 Modify employee
 Search employee
B. Salary management
 Pay salary
 Display salary
C. Department
 Add new employee
 Delete employee
 Modify employee
 Search employee

D. Display reports and result


 List of employee
 List of Department
 List of Salary
E. Change Password

i
TABLES

DATABASE DESIGN

All the tables, sequences, triggers are stored in database for storing the information about
entrance test made by the users.

Following are the tables:

1. LOGIN TABLE

2. EMPLOYEE TABLE

i
3 .DEPARTMENT TABLE

4. SALARY TABLE

i
MODULE

Module 1: Login Module

In this module, registered user enters a password and the software checks its validity. If
the password is valid then he is allowed to enter, otherwise “Invalid User/Password”
message is displayed.

Module 2: Department

In this module we can assign different department to different employees.

Module 3: Salary

In this module, Salary can be maintained.

Module4: Employee

In this we maintain the information of Employees.

i
FORMS

LOGIN FORM::

WELCOME FORM ::

i
CHANGE PASSWORD FORM ::

i
MAIN FORM ::

i
ADD EMPLOYEE FORM ::

i
EDIT EMPLOYEE FORM ::

SEARCH EMPLOYEE FORM ::

i
ADD DEPARTMENT FORM ::

i
EDIT DEPARTMENT FORM ::

i
SEARCH DEPARTMENT FORM ::

PAY SALARY FORM ::

i
LIST OF EMPLOYEE ::

i
LIST OF DEPARTMENT ::

LIST OF SALARY ::

i
CODING

Login form
class Login implements ActionListener
{
JFrame frm;
JLabel l1,l2;
JTextField txtid;
JPasswordField txtpwd;
JButton login,quit;
Login()
{
frm=new JFrame("Login Form");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);
/*ImageIcon img=new ImageIcon("image.jpg");
JLabel lpic=new JLabel(img);
lpic.setBounds(300,200,400,300);
frm.add(lpic);*/

l1=new JLabel("Login ID");


l2=new JLabel("Password");
txtid=new JTextField();
txtpwd=new JPasswordField();
login=new JButton("Login");
quit=new JButton("Quit");
login.setBackground(Color.LIGHT_GRAY);
quit.setBackground(Color.LIGHT_GRAY);
frm.setLayout(null);
l1.setBounds(30,50,150,30);
frm.add(l1);

i
txtid.setBounds(190,50,170,30);
frm.add(txtid);
l2.setBounds(30,110,150,30);
frm.add(l2);
txtpwd.setBounds(190,110,170,30);
frm.add(txtpwd);
login.setBounds(40,170,110,30);
frm.add(login);
quit.setBounds(230,170,110,30);
frm.add(quit);
login.addActionListener(this);
quit.addActionListener(this);
frm.setBounds(300,200,400,300);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==login)
{
String login,pass;
try
{
login=txtid.getText();
pass=txtpwd.getText();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from logintable where
loginid='"+login+"' and password='"+pass+"'";
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
//JOptionPane.showMessageDialog(null,"Correct");
SplashForm obj=new SplashForm();
}
else
JOptionPane.showMessageDialog(null,"Incorrect");
}
catch(Exception e1)
{}
}
else
frm.dispose();
}

Welcome form

i
class SplashForm implements ActionListener
{
JFrame frm;
JLabel l1,l2,l3,l4,l5,l6,l7,l8;
JButton btn;
SplashForm()
{
frm=new JFrame(" Welcome Form");
frm.setSize(600,700);
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.show();
frm.getContentPane().setBackground(Color.black);
frm.setLayout(null);

l1=new JLabel("EMPLOYEE");
l2=new JLabel("MANAGEMENT");
l3=new JLabel("SYSTEM");
l4=new JLabel("Developed By:");
l5=new JLabel("HEMA");
l6=new JLabel("NEELU PANDEY");
l7=new JLabel("Submitted To:");
l8=new JLabel("ANUJ SIR");
btn=new JButton("C O N T I N U E ");

Font f1=new Font("Lucida Handwriting",Font.BOLD,40);


Font f2=new Font("Times new Roman",Font.BOLD,20);
Font f3=new Font("Monotype Corsiva",Font.ITALIC,20);

l1.setFont(f1);
l2.setFont(f1);
l3.setFont(f1);
l4.setFont(f2);
l7.setFont(f2);
l5.setFont(f3);
l6.setFont(f3);
l8.setFont(f3);
l1.setForeground(Color.red);
l2.setForeground(Color.red);
l3.setForeground(Color.red);
l4.setForeground(Color.magenta);
l7.setForeground(Color.magenta);
l5.setForeground(Color.blue);
l6.setForeground(Color.blue);
l8.setForeground(Color.blue);
l1.setBounds(130,10,300,50);

i
frm.add(l1);
l2.setBounds(110,70,600,50);
frm.add(l2);
l3.setBounds(160,130,300,50);
frm.add(l3);
l4.setBounds(50,300,200,50);
frm.add(l4);
l7.setBounds(300,300,200,50);
frm.add(l7);
l5.setBounds(50,350,100,40);
frm.add(l5);
l6.setBounds(50,370,150,40);
frm.add(l6);
l8.setBounds(300,340,100,40);
frm.add(l8);
btn.setBounds(180,450,300,40);
frm.add(btn);
btn.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==btn)
{
MainMenu obj=new MainMenu();
}
}
}

Main Form
class MainMenu implements ActionListener
{
JFrame frm;
JMenuBar mb;
JMenu emp,dept,salary,report,security,exit;
JMenuItem
addemp,editemp,searchemp,adddept,editdept,searchdept,salaryslip,listofemp,listofsalary,l
istofdept,changepwd,yes,no;
MainMenu()
{
frm=new JFrame("MAIN FORM");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.gray);
frm.setSize(500,400);
frm.show();

mb=new JMenuBar();
frm.setJMenuBar(mb);

i
emp=new JMenu("EMPLOYEE");
dept=new JMenu("DEPARTMENT");
salary=new JMenu("SALARY");
report=new JMenu("REPORT");
security=new JMenu("SECURITY");
exit=new JMenu("EXIT");
mb.add(emp);
mb.add(dept);
mb.add(salary);
mb.add(report);
mb.add(security);
mb.add(exit);

addemp=new JMenuItem("Add Employee");


editemp=new JMenuItem("Edit Employee");
searchemp=new JMenuItem("Search Employee");
adddept=new JMenuItem("Add Department");
editdept=new JMenuItem("Edit Department");
searchdept=new JMenuItem("Search Department");
salaryslip=new JMenuItem("Salary Slip");
listofemp=new JMenuItem("List Of Employee");
listofsalary=new JMenuItem("List Of Salary");
listofdept=new JMenuItem("List Of Department");
changepwd=new JMenuItem("Change Password");
yes=new JMenuItem("Yes");
no=new JMenuItem("No");

emp.add(addemp);
emp.add(editemp);
emp.add(searchemp);
dept.add(adddept);
dept.add(editdept);
dept.add(searchdept);
salary.add(salaryslip);
report.add(listofemp);
report.add(listofdept);
report.add(listofsalary);
security.add(changepwd);
exit.add(yes);
exit.add(no);

addemp.addActionListener(this);
editemp.addActionListener(this);
searchemp.addActionListener(this);
adddept.addActionListener(this);
editdept.addActionListener(this);
searchdept.addActionListener(this);

i
salaryslip.addActionListener(this);
listofemp.addActionListener(this);
listofdept.addActionListener(this);
listofsalary.addActionListener(this);
changepwd.addActionListener(this);
yes.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
{
if(evt.getSource()==addemp)
{
AddEmployee obj1=new AddEmployee();

}
else if(evt.getSource()==editemp)
{
EditEmployee obj2=new EditEmployee();
}
else if(evt.getSource()==searchemp)
{
SearchEmp obj3=new SearchEmp();
}
else if(evt.getSource()==adddept)
{
DeptDetails obj4=new DeptDetails();
}
else if(evt.getSource()==editdept)
{
EditDept obj5=new EditDept();
}
else if(evt.getSource()==searchdept)
{
SearchDept obj5=new SearchDept();
}
else if(evt.getSource()==salaryslip)
{
PaySalary obj5=new PaySalary();
}
else if(evt.getSource()==listofemp)
{
ListEmployee obj5=new ListEmployee();
}
else if(evt.getSource()==listofdept)
{
ListDepartment obj5=new ListDepartment();
}
else if(evt.getSource()==listofsalary)

i
{
ListSalary obj5=new ListSalary();
}
else if(evt.getSource()==changepwd)
{
Changepswrd obj5=new Changepswrd();
}
else if(evt.getSource()==yes)
{
System.exit(0);
}
}

}
Add Employee Form

class AddEmployee implements ActionListener


{
JFrame frm;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;
JTextField
txtempcode,txtname,txtcontact,txtgender,txtage,txtdoj,txtaddress,txtsalary,txtdept,txtpost;
JButton save,exit;
JComboBox cb;
AddEmployee()
{
frm=new JFrame("ADD Employee");
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Employee Code");


l2=new JLabel("Name");
l3=new JLabel("Contact No");
l4=new JLabel("Gender");
l5=new JLabel("Age");
l6=new JLabel("Date of joining");
l7=new JLabel("Salary");
l8=new JLabel("Address");
l9=new JLabel("Department");
l10=new JLabel("Post");
save=new JButton("Save");
exit=new JButton("Exit");
save.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);
cb=new JComboBox();

txtempcode=new JTextField(20);
txtname=new JTextField(20);

i
txtcontact=new JTextField(20);
txtgender=new JTextField(20);
txtdept=new JTextField(20);
txtpost=new JTextField(20);
cb.addItem("Male");
cb.addItem("Female");
txtage=new JTextField(20);
txtdoj=new JTextField(20);
txtsalary=new JTextField(20);
txtaddress=new JTextField(20);
frm.setLayout(new GridLayout(11,2));
frm.add(l1);
frm.add(txtempcode);
frm.add(l2);
frm.add(txtname);
frm.add(l3);
frm.add(txtcontact);
frm.add(l4);
frm.add(cb);
frm.add(l5);
frm.add(txtage);
frm.add(l6);
frm.add(txtdoj);
frm.add(l7);
frm.add(txtsalary);
frm.add(l8);
frm.add(txtaddress);
frm.add(l9);
frm.add(txtdept);
frm.add(l10);
frm.add(txtpost);
frm.add(save);
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.add(exit);

save.addActionListener(this);
exit.addActionListener(this);

frm.setBounds(300,200,400,400);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==save)
{
try
{

i
int empcode,age,salary;
String name,contact,gender,doj,address,post,dept;
empcode=Integer.parseInt(txtempcode.getText());
age=Integer.parseInt(txtage.getText());
salary=Integer.parseInt(txtsalary.getText());
post=txtpost.getText();
dept=txtdept.getText();
name=txtname.getText();
contact=txtcontact.getText();
doj=txtdoj.getText();
address=txtaddress.getText();
gender=cb.getSelectedItem().toString();

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="insert into employeetable
values("+empcode+",'"+name+"','"+contact+"','"+gender+"',"+age+",'"+doj+"',"+salary+"
,'"+address+"','"+dept+"','"+post+"')";
stmt.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Data Stored");
txtempcode.setText(null);
txtage.setText("");
txtsalary.setText("");
txtname.setText("");
txtdoj.setText("");
txtcontact.setText("");
txtaddress.setText("");
txtpost.setText("");
txtdept.setText("");
txtempcode.requestFocus();
}
catch(Exception e1)
{JOptionPane.showMessageDialog(null,e1.getMessage());}
}
else
frm.dispose();
}
}
Edit Employee
class EditEmployee implements ActionListener
{
JFrame frm;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;
JTextField
txtempcode,txtname,txtage,txtgender,txtcontact,txtdoj,txtdept,txtpost,txtsalary,txtaddress;

i
JButton ok,exit,delete,update;
EditEmployee()
{
frm=new JFrame("Edit Employee Record");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Enter Employee Number");


l2=new JLabel("Name");
l3=new JLabel("Age");
l4=new JLabel("Gender");
l5=new JLabel("Contact Number");
l6=new JLabel("Date of Joining");
l7=new JLabel("Dapartment");
l8=new JLabel("Post");
l9=new JLabel("Salary");
l10=new JLabel("Address");

txtempcode= new JTextField(20);


txtname= new JTextField(20);
txtage= new JTextField(20);
txtgender= new JTextField(20);
txtcontact= new JTextField(20);
txtdoj= new JTextField(20);
txtdept=new JTextField(20);
txtpost=new JTextField(20);
txtsalary= new JTextField(20);
txtaddress= new JTextField(20);

ok=new JButton("OK");
exit=new JButton("Exit");
delete=new JButton("Delete");
update=new JButton("Update");
ok.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);
delete.setBackground(Color.LIGHT_GRAY);
update.setBackground(Color.LIGHT_GRAY);

ok.addActionListener(this);
exit.addActionListener(this);
delete.addActionListener(this);
update.addActionListener(this);

frm.setLayout(new GridLayout(12,2));
frm.add(l1);
frm.add(txtempcode);
frm.add(ok);

i
frm.add(exit);
frm.add(l2);
frm.add(txtname);
frm.add(l3);
frm.add(txtage);
frm.add(l4);
frm.add(txtgender);
frm.add(l5);
frm.add(txtcontact);
frm.add(l6);
frm.add(txtdoj);
frm.add(l7);
frm.add(txtdept);
frm.add(l8);
frm.add(txtpost);
frm.add(l9);
frm.add(txtsalary);
frm.add(l10);
frm.add(txtaddress);
frm.add(delete);
frm.add(update);
frm.setBounds(300,200,400,400);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
int ecode;
try
{
ecode=Integer.parseInt(txtempcode.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from employeetable where
empcode="+ecode;
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
txtage.setText(res.getString("age"));
txtaddress.setText(res.getString("address"));
txtname.setText(res.getString("name"));
txtsalary.setText(res.getString("salary"));
txtdoj.setText(res.getString("doj"));
txtcontact.setText(res.getString("contact"));

i
txtdept.setText(res.getString("department"));
txtpost.setText(res.getString("post"));
txtgender.setText(res.getString("gender"));
}
else
{
JOptionPane.showMessageDialog(null," Not
Found");
}

}
catch(Exception e1)
{}
}
else if(e.getSource()==delete)
{
try
{
int eno=Integer.parseInt(txtempcode.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="delete from employeetable where
empcode="+eno;
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully
deleteed");
txtempcode.setText("");
txtname.setText("");
txtgender.setText("");
txtsalary.setText("");
txtaddress.setText("");
txtdept.setText("");
txtdoj.setText("");
txtpost.setText("");
txtage.setText("");
txtcontact.setText("");
}
catch(Exception e3)
{}
}
else if(e.getSource()==update)
{
try
{
int eno=Integer.parseInt(txtempcode.getText());

i
int age,salary;
String name, address,dept,post,contact,doj,gender;

name=txtname.getText();
age=Integer.parseInt(txtage.getText());
salary=Integer.parseInt(txtsalary.getText());
contact=txtcontact.getText();
post=txtpost.getText();
dept=txtdept.getText();
doj=txtdoj.getText();
address=txtaddress.getText();
gender=txtgender.getText();

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="update employeetable set
name='"+name+"',age="+age+",salary="+salary+",contact='"+contact+"',gender='"+gend
er+"',department='"+dept+"',post='"+post+"',address='"+address+"' where
empcode="+eno;
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully
updated");
txtempcode.setText("");
txtname.setText("");
txtgender.setText("");
txtsalary.setText("");
txtaddress.setText("");
txtdept.setText("");
txtdoj.setText("");
txtpost.setText("");
txtage.setText("");
txtcontact.setText("");
}
catch(Exception e3)
{JOptionPane.showMessageDialog(null,e3.getMessage());}
}
else
frm.dispose();
}
}
Search Employee Form

class SearchEmp implements ActionListener


{
JFrame frm;

i
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10;
JTextField
txtempcode,txtname,txtage,txtgender,txtcontact,txtdoj,txtdept,txtpost,txtsalary,txtaddress;
JButton ok,exit;
SearchEmp()
{
frm=new JFrame("Search Employee");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);.

l1=new JLabel("Enter Employee Code");


l2=new JLabel("Name");
l3=new JLabel("Age");
l4=new JLabel("Gender");
l5=new JLabel("Contact Number");
l6=new JLabel("Date of Joining");
l7=new JLabel("Department");
l8=new JLabel("Post");
l9=new JLabel("Salary");
l10=new JLabel("Address");

txtempcode=new JTextField(20);
txtname=new JTextField(20);
txtage=new JTextField(20);
txtgender=new JTextField(20);
txtcontact=new JTextField(20);
txtdoj=new JTextField(20);
txtdept=new JTextField(20);
txtpost=new JTextField(20);
txtsalary=new JTextField(20);
txtaddress=new JTextField(20);

ok=new JButton("OK");
exit=new JButton("Exit");
ok.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);

frm.setLayout(new GridLayout(11,2));
frm.add(l1);
frm.add(txtempcode);
frm.add(ok);
frm.add(exit);
ok.addActionListener(this);
exit.addActionListener(this);
frm.add(l2);
frm.add(txtname);
frm.add(l3);

i
frm.add(txtage);
frm.add(l4);
frm.add(txtgender);
frm.add(l5);
frm.add(txtcontact);
frm.add(l6);
frm.add(txtdoj);
frm.add(l7);
frm.add(txtdept);
frm.add(l8);
frm.add(txtpost);
frm.add(l9);
frm.add(txtsalary);
frm.add(l10);
frm.add(txtaddress);
frm.setBounds(300,200,400,400);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
try
{
int ecode=Integer.parseInt(txtempcode.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from employeetable where
empcode="+ecode;
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
txtage.setText(res.getString("age"));
txtaddress.setText(res.getString("address"));
txtname.setText(res.getString("name"));
txtsalary.setText(res.getString("salary"));
txtdoj.setText(res.getString("doj"));
txtcontact.setText(res.getString("contact"));
txtdept.setText(res.getString("department"));
txtpost.setText(res.getString("post"));
txtgender.setText(res.getString("gender"));
}
else
{

i
JOptionPane.showMessageDialog(null," Not
Found");
}

}
catch(Exception e1)
{}
}
else
frm.dispose();
}
}
Add Department Form

class DeptDetails implements ActionListener


{
JFrame frm;
JLabel l1,l2,l3;
JTextField txtno,txtname,txthod;
JButton save,exit;
DeptDetails()
{
frm=new JFrame("Department Details");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Department Number");


l2=new JLabel("Department Name");
l3=new JLabel("Head of Department");

txtno=new JTextField(20);
txtname=new JTextField(20);
txthod=new JTextField(20);

save=new JButton("Save");
exit=new JButton("Exit");
save.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);

frm.setLayout(null);
l1.setBounds(30,30,150,30);
frm.add(l1);
txtno.setBounds(180,30,170,30);
frm.add(txtno);
l2.setBounds(30,90,150,30);
frm.add(l2);
txtname.setBounds(180,90,170,30);

i
frm.add(txtname);
l3.setBounds(30,150,150,30);
frm.add(l3);
txthod.setBounds(180,150,170,30);
frm.add(txthod);
save.setBounds(40,210,100,30);
frm.add(save);
exit.setBounds(240,210,100,30);
frm.add(exit);
frm.setBounds(300,200,400,350);
frm.show();
save.addActionListener(this);
exit.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==save)
{
try
{
int deptno;
String deptname,hod;
deptno=Integer.parseInt(txtno.getText());
deptname=txtname.getText();
hod=txthod.getText();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="insert into depttable
values("+deptno+",'"+deptname+"','"+hod+"')";
stmt.executeUpdate(query);

JOptionPane.showMessageDialog(null,"Data Stored");
txtno.setText(null);
txtname.setText("");
txthod.setText("");
txtno.requestFocus();
}
catch(Exception e1)
{JOptionPane.showMessageDialog(null,e1.getMessage());}
}
else
{
frm.dispose();
}
}
}

i
Edit Department Form
class EditDept implements ActionListener
{
JFrame frm;
JLabel l1,l2,l3;
JTextField txtno,txtname,txthod;
JButton ok,exit,delete,update;
EditDept()
{
frm=new JFrame("Edit Department Record");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Enter Department Number");


l2=new JLabel("Name");
l3=new JLabel("Head Of Department");

txtno= new JTextField(20);


txtname= new JTextField(20);
txthod= new JTextField(20);

ok=new JButton("OK");
exit=new JButton("Exit");
delete=new JButton("Delete");
update=new JButton("Update");

ok.addActionListener(this);
exit.addActionListener(this);
delete.addActionListener(this);
update.addActionListener(this);

ok.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);
delete.setBackground(Color.LIGHT_GRAY);
update.setBackground(Color.LIGHT_GRAY);

frm.setLayout(null);
l1.setBounds(30,30,150,30);
frm.add(l1);
txtno.setBounds(200,30,170,30);
frm.add(txtno);
ok.setBounds(40,80,100,30);
frm.add(ok);
exit.setBounds(260,80,100,30);
frm.add(exit);
l2.setBounds(30,130,150,30);

i
frm.add(l2);
txtname.setBounds(200,130,170,30);
frm.add(txtname);
l3.setBounds(30,190,150,30);
frm.add(l3);
txthod.setBounds(200,190,170,30);
frm.add(txthod);
delete.setBounds(40,250,100,30);
frm.add(delete);
update.setBounds(260,250,100,30);
frm.add(update);
frm.setBounds(300,200,400,400);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
int dcode;
try
{
dcode=Integer.parseInt(txtno.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from depttable where
deptno="+dcode;
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
txtname.setText(res.getString("deptname"));
txthod.setText(res.getString("hod"));
}
else
{
JOptionPane.showMessageDialog(null," Not
Found");
}

}
catch(Exception e1)
{}
}
else if(e.getSource()==delete)
{
try

i
{
int dno=Integer.parseInt(txtno.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="delete from depttable where deptno="+dno;
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully
deleteed");
txtno.setText("");
txtname.setText("");
txthod.setText("");
}
catch(Exception e3)
{}
}
else if(e.getSource()==update)
{
try
{
int dno=Integer.parseInt(txtno.getText());
String name,hod;

name=txtname.getText();
hod=txthod.getText();

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="update depttable set
deptno="+dno+",deptname='"+name+"',hod='"+hod+"'";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully
updated");
txtno.setText("");
txtname.setText("");
txthod.setText("");
}
catch(Exception e3)
{JOptionPane.showMessageDialog(null,e3.getMessage());}
}
else
{
frm.dispose();
}

i
}
}
Search Department Form
class SearchDept implements ActionListener
{
JFrame frm;
JLabel l1,l2,l3;
JTextField txtno,txtname,txthod;
JButton ok,exit;
SearchDept()
{
frm=new JFrame("Search Department");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Enter Department Number");


l2=new JLabel("Department Name");
l3=new JLabel("Head Of Depatment");

txtno=new JTextField(20);
txtname=new JTextField(20);
txthod=new JTextField(20);

ok=new JButton("OK");
exit=new JButton("Exit");
ok.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);

frm.setLayout(null);
l1.setBounds(30,30,150,30);
frm.add(l1);
txtno.setBounds(190,30,170,30);
frm.add(txtno);
ok.setBounds(40,80,100,30);
frm.add(ok);
exit.setBounds(250,80,100,30);
frm.add(exit);
ok.addActionListener(this);
exit.addActionListener(this);
l2.setBounds(30,140,150,30);
frm.add(l2);
txtname.setBounds(190,140,170,30);
frm.add(txtname);
l3.setBounds(30,220,150,30);
frm.add(l3);
txthod.setBounds(190,220,170,30);
frm.add(txthod);

i
frm.setBounds(300,200,400,350);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
try
{
int dno=Integer.parseInt(txtno.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from depttable where
deptno="+dno;
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
txtname.setText(res.getString("deptname"));
txthod.setText(res.getString("hod"));
}
else
{
JOptionPane.showMessageDialog(null," Not
Found");
}

}
catch(Exception e1)
{}
}
else
frm.dispose();
}
}

PAY SALARY FORM


class PaySalary implements ActionListener
{
JFrame frm;
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9;
JTextField
txtslipno,txtdos,txtempcode,txtname,txtpost,txtdept,txtcontact,txtsalary,txtmonth;
JButton ok,exit,pay,clear;

i
PaySalary()
{
frm=new JFrame("Pay Salary Form");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Slip Number");


l2=new JLabel("Date of Salary");
l3=new JLabel("Enter Employee Number");
l4=new JLabel("Name");
l5=new JLabel("Post");
l6=new JLabel("Department");
l7=new JLabel("Contact Number");
l8=new JLabel("Enter Salary");
l9=new JLabel("Enter Month Of Salary");

txtslipno=new JTextField(20);
txtdos=new JTextField(20);
txtempcode=new JTextField(20);
txtname=new JTextField(20);
txtpost=new JTextField(20);
txtdept=new JTextField(20);
txtcontact=new JTextField(20);
txtsalary=new JTextField(20);
txtmonth=new JTextField(20);

ok=new JButton("OK");
exit=new JButton("Exit");
pay=new JButton("Pay");
clear=new JButton("Clear");
ok.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);
pay.setBackground(Color.LIGHT_GRAY);
clear.setBackground(Color.LIGHT_GRAY);

frm.setLayout(new GridLayout(11,2));
frm.add(l1);
frm.add(txtslipno);
frm.add(l2);
frm.add(txtdos);
frm.add(l3);
frm.add(txtempcode);
frm.add(l9);
frm.add(txtmonth);
frm.add(ok);
frm.add(exit);
frm.add(l4);

i
frm.add(txtname);
frm.add(l5);
frm.add(txtpost);
frm.add(l6);
frm.add(txtdept);
frm.add(l7);
frm.add(txtcontact);
frm.add(l8);
frm.add(txtsalary);
frm.add(pay);
frm.add(clear);
ok.addActionListener(this);
exit.addActionListener(this);
pay.addActionListener(this);
clear.addActionListener(this);
frm.setBounds(300,200,400,400);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==ok)
{
int ecode;
try
{
ecode=Integer.parseInt(txtempcode.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from employeetable where
empcode="+ecode;
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
txtname.setText(res.getString("name"));
txtcontact.setText(res.getString("contact"));
txtdept.setText(res.getString("department"));
txtpost.setText(res.getString("post"));
}
else
{
JOptionPane.showMessageDialog(null,"Not
Found");
}
}
catch(Exception e1)

i
{}
}
else if(e.getSource()==pay)
{
int ecode;
try
{
int slipno,salary;
String dos,month;
slipno=Integer.parseInt(txtslipno.getText());
salary=Integer.parseInt(txtsalary.getText());
dos=txtdos.getText();
month=txtmonth.getText();
ecode=Integer.parseInt(txtempcode.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="insert into paytable values
("+slipno+",'"+dos+"',"+ecode+","+salary+",'"+month+"')";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Data Stored");
}
catch(Exception e2)
{JOptionPane.showMessageDialog(null,e2.getMessage());}
}
else if(e.getSource()==clear)
{
try
{
int eno=Integer.parseInt(txtempcode.getText());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="delete from paytable where empcode="+eno;
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Successfully
clear");
txtempcode.setText("");
txtname.setText("");
txtsalary.setText("");
txtpost.setText("");
txtdept.setText("");
txtcontact.setText("");
txtmonth.setText("");
}

i
catch(Exception e3)
{}
}
else
frm.dispose();
}
}

LIST OF EMPLOYEE
class ListEmployee
{
JFrame frm;
ListEmployee()
{
frm=new JFrame("List Of Employee");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.setSize(800,800);
frm.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
frm.getContentPane().setBackground(Color.pink);

JLabel l=new JLabel ("List of Employee");


l.setFont(new Font("Arial",Font.BOLD,15));
frm.add(l);
frm.show();
JTable jt=new JTable(0,10);
DefaultTableModel m=(DefaultTableModel)jt.getModel();
Object
head[]={"empcode","name","Gender","post","Dept","Address","salary","contact","age","
doj"};
m.addRow(head);
frm.add(jt);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from Employeetable";
ResultSet res=stmt.executeQuery(query);
while(res.next())
{
Object
newRow[]={res.getString("empcode"),res.getString("name"),res.getString("gender"),res.
getString("post"),res.getString("department"),res.getString("address"),res.getString("Sala
ry"),res.getString("contact"),res.getString("age"),res.getString("doj")};
m.addRow(newRow);
}
}

i
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage());}

}
}

LIST OF DEPARTMENT
class ListDepartment
{
JFrame frm;
ListDepartment()
{
frm=new JFrame("List Of Department");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.setSize(300,300);
frm.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
frm.getContentPane().setBackground(Color.pink);

JLabel l=new JLabel ("List of Department");


l.setFont(new Font("Arial",Font.BOLD,15));
frm.add(l);
frm.show();
JTable jt=new JTable(0,3);
DefaultTableModel m=(DefaultTableModel)jt.getModel();
Object head[]={"deptno","deptname","hod"};
m.addRow(head);
frm.add(jt);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from depttable";
ResultSet res=stmt.executeQuery(query);
while(res.next())
{
Object
newRow[]={res.getString("deptno"),res.getString("deptname"),res.getString("hod")};
m.addRow(newRow);
}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage());}

}
}

i
LIST OF SALARY
class ListSalary
{
JFrame frm;
ListSalary()
{
frm=new JFrame("List Of Salary");
frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.setSize(750,400);
frm.setLayout(new FlowLayout(FlowLayout.CENTER,10,10));
frm.getContentPane().setBackground(Color.pink);

JLabel l=new JLabel ("List of Salary");


l.setFont(new Font("Arial",Font.BOLD,20));
frm.add(l);
frm.show();
JTable jt=new JTable(0,9);
DefaultTableModel m=(DefaultTableModel)jt.getModel();
Object
head[]={"slipno","dos","empcode","name","post","dept","contact","salary","month"};
m.addRow(head);
frm.add(jt);
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select * from paytable";
ResultSet res=stmt.executeQuery(query);
while(res.next())
{
Object
newRow[]={res.getString("slipno"),res.getString("dos"),res.getString("empcode"),res.get
String("name"),res.getString("post"),res.getString("dept"),res.getString("contact"),res.get
String("salary"),res.getString("month")};
m.addRow(newRow);
}
}
catch(Exception e)
{JOptionPane.showMessageDialog(null,e.getMessage());}

}
}

CHANGE PASSWORD
class Changepswrd implements ActionListener
{

i
JFrame frm;
JPasswordField txtcurrent,txtnew,txtconfirm;
JLabel l1,l2,l3;
JButton verify,change,exit;

Changepswrd()
{

frm=new JFrame("Change Password");


frm.setDefaultCloseOperation(frm.EXIT_ON_CLOSE);
frm.getContentPane().setBackground(Color.pink);

l1=new JLabel("Current Password");


l2=new JLabel("New Password");
l3=new JLabel("Confirm Password");

verify=new JButton("Verify");
exit=new JButton("Exit");
change=new JButton("Change");
verify.setBackground(Color.LIGHT_GRAY);
change.setBackground(Color.LIGHT_GRAY);
exit.setBackground(Color.LIGHT_GRAY);

txtcurrent=new JPasswordField(20);
txtnew=new JPasswordField(20);
txtconfirm=new JPasswordField(20);

frm.setLayout(null);
l1.setBounds(50,50,150,30);
txtcurrent.setBounds(180,50,150,30);
verify.setBounds(120,100,100,30);
l2.setBounds(50,150,150,30);
txtnew.setBounds(180,150,150,30);
l3.setBounds(50,200,150,30);
txtconfirm.setBounds(180,200,150,30);
change.setBounds(50,250,100,30);
exit.setBounds(230,250,100,30);

frm.add(l1);
frm.add(txtcurrent);
frm.add(verify);
frm.add(l2);
frm.add(txtnew);
frm.add(l3);
frm.add(txtconfirm);
frm.add(change);
frm.add(exit);

i
verify.addActionListener(this);
exit.addActionListener(this);
change.addActionListener(this);
frm.setBounds(300,200,400,350);
frm.show();
}
public void actionPerformed(ActionEvent e)
{
if(e.getSource()==verify)
{
String password;
try
{
password=txtcurrent.getText();
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="select password from logintable where
password='"+password+"'";
ResultSet res=stmt.executeQuery(query);
if(res.next())
{
password.equals(query);
JOptionPane.showMessageDialog(null,"correct
password");
}
else
{
JOptionPane.showMessageDialog(null,"Not
Found");
}
}
catch(Exception e1)
{JOptionPane.showMessageDialog(null,e1.getMessage());}
}

else if(e.getSource()==change)
{
try
{
String changepswrd=txtnew.getText();
String confirmpswrd=txtconfirm.getText();
if(changepswrd.equals(confirmpswrd))
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

i
Connection
con=DriverManager.getConnection("jdbc:odbc:emp");
Statement stmt=con.createStatement();
String query="update logintable set
password='"+changepswrd+"'";
stmt.executeUpdate(query);
JOptionPane.showMessageDialog(null,"Password
Changed");
}
else
JOptionPane.showMessageDialog(null,"Password
mismatch");

}
catch(Exception e1)
{JOptionPane.showMessageDialog(null,e1.getMessage());}
}
else
frm.dispose();
}
}

i
CONCLUSION

After having completed this project, We felt that it was an excellent learning experience
as I deal with a real life project that give a opportunity to working for the students to
make their test more easy, while working on this project I got a good exposure to the
sharp programming skills and the various programming techniques while coding for this
system I was exposed to the vast knowledge about the strength and weakness of JAVA
language .

A part from this I have been able to appreciate the hard work of programmers spent in
developing such a system the most important realization was the amount of cooperation,
dedication, hardwork and team spirit that goes into making of a successful project.

i
BIBLOGRAPHY

The following are the books references that have been studied in the duration of making
of this project.

 Java 2 Black Book


 Microsoft office

WEB REFRENCES
www.google.com
www.wikipedia.com
www.studymafia.org

You might also like