📄 guestregister.java
字号:
jBNewBuildFinish.setText("完成");
jBNewBuildFinish.addActionListener(new
GuestRegister_jBNewBuildFinish_actionAdapter(this));
jBEditFinish.setEnabled(false);
jBEditFinish.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
jBEditFinish.setText("完成");
jBEditFinish.addActionListener(new
GuestRegister_jBEditFinish_actionAdapter(this));
jBDelete.setEnabled(false);
jBDelete.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
jBDelete.setText("删除");
jBDelete.addActionListener(new GuestRegister_jBDelete_actionAdapter(this));
jPQuit.setBorder(BorderFactory.createEtchedBorder());
jPQuit.setLayout(xYLayout5);
jBQuit.setFont(new java.awt.Font("宋体", Font.BOLD, 15));
jBQuit.setText("退出");
jBQuit.addActionListener(new GuestRegister_jBQuit_actionAdapter(this));
jTFCompany.setEnabled(false);
jTFName.setEnabled(false);
jTFCounty.setEnabled(false);
jTFRegPhone.setEnabled(false);
jCBPaperType.setEnabled(false);
jTFPaperNo.setEnabled(false);
jTACHOReason.setEnabled(false);
jTextField7.setEnabled(false);
jTFGuestRegID.setEnabled(false);
jTFWillCheckDate.setEnabled(false);
jTFCheckInDate.setEnabled(false);
jTFCheckInDay.setEnabled(false);
jTFPersonMon.setEnabled(false);
jTFRoomMon.setEnabled(false);
jPChickIn.setLayout(xYLayout17);
jPChickIn.setBorder(BorderFactory.createEtchedBorder());
jBChickIn.setEnabled(false);
jBChickIn.setText("入住");
jBChickIn.addActionListener(new GuestRegister_jBChickIn_actionAdapter(this));
jPEmpIDQuery.setLayout(xYLayout13);
jPEmpIDQuery.setBorder(BorderFactory.createEtchedBorder());
jLEmpIDQuery.setFont(new java.awt.Font("宋体", Font.BOLD, 12));
jLEmpIDQuery.setText("客人登记号");
jBEmpIDQuery.setText("查找");
jBEmpIDQuery.addActionListener(new
GuestRegister_jBEmpIDQuery_actionAdapter(this));
jPanel13.add(jLGuestRegID, new XYConstraints(3, 3, -1, -1));
jPGuestInfo.add(jPGuestInfo03, new XYConstraints(211, 36, 157, 105));
jPGuestInfo.add(jLCHOReason, new XYConstraints(7, 176, -1, -1));
jPGuestInfo.add(jSPCHOReason, new XYConstraints(7, 194, 361, 70));
jSPCHOReason.getViewport().add(jTACHOReason);
jPGuestInfo05.add(jLabel8, new XYConstraints(7, 4, -1, -1));
this.getContentPane().add(jPGuestInfo,
new XYConstraints(2, 58, 374, 271));
jPAccountChange.add(jRBGroupDestine, new XYConstraints(2, 2, -1, -1));
jPAccountChange.add(jRBGroupRegist, new XYConstraints(79, 2, -1, -1));
jPAccountChange.add(jRBGuestRegist, new XYConstraints(79, 28, -1, -1));
jPAccountChange.add(jRBGuestDestine, new XYConstraints(1, 28, -1, -1));
jPQuit.add(jBQuit, new XYConstraints(2, 2, -1, -1));
jPGuestInfo01.add(jLName, new XYConstraints(3, 32, -1, -1));
jPGuestInfo01.add(jLCounty, new XYConstraints(3, 63, -1, -1));
jPGuestInfo01.add(jLRegPhone, new XYConstraints(3, 93, -1, -1));
jPGuestInfo01.add(jLPaperType, new XYConstraints(3, 121, -1, -1));
jPGuestInfo01.add(jLPaperNo, new XYConstraints(3, 147, -1, -1));
jPGuestInfo01.add(jTFName, new XYConstraints(76, 31, 122, -1));
jPGuestInfo01.add(jTFCounty, new XYConstraints(76, 60, 122, -1));
jPGuestInfo01.add(jTFRegPhone, new XYConstraints(76, 91, 122, -1));
jPGuestInfo01.add(jCBPaperType, new XYConstraints(76, 118, 122, 20));
jPGuestInfo01.add(jTFPaperNo, new XYConstraints(76, 146, 122, -1));
jPGuestInfo01.add(jLCompany, new XYConstraints(3, 3, -1, -1));
jPGuestInfo01.add(jTFCompany, new XYConstraints(76, 1, 122, -1));
jPGuestInfo.add(jPGuestInfo01, new XYConstraints(2, 1, 207, 172));
jPGuestInfo03.add(jLCheckInDate, new XYConstraints(1, 3, -1, -1));
jPGuestInfo03.add(jTFCheckInDate, new XYConstraints(71, 1, 74, -1));
jPGuestInfo03.add(jTFCheckInDay, new XYConstraints(71, 38, 74, -1));
jPGuestInfo03.add(jLCheckInDay, new XYConstraints(1, 39, -1, -1));
jPGuestInfo03.add(jLPersonMon, new XYConstraints(1, 70, -1, -1));
jPanel13.add(jTFGuestRegID, new XYConstraints(70, 1, 72, -1));
this.getContentPane().add(jPQueryFreeRoom,
new XYConstraints(268, 30, 108, 28));
this.getContentPane().add(jPQueryRoomInfo,
new XYConstraints(160, 30, 107, 28));
this.getContentPane().add(jPanel13, new XYConstraints(160, 1, 216, 29));
jPGuestInfo.add(jPGuestInfo04, new XYConstraints(211, 143, 157, 30));
jPGuestInfo.add(jPGuestInfo02, new XYConstraints(211, 1, 157, 32));
jPGuestInfo02.add(jLaWillCheckDate, new XYConstraints(1, 7, -1, -1));
jPGuestInfo02.add(jTFWillCheckDate, new XYConstraints(71, 3, 74, -1));
jPjBNewBuild.add(jBNewBuild, new XYConstraints(2, 1, 67, -1));
jPjBNewBuild.add(jBNewBuildFinish, new XYConstraints(2, 30, 66, -1));
jPEdit.add(jBEdit, new XYConstraints(2, 0, -1, -1));
jPEdit.add(jBEditFinish, new XYConstraints(2, 30, -1, -1));
this.getContentPane().add(jPDelete, new XYConstraints(377, 140, 74, 34));
jPDelete.add(jBDelete, new XYConstraints(2, 0, -1, -1));
this.getContentPane().add(jPjBNewBuild,
new XYConstraints(377, 1, 74, 63));
jPanel13.add(jBGuestRegID, new XYConstraints(144, 2, 57, -1));
jPGuestInfo04.add(jBFSetRoomMon, new XYConstraints(93, 3, 52, -1));
jPGuestInfo04.add(jLRoomMon, new XYConstraints(1, 3, -1, -1));
jPQueryFreeRoom.add(jBQueryFreeRoom, new XYConstraints(7, 1, 87, 20));
jPQueryRoomInfo.add(jBQueryRoomInfo, new XYConstraints(1, 1, 98, 20));
jPGuestInfo04.add(jTFRoomMon, new XYConstraints(71, 2, 20, -1));
this.getContentPane().add(jPEdit, new XYConstraints(377, 71, 74, 63));
jPGuestInfo05.add(jTextField7, new XYConstraints(80, 2, 106, 19));
jPChickIn.add(jBChickIn, new XYConstraints(2, 4, 65, 27));
this.getContentPane().add(jPQuit, new XYConstraints(378, 322, 74, 35));
this.getContentPane().add(jPGuestInfo05,
new XYConstraints(2, 329, 374, 28));
SetFormCenter windowcenter = new SetFormCenter();
windowcenter.setcenter(this);
this.getContentPane().add(jPChickIn, new XYConstraints(377, 180, 74, 38));
jPEmpIDQuery.add(jLEmpIDQuery, new XYConstraints(2, 3, -1, -1));
jPEmpIDQuery.add(jTFEmpIDQuery, new XYConstraints(2, 24, 65, 23));
jPEmpIDQuery.add(jBEmpIDQuery, new XYConstraints(4, 51, -1, -1));
this.getContentPane().add(jPAccountChange,
new XYConstraints(2, 1, 157, 57));
this.getContentPane().add(jPEmpIDQuery,
new XYConstraints(377, 221, 74, 90));
jPGuestInfo03.add(jTFPersonMon, new XYConstraints(71, 68, 74, -1));
buttonGroup1.add(jRBGuestDestine); //散客预定
buttonGroup1.add(jRBGroupDestine); //团体预定
buttonGroup1.add(jRBGuestRegist); //散客现入
buttonGroup1.add(jRBGroupRegist); //团体现入
if (MainFrame.strGuestStyle.equals("SF")) { //散客预定管理
jRBGuestDestine.setSelected(true);
jRBGroupDestine.setEnabled(false);
jRBGuestRegist.setEnabled(false);
jRBGroupRegist.setEnabled(false);
strRegiType = "S"; //客人类型:散客
strCheckINType = "F"; //入住形式:预定
}
if (MainFrame.strGuestStyle.equals("SN")) { //散客登记管理
jRBGuestRegist.setSelected(true);
jRBGuestDestine.setEnabled(false);
jRBGroupDestine.setEnabled(false);
jRBGroupRegist.setEnabled(false);
strRegiType = "S"; //客人类型:散客
strCheckINType = "N"; //入住形式:现入
}
if (MainFrame.strGuestStyle.equals("TN")) { //团体登记管理
jRBGroupRegist.setSelected(true);
jRBGuestDestine.setEnabled(false);
jRBGroupDestine.setEnabled(false);
jRBGuestRegist.setEnabled(false);
strRegiType = "T"; //客人类型:团体
strCheckINType = "N"; //入住形式:现入
}
if (MainFrame.strGuestStyle.equals("TF")) { //团体预定管理
jRBGroupDestine.setSelected(true);
jRBGuestDestine.setEnabled(false);
jRBGuestRegist.setEnabled(false);
jRBGroupRegist.setEnabled(false);
strRegiType = "T"; //客人类型:团体
strCheckINType = "F"; //入住形式:预定
}
}
public void jBQuit_actionPerformed(ActionEvent e) { //退出
this.setVisible(false);
}
public void jBQueryRoomInfo_actionPerformed(ActionEvent e) { //查询客房信息
RoomManagement.RoomInfoQuery roominfoquery = new RoomManagement.
RoomInfoQuery();
roominfoquery.setVisible(true);
}
public void jBQueryFreeRoom_actionPerformed(ActionEvent e) { //查看空客房
RoomManagement.FreeRoomQuery freeroomquery = new RoomManagement.
FreeRoomQuery();
freeroomquery.setVisible(true);
}
public void jBNewBuild_actionPerformed(ActionEvent e) { //新单
jBGuestRegID.setEnabled(true); //验证
jTFGuestRegID.setEnabled(true); //客人登记号
jTFGuestRegID.setText(""); //客人登记号
jBNewBuild.setEnabled(false); //新单
jTFEmpIDQuery.setText(""); //查找
jTFEmpIDQuery.setEnabled(false);
jBEmpIDQuery.setEnabled(false); //查找
jCBPaperType.removeAllItems();
jCBPaperType.addItem(" ");
jCBPaperType.addItem("身份证");
jCBPaperType.addItem("护照");
jCBPaperType.addItem("军人证");
jCBPaperType.addItem("其他证件");
jTFCheckInDay.setText(""); //入住天数
jTFRegPhone.setText(""); //联系电话
jTFPersonMon.setText(""); //入住人数
jTACHOReason.setText(""); //入住原因
jTFName.setText(""); //姓名
jTFPaperNo.setText(""); //证件号码
jTFCompany.setText(""); //单位
jTFCounty.setText(""); //国家
jTFWillCheckDate.setText(""); //抵店日期
jTextField7.setText(""); //押金
jTFCheckInDate.setText(""); //入住日期
jTFRoomMon.setText(""); //订房数
}
public void jBGuestRegID_actionPerformed(ActionEvent e) { //验证
String strRegisterID = jTFGuestRegID.getText();
if (strRegisterID.equals("")) {
JOptionPane.showMessageDialog(null,
"客人登记号不能为空,请重新输入!",
"酒店信息管理系统警告",
JOptionPane.WARNING_MESSAGE);
jTFGuestRegID.setText("");
return;
}
if (!judgeval.isFigure(strRegisterID)) {
JOptionPane.showMessageDialog(null,
"客人登记号必须为数字,请重新输入!",
"酒店信息管理系统警告",
JOptionPane.WARNING_MESSAGE);
jTFGuestRegID.setText("");
return;
}
if (strRegisterID.length() != 8) {
JOptionPane.showMessageDialog(null,
"客人登记号必须为8位,请重新输入!",
"酒店信息管理系统警告",
JOptionPane.WARNING_MESSAGE);
jTFGuestRegID.setText("");
return;
}
strStartDate = format.format(date); //得到系统时间
try {
//-----------------------------------------------------------------------------------------------------
connect1 = new DataConnect();
connect1.con1 = DriverManager.getConnection(connect1.url); //建立连接
connect1.stmt1 = connect1.con1.createStatement(); //创建语句
connect1.sql1 = "SELECT * FROM HIMS_Register";
rs1l = connect1.stmt1.executeQuery(connect1.sql1);
//-----------------------------------------------------------------------------------------------------
while (rs1l.next()) {
String strID = rs1l.getString("RegisterID");
if (strID.equals(strRegisterID)) {
JOptionPane.showMessageDialog(null, "这个ID已被使用,请重新输入!",
"酒店信息管理系统提示",
JOptionPane.WARNING_MESSAGE);
jTFGuestRegID.setText("");
return;
}
} //while
JOptionPane.showMessageDialog(null, "这个ID可以使用!",
"酒店信息管理系统提示",
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -