📄 roominfoquery.java~16~
字号:
package RoomManagement;
import java.awt.BorderLayout;
import hotelinformationmanagesystem.*;
import javax.swing.JFrame;
import com.borland.jbcl.layout.XYLayout;
import com.borland.jbcl.layout.*;
import javax.swing.JScrollPane;
import javax.swing.JButton;
import javax.swing.JTable;
import ShowTable.TableExample;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JPanel;
import javax.swing.BorderFactory;
import java.awt.Font;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.JComboBox;
import javax.swing.ButtonGroup;
/**
* <p>Title: 酒店信息管理系统</p>
*
* <p>Description: HotelInformationManageSystem</p>
*
* <p>Copyright: Copyright (c) 2007</p>
*
* <p>Company: JSP</p>
*
* @author 江世澎
* @version 1.0
*/
public class RoomInfoQuery extends JFrame {
JTable jTable1;
TableExample table = new TableExample();
XYLayout xYLayout1 = new XYLayout();
JScrollPane jScrollPane1 = new JScrollPane();
JPanel jPanel1 = new JPanel();
XYLayout xYLayout2 = new XYLayout();
JRadioButton jRadioButton1 = new JRadioButton();
JRadioButton jRadioButton2 = new JRadioButton();
JRadioButton jRadioButton3 = new JRadioButton();
JPanel jPanel2 = new JPanel();
XYLayout xYLayout3 = new XYLayout();
JRadioButton jRadioButton4 = new JRadioButton();
JComboBox jComboBox1 = new JComboBox();
JPanel jPanel3 = new JPanel();
XYLayout xYLayout4 = new XYLayout();
JRadioButton jRadioButton5 = new JRadioButton();
JTextField jTextField1 = new JTextField();
JPanel jPanel4 = new JPanel();
XYLayout xYLayout5 = new XYLayout();
JRadioButton jRadioButton6 = new JRadioButton();
JTextField jTextField2 = new JTextField();
JPanel jPanel5 = new JPanel();
XYLayout xYLayout6 = new XYLayout();
JButton jButton1 = new JButton();
JButton jButton2 = new JButton();
JPanel jPanel6 = new JPanel();
XYLayout xYLayout7 = new XYLayout();
JPanel jPanel7 = new JPanel();
XYLayout xYLayout8 = new XYLayout();
ButtonGroup buttonGroup1 = new ButtonGroup();
public RoomInfoQuery() {
try {
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
jTable1 = table.createTable();
getContentPane().setLayout(xYLayout1);
this.setSize(420, 305);
SetFormCenter wcenter = new SetFormCenter();
wcenter.setcenter(this);
this.setTitle("酒店客房查询界面");
this.setResizable(false);
xYLayout1.setWidth(416);
xYLayout1.setHeight(278);
jRadioButton2.setText("按入住查询");
jRadioButton2.addActionListener(new
RoomInfoQuery_jRadioButton2_actionAdapter(this));
jRadioButton3.setText("按坏房查询");
jRadioButton3.addActionListener(new
RoomInfoQuery_jRadioButton3_actionAdapter(this));
jPanel2.setLayout(xYLayout3);
jPanel2.setBorder(BorderFactory.createEtchedBorder());
jRadioButton4.setText("按客房类型查询");
jRadioButton4.addActionListener(new
RoomInfoQuery_jRadioButton4_actionAdapter(this));
jPanel3.setLayout(xYLayout4);
jPanel3.setBorder(BorderFactory.createEtchedBorder());
jRadioButton5.setText("按客房ID查询");
jRadioButton5.addActionListener(new
RoomInfoQuery_jRadioButton5_actionAdapter(this));
jPanel4.setLayout(xYLayout5);
jPanel4.setBorder(BorderFactory.createEtchedBorder());
jRadioButton6.setText("按客房床位数查询");
jRadioButton6.addActionListener(new
RoomInfoQuery_jRadioButton6_actionAdapter(this));
jPanel5.setLayout(xYLayout6);
jPanel5.setBorder(BorderFactory.createEtchedBorder());
jButton1.setFont(new java.awt.Font("宋体", Font.BOLD, 16));
jButton1.setText("查询");
jButton1.addActionListener(new RoomInfoQuery_jButton1_actionAdapter(this));
jButton2.setFont(new java.awt.Font("宋体", Font.BOLD, 16));
jButton2.setText("退出");
jButton2.addActionListener(new RoomInfoQuery_jButton2_actionAdapter(this));
jPanel6.setLayout(xYLayout7);
jPanel6.setBorder(BorderFactory.createEtchedBorder());
jPanel7.setBorder(BorderFactory.createEtchedBorder());
jPanel7.setLayout(xYLayout8);
jRadioButton1.addActionListener(new
RoomInfoQuery_jRadioButton1_actionAdapter(this));
jPanel4.add(jRadioButton6, new XYConstraints(5, 3, -1, -1));
jPanel4.add(jTextField2, new XYConstraints(147, 3, 63, 23));
this.getContentPane().add(jPanel7, new XYConstraints(2, 237, 100, 35));
jPanel7.add(jRadioButton3, new XYConstraints(2, 3, -1, -1));
jPanel3.add(jRadioButton5, new XYConstraints(5, 4, -1, -1));
jPanel3.add(jTextField1, new XYConstraints(123, 5, 87, 23));
jPanel2.add(jRadioButton4, new XYConstraints(5, 4, -1, -1));
jPanel2.add(jComboBox1, new XYConstraints(131, 3, 79, -1));
jPanel5.add(jButton2, new XYConstraints(2, 58, 73, 42));
jPanel5.add(jButton1, new XYConstraints(3, 6, 73, 42));
jRadioButton1.setToolTipText("");
jRadioButton1.setText("按预约查询");
jPanel1.setBorder(BorderFactory.createEtchedBorder());
jPanel1.setLayout(xYLayout2);
buttonGroup1.add(jRadioButton1); //按预约查询
buttonGroup1.add(jRadioButton2); //按入住查询
buttonGroup1.add(jRadioButton3); //按坏房查询
buttonGroup1.add(jRadioButton4); //按客房类型查询
buttonGroup1.add(jRadioButton5); //按客房ID查询
buttonGroup1.add(jRadioButton6); //按客房床位数查询
this.getContentPane().add(jPanel1, new XYConstraints(1, 164, 101, 35));
jPanel1.add(jRadioButton2, new XYConstraints(3, 5, -1, -1));
this.getContentPane().add(jPanel6, new XYConstraints(2, 200, 100, 35));
jPanel6.add(jRadioButton1, new XYConstraints(2, 3, -1, -1));
this.getContentPane().add(jScrollPane1,
new XYConstraints(2, 5, 408, 156));
jScrollPane1.getViewport().add(jTable1);
this.getContentPane().add(jPanel5, new XYConstraints(327, 163, 83, 109));
this.getContentPane().add(jPanel4, new XYConstraints(106, 237, 220, 35));
this.getContentPane().add(jPanel2, new XYConstraints(106, 199, 220, 35));
this.getContentPane().add(jPanel3, new XYConstraints(106, 163, 220, 35));
jComboBox1.setEnabled(false); //按客房类型
jComboBox1.addItem(" ");
jComboBox1.addItem("标准单人间");
jComboBox1.addItem("标准双人间");
jComboBox1.addItem("标准四人间");
jComboBox1.addItem("家庭间");
jComboBox1.addItem("商务间");
jComboBox1.addItem("经济间");
jComboBox1.addItem("豪华套房");
jTextField1.setEnabled(false); //按客房ID
jTextField2.setEnabled(false); //按床位
}
public void jButton1_actionPerformed(ActionEvent e) {
if (buttonGroup1.getSelection() == jRadioButton1.getModel()) { //按预约查询
table.fetch("Select HIMS_RoomInfo.RoomID as 客房ID,Class as 客房类型,RoomArea as 房间面积,BedNo as 床位数,StandardPri as 标准价,RebatePri as 折扣价,Place as 客房位置,RoomIntro as 客房信息,Remark as 备注 From HIMS_RoomState, HIMS_RoomInfo where HIMS_RoomState.RoomID = HIMS_RoomInfo.RoomID AND HIMS_RoomState.OnUser = '3'; ");
return;
}
if (buttonGroup1.getSelection() == jRadioButton2.getModel()) { //按入住查询
table.fetch("Select HIMS_RoomInfo.RoomID as 客房ID,Class as 客房类型,RoomArea as 房间面积,BedNo as 床位数,StandardPri as 标准价,RebatePri as 折扣价,Place as 客房位置,RoomIntro as 客房信息,Remark as 备注 From HIMS_RoomState, HIMS_RoomInfo where HIMS_RoomState.RoomID = HIMS_RoomInfo.RoomID AND HIMS_RoomState.OnUser = '1' Or HIMS_RoomState.OnUser = '7' or HIMS_RoomState.OnUser = '8' Or HIMS_RoomState.OnUser = '9' Or HIMS_RoomState.OnUser = '0'; ");
return;
}
if (buttonGroup1.getSelection() == jRadioButton3.getModel()) { //按坏房查询
table.fetch("Select HIMS_RoomInfo.RoomID as 客房ID,Class as 客房类型,RoomArea as 房间面积,BedNo as 床位数,StandardPri as 标准价,RebatePri as 折扣价,Place as 客房位置,RoomIntro as 客房信息,Remark as 备注 From HIMS_RoomState, HIMS_RoomInfo where HIMS_RoomState.RoomID = HIMS_RoomInfo.RoomID AND HIMS_RoomState.OnUser = '5'; ");
return;
}
if (buttonGroup1.getSelection() == jRadioButton4.getModel()) { //按客房类型查询
String strClass = null;
try {
strClass = jComboBox1.getSelectedItem().toString();
} catch (Exception ex) {
strClass = "";
}
table.fetch("Select HIMS_RoomInfo.RoomID as 客房ID,Class as 客房类型,RoomArea as 房间面积,BedNo as 床位数,StandardPri as 标准价,RebatePri as 折扣价,Place as 客房位置,RoomIntro as 客房信息,Remark as 备注 From HIMS_RoomState, HIMS_RoomInfo where HIMS_RoomState.RoomID = HIMS_RoomInfo.RoomID AND HIMS_RoomInfo.Class = '" +
strClass + "';");
return;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -