0% found this document useful (0 votes)
15 views12 pages

AJP Microproject

The Employee Management System (EMS) is a Java-based application designed to manage employee records efficiently, allowing administrators to add, update, and delete employee details. It utilizes JDBC for database connectivity and features a user-friendly interface to enhance user experience. The system aims to streamline employee management processes, reduce errors, and ensure data consistency within organizations.

Uploaded by

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

AJP Microproject

The Employee Management System (EMS) is a Java-based application designed to manage employee records efficiently, allowing administrators to add, update, and delete employee details. It utilizes JDBC for database connectivity and features a user-friendly interface to enhance user experience. The system aims to streamline employee management processes, reduce errors, and ensure data consistency within organizations.

Uploaded by

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

Employee Management System Ashokrao Mane Polytechnic

1. Report

1.1) Abstract

The Employee Management System (EMS) is a robust application designed to streamline


the management of employee records and processes within an organization. Built using
Advanced Java technologies, the system integrates object-oriented programming principles,
JDBC (Java Database Connectivity) for enhanced functionality and scalability. In this project
the administrator can add, update and delete the employee details. The system employs a
relational database for data storage, ensuring data consistency and integrity. Advanced Java
features enable dynamic content generation and seamless integration with third-party services.
Additionally, the system is designed with a responsive and user-friendly interface to enhance
user experience.

1.2) Title

Employee management System Using Advanced Java Programming.

1.3) Introduction

Employee management is a critical aspect of any organization, as it directly influences


operational efficiency and organizational growth. Traditional methods of managing employee
data and processes are often time-consuming, prone to errors, and lack scalability. To address
these challenges, an Employee Management System (EMS) developed using Advanced Java
provides a comprehensive and automated solution for managing employee-related operations.
The system is designed to cater to the needs of various user roles within an organization,
including administrators, HR personnel, and employees. It enables administrators to handle
tasks like adding new employee, updating employee details and deleting the employee details.

1.4) Course Outcomes Integrated

a) Develop programs using GUI Framework(AWT and Swing).


b) Handle events of AWT and Swing components
c) Develop programs to handle events in Java Programming
d) Develop programs using database

1|Pa ge
Employee Management System Ashokrao Mane Polytechnic

1.5) Resources Used

Sr. No. Name of Resource Specification Quantity Remark

1 Computer Windows 10, 4 GB RAM 1 -

2 Notepad Editor 1 -

3 Internet Google - -

4 Book Advanced Java 1 -


Text Book

1.6) Actual Procedure Followed

 Understand the Work


 Taking references from Book and Internet
 Actual time of Writing Program Execution of a Program/ Generating Output
 Preparing the Project Report
 Submission of Project

1.7) Output of Microproject

Organize ideas in systematic, Logical and Coherent Manner. It helps me to deal with the
errors. It’s also helps me to get knowledge to event handling and solve the problems in Java
Programming. This Micro Project is expected to develop Employee Management System. The
output of the program is attached at the end of this project.

1.8) Skill Developed

 Problem-Solving & Algorithmic Thinking


 Event Handling in Java Programming
 Computational Thinking
 Time Management & Project Organization

2|Pa ge
Employee Management System Ashokrao Mane Polytechnic

2. Actual Implementation of Program

2.1) Algorithm

Step 1 :- Start
Step 2:- Display the main menu with the following options:
1) Create Employee
2) Update Employee
3) Delete Employee
4) Exit
Step 3:- Based on the user’s choice, perform the following actions:
Option 1: Create Employee
 Input the new employee details ( Name, Employee ID, Department, Designation,
Contact Info, etc.)
 Validate the input ensure that all required fields are filled.
 Save employee details to the database using an SQL INSERT query.
 Display a success message: "Employee added successfully."
Option 2: Update Employee
 Input the Employee ID of the employee to be updated.
 Fetch the existing record from the database. If the record does not exist, display an
error message and return to step 4.
 Display the current details and prompt the user for updated values.
 Validate the updated data.
 Save the changes to the database using an SQL UPDATE query.
 Display a success message: "Employee updated details successfully."
