/**
*##############################################################################
*
* [ 项目名 ] : 阳光酒店管理系统
* [ 模块名 ] : 系统设置模块
* [ 文件名 ] : Setup.java
* [ 相关文件 ] :
* [ 文件实现功能] : 组织系统设置窗口
* [ 版本 ] : 1.1
* ----------------------------------------------------------------------------
* [ 备注 ] :
* ----------------------------------------------------------------------------
* [ 修改记录 ] :
*
* 2006/04/22 1.1 实现数据保存
* ##--------------------------------------------------------------------------
* 版权所有(c) 2006-2007, SunshineSOFT Corporation
* --------------------------------------------------------------------------##
*
* [ 函数说明 ] : 看类内各函数开头
*
* [ 遗留问题 ] :
*
*##############################################################################
*/
package com.sunshine.setup;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import com.sunshine.sunsdk.sql.*; //公共类库
import com.sunshine.sunsdk.system.*;
import com.sunshine.sunsdk.swing.*;
import com.sunshine.mainframe.HotelFrame; //加载主窗口
public class Setup
extends JDialog
implements ActionListener, MouseListener {
private JLabel top,bott;
private JTabbedPane tp;
private JPanel panelMain;
//=========房间项目设置
private JTable tb11, tb12;
private DefaultTableModel dtm11, dtm12; //房间类型列表//房间信息列表
private JScrollPane sp11,sp12;
private JComboBox cb11,cb12;
//房间类型,可供/清理状态
private JButton bt11, bt12, bt13, bt14, bt15, bt16, bt17, bt18, bt19, bt20;
//添加, 修改,删除LX,折扣,单个,批量添加,删除,修改FJ,保存,筛选
private JTextField tf11;
//=========客户类型设置
private JTable tb21,tb22;
private DefaultTableModel dtm21,dtm22;
//客户类型列表,房间费打折列表
private JScrollPane sp21,sp22;
private JButton bt21, bt22, bt23, bt24;
//添加, 修改,删除LX,房费打折
//=========操作员设置
private JTable tb31;
private DefaultTableModel dtm31;
//操作员列表
private JScrollPane sp31;
private JComboBox cb31;//用户名
private JPasswordField tf31, tf32, tf33;
//原密码,新密码,确认密码
private JRadioButton rb31, rb32, rb33, rb34, rb35;
//新用户登记, 修改密码,删除用户,普通用户,管理员
private JButton bt31, bt32, bt33;
// 登记, 修改, 删除
//=========计费设置
private JTextField tf41, tf42, tf43, tf44, tf45, tf46, tf47;
private JCheckBox ck;
private JButton bt41, bt42;
//提示信息
String msg0 = "您确定要删除在表格中选中的资料条目吗?";
String msg1 = "请在相应的表格中选定条目,再点删除键 ...";
//日志信息
String journal;
//INI文件中的键名
String ini[] = { "[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" };
//实例化功能模块
//========================================================================//
AddRoomType art = new AddRoomType (this); //添加房间类型
ModiRoomType mrt = new ModiRoomType(this); //添加房间类型
AddCustomerType act = new AddCustomerType(this); //添加客户类型
ModiCustomerType mct = new ModiCustomerType(this); //添加客户类型
Discount dis = new Discount(this); //折扣设置
AddRoomInfo ari = new AddRoomInfo(this); //单个添加房间
AddRoomInfos aris = new AddRoomInfos(this); //批量添加房间
ModiRoomInfo mri = new ModiRoomInfo(this); //修改房间信息
//========================================================================//
/**=======================================================================**
* [## public Setup(JFrame frame) {} ]: 构造函数
* 参数 :JDialog对象表示本对话框的父窗口
* 返回值 :无
* 修饰符 :public
* 功能 :组建系统设置模块
**=======================================================================**
*/
public Setup(JFrame frame) {
super (frame, "系统设置", true);
top = new JLabel(); //假空格
panelMain = new JPanel(new BorderLayout(0,10));
tab(); //制作系统设置项目标签面板
addListener(); //加入事件监听
panelMain.add("North",top);
panelMain.add("Center",tp);
this.setContentPane(panelMain);
this.setPreferredSize (new Dimension (718,508));
this.setMinimumSize (new Dimension (718,508));
this.setResizable(false); //不允许改变窗口大小
pack();
sunswing.setWindowCenter(this); //窗口屏幕居中
}
/**=======================================================================**
* [## private void addListener() {} ]: 加事件监听
* 参数 :无
* 返回值 :无
* 修饰符 :private
* 功能 :加事件监听
**=======================================================================**
*/
private void addListener() {
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);
}
/**=======================================================================**
* [## private void tab() {} ]: 制作系统设置项目标签面板
* 参数 :无
* 返回值 :无
* 修饰符 :private
* 功能 :制作系统设置项目标签面板
**=======================================================================**
*/
private void tab() {
JPanel jp1,jp2,jp3,jp4;
///////////////////////////////////////////////-------模块面板接口
jp1 = fangjian(); //房间项目设置
jp2 = kehu(); //客户类型设置
jp3 = caozuo(); //操作员设置
jp4 = jiFei(); //计费设置
//////////////////////////////////////////////////////////////////
tp = new JTabbedPane();
tp.addTab("房间项目设置", new ImageIcon("pic/u01.gif"), jp1);
tp.addTab("客户类型设置", new ImageIcon("pic/u02.gif"), jp2);
tp.addTab("操作员设置", new ImageIcon("pic/u03.gif"), jp3);
tp.addTab("计费设置", new ImageIcon("pic/u04.gif"), jp4);
}
/**=======================================================================**
* [## private JPanel fangjian() {} ]: