Professional Documents
Culture Documents
Final Project
Final Project
Final Project
HOTEL BILLING
SYSTEM
INTRODUCTION
also called information era. In this era one very important device
that has played very crucial role is computer system. Because of the
BILLING SYSTEM”.
accessing of data.
future.
OBJECTIVES
The objective of the project is making the existing system
receiving of instructions.
software.
INTRODUCTION OF ORGANIZATION
Hotel Windsor is a service provider for Hotel & Restaurant
on the growth chart and setting very high quality standards. They
* Tandoor Menu includes Kebabs, fish, and paneer items. There are
etc.
* Indian cuisine menu has a vast variety, with veggies, rice dishes,
* Fruit Salads
* Raita
* Breakfasts
* Snacks
* Ice creams
* Beverages
* Sweets
* Food packets
PROJECT CATEGORY
FRONT-END: Java
1)Simple
Java was designated to be very simple and easy to learn. The
syntax of Java has been kept nearer to C++ so that the usage of
Java does not require extensive training programs to be
undertaken. However, in Java the infrequently used, complex
features of C++ have not been included.
2) Object Oriented
Simply stated, object oriented design is a technique that
focuses design on the data and on the interfaces rather than
modularization of the functionalities or the tools used to develop
them. Java uses object-oriented concepts as for basis for S/W
design. Java provides a clean and efficient object-based
development platform.
3) Robust
The multi-platform environment of the web places high
demand on the reliability of the program to execute on a variety of
systems. Thus, high priority has been given to create robust and
highly reliable programs in the design of Java. It provides extensive
compile-time checking followed by a second level of runtime
checking. The most common problems in programming languages
are related to memory management and exception handling.
4) Secure
Java is designed to be used in networked and distributed
environments where security is of paramount importance. Java
supports the creation of applications that cannot be invaded from
outside. On the other side, Java programs are executed in their own
environment and do not go outside these boundaries unless They
are authorized to do so. The authentication techniques are based on
the public key encryption method.
5) Architecture Neutral
Java was designed to support applications on heterogeneous
network environments composed of a variety of processors, the
operating system architectures, and multiple programming
language interfaces. To enable a Java application to execute
anywhere on the network, the Java compiler generates the
bytecode instructions which are not dependent upon a particular
OVERVIEW OF RDBMS
The project work entitled "HOTEL BILLING SYSTEM” is able to
fully automate system. Hence before discussing anything about
the project, a brief discussion of the related basic concepts is
necessary.
As a software developer or as a programmer, we are expected to
design and develop every program that works correctly,
efficiently and at the same time easy to use by any person who
may or may not be well versed with the computer and its
capabilities. The application programs written in any language
must be such that the user of that program should find it
extremely friendly in the sense that not much effort is should be
required on the part of the user to understand and use the
application. The package should be user friendly.
be done well.
PLATFORM
H/W SPECIFICATION
PROCESSOR : PANTIUM - IV
RAM : 1 GB
HDD : 40 GB
details.
ANALYSIS
there was always need for a kind of software which can fulfill
Preliminary Investigation:
Since all the works are done manually, that’s why there is
more time requires for little job. Always there is queue of customers
(clients) waiting for their turn. The simple work looks like
Feasibility Study:
Technical Feasibility:
organization has expertise to use it. In this case a totally new setup
Economic Feasibility:
benefits that will come from a new system. Such calculations are
Operational Feasibility:
that case it will necessary to verify all the rest feasibility of the
Linear Sequential Model has been used in carrying out this project
work. The Linear Sequential Model is the oldest and the most widely
Support.
This system view is essential when software must interact with other
Design: -
Code Generation: -
mechanistically.
Testing: -
Once code has been generated, program testing begins. The testing
all statements have been tested and on the functional externals, that
is, conducting tests to uncover errors and ensure that defined input
Design &
Specification
Coding
Module Testing
Integration
System Testing
System Design
designing phase.
Design Objectives
A. Practicality:
average intelligence.
B. Efficiency:
system output.
C. Cost:
D. Flexibility:
E. Security:
This is very important aspect of the design and should cover areas of
system.
Design Constraints
A) Hardware:
B) Software:
C) Budget:
The budget allocated for the project will affect the scope and
depth of design.
D) Time-Scale:
The new system may be required by a particular time (e.g. the start
The new system may require some data from another computerized
system or may provide data to another system in which case the files
must be compatible in the format and the system must operate with
management.
Be handled.
design process:
i) Output Design: -
of output.
Once the output requirements have been finalized, the next step
to be introduced.
Once the input data is captured in the system, these may have to
these files.
Computer procedure.
Non-computer procedure.
v) Control Design:
etc. This will ensure that the system is functioning as per plan.
Input Design
The design of input play very significant role in getting the correct
input design is the link that ties the information system into the
Avoiding delay.
are: -
Output Design
computer technology.
There are three main reasons why outputs from the computer are
required.
our project better. They guide us to move forward in right way and
help in dealing with the subject of the project. The data flow
a system’s data and how the processes transform the data is known
as data flow diagram. In other’s word we can say that data flow
system‘s data and how the data interacts with the system.
system’s data.
.These rules helps us to get obvious and error free data flow
other.
name.
2.0
Bill Report Restaurant Menu Item Report Database
ModuleThe customer information of Hotel Samrat
First Level
3.0DFD
Emp
module Database
4.0
Database
SUBMITTED BY:-DEEPSHIKHA VERMA Report
27
Module
HOTEL BILLING SYSTEM
Hotel
Billing
Store
System Room
Retrieval
Room Report
Store
Emp
Guest/emp Retrieval
Managemen Store
Retrieval Guest
t
The Guest
The Emp
report
report
for hotel
E-R Diagrams
Room
Room_Typ no
e Floor_n
o
Remark
Room s
Total
Restaurant date
Name
Emp_id Address
Dob
Total Rbill_i
has Employee
d
Doj
Restaurant_bill
Mob_no Basicion
has
Total_salary
Typ
Menu Item e
Name Charge
Menu_id
into different modules and they will interact with each other to
Guest
Rooms
Employee
Guest_bill
Restaurant_bill
Menu_detail
Guest Module ( )
Through the user can maintain the database of all Guest information
Rooms Module ( )
Through the user can maintain the database of all rooms details and
its charges.
Emp Module ( )
Reports module ()
Exit Module ( )
Through this module user can stop the package where they
are doing their work and maintain all the information regarding
1. Admin_Login
3. Guest_details
4. Guest_bill_details
5. Menu details
6. Restaurant_bill_details
7. Employee details
Field Name Data Type Width Constraints
Emp_id Varchar2 10 Primary key
Emp_name Varchar2 20 Not null
Dob Date Not null
Doj Date Not null
Address Varchar2 20 Not null
Mob_no Number 10 Not null
Basic_salary Number 8,2 Not null
TA Number 8,2 Not null
DA Number 8,2 Not null
HRA Number 8,2 Not null
Total Number 8,2 Not null
Windsor, patna.
The Operator can easily insert, update, and delete the entry for
logon to the system after going through user name and password
Master Information
Room Details
Guest Details
Emp Details
Menu Details
Transaction
Restaurant_bill
Guest_bill
Output
The output and the report for the HOTEL BILLING SYSTEM here will
1. Guest Details
2. Bill Detail
3. Room Detail
4. Menu_item Detail
5. Facility of Room
6. Booked Room
7. Available Room
8. Report of Bill
CODING
Connection Coding
package connection;
import java.sql.*;
con=DriverManager.getConnection(“jdbc:odbc:hotel”,”billing”,”system
");
System.out.println("connection created");
}
catch(Exception e)
{}
return con;
}
Welcome Form
package hms;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addContainerGap(105, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(90, 90, 90))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(13, 13, 13)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 43,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(jLabel5)
.addGap(23, 23, 23)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btncontinue)
.addComponent(btncancel))
.addGap(108, 108, 108))
);
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 399,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>
private void
btncontinueActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for open login form
login sc=new login();
dispose();
sc.show();
}
Security Form
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jFrame1Layout.setVerticalGroup(
jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jFrame2Layout.setVerticalGroup(
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
.
addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(txtusr_id,
javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
.addComponent(txtusr_pwd)))
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel1Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jLabel1)))
.addGap(26, 26, 26))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(btnlogin,
javax.swing.GroupLayout.PREFERRED_SIZE, 94,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btncancel)
.addContainerGap())))
);
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btncancel)
.addComponent(btnlogin))
.addGap(101, 101, 101))
);
);
pack();
}// </editor-fold>
}
else
{
JOptionPane.showMessageDialog(null,"invalid user name and
password");
}
}
catch(Exception e)
{}
}
private void btncancelActionPerformed(java.awt.event.ActionEvent
evt) {
// Coding for cancel
dispose();
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new login().setVisible(true);
}
});
} // Variables declaration - do not modify
private javax.swing.JButton btncancel;
private javax.swing.JButton btnlogin;
private javax.swing.JFrame jFrame1;
private javax.swing.JFrame jFrame2;
private javax.swing.JFrame jFrame3;
private javax.swing.JFrame jFrame4;
private javax.swing.JFrame jFrame5;
private javax.swing.JFrame jFrame6;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField txtusr_id;
private javax.swing.JPasswordField txtusr_pwd;
// End of variables declaration
}
Menu Form
Coding
package hms;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jMenu1.setText("MASTER");
jMenuItem1.setText("Employee");
jMenuItem1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);
jMenuItem2.setText("Room_details");
jMenuItem2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem2);
jMenuItem11.setAccelerator(javax.swing.KeyStroke.getKeyStroke(jav
a.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
jMenuItem11.setText("Exit");
jMenuItem11.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem11ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem11);
jMenuBar1.add(jMenu1);
jMenu2.setText("GUEST");
jMenuItem5.setText("guest_details");
jMenuItem5.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem5ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem5);
jMenuItem6.setText("menu_details");
jMenuItem6.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem6);
jMenuBar1.add(jMenu2);
jMenu3.setText("BILL");
jMenuItem7.setText("guest_bill_details");
jMenuItem7.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem7);
jMenuItem8.setText("restaurent_bill_details");
jMenuItem8.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem8);
jMenuBar1.add(jMenu3);
jMenu4.setText("REPORT");
jMenuItem9.setText("Restaurant_bill");
jMenuItem9.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem9ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem9);
jMenuItem10.setText("Guest_bill");
jMenuItem10.addActionListener(new
java.awt.event.ActionListener() {
jMenuBar1.add(jMenu4);
jMenu5.setText("HELP");
jMenuBar1.add(jMenu5);
setJMenuBar(jMenuBar1);
pack();
}// </editor-fold>
private void
jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for exit
dispose();
}
private void
jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open employee_details form
employee_details emp=new employee_details();
emp.show();
}
private void
jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for open room_details form
room_details rm=new room_details();
rm.show();
}
private void
jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open reception_details form
reception_details rd=new reception_details();
rd.show();
}
private void
jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open registration form
registration rg=new registration();
rg.show();
}
private void
jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open guest_details form
guest_details gd=new guest_details();
gd.show();
}
private void
jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open menu_details form
menu_details md=new menu_details();
md.show();
}
private void
jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open guest_bill_details form
guest_bill_details gbd=new guest_bill_details();
gbd.show();
}
private void
jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open restaurant_bill_details form
restaurent_bill_details rbd=new restaurent_bill_details();
rbd.show();
}
private void
jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open restaurant_bill_report
Restaurant_bill res=new Restaurant_bill();
res.show();
}
private void
jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open guest_bill_report
Guest_bill gb=new Guest_bill();
gb.show();
}
Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
String emp_name=null;
String dob=null;
String doj=null;
String address=null;
String mob_no=null;
String basic_salary=null;
String ta=null;
String da=null;
String hra=null;
String tax=null;
String total=null;
String dd1=null;
String mm1=null;
String yy2=null;
String dd2=null;
String mm3=null;
String yy1=null;
int mm2=0;
String month=null;
String vsid="";
String vsid1="";
/** Creates new form employee_details */
public employee_details() {
initComponents();
}
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel1.setBackground(new java.awt.Color(0, 0, 255));
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addComponent(jLabel1)
.addContainerGap(60, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
txtta.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txttaActionPerformed(evt);
}
});
txthra.addActionListener(new java.awt.event.ActionListener() {
txttotal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txttotalActionPerformed(evt);
}
});
cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));
cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));
cmbdd1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbmm1.setModel(new
javax.swing.DefaultComboBoxModel(new String[] { "MM", "Jan",
"Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}));
cmbyy1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));
txtadd.setColumns(20);
txtadd.setRows(5);
jScrollPane1.setViewportView(txtadd);
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8)
.addComponent(jLabel9)
.addComponent(jLabel11)
.addComponent(jLabel13))
.addGap(25, 25, 25)
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(41, 41, 41)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnclear))
.addGap(18, 18, 18)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btndelete,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnsearch))
.addGap(18, 18, 18)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btncancel,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnupdate))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(btnupdate)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btncancel))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(btnsave)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btnclear))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(btnsearch)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btndelete)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
pack();
}// </editor-fold>
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
dob=dd+"-"+mm+"-"+yy;
Object dd1=cmbdd1.getSelectedItem();
Object mm1=cmbmm1.getSelectedItem();
Object yy1=cmbyy1.getSelectedItem();
doj=dd1+"-"+mm1+"-"+yy1;
address=txtadd.getText();
mob_no=txtmob.getText();
basic_salary=txtbs.getText();
ta=txtta.getText();
da=txtda.getText();
hra=txthra.getText();
tax=txttax.getText();
total=txttotal.getText();
if(!emp_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into employee_details
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,emp_id);
ps.setString(2,emp_name);
ps.setString(3,dob);
ps.setString(4,doj);
ps.setString(5,address);
ps.setString(6,mob_no);
ps.setString(7,basic_salary);
ps.setString(8,ta);
ps.setString(9,da);
ps.setString(10,hra);
ps.setString(11,tax);
ps.setString(12,total);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
private void
btnupdateActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for delete
emp_id=txtemp_id.getText();
emp_name=txtemp_name.getText();
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
dob=dd+"-"+mm+"-"+yy;
Object dd1=cmbdd1.getSelectedItem();
Object mm1=cmbmm1.getSelectedItem();
Object yy1=cmbyy1.getSelectedItem();
doj=dd1+"-"+mm1+"-"+yy1;
address=txtadd.getText();
mob_no=txtmob.getText();
basic_salary=txtbs.getText();
ta=txtta.getText();
da=txtda.getText();
hra=txthra.getText();
tax=txttax.getText();
total=txttotal.getText();
try
{
con=connection.connect.conn();
ps=con.prepareStatement("update employee_details set
emp_id=?,emp_name=?,dob=?,doj=?,address=?,mob=?,bs=?,ta=?,da=?,
hra=?,tax=?,total=?");
ps.setString(1,emp_id);
ps.setString(2,emp_name);
ps.setString(3,dob);
ps.setString(4,doj);
ps.setString(5,address);
ps.setString(6,mob_no);
ps.setString(7,basic_salary);
ps.setString(8,ta);
ps.setString(9,da);
ps.setString(10,hra);
ps.setString(11,tax);
ps.setString(12,total);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"data has been edited");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"sorry data has not been
edited");
}
JOptionPane.showMessageDialog(null,"date="+dbSqlDate);
yy1=vsid.substring(0,4);
mm1=vsid.substring(5, 7);
dd1=vsid.substring(8);
JOptionPane.showMessageDialog(null,"yy="+yy1);
JOptionPane.showMessageDialog(null,"mm="+mm1);
JOptionPane.showMessageDialog(null,"dd="+dd1);
cmbdd.setSelectedItem(dd1);
mm2=mm1.compareTo("01");
if(mm2==0)
{
month="Jan";
cmbmm.setSelectedIndex(0);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("02");
if(mm2==0)
{
month="Feb";
cmbmm.setSelectedIndex(1);
JOptionPane.showMessageDialog(null,"mm="+month);
mm2=mm1.compareTo("03");
if(mm2==0)
{
month="Mar";
cmbmm.setSelectedIndex(2);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("04");
if(mm2==0)
{
month="Apr";
cmbmm.setSelectedIndex(3);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("05");
if(mm2==0)
{
month="May";
cmbmm.setSelectedIndex(4);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("06");
if(mm2==0)
{
month="Jun";
cmbmm.setSelectedIndex(5);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("07");
if(mm2==0)
{
month="Jul";
cmbmm.setSelectedIndex(6);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("08");
if(mm2==0)
{
month="Aug";
cmbmm.setSelectedIndex(7);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("09");
if(mm2==0)
{
month="Sep";
cmbmm.setSelectedIndex(8);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("10");
if(mm2==0)
{
month="Oct";
cmbmm.setSelectedIndex(9);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("11");
if(mm2==0)
{
month="Nov";
cmbmm.setSelectedIndex(10);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("12");
if(mm2==0)
{
month="Dec";
cmbmm.setSelectedIndex(11);
JOptionPane.showMessageDialog(null,"mm="+month);
}
cmbyy.setSelectedItem(yy1);
java.sql.Date dbSqlDate1=null;
dbSqlDate1=rs.getDate(4);
vsid= dbSqlDate1.toString();
JOptionPane.showMessageDialog(null,"date="+dbSqlDate1);
yy2=vsid.substring(0,4);
mm3=vsid.substring(5,7);
dd2=vsid.substring(8);
JOptionPane.showMessageDialog(null,"yy="+yy2);
JOptionPane.showMessageDialog(null,"mm="+mm3);
JOptionPane.showMessageDialog(null,"dd="+dd2);
cmbdd1.setSelectedItem(dd2);
mm2=mm3.compareTo("01");
if(mm2==0)
{
month="Jan";
cmbmm1.setSelectedIndex(0);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("02");
if(mm2==0)
{
month="Feb";
cmbmm1.setSelectedIndex(1);
JOptionPane.showMessageDialog(null,"mm="+month);
mm2=mm3.compareTo("03");
if(mm2==0)
{
month="Mar";
cmbmm1.setSelectedIndex(2);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("04");
if(mm2==0)
{
month="Apr";
cmbmm1.setSelectedIndex(3);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("05");
if(mm2==0)
{
month="May";
cmbmm1.setSelectedIndex(4);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("06");
if(mm2==0)
{
month="Jun";
cmbmm1.setSelectedIndex(5);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("07");
if(mm2==0)
{
month="Jul";
cmbmm1.setSelectedIndex(6);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("08");
if(mm2==0)
{
month="Aug";
cmbmm1.setSelectedIndex(7);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("09");
if(mm2==0)
{
month="Sep";
cmbmm1.setSelectedIndex(8);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("10");
if(mm2==0)
{
month="Oct";
cmbmm1.setSelectedIndex(9);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("11");
if(mm2==0)
{
month="Nov";
cmbmm1.setSelectedIndex(10);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("12");
if(mm2==0)
{
month="Dec";
cmbmm1.setSelectedIndex(11);
JOptionPane.showMessageDialog(null,"mm="+month);
}
cmbyy1.setSelectedItem(yy2);
txtadd.setText(rs.getString(5));
txtmob.setText(rs.getString(6));
txtbs.setText(rs.getString(7));
txtta.setText(rs.getString(8));
txtda.setText(rs.getString(9));
txthra.setText(rs.getString(10));
txttax.setText(rs.getString(11));
txttotal.setText(rs.getString(12));
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Sorry!\n No match
found!");
}
}
else
{
JOptionPane.showMessageDialog(null,"please enter the employee
emp_id!!");
}
}
{
int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO
DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from employee_details where
emp_id=?");
ps.setString(1,emp_id);
ps.executeUpdate();
}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else
}
public void clear()
{
txtemp_id.setText("");
txtemp_name.setText("");
cmbdd.setSelectedIndex(0);
cmbmm.setSelectedIndex(0);
cmbyy.setSelectedIndex(0);
cmbdd1.setSelectedIndex(0);
cmbmm1.setSelectedIndex(0);
cmbyy1.setSelectedIndex(0);
txtadd.setText("");
txtmob.setText("");
txtbs.setText("");
txtta.setText("");
txtda.setText("");
txthra.setText("");
txttax.setText("");
txttotal.setText("");
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new employee_details().setVisible(true);
}
});
}
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addContainerGap(49, Short.MAX_VALUE)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 252,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(71, 71, 71))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
txtroom_type.addActionListener(new
java.awt.event.ActionListener() {
txtroom_charge.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtroom_chargeActionPerformed(evt);
}
});
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(jLabel2)
.addComponent(jLabel4)
.addComponent(jLabel6))
.addGap(26, 26, 26)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(txtremarks)
.addComponent(txtroom_charge)
.addComponent(txtroom_type)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(txtroom_no,
javax.swing.GroupLayout.PREFERRED_SIZE, 63,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(29, 29, 29)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(txtfloor_no,
javax.swing.GroupLayout.PREFERRED_SIZE, 64,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(11, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtroom_no,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(txtfloor_no,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(txtroom_type,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(txtroom_charge,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(txtremarks,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addGap(64, 64, 64))
);
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btnclear)
.addComponent(btndelete)
.addComponent(btncancel))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
pack();
}// </editor-fold>
ps.setString(3,room_type);
ps.setString(4,room_charge);
ps.setString(5,remarks);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}
while (rs.next()) {
txtroom_no.setText(rs.getString(1).trim());
txtfloor_no.setText(rs.getString(2).trim());
txtroom_type.setText(rs.getString(3).trim());
txtroom_charge.setText(rs.getString(4).trim());
txtremarks.setText(rs.getString(5).trim());
} catch (Exception e) {
e.printStackTrace();
}
} else {
JOptionPane.showMessageDialog(null, "Please Enter the
Guest_id!!");
}
}
public void clear()
{
txtroom_no.setText("");
txtfloor_no.setText("");
txtroom_type.setText("");
txtroom_charge.setText("");
txtremarks.setText("");
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new room_details().setVisible(true);
}
});
}
Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
String name=null;
String room_no=null;
String guest_type=null;
String arr_date=null;
String dep_date=null;
String arr_time=null;
String dep_time=null;
String address=null;
String mob_no=null;
String advance=null;
String purpose=null;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 280,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(68, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));
cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
cmbdd1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbdd1.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmbdd1ActionPerformed(evt);
}
});
cmbmm1.setModel(new
javax.swing.DefaultComboBoxModel(new String[] { "MM", "Jan",
"Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}));
cmbyy1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));
txtarr_time.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtarr_timeActionPerformed(evt);
}
});
tarea_address.setColumns(20);
tarea_address.setRows(5);
jScrollPane1.setViewportView(tarea_address);
txtmob_no.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtmob_noActionPerformed(evt);
}
});
txtpurpose.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtpurposeActionPerformed(evt);
}
});
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel12)
.addComponent(jLabel13)
.addComponent(jLabel8)
.addComponent(jLabel6)
.addComponent(jLabel2)
.addComponent(jLabel5)
.addComponent(jLabel4)
.addComponent(jLabel3))
.addGap(14, 14, 14)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(txtroom_no,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(txtname,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(txtguest_id,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(txtguest_type,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(txtarr_time,
javax.swing.GroupLayout.PREFERRED_SIZE, 57,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(jLabel7))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(cmbdd, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbdd1, 0, 57,
Short.MAX_VALUE))
.addGap(38, 38, 38)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(cmbmm, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbmm1, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
});
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btnclear,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, 80, Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btncancel,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btndelete,
javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
.addGap(52, 52, 52))
);
guest_id=txtguest_id.getText();
name=txtname.getText();
room_no=txtroom_no.getText();
guest_type=txtguest_type.getText();
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
arr_date=dd+"-"+mm+"-"+yy;
Object dd1=cmbdd1.getSelectedItem();
Object mm1=cmbmm1.getSelectedItem();
Object yy1=cmbyy1.getSelectedItem();
dep_date=dd+"-"+mm+"-"+yy;
arr_time=txtarr_time.getText();
dep_time=txtarr_time.getText();
address=tarea_address.getText();
mob_no=txtmob_no.getText();
advance=txtadvance_pay.getText();
purpose=txtpurpose.getText();
if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into guest_details
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,guest_id);
ps.setString(2,name);
ps.setString(3,room_no);
ps.setString(4,guest_type);
ps.setString(5,arr_date);
ps.setString(6,dep_date);
ps.setString(7,arr_time);
ps.setString(8,dep_time);
ps.setString(9,address);
ps.setString(10,mob_no);
ps.setString(11,advance);
ps.setString(12,purpose);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}
if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
int ok=3;
if(ok<=3)
{
int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO
DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from guest_details where
guest_id=?");
ps.setString(1,guest_id);
ps.executeUpdate();
JOptionPane.showMessageDialog(null, "DATA DELETED
SUCCESSFULLY");
clear();
}
else
{
if(aa==JOptionPane.NO_OPTION)
JOptionPane.showMessageDialog(null," DATA NOT DELETED");
}
}
else
{
dispose();
}
}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else
{
JOptionPane.showMessageDialog(null,"Please enter the guestid for
Delete Record!!");
}
}
public void clear()
{
txtguest_id.setText("");
txtname.setText("");
txtroom_no.setText("");
txtguest_type.setText("");
cmbdd.setSelectedIndex(0);
cmbmm.setSelectedIndex(0);
cmbyy.setSelectedIndex(0);
cmbdd1.setSelectedIndex(0);
cmbmm1.setSelectedIndex(0);
cmbyy1.setSelectedIndex(0);
txtarr_time.setText("");
txtdep_time.setText("");
tarea_address.setText("");
txtmob_no.setText("");
txtadvance_pay.setText("");
txtpurpose.setText("");
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new guest_details().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btncancel;
Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(jLabel1)
.addContainerGap(45, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addGap(26, 26, 26)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING, false)
.addComponent(txtcharge,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(txtmenu_id,
javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED))
.addComponent(txtmenu_name)
.addComponent(txtmenu_type))))
.addContainerGap(32, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtmenu_id,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtmenu_name,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
pack();
}// </editor-fold>
if(!menu_id.equals(" "))
{
try
{
con=connection.connect.conn();
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}
}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else
{
JOptionPane.showMessageDialog(null,"Please enter the menuid for
Delete Record!!");
}
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new menu_details().setVisible(true);
}
});
}
Guest_bill Details
Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
String miss_bill=null;
String no_of_days=null;
String total=null;
String tax=null;
String balance=null;
String advance_pay=null;
/** Creates new form guest_bill_details */
public guest_bill_details() {
initComponents();
}
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(52, 52, 52)
.addComponent(jLabel1)
.addContainerGap(69, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jLabel10.setText("Tax");
cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));
cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));
txttax.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txttaxActionPerformed(evt);
}
});
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel6)
.addComponent(jLabel5)
.addComponent(jLabel7)
.addComponent(jLabel3)
.addComponent(jLabel9)
.addComponent(jLabel11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING, false)
.addComponent(txtname,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtguest_id,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING)
.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel3Layout.createSequentialGroup()
.addComponent(cmbdd,
javax.swing.GroupLayout.PREFERRED_SIZE, 44,
javax.swing.GroupLayout.PREFERRED_SIZE)
btncancelActionPerformed(evt);
}
});
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btnclear,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))
.addGap(84, 84, 84)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(btncancel)
.addComponent(btndelete))
.addContainerGap(58, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel4Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btndelete)
.addComponent(btnsave))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btncancel)
.addComponent(btnclear))
.addContainerGap())
);
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING, false)
.addComponent(jPanel4,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>
room_no=txtroom_no.getText();
room_charge=txtroom_charge.getText();
bill_no=txtbill_no.getText();
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
bill_date=dd+"-"+mm+"-"+yy;
miss_bill=txtmiss_bill.getText();
no_of_days=txtno_of_days.getText();
total=txttotal.getText();
tax=txttax.getText();
balance=txtbalance.getText();
advance_pay=txtadvance_pay.getText();
if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into guest_bill_details
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,guest_id);
ps.setString(2,name);
ps.setString(3,room_no);
ps.setString(4,room_charge);
ps.setString(5,bill_no);
ps.setString(6,bill_date);
ps.setString(7,miss_bill);
ps.setString(8,no_of_days);
ps.setString(9,total);
ps.setString(10,tax);
ps.setString(11,balance);
ps.setString(12,advance_pay);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}
}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else
txtno_of_days.setText("");
txttotal.setText("");
txttax.setText("");
txtbalance.setText("");
txtadvance_pay.setText("");
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new guest_bill_details().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btncancel;
private javax.swing.JButton btnclear;
private javax.swing.JButton btndelete;
private javax.swing.JButton btnsave;
}
Restaurant_bill_details
package hms;
import java.sql.*;
import javax.swing.JOptionPane;
public restaurent_bill_details() {
initComponents();
}
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1,
javax.swing.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 66,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(8, Short.MAX_VALUE))
);
cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));
cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8))
.addGap(15, 15, 15)
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnclear))
.addGap(123, 123, 123)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(btncancel)
.addComponent(btndelete))
.addContainerGap(48, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(btncancel))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btnsave)
.addComponent(btndelete))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btnclear)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING)
.addComponent(jPanel4,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 74,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 237,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}
}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else
REPORTS
Guest_bill_Report
package hms;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.awt.print.*;
public class Guest_bill extends JFrame implements ActionListener
{
Container cp;
PrinterJob pj;
PageFormat pf;
PrintPanel canvas;
JPanel p,t;
JLabel lblempid;
JComboBox cmbemp_id;
JButton btnShow,btnShowAll,btnPrint,btnPgSetup,btnClose;
JTable table;
Connection cn;
ResultSet rs,rst;
ResultSetMetaData rsmd;
Statement st,stt;
int rc,cc,rc1,cc1;
Object[][] cells;
String rdt,wCOND="",columnNames[];
public void connect()
{
try{
DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());
cn=DriverManager.getConnection(“jdbc:odbc:hotel”,”billing”,”system")
;
st=cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultS
et.CONCUR_UPDATABLE);
}
public void grand_total()
{
try
{
String query1="Select sum(gid) from guest_bill_detail where
gid=? group by gid";
st =
cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.
CONCUR_READ_ONLY);
rs = st.executeQuery(query1);
rc1 = 0;
while(rs.next())
rc1++;
rsmd=rs.getMetaData();
cc1=rsmd.getColumnCount();
}catch(Exception e) { }
}
public void openRecord()
{
try{
String query = "SELECT * FROM guest_bill_detail " + wCOND;
st =
cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.
CONCUR_READ_ONLY);
rs = st.executeQuery(query);
rc = 0;
while(rs.next())
rc++;
rsmd=rs.getMetaData();
cc=rsmd.getColumnCount();
}catch(Exception e) { }
}
i=0;
rs.first();
do{
for(j=0;j<cc;j++)
cells[i][j]=rs.getString(j+1);
i++;
}while(rs.next());
cp = getContentPane();
setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
p=new JPanel();
p.setLayout(new GridLayout(0,7));
lblempid = new JLabel("Guest Id : ",SwingConstants.RIGHT);
cmbemp_id = new JComboBox();
btnShow = new JButton("Show"); btnShow.setMnemonic('S');
btnShowAll = new JButton("Show All");
btnShow.setMnemonic('A');
btnPrint = new JButton("Print"); btnPrint.setMnemonic('P');
btnPgSetup = new JButton("Page
setup");btnPgSetup.setMnemonic('G');
btnClose = new JButton("Close");
btnClose.setMnemonic('C');
cmbemp_id.setEditable(false);
btnShow.setActionCommand("Show");
btnShowAll.setActionCommand("Show All");
btnPrint.setActionCommand("Print");
btnPgSetup.setActionCommand("Page Setup");
btnClose.setActionCommand("Close");
btnShow.addActionListener((ActionListener) this);
btnShowAll.addActionListener(this);
btnPrint.addActionListener(this);
btnPgSetup.addActionListener(this);
btnClose.addActionListener(this);
btnShow.setForeground(Color.BLUE);
btnShowAll.setForeground(Color.BLUE);
btnPrint.setForeground(Color.BLUE);
btnPgSetup.setForeground(Color.BLUE);
btnClose.setForeground(Color.BLUE);
lblempid.setForeground(Color.BLUE);
cmbemp_id.setForeground(Color.BLUE);
p.add(lblempid);
p.add(cmbemp_id);
p.add(btnShow);
p.add(btnShowAll);
p.add(btnPrint);
p.add(btnPgSetup);
p.add(btnClose);
cp.add(p,"North");
connect();
openRecord();
setemp_code();
t=new JPanel();
canvas = new PrintPanel();
cp.add(canvas, "Center");
}
public void actionPerformed(ActionEvent e)
{
String cmd = e.getActionCommand();
if(cmd.equals("Show"))
{
wCOND = " WHERE gid='" + cmbemp_id.getSelectedItem()+"'";
showGridData();
}
if(cmd.equals("Show All"))
{
wCOND = "";
showGridData();
}
if (cmd.equals("Print"))
{
pj = PrinterJob.getPrinterJob();
if (pf == null)
pf = pj.defaultPage();
pj.setPrintable(canvas, pf);
if (pj.printDialog())
{ try
{ pj.print();
}
catch (PrinterException exception)
{ JOptionPane.showMessageDialog(this, exception);
}
}
}
if(cmd.equals("Page Setup"))
{
pj = PrinterJob.getPrinterJob();
if (pf == null)
pf = pj.defaultPage();
pf = pj.pageDialog(pf);
}
if(cmd.equals("Close")){
if (cn != null) {
try{
cn.close();
}catch(Exception zx) {}
}
setVisible(false);
//System.exit(0);
}
}
void showGridData()
{
openRecord();
if(rc==0)
JOptionPane.showMessageDialog(null,"Data not Found.","Guest
Bill Report",JOptionPane.INFORMATION_MESSAGE);
else
{
columnNames=new String[cc];
cells=new Object[rc][cc];
setData();
table = new JTable(cells, columnNames);
remove(t);
t=new JPanel();
t.setBorder(BorderFactory.createTitledBorder("Guest_bill_report"
));
t.setLayout(new BorderLayout());
t.add(new JScrollPane(table));
cp.add(t, "Center");
setVisible(true);
}
}
public static void main(String args[])
{
Guest_bill gb=new Guest_bill();
gb.show();
}
class PrintPanel extends JPanel implements Printable
{
@Override
public void paintComponent(Graphics g)
{ super.paintComponent(g);
}
rs.beforeFirst();
while(rs.next())
{
rdt="";
for(int i=0;i<cc;i++)
rdt+=rs.getString(i+1)+ " ";
g.drawString(rdt,10,(++r)*20);
}
}catch (SQLException e){ }
return Printable.PAGE_EXISTS;
}
public PrintPanel(){}
}
}
TESTING
TESTING
an error.
undiscovered error.
error.
Unit Testing
Integration Testing
Validation Testing
Loop Testing
idea of what caused it. Integration is the process of verifying that the
tested are those that call the previously tested modules. For example,
variables used for record sets and connections, which are frequently
the modules are being tested. At the times coding there are so
many errors inside the unit modules and it was removed while
when the unit modules does not match with our target it will be
White-box errors.
The guide and user both did testing at the several stages.
of data was given as input to the module and output data produces
and output data was also checked. The interface between this model
and others was also checked for correctness. While collecting the
input data for testing the program module it was kept in mind that
input data must be from the all classes, so the entire condition of the
program could be checked. In the testing, the role of the user is also
very important, since they understand the full range of data and
condition that might occur in the system. So a wide range of data was
the system work together. For testing, the entire system was
tested are those that call the previously tested modules. For
form.
Function Testing:-
Acceptance Testing:-
nstallation Testing :-
When I press on this ok button .the related line the returned into
light yellow and cursor set on the particular place where list
successfully.
When I press on the debug command the related line turned into
yellow color. When I check minutely and found object is not open in
PERT CHART:
activities or tasks. PERT has several advantages over bar charts and is
PERT CHART
I/O DESIGN
START
INTEGRATION AND
TESTING
ANALYSIS
CODING
FINISH
WRITE
SUBMITTED BY:-DEEPSHIKHA VERMA 164
MANUAL
HOTEL BILLING SYSTEM
activity.
GANTT CHART
OCT 15,11 NOV 15,11 NOV 20,11 DEC 10,11 DEC 12,11
START
ANALYSIS
I /O DESIGN
CODING
WRITE MANUAL
The development of this software has been done keeping in mind the
the future also. I find it is getting solved the work of the HOTEL
handle. Keeping in mind the needs of the Hotel, which may crop up in
the near future, I have tried and introduced certain features, which
software keeping in mind just of The Hotel Windsor, but this job can
approach, it means it will develop using unit, and each unit will be
sub-module the main module will completed. So, it will easier task to
BIBLIOGRAPHY