Option 3: Delete Employee
 Input the Employee ID of the employee to be deleted.
 Check if the record exists in the database. If the record does not exist, display an
error message and return to step 4.
 Delete the employee record using an SQL DELETE query.
 Display a success message: "Employee details deleted successfully."
Option 4: Exit
 Terminate the program.
Step 4:- Return to the main menu (step 2) after completing any operation.
Step 5:- End

3|Pa ge
Employee Management System Ashokrao Mane Polytechnic

2.1) Flowchart

Start

Main Menu

Option 1 Create Employee

Option 2 Update Employee

Option 3 Delete Employee

Option 4 Exit

End

4|Pa ge
Employee Management System Ashokrao Mane Polytechnic

2.3) Program Code

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;

public class EmployeeManagementSystem extends JFrame {


private List<Employee> employees = new ArrayList<>();
private JPanel mainPanel;
private CardLayout cardLayout;

// Constructor
public EmployeeManagementSystem() {
setTitle("Employee Management System");
setSize(600, 400);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setLocationRelativeTo(null);

cardLayout = new CardLayout();


mainPanel = new JPanel(cardLayout);

mainPanel.add(getWelcomePage(), "Welcome");
mainPanel.add(getCreateEmployeePage(), "Create");
mainPanel.add(getUpdateEmployeePage(), "Update");
mainPanel.add(getDeleteEmployeePage(), "Delete");

add(mainPanel);
setVisible(true);
}

// Welcome Page
private JPanel getWelcomePage() {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());

JLabel welcomeLabel = new JLabel("Welcome to Employee Management System", Label.CENTER);

5|Page
Employee Management System Ashokrao Mane Polytechnic

welcomeLabel.setFont(new Font("Arial", Font.BOLD, 18));


panel.add(welcomeLabel, BorderLayout.CENTER);
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new FlowLayout());

JButton createBtn = new JButton("Create Employee");


JButton updateBtn = new JButton("Update Employee");
JButton deleteBtn = new JButton("Delete Employee");

createBtn.setPreferredSize(new Dimension(150, 30));


updateBtn.setPreferredSize(new Dimension(150, 30));
deleteBtn.setPreferredSize(new Dimension(150, 30));

createBtn.addActionListener(e -> cardLayout.show(mainPanel, "Create"));


updateBtn.addActionListener(e -> cardLayout.show(mainPanel, "Update"));
deleteBtn.addActionListener(e -> cardLayout.show(mainPanel, "Delete"));

buttonPanel.add(createBtn);
buttonPanel.add(updateBtn);
buttonPanel.add(deleteBtn);

panel.add(buttonPanel, BorderLayout.SOUTH);
return panel;
}

// Create Employee Page


private JPanel getCreateEmployeePage() {
JPanel panel = new JPanel(new GridLayout(5, 2, 10, 10));

JLabel nameLabel = new JLabel("Name:");


JLabel idLabel = new JLabel("ID:");
JLabel addressLabel = new JLabel("Address:");

JTextField nameField = new JTextField();


JTextField idField = new JTextField();
JTextField addressField = new JTextField();

JButton saveBtn = new JButton("Save");


JButton backBtn = new JButton("Back");

6|Page
Employee Management System Ashokrao Mane Polytechnic

saveBtn.setPreferredSize(new Dimension(100, 30));


backBtn.setPreferredSize(new Dimension(100, 30));

panel.add(nameLabel);
panel.add(nameField);
panel.add(idLabel);
panel.add(idField);
panel.add(addressLabel);
panel.add(addressField);
panel.add(saveBtn);
panel.add(backBtn);

saveBtn.addActionListener(e -> {
String name = nameField.getText();
String id = idField.getText();
String address = addressField.getText();

if (!name.isEmpty() && !id.isEmpty() && !address.isEmpty()) {


employees.add(new Employee(name, id, address));
JOptionPane.showMessageDialog(this, "Employee added successfully!");
nameField.setText("");
idField.setText("");
addressField.setText("");
} else {
JOptionPane.showMessageDialog(this, "All fields are required.");
}
});

backBtn.addActionListener(e -> cardLayout.show(mainPanel, "Welcome"));


return panel;
}

// Update Employee Page


private JPanel getUpdateEmployeePage() {
JPanel panel = new JPanel(new GridLayout(5, 2, 10, 10));
JLabel idLabel = new JLabel("Enter ID:");
JLabel nameLabel = new JLabel("New Name:");
JLabel addressLabel = new JLabel("New Address:");

7|Page
Employee Management System Ashokrao Mane Polytechnic

JTextField idField = new JTextField();


JTextField nameField = new JTextField();
JTextField addressField = new JTextField();

JButton updateBtn = new JButton("Update");


JButton backBtn = new JButton("Back");

updateBtn.setPreferredSize(new Dimension(100, 30));


backBtn.setPreferredSize(new Dimension(100, 30));

panel.add(idLabel);
panel.add(idField);
panel.add(nameLabel);
panel.add(nameField);
panel.add(addressLabel);
panel.add(addressField);
panel.add(updateBtn);
panel.add(backBtn);

updateBtn.addActionListener(e -> {
String id = idField.getText();
String newName = nameField.getText();
String newAddress = addressField.getText();

for (Employee emp : employees) {


if (emp.getId().equals(id)) {
emp.setName(newName);
emp.setAddress(newAddress);
JOptionPane.showMessageDialog(this, "Employee updated successfully!");
return;
}
}

JOptionPane.showMessageDialog(this, "Employee with ID not found.");


});
backBtn.addActionListener(e -> cardLayout.show(mainPanel, "Welcome"));
return panel;
}

8|Page
Employee Management System Ashokrao Mane Polytechnic

// Delete Employee Page


private JPanel getDeleteEmployeePage() {
JPanel panel = new JPanel(new GridLayout(5, 2, 10, 10));

JLabel idLabel = new JLabel("Enter ID:");


JLabel idLabel1 = new JLabel(" ");
JLabel idLabel2 = new JLabel(" ");
JLabel idLabel3 = new JLabel(" ");
JLabel idLabel4 = new JLabel(" ");

JTextField idField = new JTextField();

JButton deleteBtn = new JButton("Delete");


JButton backBtn = new JButton("Back");

deleteBtn.setPreferredSize(new Dimension(100, 30));


backBtn.setPreferredSize(new Dimension(100, 30));

panel.add(idLabel1);
panel.add(idLabel2);
panel.add(idLabel);
panel.add(idField);
panel.add(idLabel3);
panel.add(idLabel4);

panel.add(deleteBtn);
panel.add(backBtn);

deleteBtn.addActionListener(e -> {
String id = idField.getText();
for (Employee emp : employees) {
if (emp.getId().equals(id)) {
employees.remove(emp);
JOptionPane.showMessageDialog(this, "Employee details deleted successfully!");
return;
}
} JOptionPane.showMessageDialog(this, "Employee with ID not found.");
});

9|Page
Employee Management System Ashokrao Mane Polytechnic

backBtn.addActionListener(e -> cardLayout.show(mainPanel, "Welcome"));


return panel;
}
// Main Method
public static void main(String[] args) {
SwingUtilities.invokeLater(EmployeeManagementSystem::new);
}
}

// Employee Class
class Employee {
private String name;
private String id;
private String address;
public Employee(String name, String id, String address) {
this.name = name;
this.id = id;
this.address = address;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}

10 | P a g e
Employee Management System Ashokrao Mane Polytechnic

3. Output of microproject
3.1) Output

 Create Employee Module :-

 Update Employee Details Module :-

11 | P a g e
Employee Management System Ashokrao Mane Polytechnic

 Delete Employee Details Module :-

4. Conclusion

The Employee Management System developed using Advanced Java offers an efficient,
scalable, and secure solution for managing employee records and streamlining organizational
processes. By incorporating features such as dynamic content handling, database integration,
and user role management, the system simplifies complex tasks like adding, updating, and
deleting employee information. This system not only reduces manual effort but also
minimizes errors and ensures data consistency across operations.

12 | P a g e

You might also like