officemanagementsystem (1)
DESCRIPTION
project report on Office ManagementTRANSCRIPT
Office Management System
1
Office ManagementSystem
Office Management System
2. Introduction
The Office Management System is the coordinator of the work system. An
office manager is responsible for planning, organization, and controlling the
clerical aspect of the organization, including the preparation,
communication, coordination and storage of item. Often they also engage in
marketing. Also, their tasks are to monitor the work processes and to
evaluate the outcome. The outcomes of work are intended for what can be
called the final receiving system, as for instance, client, customer, and other
departments.
Furthermore, their role is to coordinate on the front end by issuing various
assignments. They usually lead or manage a team of secretaries or
administrative clerks. And they take care of the assignment of tasks within
the department, but the more complex tasks tend to come to their desk.
2
Office Management System OBJECTIVE OF THE PROJECT
The main objectives of using Relational Database Management
System are as follows: -
1. CONTROL REDUNDANCY : The System should identify existence
of common data and avoid duplicate recording relationships of pointers
should be used to locate data which are used many times selective
redundancy is sometimes allowed to improve performance or far better
reliability.
2. DATA INTEGRITY : Consistency of data values and relationships
must be preserved in order to achieve this the system must ensure
validity of data by using good editing, synchronize updating and
propagating changes to other related data element it also involves
maintaining audit trails to enable recovery if errors are deleted.
3. DATA SECURITY : This is concerned with protecting access to data
protection is needed at many levels for access, modification, deletion or
display access restriction may be for individual data items or group of
items.
4. DATABASE PERFORMANCE : The system should be able to
provide timely information as required. The cost of storing and
retrieving the data should be commensurate with the value of
information provided.
3
Office Management System
5. MANAGEMENT CONTROL : As the dependence of an organization
on a data base increases positive management controls should be
exercised over addition, deletion, changes and disposition of data must
be protected to start legal accounting and auditing requirements.
Main Objectives are :-
Provide an innovative, cost efficient and effective Office
Management System.
Increase the quality and quantity of applicants applying for office
item.
Offer immediate cost savings on Office Management System with
substantial long term saving over a prolong period.
Dramatically reduce paper work and administrative work.
Streamline the Office Management System and reduce the corporate
overall item cycle.
4
Office Management System
PROPOSED SYSTEM
Proposed system is an automated Office Management System.
Through our software user can add members, add item, view free item, view
allot item, view return item in quick time. Our proposed system has the
following advantages.
User friendly interface
Fast access to database
Less error
More Storage Capacity
Search facility
Look and Feel Environment
Quick transaction
All the manual difficulties in managing the Office have been rectified by
implementing computerization.
5
Office Management System
AdvantageI have designed the given proposed system in the Java to automate the
process of Office . This project is useful for the authorities who keep track
of all the users registered in a particular state .The authority can add Item,
view item details, availability of Item, issue Item item list etc.
The following steps that give the detailed information of the need
ofproposed system are:
Performance: During past several decades, the records are supposed to be
manually handled for all activities. The manual handling of the record is
time consuming and highly prone to error. To improve the performance of
the Office Management System, the computerized system is to be
undertaken. This project is fully computerized and user friendly even that
any of the members can see the report and status of the company.
Efficiency: The basic need of this website is efficiency. The website should
be efficient so that whenever a new user submits his/her details the website
is updated automatically. This record will be useful for other users instantly.
Control: The complete control of the project is under the hands of
authorized person who has the password to access this project and illegal
access is not supposed to deal with. All the control is under the administrator
and the other members have the rights to just see the records not to change
any transaction or entry.
6
Office Management System
Security: Security is the main criteria for the proposed system. Since illegal
access may corrupt the database. So security has to be given in this project.
7
Office Management System
3. Category of the Project
This Project is coupled with material on how to use the various tool, sub sets
available in JAVA AND MY-SQL
The need of today’s software development is competence in a GUI based
front-end tool, which can connect to Relational Database engines. This gives
the programmer the opportunity to develop client server based commercial
applications.
These applications give users the power and ease of a GUI with the multi
user
Capabilities of WinNT based RDBMS engines such as MY-SQL.
All the important coding techniques used by programmers, in OOPS based
coding is brought out in full and in great detail.
.
8
Office Management SystemSoftware Design Specification
Architectural Design
Under architectural design, after defining the whole system into a set of
objectives & further subdividing them into functions, we defined the basic
dependency & communication between them.
This means that all the prime functions, their required inputs, expected
output/behavior & interdependency between other functions were clearly
defined. The corresponding interfaces for the user for each function were
designed to ensure user-friendliness.
We actually addressed the system-level problems here and made a conscious
effort to build a robust design which can result in an effective
communication within itself and with the system in terms of raw data or
processed information.
All the primary database design for data storage was also done in this phase.
Detailed Design
In this phase, we further subdivided every function into a set of modules &
defined required inputs & expected behavior for each of them. All the
minute correlations, interdependencies, communication between the
modules were clearly defined. The source, usage & processing of data for
every module was carefully done. The database design was also normalized
at this stage to ensure that the data is efficiently stored & retrieved.
9
Office Management System
Detailed design helped us to exactly concretize every problem into inputs &
outputs and visualize them in terms of their communication with each other.
We focused on interdependency & interoperability between the broken
modules here.
It was this design phase where the factors like user-friendliness ease of use,
scalability and self-explanation of interfaces & outputs were actually
realized. For all the modules, the placement of controls, passing of
information, communication of different interfaces, user messages, data
transfer to databases was defined.
10
Office Management System
Hardware and Software Specification
Hardware Specification
Minimum requirement for the Database server: -
Intel Pentium-4 1.8 GHz capable with Intel 512 DDR RAM,
100GB Hard Disk.
Minimum requirement for the User System: -
Intel Pentium IV Processor 512 MB RAM,
10GB Hard Disk,
Window XP/2000,
SOFTWARE Requirements
DATABASE – MY-SQL (5.0)
SOFTWARE DEVELOPMENT TOOLS –
J2EE, Java
Net Beans 6.9
OPERATING SYSTEM –Windows XP
11
Office Management System
Requirement & Analysis
Analysis is a detailed study of the various operations performed by a
system and their relationship within and outside of the system.
One aspect of analysis is defining the boundaries of the system and
determining whether or not user should consider other related systems.
During analysis, data are collected on the available files, decision points
and transactions handled by the present system. Data flow diagrams,
interviews, on site observations, questionnaires are the tools that are used in
analysis.
The interview is a commonly used tool in analysis. Once analysis is
completed, the analyst has a firm understanding of what is to be done.
Steps of System Analysis:—
System planning and the initial investigation
Information Gathering
The tools of Structured Analysis
Feasibility Study
Cost/Benefit Analysis
Requirement analysis and specification.
The success of the system depends largely on how accurately a problem
defined, thoroughly investigated, and properly carried out through the choice
of solution.
12
Office Management System
Problem Definition
I being Software Developer faced many problems for which I had to
search the net. But there was no information available in a single site. All the
information was scattered across the web and also some of the information
provided were quite vague and difficult to understand.
So I decided to build a website which will help all the IT professionals to
share accurate information and almost all the things among themselves so
that they don’t have to go searching for things in the internet.
Requirement Specification
During the requirements analysis phase, the development team analyzes
the requirements to be fulfilled by the KnowledgeConnect.com application
and identifies the probable approach for meeting these requirements. To
identify the requirements needed of the application the team decides to study
the existing Knowledge sharing websites and conduct extensive interviews
among potential IT professionals, developers. Finally, the team identifies
that the KnowledgeConnect.com application should:
Functional Requirements:
1. Enable a guest to register with the application after validation has
been performed on the data provided by the user
2. Enable Guests to perform activities like view answers, view
components, posted by developers etc.
3. Enable a registered user post answers to previously posted questions,
and post questions as well.
4. Enable registered users Search for a professional friend and view their
profile, add them as friend.
13
Office Management System5. Enable administrators to maintain user details and post technical
reviews.
6. Enable developer to post components and example source code which
can be used by user.
Technical Specifications:
1. Java is used to build the software.
2. J2EE, Java, J2ee and Java script are the languages used to build the
application.
3. Dream weaver CS-3 is used as GUI interface building tool.
4. MY-SQL is used as the backend database server.
5. The application is deployed under server.
14
Office Management System
Project Planning and Scheduling
The Concept:
Software project scheduling is an activity that distributes estimated
effort across the planned project duration by allocating the effort to specific
software engineering tasks. Every project has a deadline to complete. So,
software projects also have a deadline to meet. To complete a software
project within a time frame, proper scheduling should be done. In other
words, we can say that successful software projects are those that have been
successfully placed a schedule. A software project scheduling involves
plotting project activities against a time frame. So, the scheduling is about
developing a road map structure or a network based on analysis of the tasks
that must be performed to complete the projects. The schedule evolves over
time. During early stages of project planning, a microscopic schedule is
developed. This type of schedule identifies all major software-engineering
activities and the product functions to which they are applied. As the project
gets under way, each entry on the macroscopic schedule is refined into a
detailed schedule. Here, specific software tasks are identified and scheduled.
The scheduling objective is to define all project tasks, build a network that
depicts their interdependencies, identity the tasks that are critical within the
network, ant then track their progress to ensure that delay is recognized “
one Day at a time”. To accomplish this, the manager must have a schedule
that has been defined at a degree of resolution that enables the manager to
monitor progress and control the project.
15
Office Management System Pert & Gantt chart:
Program evaluation and review technique
(PERT) and critical path method are two project scheduling methods that are
applied to software development. Both techniques are driven by information
already developed in earlier project planning activities. Gantt charts are a
project control technique that can be used for several purposes, including
scheduling, budgeting and resources planning. A Gantt chart is a bar chart,
with each bar is proportional to the length of time planned for the activity.
Inter task dependencies cannot be shown using these techniques. PERT
charts show tasks inter dependencies directly. It is organized by events and
activities or tasks. PERT controls time and cost during the project and also
facilitate finding the right balance between completing a project on time and
completing it within the budget. In my project a set of tasks was performed
for the project development. The major identified Software Engineering
Tasks at software project development are as follows:
1. System Analysis
2. System Design
3. Software Development
4. Software Testing
5. Software Installation
6. Software Documentation
7. System Evaluation
The timeline chart of the above task set (Time Frame: 3 months 15 days) has
been prepared. The PERT Chart of the software development phase is also
prepared and is depicted in figure 1. It is based on the different modules
identified in the software.
16
Office Management System
Project Development Scheduling
PERT (Program Evaluation & Review Technique) Chart
17
Problem
Analysis
Analysis of the existing
Systems
Like the proposed
oneSelection
& Learning the s/w to be used
Under -standing Database
Coding
Page
Designing
Implementation
Evaluation
Testing
Day 1 – 5START
5 Days
Day 6–2015 Days
Day 21–4525 Days
Day 46–6015 Days
Day 61–8020 Days
Day 81–100
20 Days
Day 101–110
10 Days
Day 111–115
5 Days
Day 116– 120
5 Days
Office Management System
Gantt Chart
Gantt Chart is a project scheduling technique. Progress can be represented
easily in a Gantt chart, by coloring each milestone when completed. The
project will start in the month of August and end after 4 months at the end of
April.
System Study & Analysis
PRINCIPLES OF SYSTEM ANALYSIS
1. Understand the problem before you begin to create the analysis model.
2. Develop prototypes that enable a user to understand how human machine
interaction will occur.
3. Record the origin of and the reason for every requirement.
4. Use multiple views of requirements like building data, function and
behavioral models.
5. Work to eliminate ambiguity.
18
Feasibility
Analysis
Design
Development
Implementation
Maintenance
Analysis
Office Management System
ENTITY RELATIONSHIP DIAGRAM (ERD)
Entity – Relationship Diagram: This depicts relationship between data
objects.
The attribute of each data objects noted in the entity-relationship diagram
can be Described using a data object description. Data flow diagram serves
two Purposes:
1. To provide an indication of how data are transformed as they move
through the System.
2. To depict the functions that transformation the data flow.
Data Objects: A data object is a representation of almost any composite
information that must be understood by the software. By composite
information, we mean something that has a number of different properties or
attributes. A data object encapsulates data only there is no reference within a
data object to operations that act on the data.
Attributes: Attributes define the properties of a data object and take on one
of three different characteristics. They can be used to:
Name an instance of data object.
Describe the instance.
Make reference to another instance in other table.
Relationships: Data objects are connected to one another in a variety of
different ways. We can define a set of object relationship pairs that define
the relevant relationships.
19
Office Management System
CARDINALITY AND MODALITY:
Cardinality :
The data model must be capable of representing the number of occurrences
of objects in a given relationship. The cardinality of an object relationship
pair is :L
One-T0-One (1:1): An occurrence of object ‘A’ can relate to one and only
one occurrence of object ‘B’ and vice versa.
20
Office Management System
One-To-Many (1:N): One occurrence of object ‘A’ can relate to one or may
occurrences of object ‘B’ but an occurrence of object ‘B’ can relate to only
one occurrence of object ‘A’.
Many-To-Many (M: N): An occurrences of ‘B’ and an occurrence of ‘B’
can relate to one or many occurrence of ‘A’.
Modality:
The modality of a relationship is zero if there is no explicit need for the
relationship to occur or the relationship is optional. The Modality is one if
the occurrence of the relationship is mandatory.
The object relationship pair can be represented graphically using the Entity
Relationship Diagrams. A set of primary components are identified for the
Entity Relationship Diagram,
1. Attributes,
2. Relationships and
3. Various Type Indicators.
The primary purpose of the Entity Relationship Diagram is to represent
data objects and their relationships.
21
Office Management SystemCONTEXT LEVEL DFD
Office Management System
22
ITEM
ISSUE ITEM
USER
View Item Details
Office Management System
Office Management System
DATA FLOW DIAGRAM
23
Office Management System
24
USERDetail
Update Table
USER
File
1.3ISSUE ITEM
DETAILS
1.2 Get Details
DisplayForm
1. Assigning New
ITEM number
1.4 Update
Process
Office Management System
E-R DIAGRAM
25
Office Management System
Has
Registered Item
Item Details
Issue Item Details
Has
U_name
StatusDate
U_id
views
B_id S_id
B_Name Issue
Date
Office Management System
DATA TABLE
Data modeling define primary data objects, composition of each data object,
and attributes of the objects, relationship between each object and other
objects and between objects and the processes
ALLOT ITEM
26
Office Management SystemITEM MASTER
RECIVED DETAILS
27
Office Management System
28
Office Management System
Screen ShortLogin Page
Code
29
Office Management System/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* LoginPage.java
*
*/
package officemanagementsystem;
import javax.swing.JOptionPane;
/**
*
* @author Sivesh
*/
public class LoginPage extends javax.swing.JFrame {
/** Creates new form LoginPage */
public LoginPage() {
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
30
Office Management System */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jPanel2 = new javax.swing.JPanel();
jPanel3 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
txtusername = new javax.swing.JTextField();
txtpassword = new javax.swing.JPasswordField();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
setTitle("Login page");
setResizable(false);
jPanel1.setBackground(new java.awt.Color(204, 255, 204));
jPanel2.setBackground(new java.awt.Color(0, 102, 102));
jPanel3.setBackground(new java.awt.Color(51, 0, 51));
31
Office Management System jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 14));
jLabel1.setText("Username");
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 14));
jLabel2.setText("Password");
jButton1.setText("Login");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Cancel");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 24)); //
NOI18N
jLabel3.setForeground(new java.awt.Color(255, 255, 255));
jLabel3.setText("OFFICE MANAGEMENT SYSTEM");
javax.swing.GroupLayout jPanel3Layout = new
javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
32
Office Management System jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(24, 24, 24)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.LEADING)
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 376,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.G
roupLayout.Alignment.LEADING)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 74,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlace
ment.RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.G
roupLayout.Alignment.LEADING, false)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(jButton1)
.addGap(34, 34, 34)
.addComponent(jButton2))
.addComponent(txtpassword,
javax.swing.GroupLayout.DEFAULT_SIZE, 266, Short.MAX_VALUE)
33
Office Management System .addComponent(txtusername))))
.addContainerGap(30, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel3Layout.createSequentialGroup()
.addGap(40, 40, 40)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED, 39, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtusername,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtpassword,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
34
Office Management System .addGap(29, 29, 29)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.BASELINE)
.addComponent(jButton2)
.addComponent(jButton1))
.addGap(26, 26, 26))
);
javax.swing.GroupLayout jPanel2Layout = new
javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(141, 141, 141)
.addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(245, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel2Layout.createSequentialGroup()
35
Office Management System .addGap(134, 134, 134)
.addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(127, Short.MAX_VALUE))
);
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 10, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
36
Office Management System .addComponent(jPanel2,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
37
Office Management System private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose(); // TODO add your handling code here:
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
String username = txtusername.getText();
String password = txtpassword.getText();
if(username.equals("")){
JOptionPane.showMessageDialog(null, "Please enter your user name!");
txtusername.requestFocusInWindow();
return;
}
if(password.equals("")){
JOptionPane.showMessageDialog(null, "Please enter your password!");
txtpassword.requestFocusInWindow();
return;
}
if(username.equals("admin") && password.equals("admin"))
{
Home obj = new Home();
obj.setVisible(true);
this.dispose();
}// TODO add your handling code here:
else
{
JOptionPane.showMessageDialog(null, "Your user id or password is
wrong");
txtusername.requestFocusInWindow();
38
Office Management System}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LoginPage().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPasswordField txtpassword;
private javax.swing.JTextField txtusername;
// End of variables declaration
}
39
Office Management System
Home Page
40
Office Management System
CODE
/*
41
Office Management System * To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package officemanagementsystem;
/**
*
* @author Sony
*/
public class Home extends javax.swing.JFrame {
/**
* Creates new form Home
*/
public Home() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
42
Office Management System jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem6 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem5 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
jMenu4 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jMenuItem2 = new javax.swing.JMenuItem();
jMenuItem3 = new javax.swing.JMenuItem();
jMenu5 = new javax.swing.JMenu();
jMenuItem7 = new javax.swing.JMenuItem();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
setTitle("Home page");
jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/img/bbb.jpg"))); //
NOI18N
jPanel1.setBackground(new java.awt.Color(76, 139, 168));
43
Office Management System jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 36)); //
NOI18N
jLabel2.setForeground(new java.awt.Color(51, 0, 0));
jLabel2.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 984, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
.addContainerGap())
44
Office Management System );
jMenu1.setText("New Item");
jMenuItem6.setText("Enter New Item");
jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem6);
jMenuBar1.add(jMenu1);
jMenu2.setText("Item Allot");
jMenuItem5.setText("Allot a item");
jMenuItem5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem5ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem5);
jMenuBar1.add(jMenu2);
jMenu3.setText("Item Recieve");
45
Office Management System jMenuItem4.setText("Recieve a item");
jMenuItem4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem4ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem4);
jMenuBar1.add(jMenu3);
jMenu4.setText("Item Details");
jMenuItem1.setText("List of all free item");
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem1);
jMenuItem2.setText("List of all allot item");
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem2);
46
Office Management System jMenuItem3.setText("List of all recieve item");
jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem3ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem3);
jMenuBar1.add(jMenu4);
jMenu5.setText("Quit");
jMenuItem7.setText("Exit");
jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jMenu5.add(jMenuItem7);
jMenuBar1.add(jMenu5);
setJMenuBar(jMenuBar1);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
47
Office Management System
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addGap(237, 237, 237)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
48
Office Management System .addContainerGap())
);
pack();
}// </editor-fold>
private void jMenuItem7ActionPerformed(java.awt.event.ActionEvent
evt) {
this.dispose();
}
private void jMenuItem6ActionPerformed(java.awt.event.ActionEvent
evt) {
newItem ob = new newItem();
ob.setVisible(true);
}
private void jMenuItem5ActionPerformed(java.awt.event.ActionEvent
evt) {
allotItem ob = new allotItem();
ob.setVisible(true);
}
49
Office Management System private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent
evt) {
recieveItem ob = new recieveItem();
ob.setVisible(true);
}
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent
evt) {
try {
allFreeItem1 ob = new allFreeItem1();
ob.setVisible(true);
} catch (Exception e) {
}
}
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent
evt) {
try {
allAllotItem ob = new allAllotItem();
ob.show();
} catch (Exception e) {
}
}
private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent
evt) {
try {
allRecieveItem ob = new allRecieveItem();
50
Office Management System ob.show();
} catch (Exception e) {
}
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting
code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
51
Office Management System
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Home.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Home().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
52
Office Management System private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}
Add New Item
53
Office Management System
CODE
/*
54
Office Management System * To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package officemanagementsystem;
import java.sql.*;
import javax.swing.JOptionPane;
/**
*
* @author Sony
*/
public class newItem extends javax.swing.JFrame {
Connection con = null;
PreparedStatement ps = null;
int i = 0;
String sq = null;
/**
* Creates new form newItem
*/
public newItem() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
55
Office Management System * WARNING: Do NOT modify this code. The content of this method is
always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
txtItemNo = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
txtDate = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
comStatus = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
txtDesc = new javax.swing.JTextArea();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jLabel6 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
setTitle("Allot Item");
56
Office Management System
jPanel1.setBackground(new java.awt.Color(76, 139, 168));
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 36)); //
NOI18N
jLabel2.setForeground(new java.awt.Color(51, 0, 0));
jLabel2.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 990, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
57
Office Management System .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
.addContainerGap())
);
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel1.setText("Item No.");
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel3.setText("Description");
txtDate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtDateActionPerformed(evt);
}
});
jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel4.setText("Date");
jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel5.setText("Status");
58
Office Management System comStatus.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "Select..", "Free", "Allot", "Expire" }));
txtDesc.setColumns(20);
txtDesc.setRows(5);
jScrollPane1.setViewportView(txtDesc);
jButton1.setText("Save");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Back");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("Quit");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
59
Office Management System jLabel6.setText("dd/mm/yyyy");
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(220, 220, 220)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(94, 94, 94)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(jButton2)
.addGap(18, 18, 18)
.addComponent(jButton3))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel5))
60
Office Management System .addGap(103, 103, 103)
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(txtDate,
javax.swing.GroupLayout.PREFERRED_SIZE, 208,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37)
.addComponent(jLabel6))
.addComponent(comStatus,
javax.swing.GroupLayout.PREFERRED_SIZE, 208,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel3))
.addGap(62, 62, 62)
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 378,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtItemNo,
javax.swing.GroupLayout.PREFERRED_SIZE, 209,
javax.swing.GroupLayout.PREFERRED_SIZE))))
.addContainerGap())
);
61
Office Management System layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(40, 40, 40)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(txtItemNo,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
62
Office Management System .addComponent(jLabel4)
.addComponent(txtDate,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addGap(27, 27, 27)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel5)
.addComponent(comStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED, 43, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton3)
.addComponent(jButton2))
.addGap(32, 32, 32))
);
pack();
}// </editor-fold>
private void txtDateActionPerformed(java.awt.event.ActionEvent evt) {
63
Office Management System // TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
Home ob = new Home();
ob.show();
this.dispose(); // TODO add your handling code here:
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose(); // TODO add your handling code here:
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
sq = "insert into item(itemNo, itemDesc, itemDate, itemStatus)
values('"+txtItemNo.getText()+"','"+txtDesc.getText()
+"','"+txtDate.getText()+"','"+comStatus.getSelectedItem().toString()+"')";
try {
con = connection.makeCon.openDb();
ps = con.prepareStatement(sq);
i = ps.executeUpdate();
if(i>0){
JOptionPane.showMessageDialog(null, "Item Submited
Successfully!");
txtItemNo.setText("");
txtDesc.setText("");
txtDate.setText("");
64
Office Management System comStatus.setSelectedIndex(0);
}
else{
JOptionPane.showMessageDialog(null, "Item Not Submited
Successfully!");
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.toString());
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting
code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
65
Office Management System for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.l
ogging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
66
Office Management System public void run() {
new newItem().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JComboBox comStatus;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTextField txtDate;
private javax.swing.JTextArea txtDesc;
private javax.swing.JTextField txtItemNo;
// End of variables declaration
}
67
Office Management System
Allot Item
68
Office Management System
CODE
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package officemanagementsystem;
import java.sql.*;import javax.swing.JOptionPane;
/** * * @author Sony */public class allotItem extends javax.swing.JFrame {
Connection con = null; Statement st = null; ResultSet rs = null; PreparedStatement ps = null; PreparedStatement pss = null; int i = 0;
/** * Creates new form newItem */ public allotItem() { initComponents();
69
Office Management System }
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() {
jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); txtDate = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); txtDesc = new javax.swing.JTextArea(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); txtAllotTo = new javax.swing.JTextField(); jLabel6 = new javax.swing.JLabel(); comItemNo = new javax.swing.JComboBox(); txtStatus = new javax.swing.JTextField(); jLabel7 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Allot Item"); addWindowListener(new java.awt.event.WindowAdapter() { public void windowOpened(java.awt.event.WindowEvent evt) { formWindowOpened(evt); } });
jPanel1.setBackground(new java.awt.Color(76, 139, 168));
70
Office Management System
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 36)); // NOI18N jLabel2.setForeground(new java.awt.Color(51, 0, 0)); jLabel2.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 990, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE) .addContainerGap()) );
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel1.setText("Item No.");
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel3.setText("Description");
txtDate.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {
71
Office Management System txtDateActionPerformed(evt); } });
jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel4.setText("Allot Date");
jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel5.setText("Status");
txtDesc.setColumns(20); txtDesc.setRows(5); jScrollPane1.setViewportView(txtDesc);
jButton1.setText("Allot"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });
jButton2.setText("Back"); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } });
jButton3.setText("Quit"); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } });
txtAllotTo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtAllotToActionPerformed(evt); }
72
Office Management System });
jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N jLabel6.setText("Allot To");
comItemNo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select Item Number.." })); comItemNo.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { comItemNoActionPerformed(evt); } });
txtStatus.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { txtStatusActionPerformed(evt); } });
jLabel7.setText("dd/mm/yyyy");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addGap(220, 220, 220) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jLabel6) .addGap(103, 103, 103)
73
Office Management System .addComponent(txtAllotTo, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(94, 94, 94) .addComponent(jButton1) .addGap(18, 18, 18) .addComponent(jButton2) .addGap(18, 18, 18) .addComponent(jButton3)) .addComponent(jLabel3) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addComponent(jLabel5) .addComponent(jLabel1)) .addGap(88, 88, 88) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 378, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addComponent(txtDate, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(27, 27, 27) .addComponent(jLabel7)) .addComponent(comItemNo, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
74
Office Management System .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(40, 40, 40) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(comItemNo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel3) .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel4) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(txtDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel7))) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel6) .addComponent(txtAllotTo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
75
Office Management System .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel5) .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jButton1) .addComponent(jButton3) .addComponent(jButton2)) .addGap(32, 32, 32)) );
pack(); }// </editor-fold>
private void txtDateActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: }
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { Home ob = new Home(); ob.show(); this.dispose();// TODO add your handling code here: }
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { this.dispose(); // TODO add your handling code here: }
private void txtAllotToActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: }
private void formWindowOpened(java.awt.event.WindowEvent evt) { try {
76
Office Management System con = connection.makeCon.openDb(); st = con.createStatement(); rs = st.executeQuery("select itemNo from item where itemstatus = 'Free'"); while (rs.next()) { comItemNo.addItem(rs.getString(1).toString()); } Statement st1 = con.createStatement(); ResultSet rs1 = st1.executeQuery("select itemNo from item"); while (rs1.next()) { // comItemNo.addItem(rs1.getString(1).toString()); } } catch (Exception e) { } // TODO add your handling code here: }
private void comItemNoActionPerformed(java.awt.event.ActionEvent evt) { String ss = comItemNo.getSelectedItem().toString(); try { st = con.createStatement(); rs = st.executeQuery("select itemDesc, itemStatus from item where itemNo = '" + ss + "'"); if (rs.next()) { txtDesc.setText(rs.getString(1)); // comStatus.setSelectedItem(rs.getString(2).toString()); txtStatus.setText(rs.getString(2));
} } catch (Exception e) { //JOptionPane.showMessageDialog(null, e.toString()); } // TODO add your handling code here: }
private void txtStatusActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: }
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { String status = txtStatus.getText();
77
Office Management System if(status.equals("Free")){ try { String sql = "insert into allot(itemNo, description, allotdate, allotto,status) values('"+ comItemNo.getSelectedItem().toString()+"','"+ txtDesc.getText()+"','"+txtDate.getText()+"','"+txtAllotTo.getText()+"','Allot')"; ps = con.prepareStatement(sql); i = ps.executeUpdate(); if(i>0){ pss = con.prepareStatement("update item set itemstatus = 'Allot' where itemno = '"+comItemNo.getSelectedItem().toString()+"'"); int ii = pss.executeUpdate(); if(ii>0){ JOptionPane.showMessageDialog(null, "Item Alloted successfully"); comItemNo.setSelectedIndex(0); txtDesc.setText(""); txtDate.setText(""); txtAllotTo.setText(""); txtStatus.setText(""); } } } catch (Exception e) { JOptionPane.showMessageDialog(null, e.toString()); } } else{ JOptionPane.showMessageDialog(null, "This item is already alloted or expire"); }
}
/** * @param args the command line arguments */ public static void main(String args[]) { /* Set the Nimbus look and feel */ //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
78
Office Management System /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html */ try { for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (ClassNotFoundException ex) { java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(newItem.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold>
/* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new allotItem().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JComboBox comItemNo;
79
Office Management System private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; private javax.swing.JLabel jLabel7; private javax.swing.JPanel jPanel1; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextField txtAllotTo; private javax.swing.JTextField txtDate; private javax.swing.JTextArea txtDesc; private javax.swing.JTextField txtStatus; // End of variables declaration }
80
Office Management SystemRecived Item
Code
81
Office Management System
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package officemanagementsystem;
import java.sql.*;
import javax.swing.JOptionPane;
/**
*
* @author Sony
*/
public class recieveItem extends javax.swing.JFrame {
Connection con = null;
Statement st = null;
ResultSet rs = null;
PreparedStatement ps, pss = null;
String sql = null;
int i = 0;
/**
* Creates new form newItem
*/
public recieveItem() {
initComponents();
82
Office Management System }
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
txtAllotDate = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
txtAllotedPerson = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
txtRecieveDate = new javax.swing.JTextField();
jLabel7 = new javax.swing.JLabel();
txtStatus = new javax.swing.JTextField();
comItemNo = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
83
Office Management System jLabel8 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
setTitle("Recieve Item");
addWindowListener(new java.awt.event.WindowAdapter() {
public void windowOpened(java.awt.event.WindowEvent evt) {
formWindowOpened(evt);
}
});
jPanel1.setBackground(new java.awt.Color(76, 139, 168));
jLabel2.setFont(new java.awt.Font("Times New Roman", 1, 36)); //
NOI18N
jLabel2.setForeground(new java.awt.Color(51, 0, 0));
jLabel2.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
84
Office Management System .addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 913, Short.MAX_VALUE)
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2,
javax.swing.GroupLayout.DEFAULT_SIZE, 69, Short.MAX_VALUE)
.addContainerGap())
);
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel1.setText("Item No.");
txtAllotDate.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtAllotDateActionPerformed(evt);
}
});
jLabel4.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
85
Office Management System jLabel4.setText("Allot Date");
jLabel5.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel5.setText("Status");
jButton1.setText("Recieve");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jButton2.setText("Back");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jButton3.setText("Quit");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});
86
Office Management System txtAllotedPerson.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtAllotedPersonActionPerformed(evt);
}
});
jLabel6.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel6.setText("Alloted Person");
txtRecieveDate.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtRecieveDateActionPerformed(evt);
}
});
jLabel7.setFont(new java.awt.Font("Times New Roman", 1, 18)); //
NOI18N
jLabel7.setText("Recieve Date");
comItemNo.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "Select Item Number.." }));
comItemNo.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comItemNoActionPerformed(evt);
}
87
Office Management System });
jLabel3.setText("dd/mm/yyyy");
jLabel8.setText("dd/mm/yyyy");
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(220, 220, 220)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addComponent(jLabel6)
.addGroup(layout.createSequentialGroup()
.addGap(92, 92, 92)
.addComponent(jButton1)
.addGap(18, 18, 18)
.addComponent(jButton2)
.addGap(18, 18, 18)
.addComponent(jButton3))
88
Office Management System .addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(jLabel1)
.addComponent(jLabel4))
.addGap(89, 89, 89)
.addGroup(layout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.TRAILING, false)
.addComponent(txtStatus,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 209, Short.MAX_VALUE)
.addComponent(txtAllotDate,
javax.swing.GroupLayout.PREFERRED_SIZE, 208,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtAllotedPerson,
javax.swing.GroupLayout.PREFERRED_SIZE, 208,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(txtRecieveDate,
javax.swing.GroupLayout.PREFERRED_SIZE, 208,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(comItemNo,
javax.swing.GroupLayout.Alignment.LEADING, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addComponent(jLabel7))
89
Office Management System .addGap(31, 31, 31)
.addGroup(layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel8))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(40, 40, 40)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(comItemNo,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel5)
90
Office Management System .addComponent(txtStatus,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel4)
.addComponent(txtAllotDate,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(txtAllotedPerson,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(26, 26, 26)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel7)
.addComponent(txtRecieveDate,
javax.swing.GroupLayout.PREFERRED_SIZE,
91
Office Management Systemjavax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel8))
.addGap(52, 52, 52)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jButton1)
.addComponent(jButton3)
.addComponent(jButton2))
.addContainerGap(68, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void txtAllotDateActionPerformed(java.awt.event.ActionEvent
evt) {
// TODO add your handling code here:
}
private void
txtAllotedPersonActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void txtRecieveDateActionPerformed(java.awt.event.ActionEvent
evt) {
// TODO add your handling code here:
92
Office Management System }
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
Home ob = new Home();
ob.show();
this.dispose(); // TODO add your handling code here:
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose(); // TODO add your handling code here:
}
private void formWindowOpened(java.awt.event.WindowEvent evt) {
try {
con = connection.makeCon.openDb();
st = con.createStatement();
rs = st.executeQuery("select itemno from allot where status =
'Allot'");
while (rs.next()) {
comItemNo.addItem(rs.getString(1).toString());
}
} catch (Exception e) {
}
}
93
Office Management System private void comItemNoActionPerformed(java.awt.event.ActionEvent
evt) {
String ss = comItemNo.getSelectedItem().toString();
//if(txtStatus.getText().equals("Allot")){
try {
st = con.createStatement();
rs = st.executeQuery("select allotdate, allotto,status from allot where
itemNo = '" + ss + "' and status = 'Allot'");
if (rs.next()) {
txtStatus.setText("Allot");
txtAllotDate.setText(rs.getString(1));
txtAllotedPerson.setText(rs.getString(2));
}
} catch (Exception e) {
//JOptionPane.showMessageDialog(null, e.toString());
}
//}
//else{
//JOptionPane.showMessageDialog(null, "This item is not alloted to
anyone");
//}// TODO add your handling code here:
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
if(txtStatus.getText().equals("Allot")){
94
Office Management System try {
sql = "insert into recieve(itemno, allotdate, allotperson,
recievedate) values('"+
comItemNo.getSelectedItem().toString()+"','"+
txtAllotDate.getText()+"','"+
txtAllotedPerson.getText()+"','"+txtRecieveDate.getText()
+"')";
ps = con.prepareStatement(sql);
i = ps.executeUpdate();
if (i > 0) {
pss = con.prepareStatement("update item set itemstatus = 'Free'
where itemno = '" + comItemNo.getSelectedItem().toString() + "'");
PreparedStatement pss1 = con.prepareStatement("update allot
set status = 'Recieve' where itemno = '" +
comItemNo.getSelectedItem().toString() + "' and status = 'Allot'");
//pss = con.prepareStatement("update allot set status = 'Recieve'
where itemno = '" + comItemNo.getSelectedItem().toString() + "'");
pss1.executeUpdate();
int ii = pss.executeUpdate();
if (ii > 0) {
JOptionPane.showMessageDialog(null, "Item Recieved
successfully");
comItemNo.setSelectedIndex(0);
txtStatus.setText("");
txtAllotDate.setText("");
txtAllotedPerson.setText("");
txtRecieveDate.setText("");
95
Office Management System }
}
} catch (Exception e) {
JOptionPane.showMessageDialog(null, e.toString());
}
}
else{
JOptionPane.showMessageDialog(null, "This item is not alloted yet!");
}
// TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting
code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
96
Office Management System javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(recieveItem.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(recieveItem.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(recieveItem.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(recieveItem.class.getName()).log(java.ut
il.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new recieveItem().setVisible(true);
}
97
Office Management System });
}
// Variables declaration - do not modify
private javax.swing.JComboBox comItemNo;
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextField txtAllotDate;
private javax.swing.JTextField txtAllotedPerson;
private javax.swing.JTextField txtRecieveDate;
private javax.swing.JTextField txtStatus;
// End of variables declaration
}
98
Office Management System
List of Allot Item
99
Office Management System
Code
100
Office Management System/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* AllPurchaseBill.java
*
*/
package officemanagementsystem;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Vector;
/**
*
* @author Sivesh
*/
public class allAllotItem extends javax.swing.JFrame {
private Vector<Vector<String>> data;
private Vector<String> header;
/** Creates new form AllPurchaseBill */
public allAllotItem() throws Exception{
data = getEmployee();
header = new Vector<String>();
101
Office Management System header.add("ItemNo");
header.add("Description");
header.add("Date");
header.add("Alloted to person");
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton2 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
102
Office Management System
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
jPanel1.setBackground(new java.awt.Color(37, 197, 239));
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); //
NOI18N
jLabel1.setForeground(new java.awt.Color(255, 102, 0));
jLabel1.setText("LIST OF ALL ALLOTED ITEM");
jButton1.setText("BACK");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
data,header
));
jScrollPane1.setViewportView(jTable1);
jButton2.setText("EXIT");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
103
Office Management System });
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 48)); //
NOI18N
jLabel3.setForeground(new java.awt.Color(102, 0, 0));
jLabel3.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.G
roupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(283, 283, 283)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
104
Office Management System .addGap(333, 333, 333)
.addComponent(jButton1)
.addGap(46, 46, 46)
.addComponent(jButton2)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 102,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED)
.addComponent(jLabel1)
.addGap(25, 25, 25)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 357,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.BASELINE)
.addComponent(jButton1)
105
Office Management System .addComponent(jButton2))
.addContainerGap(16, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
106
Office Management System }// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Home obj = new Home();
obj.setVisible(true);
this.dispose();// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose(); // TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public Vector getEmployee()throws Exception
{
Vector<Vector<String>> employeeVector = new
Vector<Vector<String>>();
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/office", "root",
"root");
PreparedStatement pre = con.prepareStatement("select itemno,
description, allotdate, allotto from allot");
ResultSet rs = pre.executeQuery();
107
Office Management Systemwhile(rs.next())
{
Vector<String> employee = new Vector<String>();
employee.add(rs.getString(1)); //Empid
employee.add(rs.getString(2)); //name
employee.add(rs.getString(3)); //position
employee.add(rs.getString(4));
//employee.add(rs.getString(5));
//employee.add(rs.getString(6));
//employee.add(rs.getString(4)); //department
employeeVector.add(employee);
}
/*Close the connection after use (MUST)*/
return employeeVector;
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try
{
new allAllotItem().setVisible(true);
}
catch(Exception e)
{
e.printStackTrace();
}
108
Office Management System }
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration
}
List of Free Item
109
Office Management System
Code
110
Office Management System/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* AllPurchaseBill.java
*
*/
package officemanagementsystem;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Vector;
/**
*
* @author Sivesh
*/
public class allFreeItem1 extends javax.swing.JFrame {
private Vector<Vector<String>> data;
private Vector<String> header;
/** Creates new form AllPurchaseBill */
public allFreeItem1() throws Exception{
data = getEmployee();
header = new Vector<String>();
111
Office Management System header.add("ItemID");
header.add("ItemName");
header.add("ItemPrice");
header.add("CustomerName");
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton2 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
112
Office Management System
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
jPanel1.setBackground(new java.awt.Color(37, 197, 239));
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); //
NOI18N
jLabel1.setForeground(new java.awt.Color(255, 102, 0));
jLabel1.setText("LIST OF ALL ITEM");
jButton1.setText("BACK");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
data,header
));
jScrollPane1.setViewportView(jTable1);
jButton2.setText("EXIT");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
113
Office Management System });
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 48)); //
NOI18N
jLabel3.setForeground(new java.awt.Color(102, 0, 0));
jLabel3.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.G
roupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(283, 283, 283)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
114
Office Management System .addGap(333, 333, 333)
.addComponent(jButton1)
.addGap(46, 46, 46)
.addComponent(jButton2)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 102,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED)
.addComponent(jLabel1)
.addGap(25, 25, 25)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 357,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.BASELINE)
.addComponent(jButton1)
115
Office Management System .addComponent(jButton2))
.addContainerGap(16, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
116
Office Management System }// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Home obj = new Home();
obj.setVisible(true);
this.dispose();// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose(); // TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public Vector getEmployee()throws Exception
{
Vector<Vector<String>> employeeVector = new
Vector<Vector<String>>();
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/office", "root",
"root");
PreparedStatement pre = con.prepareStatement("select * from item ");
ResultSet rs = pre.executeQuery();
while(rs.next())
117
Office Management System{
Vector<String> employee = new Vector<String>();
employee.add(rs.getString(1)); //Empid
employee.add(rs.getString(2)); //name
employee.add(rs.getString(3)); //position
employee.add(rs.getString(4));
//employee.add(rs.getString(5));
//employee.add(rs.getString(6));
//employee.add(rs.getString(4)); //department
employeeVector.add(employee);
}
/*Close the connection after use (MUST)*/
return employeeVector;
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try
{
new allFreeItem1().setVisible(true);
}
catch(Exception e)
{
e.printStackTrace();
}
}
118
Office Management System });
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration
}
List of all Recived Item
119
Office Management System
Code
/*
120
Office Management System * To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* AllPurchaseBill.java
*
*/
package officemanagementsystem;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Vector;
/**
*
* @author Sivesh
*/
public class allRecieveItem extends javax.swing.JFrame {
private Vector<Vector<String>> data;
private Vector<String> header;
/** Creates new form AllPurchaseBill */
public allRecieveItem() throws Exception{
data = getEmployee();
header = new Vector<String>();
// header.add("ID");
121
Office Management System header.add("Item No");
//header.add("Description");
header.add("AllotDate");
header.add("Allot Person");
header.add("Recieve Date");
//header.add("");
initComponents();
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
jTable1 = new javax.swing.JTable();
jButton2 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
122
Office Management System
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOS
E);
jPanel1.setBackground(new java.awt.Color(37, 197, 239));
jLabel1.setFont(new java.awt.Font("Times New Roman", 1, 24)); //
NOI18N
jLabel1.setForeground(new java.awt.Color(255, 102, 0));
jLabel1.setText("LIST OF ALL RECIEVE ITEM");
jButton1.setText("BACK");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jTable1.setModel(new javax.swing.table.DefaultTableModel(
data,header
));
jScrollPane1.setViewportView(jTable1);
jButton2.setText("EXIT");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
123
Office Management System });
jLabel3.setFont(new java.awt.Font("Times New Roman", 1, 48)); //
NOI18N
jLabel3.setForeground(new java.awt.Color(102, 0, 0));
jLabel3.setText(" *OFFICE MANAGEMENT SYSTEM*");
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.LEADING)
.addComponent(jScrollPane1)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.G
roupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(283, 283, 283)
.addComponent(jLabel1))
.addGroup(jPanel1Layout.createSequentialGroup()
124
Office Management System .addGap(333, 333, 333)
.addComponent(jButton1)
.addGap(46, 46, 46)
.addComponent(jButton2)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 102,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED)
.addComponent(jLabel1)
.addGap(25, 25, 25)
.addComponent(jScrollPane1,
javax.swing.GroupLayout.PREFERRED_SIZE, 357,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.
RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.Group
Layout.Alignment.BASELINE)
.addComponent(jButton1)
125
Office Management System .addComponent(jButton2))
.addContainerGap(16, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING
)
.addComponent(jPanel1,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
);
pack();
126
Office Management System }// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Home obj = new Home();
obj.setVisible(true);
this.dispose();// TODO add your handling code here:
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
this.dispose(); // TODO add your handling code here:
}
/**
* @param args the command line arguments
*/
public Vector getEmployee()throws Exception
{
Vector<Vector<String>> employeeVector = new
Vector<Vector<String>>();
Class.forName("java.sql.Driver");
Connection con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/office", "root",
"root");
PreparedStatement pre = con.prepareStatement("select itemno, allotdate,
allotperson, recievedate from recieve");
ResultSet rs = pre.executeQuery();
127
Office Management Systemwhile(rs.next())
{
Vector<String> employee = new Vector<String>();
employee.add(rs.getString(1)); //Empid
employee.add(rs.getString(2)); //name
employee.add(rs.getString(3)); //position
employee.add(rs.getString(4));
//employee.add(rs.getString(5));
//employee.add(rs.getString(6));
//employee.add(rs.getString(4)); //department
employeeVector.add(employee);
}
/*Close the connection after use (MUST)*/
return employeeVector;
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
try
{
new allRecieveItem().setVisible(true);
}
catch(Exception e)
{
e.printStackTrace();
}
128
Office Management System }
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel3;
private javax.swing.JPanel jPanel1;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JTable jTable1;
// End of variables declaration
}
Scope of Future Application
This project can be used in the office after adding some more useful modules
in the Project for which Office Management System are providing services.
Utmost care and back-up procedures must be established to ensure 100%
successful Implementation of the computerized Office system. In case of
system failure, the organization should be in a position to process the
transaction with another organization or if the worst comes to the worst, it
should be in a position to complete it manually.
129
Office Management System
Scope of Improvement
Now a days Office Management System are providing many other facilities,
this project can also be improved with the improvement in the Office
System.
Utmost care and back-up procedures must be established to ensure 100%
successful Implementation of the computerized office system. In case of
system failure, the Organization should be in a position to process the
130
Office Management Systemtransaction with another organization Or if the worst comes to the worst, it
should be in a position to complete it manually.
131
Office Management System
CONCLUSION
Our project is only a humble venture to satisfy the needs in a
Office . Several user friendly coding have also adopted. This package
shall prove to be a powerful package in satisfying all the requirements of
the organization.
The objective of software planning is to provide a frame work that
enables the manger to make reasonable estimates made within a
limited time frame at the beginning of the software project and should be
updated regularly as the project progresses. Last but not least it is no the
work that played the ways to success but ALMIGHTY
132
Office Management System
BIBLIOGRAPHY
ITEMS REFERRED
The following Items were used extensively for the project development
and implementation.
1.”The Complete Reference Java2” Tata McGraw-Hill publishing
Company Limited. By Herbert Schildt.
2. “Software Engineering, A Practitioner’s Approach” Tata McGraw-Hill
Publishing Company Limited. By Roger S. Pressman.
3. “PL/SQL”. By Ivan Bayross.
WEBSITES REFERRED
The following links were searched and exploited extensively for the
project development and implementation.
1. http://www.java.sun.com/products\java
2. http://www.jakarta.apache.org
3. http://www.javaworld.com/
4. http://www.java2s.com/
133