Java swing实现酒店管理系统
今天给大家提供一个由今天给大家提供一个由Javaswing实现的酒店管理系统,数据库采用sqlserver,我会贴上部分代码,完整的代码请看文章最下方下载,下面看代码:
1.主框架代码:
package主框架窗口;
importjava.awt.BorderLayout;
importjava.awt.Color;
importjava.awt.Dimension;
importjava.awt.FlowLayout;
importjava.awt.event.ActionEvent;
importjava.awt.event.ActionListener;
importjava.awt.event.MouseEvent;
importjava.awt.event.MouseListener;
importjava.awt.event.WindowAdapter;
importjava.awt.event.WindowEvent;
importjava.sql.Connection;
importjava.sql.DriverManager;
importjava.sql.ResultSet;
importjava.sql.Statement;
importjavax.swing.JButton;
importjavax.swing.JFrame;
importjavax.swing.JLabel;
importjavax.swing.JMenu;
importjavax.swing.JMenuBar;
importjavax.swing.JMenuItem;
importjavax.swing.JOptionPane;
importjavax.swing.JPanel;
importjavax.swing.JSplitPane;
importjavax.swing.JToolBar;
importjavax.swing.border.LineBorder;
importjavax.swing.table.DefaultTableModel;
importcom.sunshine.sunsdk.system.suntools;
importsunsdk.sql.Journal;
importsunsdk.sql.sunsql;
importsunsdk.swing.TJButton;
import关于我们.About;
import团体开单.Team;
import客户管理.Customer;
import客房预定.Engage;
import宾客结账.CheckOut;
import散客开单.Individual;
import系统设置.Setup;
import网络设置.NetSetup;
import菜单事件窗口.ApartBill;
import菜单事件窗口.Change;
import菜单事件窗口.GoOn;
import菜单事件窗口.Record;
import菜单事件窗口.UniteBill;
import营业查询.Query;
//加入公共类库
//加入模块类库
//散客开单
//团体开单
//宾客结帐
//预订房间
//营业查询
//客户管理
//网络设置
//系统设置
//关于我们
//下拉菜单中的功能库
publicclassHotelFrame
extendsJFrame
implementsActionListener,MouseListener,Runnable{
//用户名,权限
publicstaticStringuserid,puil;
publicstaticJLabellbA,lbB;
publicstaticStringclue="提示:";
publicstaticStringface="当前操作界面:";
//声名与菜单相关的类
privateJMenuBarmb;
privateJMenum1,m2,m3,m4;
privateJMenuItemmi11,mi12,mi13,mi14,mi15,mi16,mi17,mi18,mi19,
mi21,mi22,mi23,mi24,mi25,
mi31,mi32,mi33,mi34,mi35,mi36;
//工具栏
privateJToolBartb;
privateJButtonbt1,bt2,bt3,bt4,bt5,bt6,bt7,bt8,bt9,btA;
//分割面板
privateJSplitPanespaneMain,spaneLeft,spaneRight;
//模块接口
privateJPanelpanelMain,bott,jp2,jp3,jp4;
privateLeftTopPaneljp1;//主窗口左边面板
//功能提示
privateStringtoolTip[]={
"零散宾客入住登记",
"团体入住登记",
"关于本软件的支持信息",
"宾客退房结算",
"为宾客预订房间",
"查询营业情况",
"为酒店固定客户设置参数",
"设置系统的网络连接方式",
"设置系统参数",
"返回Windows"
};
//功能模块
/*#######################################################################*/
Individualidv=newIndividual(this);//散客开单
Teamtm=newTeam(this);//团体开单
CheckOutco=newCheckOut(this);//宾客结帐
Engageeg=newEngage(this);//客房预定
Queryqr=newQuery(this);//营业查询
Customerct=newCustomer(this);//客户管理
NetSetupns=newNetSetup(this);//网络设置
Setupst=newSetup(this);//系统设置
Aboutab=newAbout(this);//关于我们
GoOngo=newGoOn(this);//宾客续住
Changecg=newChange(this);//更换房间
//Remindrm=newRemind(this);//电子提醒
UniteBillub=newUniteBill(this);//合并帐单
ApartBillap=newApartBill(this);//拆分帐单
Recordrc=newRecord(this);//系统日志
/*#######################################################################*/
//构造函数
publicHotelFrame(Stringus,Stringpu){
super("阳光酒店管理系统-★★版");
userid=us;//获得操作员名称
puil=pu;//获得操作员权限
panelMain=newJPanel(newBorderLayout());//主面板
//制作菜单
buildMenuBar();
//制作工具栏
buildToolBar();
//制作分割面板
buildSpaneMain();
//制作窗口底端信息框
buildBott();
//加入组件到主面板
panelMain.add("North",tb);//加入工具栏
panelMain.add("South",bott);//加入窗口底端信息框
panelMain.add("Center",spaneMain);//加入分割面板
//加入菜单栏
this.setJMenuBar(mb);
//加事件监听
addListener();
this.addWindowListener(newWindowAdapter(){
publicvoidwindowClosing(WindowEventwe){
quit();
}//EndwindowClosing
});
this.setContentPane(panelMain);
this.setBounds(2,2,1020,740);
this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
this.setMinimumSize(newDimension(1020,740));//设置窗口最小尺寸
this.setVisible(true);
(newThread(this)).start();//启动房间状态检查线程
}
//制作菜单
privatevoidbuildMenuBar(){
//实例菜单栏
mb=newJMenuBar();
//实例菜单
m1=newJMenu("来宾登记(B)");
m2=newJMenu("收银结算(S)");
m3=newJMenu("系统维护(W)");
//实例菜单项
mi11=newJMenuItem("散客开单(G)");
mi12=newJMenuItem("团体开单(M)");
mi13=newJMenuItem("宾客续住(Z)");
mi14=newJMenuItem("更换房间(A)");
mi15=newJMenuItem("修改登记(J)");
mi16=newJMenuItem("房间状态(Z)");
mi17=newJMenuItem("预订管理(T)");
mi18=newJMenuItem("电子提醒(L)");
mi19=newJMenuItem("退出系统(X)");
mi21=newJMenuItem("宾客结帐(J)");
mi22=newJMenuItem("合并帐单(E)");
mi23=newJMenuItem("折分帐单(F)");
mi24=newJMenuItem("宾客消费明细查询");
mi25=newJMenuItem("宾客退单明细查询");
mi31=newJMenuItem("网络设置(N)");
mi32=newJMenuItem("系统设置(X)");
mi33=newJMenuItem("系统日志(Z)");
mi34=newJMenuItem("数据备份(R)");
mi35=newJMenuItem("软件帮助(H)");
mi36=newJMenuItem("关于我们(A)");
///////////////////////////////////////////
mi16.setEnabled(false);//未开发完毕的功能
mi18.setEnabled(false);
mi34.setEnabled(false);
////////////////////////////////////////////
//组织菜单
m1.add(mi11);//来宾登记
m1.add(mi12);
m1.add(mi13);
m1.add(mi14);
m1.add(mi15);
m1.add(mi16);
m1.addSeparator();
m1.add(mi17);
m1.add(mi18);
m1.addSeparator();
m1.add(mi19);
m2.add(mi21);//收银结算
m2.add(mi22);
m2.add(mi23);
//m2.addSeparator();
//m2.add(mi24);//宾客消费明细
//m2.add(mi25);
m3.add(mi31);//系统维护
m3.add(mi32);
m3.add(mi33);
m3.addSeparator();
m3.add(mi34);
m3.addSeparator();
m3.add(mi35);
m3.add(mi36);
mb.add(m1);//加入菜单栏
mb.add(m2);
mb.add(m3);
}
//制作工具栏
privatevoidbuildToolBar(){
tb=newJToolBar();
//制作按键
bt1=newTJButton("pic/ToolBar/m01.gif","散客开单","零散宾客入住登记",true);
bt2=newTJButton("pic/ToolBar/m02.gif","团体开单","团体入住登记",true);
bt3=newTJButton("pic/ToolBar/m03.gif","关于我们","软件信息",true);
bt4=newTJButton("pic/ToolBar/m04.gif","宾客结帐","宾客退房结算",true);
bt5=newTJButton("pic/ToolBar/m05.gif","客房预订","为宾客预定房间",true);
bt6=newTJButton("pic/ToolBar/m06.gif","营业查询","查询营业情况",true);
bt7=newTJButton("pic/ToolBar/m07.gif","客户管理","为酒店固定客户设置",true);
bt8=newTJButton("pic/ToolBar/m08.gif","网络设置","设置连接方式",true);
bt9=newTJButton("pic/ToolBar/m09.gif","系统设置","设置系统参数",true);
btA=newTJButton("pic/ToolBar/m10.gif","退出系统","返回Windows",true);
//把按键加入工具栏
tb.addSeparator();
tb.add(bt1);
tb.add(bt2);
tb.addSeparator();
tb.add(bt4);
tb.add(bt5);
tb.add(bt6);
tb.addSeparator();
tb.add(bt7);
tb.add(bt8);
tb.add(bt9);
tb.addSeparator();
tb.add(bt3);
tb.addSeparator();
tb.add(btA);
//设置工具栏不可浮动
tb.setFloatable(false);
}
//制作主面板
privatevoidbuildSpaneMain(){
jp1=newLeftTopPanel();//这四个面板为功能接口//////////////
jp2=newLeftBottPanel();//左下面板快速通道
jp3=newRightTopPanel();///////////////////////////////
jp4=newRightBottPanel();//右下面板消费信息表
//声名分割面板
spaneLeft=newJSplitPane(JSplitPane.VERTICAL_SPLIT,true,jp1,jp2);
spaneRight=newJSplitPane(JSplitPane.VERTICAL_SPLIT,true,jp3,jp4);
spaneMain=newJSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,spaneLeft,spaneRight);
//设置面板最小尺寸
jp1.setMinimumSize(newDimension(157,450));
jp2.setMinimumSize(newDimension(157,94));
jp3.setMinimumSize(newDimension(875,300));
jp4.setMinimumSize(newDimension(875,94));
spaneRight.setMinimumSize(newDimension(875,565));
//设置分割条是否有伸缩键
spaneMain.setOneTouchExpandable(true);
spaneRight.setOneTouchExpandable(true);
//设置各面板的初起尺寸
spaneMain.setDividerLocation(160);
spaneLeft.setDividerLocation(450);
spaneRight.setDividerLocation(450);
//设置分隔条宽度
spaneMain.setDividerSize(10);
spaneLeft.setDividerSize(23);
spaneRight.setDividerSize(23);
}
//制作bott栏
privatevoidbuildBott(){
JLabellb1,lb2;
lb1=newJLabel("阳光酒店管理系统");
lb2=newJLabel("当前操作员:"+userid+"");
lbA=newJLabel(clue+"请选择功能项...");
lbB=newJLabel(face+"阳光酒店管理系统-★★版");
//加外框线
lbA.setBorder(newLineBorder(newColor(87,87,47)));
lbB.setBorder(newLineBorder(newColor(87,87,47)));
lb1.setBorder(newLineBorder(newColor(87,87,47)));
lb2.setBorder(newLineBorder(newColor(87,87,47)));
bott=newJPanel(newFlowLayout(FlowLayout.LEFT,2,2));
bott.add(lb1);
bott.add(lbA);
bott.add(lbB);
bott.add(lb2);
}
//加事件监听
privatevoidaddListener(){
mi11.addActionListener(this);//来宾登记
mi12.addActionListener(this);
mi13.addActionListener(this);
mi14.addActionListener(this);
mi15.addActionListener(this);
mi16.addActionListener(this);
mi17.addActionListener(this);
mi18.addActionListener(this);
mi19.addActionListener(this);
mi21.addActionListener(this);//收银结算
mi22.addActionListener(this);
mi23.addActionListener(this);
mi24.addActionListener(this);
mi25.addActionListener(this);
mi31.addActionListener(this);//系统维护
mi32.addActionListener(this);
mi33.addActionListener(this);
mi34.addActionListener(this);
mi35.addActionListener(this);
mi36.addActionListener(this);
bt1.addActionListener(this);//按键加动作监听
bt2.addActionListener(this);
bt3.addActionListener(this);
bt4.addActionListener(this);
bt5.addActionListener(this);
bt6.addActionListener(this);
bt7.addActionListener(this);
bt8.addActionListener(this);
bt9.addActionListener(this);
btA.addActionListener(this);
bt1.addMouseListener(this);//按键加鼠标监听
bt2.addMouseListener(this);
bt3.addMouseListener(this);
bt4.addMouseListener(this);
bt5.addMouseListener(this);
bt6.addMouseListener(this);
bt7.addMouseListener(this);
bt8.addMouseListener(this);
bt9.addMouseListener(this);
btA.addMouseListener(this);
}
/**=======================================================================**
*[##privatevoidquit(){}]:系统退出
*参数:无
*返回值:无
*修饰符:private
*功能:关闭系统函数,仅类内使用
**=======================================================================**
*/
privatevoidquit(){
intflag=0;
Stringmsg="您现在要关闭系统吗?";
flag=JOptionPane.showConfirmDialog(null,msg,"提示",JOptionPane.YES_NO_OPTION);
if(flag==JOptionPane.YES_OPTION){
Journal.writeJournalInfo(userid,"退出本系统",Journal.TYPE_LG);//记录操作日志
this.setVisible(false);
System.exit(0);
}//Endif(flag==JOptionPane.YES_OPTION)
return;
}
//刷新左房间信息栏数据
privatevoidinitLeftData(){
jp1.title1.setText("");//刷房间信息
for(inti=0;i<8;i++){
jp1.lt[i].setText("");
}//Endfor
jp1.initRoomstate();//刷新房间总状态
}
//传数据给散客开单窗口
privatebooleaninitIDV(){
try{
//从房间信息表里获得当前房间的状态和房间类型编号
ResultSetrs=sunsql.executeQuery("selectstate,r_type_idfromroominfo"+
"wheredelmark=0andid='"+LeftTopPanel.title1.getText()+"'");
if(!rs.next()){//如果无结果集,提示用户刷新房间数据
if(LeftTopPanel.title1.getText().length()==0){
JOptionPane.showMessageDialog(null,"请选定房间后,再为宾客开设房间",
"提示",JOptionPane.INFORMATION_MESSAGE);
}else{
JOptionPane.showMessageDialog(null,"["+LeftTopPanel.title1.getText()+
"]房间信息已更改,请刷新房间信息,再为宾客开设房间","提示",JOptionPane.INFORMATION_MESSAGE);
}
returnfalse;
}else{
if(!rs.getString(1).equals("可供")){//只有状态是可供房间,才能为宾客开设
JOptionPane.showMessageDialog(null,"请选择空房间,再为宾客开设房间",
"提示",JOptionPane.INFORMATION_MESSAGE);
returnfalse;
}//Endif
//传房间号到开单窗口
Individual.lbA.setText(LeftTopPanel.title1.getText());
//传房间类型到开单窗口
Individual.lbB.setText(LeftTopPanel.title0.getText().substring(0,
LeftTopPanel.title0.getText().length()-2));
//传房间单价到开单窗口
Individual.lbC.setText(LeftTopPanel.lt[1].getText());
//房间类型编号
StringclRoom=rs.getString(2);
//获得此类型房间是否可以开设钟点房
rs=sunsql.executeQuery("selectcl_roomfromroomtypewhere"+
"delmark=0andid='"+clRoom+"'");
rs.next();
if(rs.getString(1).equals("N")){//不能开设,则开单窗口的钟点选项不可用
Individual.chk1.setSelected(false);//取消选中状态
Individual.chk1.setEnabled(false);//设置不可用
}else{
Individual.chk1.setEnabled(true);//可用
}//Endif
//传宾客类型数据给开单窗口
rs=sunsql.executeQuery("selectdistinctc_typefromcustomertypewhere"+
"delmark=0andpk!=0");
intct=sunsql.recCount(rs);
StringcType[]=newString[ct];
for(inti=0;i0");
ste1.executeUpdate("updateroominfosetstate='可供'wherestatetime=0andstate='脏房'");
Thread.sleep(30000);
}//Endwhile
}
catch(Exceptionex){
JOptionPane.showMessageDialog(null,"数据库连接失败...","错误",JOptionPane.ERROR_MESSAGE);
System.exit(0);
//ex.printStackTrace();
}//Endtry
}
/*
publicstaticvoidmain(Stringsd[]){
sunswing.setWindowStyle(sunini.getIniKey("Sys_style").charAt(0));
newHotelFrame("gujun","管理员");
}*/
}
2.系统设置:
/**
*##############################################################################
*
*[项目名]:阳光酒店管理系统
*[公司名]:清华IT
*[模块名]:系统设置模块
*[文件名]:Setup.java
*[相关文件]:
*[文件实现功能]:组织系统设置窗口
*[作者]:董丰
*[版本]:1.1
*----------------------------------------------------------------------------
*[备注]:
*----------------------------------------------------------------------------
*[修改记录]:
*
*[日期][版本][修改人][修改内容]
*2006/04/191.0董丰创建
*2006/04/221.1顾俊实现数据保存
*##--------------------------------------------------------------------------
*版权所有(c)2006-2007,SunshineSOFTCorporation
*--------------------------------------------------------------------------##
*
*[函数说明]:看类内各函数开头
*
*[遗留问题]:
*
*##############################################################################
*/
packagecom.sunshine.setup;
importjavax.swing.*;
importjavax.swing.border.*;
importjavax.swing.table.*;
importjava.awt.*;
importjava.awt.event.*;
importjava.sql.*;
importcom.sunshine.sunsdk.sql.*;//公共类库
importcom.sunshine.sunsdk.system.*;
importcom.sunshine.sunsdk.swing.*;
importcom.sunshine.mainframe.HotelFrame;//加载主窗口
publicclassSetup
extendsJDialog
implementsActionListener,MouseListener{
privateJLabeltop,bott;
privateJTabbedPanetp;
privateJPanelpanelMain;
//=========房间项目设置
privateJTabletb11,tb12;
privateDefaultTableModeldtm11,dtm12;//房间类型列表//房间信息列表
privateJScrollPanesp11,sp12;
privateJComboBoxcb11,cb12;
//房间类型,可供/清理状态
privateJButtonbt11,bt12,bt13,bt14,bt15,bt16,bt17,bt18,bt19,bt20;
//添加,修改,删除LX,折扣,单个,批量添加,删除,修改FJ,保存,筛选
privateJTextFieldtf11;
//=========客户类型设置
privateJTabletb21,tb22;
privateDefaultTableModeldtm21,dtm22;
//客户类型列表,房间费打折列表
privateJScrollPanesp21,sp22;
privateJButtonbt21,bt22,bt23,bt24;
//添加,修改,删除LX,房费打折
//=========操作员设置
privateJTabletb31;
privateDefaultTableModeldtm31;
//操作员列表
privateJScrollPanesp31;
privateJComboBoxcb31;//用户名
privateJPasswordFieldtf31,tf32,tf33;
//原密码,新密码,确认密码
privateJRadioButtonrb31,rb32,rb33,rb34,rb35;
//新用户登记,修改密码,删除用户,普通用户,管理员
privateJButtonbt31,bt32,bt33;
//登记,修改,删除
//=========计费设置
privateJTextFieldtf41,tf42,tf43,tf44,tf45,tf46,tf47;
privateJCheckBoxck;
privateJButtonbt41,bt42;
//提示信息
Stringmsg0="您确定要删除在表格中选中的资料条目吗?";
Stringmsg1="请在相应的表格中选定条目,再点删除键...";
//日志信息
Stringjournal;
//INI文件中的键名
Stringini[]={"[SOFTINFO]","UserName","CompName","[CONFIG]","Soft_First",
"Default_Link","Default_Page","Sys_style","[NUMBER]",
"LodgName","LodgNumber","EngaName","EngaNumber","ChouName",
"ChouNumber","[HABITUS]","Ck_Habitus","Ck_Minute","[PARTTIME]",
"In_Room","Out_Room1","Out_Room2","InsuDay","ClockRoom1",
"ClockRoom2","InsuHour1","InsuHour2","[JDBC]","DBFname",
"UserID","Password","IP","Access","[ODBC]","LinkName"};
//实例化功能模块
//========================================================================//
AddRoomTypeart=newAddRoomType(this);//添加房间类型
ModiRoomTypemrt=newModiRoomType(this);//添加房间类型
AddCustomerTypeact=newAddCustomerType(this);//添加客户类型
ModiCustomerTypemct=newModiCustomerType(this);//添加客户类型
Discountdis=newDiscount(this);//折扣设置
AddRoomInfoari=newAddRoomInfo(this);//单个添加房间
AddRoomInfosaris=newAddRoomInfos(this);//批量添加房间
ModiRoomInfomri=newModiRoomInfo(this);//修改房间信息
//========================================================================//
/**=======================================================================**
*[##publicSetup(JFrameframe){}]:构造函数
*参数:JDialog对象表示本对话框的父窗口
*返回值:无
*修饰符:public
*功能:组建系统设置模块
**=======================================================================**
*/
publicSetup(JFrameframe){
super(frame,"系统设置",true);
top=newJLabel();//假空格
panelMain=newJPanel(newBorderLayout(0,10));
tab();//制作系统设置项目标签面板
addListener();//加入事件监听
panelMain.add("North",top);
panelMain.add("Center",tp);
this.setContentPane(panelMain);
this.setPreferredSize(newDimension(718,508));
this.setMinimumSize(newDimension(718,508));
this.setResizable(false);//不允许改变窗口大小
pack();
sunswing.setWindowCenter(this);//窗口屏幕居中
}
/**=======================================================================**
*[##privatevoidaddListener(){}]:加事件监听
*参数:无
*返回值:无
*修饰符:private
*功能:加事件监听
**=======================================================================**
*/
privatevoidaddListener(){
bt11.addActionListener(this);//加动作监听
bt12.addActionListener(this);
bt13.addActionListener(this);
bt14.addActionListener(this);
bt15.addActionListener(this);
bt16.addActionListener(this);
bt17.addActionListener(this);
bt18.addActionListener(this);
bt19.addActionListener(this);
bt20.addActionListener(this);
bt21.addActionListener(this);
bt22.addActionListener(this);
bt23.addActionListener(this);
bt24.addActionListener(this);
bt31.addActionListener(this);
bt32.addActionListener(this);
bt33.addActionListener(this);
bt41.addActionListener(this);
bt42.addActionListener(this);
rb31.addActionListener(this);//操作员作操范围监听
rb32.addActionListener(this);
rb33.addActionListener(this);
tf41.addActionListener(this);//计费设置文本框加监听
tf42.addActionListener(this);
tf43.addActionListener(this);
tf44.addActionListener(this);
tf45.addActionListener(this);
tf46.addActionListener(this);
bt11.addMouseListener(this);//加鼠标监听
bt12.addMouseListener(this);
bt13.addMouseListener(this);
bt14.addMouseListener(this);
bt15.addMouseListener(this);
bt16.addMouseListener(this);
bt17.addMouseListener(this);
bt18.addMouseListener(this);
bt19.addMouseListener(this);
bt20.addMouseListener(this);
bt21.addMouseListener(this);
bt22.addMouseListener(this);
bt23.addMouseListener(this);
bt24.addMouseListener(this);
bt31.addMouseListener(this);
bt32.addMouseListener(this);
bt33.addMouseListener(this);
bt41.addMouseListener(this);
bt42.addMouseListener(this);
}
/**=======================================================================**
*[##privatevoidtab(){}]:制作系统设置项目标签面板
*参数:无
*返回值:无
*修饰符:private
*功能:制作系统设置项目标签面板
**=======================================================================**
*/
privatevoidtab(){
JPaneljp1,jp2,jp3,jp4;
///////////////////////////////////////////////-------模块面板接口
jp1=fangjian();//房间项目设置
jp2=kehu();//客户类型设置
jp3=caozuo();//操作员设置
jp4=jiFei();//计费设置
//////////////////////////////////////////////////////////////////
tp=newJTabbedPane();
tp.addTab("房间项目设置",newImageIcon("pic/u01.gif"),jp1);
tp.addTab("客户类型设置",newImageIcon("pic/u02.gif"),jp2);
tp.addTab("操作员设置",newImageIcon("pic/u03.gif"),jp3);
tp.addTab("计费设置",newImageIcon("pic/u04.gif"),jp4);
}
/**=======================================================================**
*[##privateJPanelfangjian(){}]:
*参数:无
*返回值:JPanel
*修饰符:private
*功能:房间项目设置
**=======================================================================**
*/
privateJPanelfangjian(){
dtm11=newDefaultTableModel();
tb11=newJTable(dtm11);
sp11=newJScrollPane(tb11);
dtm12=newDefaultTableModel();
tb12=newJTable(dtm12);
sp12=newJScrollPane(tb12);
JPanelpfangjian,pTop,pBott,pTn,pTc,pBn,pBc,pTcc,pTcs,pBcc,pBcs;
pfangjian=newJPanel(newGridLayout(2,1,0,5));
pTop=newJPanel(newBorderLayout());
pBott=newJPanel(newBorderLayout());
pTn=newJPanel();//放置保存按钮等...
pTc=newJPanel(newBorderLayout());//放置房间类型列表及四个按钮
pBn=newJPanel(newFlowLayout(FlowLayout.LEFT,10,0));//放置下拉列表
pBc=newJPanel(newBorderLayout());//放置房间信息列表及四个按钮
pTcc=newJPanel(newGridLayout(1,1));//放置房间类型列表
pTcs=newJPanel(newFlowLayout(FlowLayout.CENTER,20,5));//放置四个按钮
pBcc=newJPanel(newGridLayout(1,1));//放置房间信息列表
pBcs=newJPanel(newFlowLayout(FlowLayout.CENTER,20,5));//放置四个按钮
//保存按钮等...
JLabellb1,lb2,lb3;
lb1=newJLabel("结帐后房间状态变为:");
lb2=newJLabel("结帐后");
lb3=newJLabel("分钟后变为可供状态");
tf11=newTJTextField(sunini.getIniKey(ini[17]),5);//根据INI文件给初值
tf11.setHorizontalAlignment(JTextField.RIGHT);
cb12=newJComboBox();
cb12.addItem("可供状态");
cb12.addItem("清理状态");//根据INI文件给初值
cb12.setSelectedIndex(Integer.parseInt(sunini.getIniKey(ini[16])));
bt19=newTJButton("pic/save.gif","保存","保存设置");
pTn.add(lb1);
pTn.add(cb12);
pTn.add(lb2);
pTn.add(tf11);
pTn.add(lb3);
pTn.add(bt19);
pTn.setBorder(BorderFactory.createTitledBorder(""));
//房间类型列表及四个按钮
bt11=newTJButton("pic/new.gif","添加类型","添加房间类型");
bt12=newTJButton("pic/modi0.gif","修改类型","修改房间类型");
bt13=newTJButton("pic/del.gif","删除类型","删除房间类型");
bt14=newTJButton("pic/modi3.gif","房费打折","设置房间费折扣");
pTcc.add(sp11);
pTcs.add(bt11);
pTcs.add(bt12);
pTcs.add(bt13);
pTcs.add(bt14);
pTc.add(pTcc);
pTc.add("South",pTcs);
pTc.setBorder(BorderFactory.createTitledBorder("房间类型"));
//完成上半部分
pTop.add("North",pTn);
pTop.add(pTc);
//下拉列表
JLabellb0=newJLabel("按包厢类型过滤:");
cb11=newJComboBox();
bt20=newTJButton("pic/choose1.gif","筛选","筛选房间信息");
bt20.setBorderPainted(false);
bt20.setFocusPainted(false);
pBn.add(lb0);
pBn.add(cb11);
pBn.add(bt20);
buildDTM11();//初始化房间类型列表和下拉列表的值
buildDTM12("");//初始化房间号列表
//房间信息列表及四个按钮
bt15=newTJButton("pic/new.gif","单个添加","添加单个房间信息");
bt16=newTJButton("pic/book.gif","批量添加","批量添加房间信息");
bt17=newTJButton("pic/del.gif","删除房间","删除某个房间信息");
bt18=newTJButton("pic/modi0.gif","修改房间","修改某个房间信息");
pBcc.add(sp12);
pBcs.add(bt15);
pBcs.add(bt16);
pBcs.add(bt17);
pBcs.add(bt18);
pBc.add(pBcc);
pBc.add("South",pBcs);
pBc.setBorder(BorderFactory.createTitledBorder("房间信息"));
//完成下半部分
pBott.add("North",pBn);
pBott.add(pBc);
//组合
pfangjian.add(pTop);
pfangjian.add(pBott);
returnpfangjian;
}
//
/**=======================================================================**
*[##privatevoidbuildDTM11(){}]:
*参数:无
*返回值:无
*修饰符:private
*功能:房间类型列表和ComboBox
**=======================================================================**
*/
privatevoidbuildDTM11(){
StringsqlCode2="selectpk,sysmark,id,foregift,r_type房间类型,"+
"price预设单价,cl_price"+"'钟点价格/小时'"+",bed床位数量,cl_room"+
"'能否按钟点计费(Y/N)'fromroomtypewheredelmark=0";
sunsql.initDTM(dtm11,sqlCode2);
tb11.removeColumn(tb11.getColumn("pk"));
tb11.removeColumn(tb11.getColumn("sysmark"));
tb11.removeColumn(tb11.getColumn("foregift"));
tb11.removeColumn(tb11.getColumn("id"));
StringsqlCode1="selectr_typefromroomtypewheredelmark=0";
sunsql.initJComboBox(cb11,sqlCode1);
cb11.addItem("显示全部房间信息");
cb11.setSelectedIndex(cb11.getItemCount()-1);//设置显示全部
}
/**=======================================================================**
*[##privatevoidbuildDTM12(StringrType){}]:
*参数:StringrType为刷新参数
*返回值:无
*修饰符:private
*功能:房间信息表
**=======================================================================**
*/
publicvoidbuildDTM12(StringrType){
StringsqlCode="selecta.pk,a.r_type_id,a.id房间号,b.r_type房间类型,"+
"a.state房间状态,a.location所在区域,a.r_tel房间电话fromroominfoasa,"+
"roomtypeasbwherea.r_type_id=b.idanda.delmark=0"+rType;
sunsql.initDTM(dtm12,sqlCode);
tb12.removeColumn(tb12.getColumn("pk"));
tb12.removeColumn(tb12.getColumn("r_type_id"));
}
/**=======================================================================**
*[##privateJPanelkehu(){}]:
*参数:无
*返回值:无
*修饰符:private
*功能:客户类型设置
**=======================================================================**
*/
privateJPanelkehu(){
dtm21=newDefaultTableModel();
tb21=newJTable(dtm21);
sp21=newJScrollPane(tb21);
dtm22=newDefaultTableModel();
tb22=newJTable(dtm22);
sp22=newJScrollPane(tb22);
JPanelpkehu,p1,p2,p1b,p2b;
p1=newJPanel(newBorderLayout());//客户类型面板
p2=newJPanel(newBorderLayout());//房间费打折面板
p1b=newJPanel(newFlowLayout(FlowLayout.CENTER,30,5));//客户类型按钮面板
p2b=newJPanel();//房间费打折按钮面板
buildDTM21();//初始化客户类型表
bt21=newTJButton("pic/new.gif","添加类型","添加客户类型");
bt22=newTJButton("pic/modi0.gif","修改类型","修改客户类型");
bt23=newTJButton("pic/del.gif","删除类型","删除客户类型");
p1b.add(bt21);
p1b.add(bt22);
p1b.add(bt23);
p1.add(sp21);
p1.add("South",p1b);
p1.setBorder(BorderFactory.createTitledBorder("客户类型"));
buildDTM22();//初始化房间打折表
bt24=newTJButton("pic/modi3.gif","房间费打折","设置房间费折扣");
p2b.add(bt24);
p2.add(sp22);
p2.add("South",p2b);
p2.setBorder(BorderFactory.createTitledBorder("房间费打折"));
pkehu=newJPanel(newGridLayout(2,1,0,10));
pkehu.add(p1);
pkehu.add(p2);
returnpkehu;
}
/**=======================================================================**
*[##privateJPanelcaozuo(){}]:
*参数:无
*返回值:JPanel
*修饰符:private
*功能:操作员设置
**=======================================================================**
*/
privateJPanelcaozuo(){
JPanelpanelMain,panelMain1,panelTop,panelBott1,panelBott2;
dtm31=newDefaultTableModel();
tb31=newJTable(dtm31);
sp31=newJScrollPane(tb31);
panelMain=newJPanel(newGridLayout(2,1,0,5));
panelMain1=newJPanel(newBorderLayout(0,3));//下半面板
panelTop=newJPanel(newGridLayout(1,1));//操作员列表面板
panelBott1=newJPanel(newGridLayout(1,2));//详细信息,操作范围,操作权限面板
panelBott2=newJPanel(newFlowLayout(FlowLayout.CENTER,20,5));//按钮面板
bt31=newTJButton("pic/new.gif","登记","保存当前用户信息",false);
bt32=newTJButton("pic/key.gif","修改","修改密码",false);
bt33=newTJButton("pic/del.gif","删除","删除当前用户",false);
bt32.setEnabled(false);
bt33.setEnabled(false);
panelBott2.add(bt31);
panelBott2.add(bt32);
panelBott2.add(bt33);
//制作并加入Top_Left面板
panelBott1.add(bottLeft());
//制作并加入Top_Right面板
panelBott1.add(bottRight());
panelMain1.add("Center",panelBott1);
panelMain1.add("South",panelBott2);
buildDTM31();//初始化操作员信息表
panelTop.add(sp31);
panelTop.setBorder(BorderFactory.createTitledBorder("操作员列表"));
panelMain.add(panelTop);
panelMain.add(panelMain1);
returnpanelMain;
}
/**=======================================================================**
*[##privateJPaneltopLeft(){}]:制作Top_Left面板
*参数:无
*返回值:JPanel表示组织好的面板
*修饰符:private
*功能:组建对话框的用户名和密码面板
**=======================================================================**
*/
privateJPanelbottLeft(){
JLabellb1,lb2,lb3,lb4;
JPaneltl,jp1,jp2;
lb1=newJLabel("用户名:");
lb2=newJLabel("原密码:");
lb3=newJLabel("新密码:");
lb4=newJLabel("确认密码:");
tf31=newTJPasswordField(17);
tf32=newTJPasswordField(17);
tf33=newTJPasswordField(17);
tl=newJPanel();
jp1=newJPanel(newGridLayout(4,1,0,18));
jp2=newJPanel(newGridLayout(4,1,0,9));
//初始化用户名下拉框
cb31=newJComboBox();
cb31.setEditable(true);
tf31.setEditable(false);
//加入组件
jp1.add(lb1);
jp1.add(lb2);
jp1.add(lb3);
jp1.add(lb4);
jp2.add(cb31);
jp2.add(tf31);
jp2.add(tf32);
jp2.add(tf33);
tl.add(jp1);
tl.add(jp2);
tl.setBorder(BorderFactory.createTitledBorder("详细信息"));
returntl;
}
/**=======================================================================**
*[##privateJPaneltopRight(){}]:制作Top_Right面板
*参数:无
*返回值:JPanel表示组织好的面板
*修饰符:private
*功能:组建对话框操作面板
**=======================================================================**
*/
privateJPanelbottRight(){
JPaneltr,jp1,jp2;
ButtonGroupbg1,bg2;
rb31=newJRadioButton("新用户登记",true);
rb32=newJRadioButton("修改密码");
rb33=newJRadioButton("删除用户");
rb34=newJRadioButton("普通操作员",true);
rb35=newJRadioButton("管理员");
bg1=newButtonGroup();
bg2=newButtonGroup();
tr=newJPanel(newGridLayout(2,1));
jp1=newJPanel();
jp2=newJPanel();
//加单选组操作范围
bg1.add(rb31);
bg1.add(rb32);
bg1.add(rb33);
//加单选组操作权限
bg2.add(rb34);
bg2.add(rb35);
jp1.add(rb31);
jp1.add(rb32);
jp1.add(rb33);
jp2.add(rb34);
jp2.add(rb35);
jp1.setBorder(BorderFactory.createTitledBorder("操作范围"));
jp2.setBorder(BorderFactory.createTitledBorder("操作权限"));
tr.add(jp1);
tr.add(jp2);
returntr;
}
/**=======================================================================**
*[##privatevoidbuildDTM21(){}]:
*参数:无
*返回值:无
*修饰符:private
*功能:初始化客户类型列表
**=======================================================================**
*/
privatevoidbuildDTM21(){
StringsqlCode="selectpk,id客户类型编号,id,c_type客户类型,discount"+
"打折比率fromcustomertypewheredelmark=0anddis_attr='购物折扣'andid!='SYSMARK'";
sunsql.initDTM(dtm21,sqlCode);
tb21.removeColumn(tb21.getColumn("pk"));
tb21.removeColumn(tb21.getColumn("id"));
}
/**=======================================================================**
*[##privatevoidbuildDTM22(){}]:
*参数:无
*返回值:无
*修饰符:private
*功能:初始化房间打折费列表
**=======================================================================**
*/
privatevoidbuildDTM22(){
StringsqlCode="selectpk,sysmark,id,foregift,r_type房间类型,price预设单价fromroomtypewheredelmark=0";
sunsql.initDTM(dtm22,sqlCode);
tb22.removeColumn(tb22.getColumn("pk"));
tb22.removeColumn(tb22.getColumn("id"));
tb22.removeColumn(tb22.getColumn("sysmark"));
tb22.removeColumn(tb22.getColumn("foregift"));
}
/**=======================================================================**
*[##privatevoidbuildDTM31(){}]:
*参数:无
*返回值:无
*修饰符:private
*功能:初始化操作员列表
**=======================================================================**
*/
privatevoidbuildDTM31(){
StringsqlCode="selectpk,userid用户登录ID,puis用户权限frompwdwheredelmark=0";
sunsql.initDTM(dtm31,sqlCode);
tb31.removeColumn(tb31.getColumn("pk"));
sunsql.initJComboBox(cb31,"selectuseridfrompwdwheredelmark=0");
}
/**=======================================================================**
*[##privateJPaneljiFei(){}]:
*参数:无
*返回值:JPanel
*修饰符:private
*功能:计费设置
**=======================================================================**
*/
privateJPaneljiFei(){
JLabellb1,lb2,lb3,lb4,lb5,lb6,lb7,lb8,lb9,lb10,
lb11,lb12,lb13,lb14,lb15,lb16;
//定义各方位面板
JPanelpanelJF,jfTop,jfLeft,jfRight,jfBott;
JPaneljp1,jp2,jp3,jp4,jp5,jp6,jp7,jp8,jp9;
//定义标签
lb1=newJLabel("客人开房时间在");
lb2=newJLabel("点之后按新的一天开始计费");
lb3=newJLabel("客人退房时间在");
lb4=newJLabel("点之后计价天数自动追加半天");
lb5=newJLabel("客人退房时间在");
lb6=newJLabel("点之后计价天数自动追加一天");
lb7=newJLabel("开房后");
lb8=newJLabel("分钟开始计费");
lb9=newJLabel("最少按");
lb10=newJLabel("小时计费,小于这个时间的按此时间计费");
lb11=newJLabel("若不足一小时但超过");
lb12=newJLabel("分钟的部分按1小时计费");
lb13=newJLabel("不足上面分钟数但超过");
lb14=newJLabel("分钟的部分按半小时计费");
lb15=newJLabel("注:此设置仅限于标准计费的钟点房!");
lb16=newJLabel("");
lb15.setForeground(newColor(255,138,0));
//初始化计时计费设置
tf41=newTJTextField(sunini.getIniKey("In_Room"),5);
tf42=newTJTextField(sunini.getIniKey("Out_Room1"),5);
tf43=newTJTextField(sunini.getIniKey("Out_Room2"),5);
tf44=newTJTextField(sunini.getIniKey("ClockRoom1"),5);
tf45=newTJTextField(sunini.getIniKey("ClockRoom2"),5);
tf46=newTJTextField(sunini.getIniKey("InsuHour1"),5);
tf47=newTJTextField(sunini.getIniKey("InsuHour2"),5);
//设置文本框右对齐
tf41.setHorizontalAlignment(JTextField.RIGHT);
tf42.setHorizontalAlignment(JTextField.RIGHT);
tf43.setHorizontalAlignment(JTextField.RIGHT);
tf44.setHorizontalAlignment(JTextField.RIGHT);
tf45.setHorizontalAlignment(JTextField.RIGHT);
tf46.setHorizontalAlignment(JTextField.RIGHT);
tf47.setHorizontalAlignment(JTextField.RIGHT);
//不足一天是否按一天计价
ck=newJCheckBox("入住时间不足一天的按一天计费");
if(sunini.getIniKey("InsuDay").equals("1")){
ck.setSelected(true);
}
bt41=newTJButton("pic/save.gif","保存","保存当前设置");
bt42=newTJButton("pic/exit.gif","返回","返回主窗口");
panelJF=newJPanel(newBorderLayout());//计费主面板
jfTop=newJPanel(newGridLayout(2,1));//放左右面板
jfLeft=newJPanel(newGridLayout(4,1));//计费左面板
jfRight=newJPanel(newGridLayout(5,1));//计费右面板
jfBott=newJPanel(newFlowLayout(FlowLayout.RIGHT,40,4));//按键面板
jp1=newJPanel(newFlowLayout(FlowLayout.LEFT));//左边的面板用到的
jp2=newJPanel(newFlowLayout(FlowLayout.LEFT));
jp3=newJPanel(newFlowLayout(FlowLayout.LEFT));
jp4=newJPanel(newFlowLayout(FlowLayout.LEFT));
jp5=newJPanel(newFlowLayout(FlowLayout.LEFT));//右边的面板用到的
jp6=newJPanel(newFlowLayout(FlowLayout.LEFT));
jp7=newJPanel(newFlowLayout(FlowLayout.LEFT));
jp8=newJPanel(newFlowLayout(FlowLayout.LEFT));
jp9=newJPanel(newFlowLayout(FlowLayout.RIGHT));
//制作左边面板
jp1.add(lb1);
jp1.add(tf41);
jp1.add(lb2);
jp2.add(lb3);
jp2.add(tf42);
jp2.add(lb4);
jp3.add(lb5);
jp3.add(tf43);
jp3.add(lb6);
jp4.add(lb16);//假空格
jp4.add(ck);
jfLeft.add(jp1);
jfLeft.add(jp2);
jfLeft.add(jp3);
jfLeft.add(jp4);
//制作右边面板
jp5.add(lb7);
jp5.add(tf44);
jp5.add(lb8);
jp6.add(lb9);
jp6.add(tf45);
jp6.add(lb10);
jp7.add(lb11);
jp7.add(tf46);
jp7.add(lb12);
jp8.add(lb13);
jp8.add(tf47);
jp8.add(lb14);
jp9.add(lb15);
jfRight.add(jp5);
jfRight.add(jp6);
jfRight.add(jp7);
jfRight.add(jp8);
jfRight.add(jp9);
//组织两个表到一起
jfTop.add(jfLeft);
jfTop.add(jfRight);
//组织按键面板
jfBott.add(bt41);
jfBott.add(bt42);
//加入主面板
panelJF.add("Center",jfTop);
panelJF.add("South",jfBott);
jfLeft.setBorder(BorderFactory.createTitledBorder("普通房间标准计费"));
jfRight.setBorder(BorderFactory.createTitledBorder("钟点房标准计费"));
returnpanelJF;
}
/**=======================================================================**
*[##privatebooleaninitMrt(){}]:
*参数:无
*返回值:boolean
*修饰符:private
*功能:传数据给修改房间类型窗口
**=======================================================================**
*/
privatebooleaninitMrt(){
introw=tb11.getSelectedRow();
if(row==-1){
JOptionPane.showMessageDialog(null,"请在上面类型表中指定房间类型,"+
"才能执行修改操作","提示",JOptionPane.INFORMATION_MESSAGE);
returnfalse;
}
ModiRoomType.tf0.setText(dtm11.getValueAt(row,2)+"");//类型编号
ModiRoomType.tf1.setText(dtm11.getValueAt(row,4)+"");//类型名称
ModiRoomType.tf2.setText(dtm11.getValueAt(row,7)+"");//床位数量
ModiRoomType.tf3.setText(dtm11.getValueAt(row,5)+"");//预设单价
ModiRoomType.tf4.setText(dtm11.getValueAt(row,3)+"");//预设押金
ModiRoomType.tf5.setText(dtm11.getValueAt(row,6)+"");//钟点计费
Stringcl_room=dtm11.getValueAt(row,8)+"";
if(cl_room.equals("Y")){
ModiRoomType.chk.setSelected(true);//允许提供钟点服务
}
else{
ModiRoomType.chk.setSelected(false);//不允许提供钟点服务
ModiRoomType.tf5.setEnabled(false);//设置钟点计费不可用
}
returntrue;
}
/**=======================================================================**
*[##privatebooleaninitMri(){}]:
*参数:无
*返回值:boolean
*修饰符:private
*功能:传数据给修改房间信息窗口
**=======================================================================**
*/
privatebooleaninitMri(){
introw=tb12.getSelectedRow();
if(row==-1){
JOptionPane.showMessageDialog(null,"请在上面房间信息表中指定房间号,"+
"才能执行修改操作","提示",JOptionPane.INFORMATION_MESSAGE);
returnfalse;
}
ModiRoomInfo.tf1.setText(dtm12.getValueAt(row,2)+"");//房间编号
ModiRoomInfo.tf2.setText(dtm12.getValueAt(row,5)+"");//所在区域
ModiRoomInfo.tf3.setText(dtm12.getValueAt(row,6)+"");//房间电话
ModiRoomInfo.pk=dtm12.getValueAt(row,0)+"";//获得当前行的PK
try{
ResultSetrs=sunsql.executeQuery("selectr_typefromroomtype"+
"wheredelmark=0andid='"+dtm12.getValueAt(row,1)+"'");
rs.next();
ModiRoomInfo.cb1.setSelectedItem(rs.getString(1));//房间类型
}
catch(Exceptionex){
System.out.println("ModiRoomInfo.initMri():Modifalse");
}//Endtry
returntrue;
}
/**=======================================================================**
*[##privatebooleaninitMct(){}]:
*参数:无
*返回值:boolean
*修饰符:private
*功能:传数据给修改客户类型窗口
**=======================================================================**
*/
privatebooleaninitMct(){
introw=tb21.getSelectedRow();
if(row==-1){
JOptionPane.showMessageDialog(null,"请在上面类型表中指定客户类型,"+
"才能执行修改操作","提示",JOptionPane.INFORMATION_MESSAGE);
returnfalse;
}
ModiCustomerType.tf1.setText(dtm21.getValueAt(row,1)+"");//客户类型编号
ModiCustomerType.tf2.setText(dtm21.getValueAt(row,3)+"");//客户类型名称
ModiCustomerType.tf3.setText(dtm21.getValueAt(row,4)+"");//客户类型折扣
ModiCustomerType.pk=dtm21.getValueAt(row,0)+"";//获得当前行的PK
returntrue;
}
/**=======================================================================**
*[##privatebooleaninitDis(JTabledtb,DefaultTableModelddtm){}]:
*参数:JTable与DefaultTableModel为项目与折扣中的表
*返回值:boolean
*修饰符:private
*功能:传数据给打折设置窗口
**=======================================================================**
*/
privatebooleaninitDis(JTabledtb,DefaultTableModelddtm){
introw=dtb.getSelectedRow();
if(row==-1){
JOptionPane.showMessageDialog(null,"请在相应列表中指定房间类型,"+
"才能进行打折设置操作","提示",JOptionPane.INFORMATION_MESSAGE);
returnfalse;
}
try{
Discount.rt=ddtm.getValueAt(row,2)+"";//获得房间编号
ResultSetrs=sunsql.executeQuery("selectdiscountfromcustomertype"+
"whereid='SYSMARK'anddis_attr='"+ddtm.getValueAt(row,2)+"'");
rs.next();
inttemp=rs.getInt(1);
if(temp==10){
Discount.cb1.setSelectedIndex(1);//普通宾客不打折选项
Discount.tf1.setEnabled(false);
}else{
Discount.cb1.setSelectedIndex(0);//普通宾客打折选项
Discount.tf1.setEnabled(true);
}//Endif
Discount.tf1.setText(temp+"");//普通宾客的折扣
}
catch(Exceptionex){
}
Discount.lb1.setText(ddtm.getValueAt(row,4)+"");//房间类型名称
Discount.lb2.setText(ddtm.getValueAt(row,5)+"");//房间价格
//初始化表格的DTM
sunsql.initDTM(Discount.dtm,"selectc_type客户等级,discount享受折扣,"+
"dis_price折扣价格fromcustomertypewheredelmark=0anddis_attr='"+
ddtm.getValueAt(row,2)+"'andid!='SYSMARK'");
//初始化会员等级ComboBox
sunsql.initJComboBox(Discount.cb2,"selectc_typefromcustomertypewhere"+
"delmark=0andid!='SYSMARK'anddis_attr='"+ddtm.getValueAt(row,2)+"'");
returntrue;
}
/**=======================================================================**
*[##privatebooleandelInfo(StringtName,DefaultTableModeldelDtm,intdr[],Stringm){}]:
*参数:SringtName表示要执行删除的表名
*DTMdelDtm表示相关联的DTM
*intdr[]要被执行删除的行数
*Stringm提示信息
*返回值:boolean
*修饰符:private
*功能:房间类型、房间信息和客户类型的删操作
**=======================================================================**
*/
privatebooleandelInfo(StringtName,DefaultTableModeldelDtm,intdr[],Stringm){
introwCount=dr.length;
intr=0;//DTM行指针
if(tName.equals("roomtype")){//如果删除房间类型,则删除与房间类型相关的房间信息与客户折扣设置
rowCount=rowCount*3;
}//Endif
if(rowCount>0){//判断选择记录数
intisDel=JOptionPane.showConfirmDialog(null,m,"提示",JOptionPane.YES_NO_OPTION);
if(isDel==JOptionPane.YES_OPTION){
StringsqlCode[]=newString[rowCount];
//生成SQL语句
for(inti=0;i