📄 guestchechinroom.java~75~
字号:
this.getContentPane().add(jPGuestRegID, new XYConstraints(4, 3, 226, 32));
jPRoomID01.add(jTFRoomID01, new XYConstraints(90, 5, 128, 29));
jPRoomID01.add(jTFRoomID02, new XYConstraints(90, 43, 128, 29));
jPRoomID01.add(jTFRoomID03, new XYConstraints(90, 79, 128, 29));
jPRoomID01.add(jLRoomID03, new XYConstraints(10, 84, -1, -1));
jPRoomID01.add(jTFRoomID04, new XYConstraints(90, 115, 128, 29));
jPRoomID01.add(jLRoomID04, new XYConstraints(10, 123, -1, -1));
jPRoomID02.add(jTFRoomID06, new XYConstraints(86, 41, 128, 29));
jPRoomID02.add(jTFRoomID07, new XYConstraints(86, 79, 128, 29));
jPRoomID02.add(jTFRoomID08, new XYConstraints(86, 115, 128, 29));
jPRoomID02.add(jLRoomID08, new XYConstraints(9, 123, -1, -1));
jPRoomID02.add(jLRoomID07, new XYConstraints(9, 84, -1, -1));
jPCommand01.add(jBShowFreeRoom, new XYConstraints(2, 4, 85, 20));
this.getContentPane().add(jPCommand02, new XYConstraints(394, 3, 64, 32));
jPCommand02.add(jBYes, new XYConstraints(3, 4, -1, 20));
this.getContentPane().add(jPCommand01, new XYConstraints(232, 3, 93, 32));
this.getContentPane().add(jPCommand03, new XYConstraints(327, 3, 66, 32));
jPCommand03.add(jBChange, new XYConstraints(3, 2, -1, -1));
jPCommand03.add(jBPush, new XYConstraints(3, 2, -1, -1));
SetFormCenter windowcenter = new SetFormCenter();
windowcenter.setcenter(this);
jTFGuestRegID.setText(guestreg.RegisterID);
}
public void jButton3_actionPerformed(ActionEvent e) { //
strRoomName01 = jTFRoomID01.getText();
strRoomName02 = null;
strRoomName03 = null;
strRoomName04 = null;
strRoomName05 = null;
strRoomName06 = null;
strRoomName07 = null;
strRoomName08 = null;
try {
strRoomName02 = jTFRoomID02.getText();
} catch (Exception ex) {
strRoomName02 = null;
}
try {
strRoomName03 = jTFRoomID03.getText();
} catch (Exception ex) {
strRoomName03 = null;
}
try {
strRoomName04 = jTFRoomID04.getText();
} catch (Exception ex) {
strRoomName04 = null;
}
try {
strRoomName05 = jTFRoomID05.getText();
} catch (Exception ex) {
strRoomName05 = null;
}
try {
strRoomName06 = jTFRoomID06.getText();
} catch (Exception ex) {
strRoomName06 = null;
}
try {
strRoomName07 = jTFRoomID07.getText();
} catch (Exception ex) {
strRoomName07 = null;
}
try {
strRoomName08 = jTFRoomID08.getText();
} catch (Exception ex) {
strRoomName08 = null;
}
//----------------------------------------------------------------------- 散客登记管理||团体登记管理
if (MainFrame.strGuestStyle.equals("SN") ||
MainFrame.strGuestStyle.equals("TN")) { //散客登记管理||团体登记管理
try {
connect1 = new DataConnect();
connect2 = new DataConnect();
connect1.con1 = DriverManager.getConnection(connect1.url); //建立连接
connect2.con2 = DriverManager.getConnection(connect2.url); //建立连接
connect1.stmt1 = connect1.con1.createStatement(); //创建语句
connect2.stmt2 = connect2.con2.createStatement(); //创建语句
connect1.sql1 =
" Update HIMS_Register_CheckInRoom Set RoomName01 = '" +
strRoomName01
+ "',RoomName02 = '" + strRoomName02 +
"',RoomName03 = '" + strRoomName03
+ "',RoomName04 = '" + strRoomName04 +
"',RoomName05 = '" + strRoomName05 +
"' ,RoomName06 = '" + strRoomName06 +
"',RoomName07 = '" + strRoomName07 + "',RoomName08 = '" +
strRoomName08 +
"' where RegRoomID = '" + guestreg.RegisterID + "'";
connect2.sql2 =
" UPDATE HIMS_RoomState SET OnUser = '1' , Reason = '此房间有客人入住!!' where RoomID = '" +
strRoomName01 + "' or RoomID = '" +
strRoomName02
+ "' or RoomID = '" + strRoomName03 +
"' or RoomID = '" + strRoomName04 +
"' or RoomID = '" + strRoomName05 +
"' or RoomID = '" + strRoomName02
+ "' or RoomID = '" + strRoomName06 +
"' or RoomID = '" + strRoomName07 +
"' or RoomID = '" + strRoomName08 + "'";
connect1.stmt1.executeUpdate(connect1.sql1);
connect2.stmt2.executeUpdate(connect2.sql2);
//---------------------------------------------------------------------------------------散客预约管理||团体预约管理
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
try {
if (connect1.con1 != null && connect2.con2 != null) {
connect1.con1.close(); //关闭数据库
connect2.con2.close(); //关闭数据库
connect1.stmt1.close();
connect2.stmt2.close();
JOptionPane.showMessageDialog(null, "操作成功!",
"酒店信息管理系统提示",
JOptionPane.WARNING_MESSAGE);
this.setVisible(false);
} //if
} catch (SQLException ex) {
System.out.println(ex);
} //catch
} //finally
}
//-----------------------------------------------------------------
else if (MainFrame.strGuestStyle.equals("SF") ||
MainFrame.strGuestStyle.equals("TF")) {
try {
connect1 = new DataConnect();
connect2 = new DataConnect();
connect1.con1 = DriverManager.getConnection(connect1.url); //建立连接
connect2.con2 = DriverManager.getConnection(connect2.url); //建立连接
connect1.stmt1 = connect1.con1.createStatement(); //创建语句
connect2.stmt2 = connect2.con2.createStatement(); //创建语句
connect1.sql1 =
" Update HIMS_Register_CheckInRoom Set RoomName01 = '" +
strRoomName01
+ "',RoomName02 = '" + strRoomName02 +
"',RoomName03 = '" + strRoomName03
+ "',RoomName04 = '" + strRoomName04 +
"',RoomName05 = '" + strRoomName05 +
"' ,RoomName06 = '" + strRoomName06 +
"',RoomName07 = '" + strRoomName07 + "',RoomName08 = '" +
strRoomName08 + "' where RegRoomID = '" +
guestreg.RegisterID + "'";
connect2.sql2 = " UPDATE HIMS_RoomState SET OnUser = '3' , Reason = '此房间以预定!!' where RoomID = '" +
strRoomName01 + "' or RoomID = '" +
strRoomName02
+ "' or RoomID = '" + strRoomName03 +
"' or RoomID = '" + strRoomName04 +
"' or RoomID = '" + strRoomName05 +
"' or RoomID = '" + strRoomName02
+ "' or RoomID = '" + strRoomName06 +
"' or RoomID = '" + strRoomName07 +
"' or RoomID = '" + strRoomName08 + "'";
connect1.stmt1.executeUpdate(connect1.sql1);
connect2.stmt2.executeUpdate(connect2.sql2);
//-----------------------------------------------------------------------------------------------------
} catch (SQLException ex) {
ex.printStackTrace();
} finally {
try {
if (connect1.con1 != null && connect2.con2 != null) {
connect1.con1.close(); //关闭数据库
connect2.con2.close(); //关闭数据库
connect1.stmt1.close();
connect2.stmt2.close();
JOptionPane.showMessageDialog(null, "操作成功!",
"酒店信息管理系统提示",
JOptionPane.WARNING_MESSAGE);
this.setVisible(false);
} //if
} catch (SQLException ex) {
System.out.println(ex);
} //catch
} //finally
}
}
public void jButton1_actionPerformed(ActionEvent e) {
RoomManagement.FreeRoomQuery freeroomquery = new RoomManagement.
FreeRoomQuery();
freeroomquery.setVisible(true);
}
public void jBChange_actionPerformed(ActionEvent e) {
ChangeRoom changeroom = new ChangeRoom();
changeroom.setVisible(true);
jBChange.setVisible(false);
jBPush.setEnabled(true);
}
public void jBPush_actionPerformed(ActionEvent e) {
jBYes.setEnabled(true);
strRoomName01 = jTFRoomID01.getText();
strRoomName02 = jTFRoomID02.getText();
strRoomName03 = jTFRoomID03.getText();
strRoomName04 = jTFRoomID04.getText();
strRoomName05 = jTFRoomID05.getText();
strRoomName06 = jTFRoomID06.getText();
strRoomName07 = jTFRoomID07.getText();
strRoomName08 = jTFRoomID08.getText();
if (strRoomName01.equals(changeroom.strOldRoomID)) {
jTFRoomID01.setText(changeroom.strNewRoomID);
} else if (strRoomName02.equals(changeroom.strOldRoomID)) {
jTFRoomID02.setText(changeroom.strNewRoomID);
} else if (strRoomName03.equals(changeroom.strOldRoomID)) {
jTFRoomID03.setText(changeroom.strNewRoomID);
} else if (strRoomName04.equals(changeroom.strOldRoomID)) {
jTFRoomID04.setText(changeroom.strNewRoomID);
} else if (strRoomName05.equals(changeroom.strOldRoomID)) {
jTFRoomID05.setText(changeroom.strNewRoomID);
} else if (strRoomName06.equals(changeroom.strOldRoomID)) {
jTFRoomID06.setText(changeroom.strNewRoomID);
} else if (strRoomName07.equals(changeroom.strOldRoomID)) {
jTFRoomID07.setText(changeroom.strNewRoomID);
} else if (strRoomName08.equals(changeroom.strOldRoomID)) {
jTFRoomID08.setText(changeroom.strNewRoomID);
}
}
}
class GuestChechInRoom_jBPush_actionAdapter implements ActionListener {
private GuestChechInRoom adaptee;
GuestChechInRoom_jBPush_actionAdapter(GuestChechInRoom adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jBPush_actionPerformed(e);
}
}
class GuestChechInRoom_jBChange_actionAdapter implements ActionListener {
private GuestChechInRoom adaptee;
GuestChechInRoom_jBChange_actionAdapter(GuestChechInRoom adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jBChange_actionPerformed(e);
}
}
class GuestChechInRoom_jButton1_actionAdapter implements ActionListener {
private GuestChechInRoom adaptee;
GuestChechInRoom_jButton1_actionAdapter(GuestChechInRoom adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton1_actionPerformed(e);
}
}
class GuestChechInRoom_jButton3_actionAdapter implements ActionListener {
private GuestChechInRoom adaptee;
GuestChechInRoom_jButton3_actionAdapter(GuestChechInRoom adaptee) {
this.adaptee = adaptee;
}
public void actionPerformed(ActionEvent e) {
adaptee.jButton3_actionPerformed(e);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -