您好,欢迎来到九壹网。
搜索
您的当前位置:首页软件工程课程设计实验室设备管理系统

软件工程课程设计实验室设备管理系统

来源:九壹网
实验室设备目录

管理系统

一、 系统的开发背景与目标…………………………………………………

1、开发背景………………………………………………………………… 2、开发目标…………………………………………………………………

二、 可行性分析与初步开发计划……………………………………………

1、技术可行性……………………………………………………………… 2、经济可行性……………………………………………………………… 3、法律可行性……………………………………………………………… 4、初步开发计划……………………………………………………………

三、 需求分析……………………………………………………………………

1、系统功能列表…………………………………………………………… 2、数据流图………………………………………………………………… 3、数据字典………………………………………………………………… 4、数据加工的描述………………………………………………………… 5、性能需求…………………………………………………………………

四、 系统设计……………………………………………………………………

1、系统结构图……………………………………………………………… 2、输出设计………………………………………………………………… 3、数据库结构设计………………………………………………………… 4、模块详细设计……………………………………………………………

五、 课程设计总结……………………………………………………………… 六、 代码………………………………………………………………………… 七、 参考文献……………………………………………………………………

一、系统的开发背景与开发目标

1、系统的开发背景

现代社会的校园网络环境,已经大大发生了变化,除了个人笔记本电脑,各种计算机、语音实验室机房也成为了使用频率颇高的场所,我们不能仅仅把它理解为提供上机的环境,而是应该完善此处的各种相关工作,如考勤,收费等,同?时最大限度的降低机房的运营成本,提高使用率。通过建设“实验室设备管理系统”,?运用先进的技术手段和设备,满足以上应用需求。实验室设备管理系统是一个功能比较完善的数据管理软件,?具有数据操作方便高效?迅速等优点,具有很好的可移植性,可在?WINDOWS?系列等操作系统上使用。

2、系统的开发目标

a 提高人员的工作效率,提高设备的利用率 b实验室的设备管理更加便捷有效 c减少设备管理的费用,节省开支 d提高决策效率 e能够准确的控制生产

二、可行性分析与初步开发计划

1技术可行性 1.1对系统的简要描述

在原来的手工系统之上创建,利用计算机实现对实验室设备的管理,包括借出、购入、修理仪器、归还仪器等各种功能

1.2采用建议系统可能带来的影响

在建立所建议系统时,预期会带来的影响包括以下几个方面。 (1)对设备的影响

由于所建议系统是基于WINDOWS操作系统和互联网的,所以需要配备足够符合以上列出的各种软硬件条件的计算机和通信线路。系统失效后,服务器端需要利用备份的数据库恢复数据信息,要求要有足够的数据备份空间。

(2)对软件的影响

需要落实是否有符合本报告所列出的正版的软件环境,如果没有则需要购买。

(3)对用户单位机构的影响

投入使用前还需改进现有的管理模式。

(4)对开发的影响

管理员只要输入简单的数据就可以完成设备管理。

(5)对经费开支的影响

除了需要支付开发单位的有关费用外,每年还需要一定的运行维护费用(见经济可行性分析)。

1.3技术可行性评价

本系统是一个基于局域网、互联网和WINDOWS操作的系统,现有技术已较为成熟,利用现有技术完全可以实现系统开发目标。同时,开发期限较为宽裕, 预计可以在规定期限内完成开发任务。

2经济可行性 2.1支出

(1)一次性支出

1)系统开发、建立费用3.4万元。其中:本系统开发期为3个月,需要开发人员3人

(不一定都是参加满3个月)。根据软件系统的规模估算,开发工作量月为3人2个月即6人月,每人月的人工费按5000员计算,开发费用为3万元。实验室设备等基本信息建立需要2人1个月即2人月,每人月的人工费用按2000员计算,需0.4万元。

2)硬件设备费共4.6万元,其中:微机1台约0.6万元;服务器1台及网络等设备费4万元。

3)外购开发工具、软件环境费用共4万元。 4)其他费用共2万元。

一次性支出总费用:14万元。 (2)经常性费用

主要是系统的运行费用,假设本系统运行期10年,每年的运行费用(包括系统维修、设备维护等)5万元,按年利率5%计算运行费用见 表A-1 系统投资成本总额为:14+38.6082=52.6082 万元

2.2效益

假设投入本系统,效率可以提高50%,以现有的工作人员10人计算,可减少5人,每人每月平均工资按2500元计算,每年节约人员工资5×12×0.25=15万元/年。按年利率5%计算,效益计算如下表。

系统收益总额为:115.8279万元。

2.3收益/投资比

在10年期内,系统总成本52.6082万元,系统总收益115.8279万元。 投资回报率:×%

(即为52.6082=15 /(1+j)+15/(1+j)2+…+15/(1+j)10的方程解i×100) 纯收益:115.8279-52.6082=63.21975万元 从经济上考虑,开发本系统完全可行的。

2.4投资回收周期

投资回收期:3+(52.6082-40.84)/12.3406=3.95年

2.5敏感性分析

生命周期为10年,需要30人左右。

3法律可行性

3.1法律因素

侵犯专利权:有?侵犯版权:有?

为了能够解决在使用实验设备出现的一些问题,需要建立一个安全完善的管理平台,能够使设备信息能够快速完整地自动记录在案,并自动更新

3.2用户使用可行性

适用于实验室设备管理,系统操作简单,便于管理人员使用。

4初步开发计划

任务 开发背景与目标 可行性分析 需求分析 系统设计 编码 调试 计划时间 2天 3天 10天 20天 15天 5天 人员 三、需求分析

1、系统功能列表(Function List)

需求标号 需求名称 统计查询 需求来源 用户 需求描述 查询设备的信息如购买日期,型号类别 需求等级 低 1 2 3 4 维修 用户 维修的情况,维修员,维修日期,维修状况 中 购买 用户 购买的情况和信息,购买日期,价格 高 报废 用户 报废设备的信息,报废日期和型号数量 高 2、数据流图

0层数据流图: 1层数据流图: 2层数据流图: 3、数据字典

1.数据流条目 登陆信息

输入:设备管理员 输出:身份验证

描述:登陆信息=用户名+密码+登陆权限 查询信息

输入:合法人员对设备的查询操作 输出:设备信息表

描述:查询信息=[设备名|型号|类别|购置日期] 维修信息

输入:所需维修设备的信息 输出:确定维修设备的记录

描述:维修信息=修理日期+设备名+编号+修理厂家+修理费用+责任人 购买设备

输入:购买设备的信息

输出:确定购买的新设备的记录

描述:新设备=类别+设备名+编号+型号+规格+单价+数量+购置日期+生产厂家+保质期+经办人等 报废设备

输入:所需报废的设备的信息 输出:报废的设备记录

描述:报废设备=类别+设备+型号等 审核信息 输入:审核 输出:上级领导

描述:审核信息=报废设备信息/新设备购买信息 2.加工条目

身份验证,统计查询,维修,购买,报废,生产报表,审核。 3.文件条目 登陆表

输入:身份验证 输出:身份验证

数据结构:用户名+密码+登陆权限 设备基本信息表 输入:统计查询

数据结构:类别+设备名+型号+规格等 维修记录表

输入:统计查询,维修

输出:统计查询

数据结构:修理日期+设备名+编号+修理厂家+修理费用+责任人 购买设备表

输入:统计查询,购买 输出:统计查询

数据结构:类别+设备名+编号+型号+规格+单价+数量+购置日期+生产厂家+保质期+经办人等 报废记录表

输入:报废,统计查询,生产报表 输出:统计查询,生产报表 数据结构:类别+设备名+型号等 申请表

输入:统计查询,生产报表 输出:统计查询,生产报表,购买 数据结构:类别+设备名+型号+规格+数量

4.数据加工处理的描述

登陆用例

简要说明:?本用例说明用户如何登录到系统。? 角色:?管理员、实验员、学生? 前置条件:?启动程序,进入登录界面? 基本事件流:???

1.用户输入基本信息(登录名和密码),点击确定按钮?

2.系统查找数据库,看该用户是否在数据库中。若存在则进入主页面。?

备选事件流:?1.输入无效的用户名或密码,提示用户名或密码不能为空或者提示用户名或密码不正确。? ?后置条件:?登录成功?

特殊需求:?没有和本用例有关的特殊需求。? 扩展点:?没有和本用例有关的扩展点。? 购买设备用例?

简要说明:?本用例说明管理员如何购买设备并记录进入系统。? 角色:?管理员?

前置条件:?已经成功登陆到系统。? 基本事件流:???

1.管理员填写设备各种信息,确定添加。?2.系统把对应信息写入数据库,更新数据库。?? 备选事件流:?输入了已存在的设备编号,系统提示编号中已存在。? 后置条件:?购买成功。?

特殊需求:?没有和本用例有关的特殊需求。? 扩展点:?没有和本用例有关的扩展点。? 报废设备用例?

简要说明:?本用例说明管理员如何从入系统中删除报废的设备记录。? 角色:?管理员?

前置条件:?已经成功登陆到系统。? 基本事件流:???

1.管理员根据设备编号,找到需要删除的设备记录,确定删除。?2.系统把从数据库中删除对应信息,更新数据

库。??

备选事件流:?输入了不存在的设备编号,系统提示未找到记录。? 后置条件:?删除成功。?

特殊需求:?没有和本用例有关的特殊需求。 ?扩展点:?没有和本用例有关的扩展点。? 设备查询用例

简要说明:?本用例说明管理员如何查询系统中已记录的实验设备。? 角色:?管理员?

前置条件:?已经成功登陆到系统。? 基本事件流:???

1.管理员选择设备查询功能,根据名称、编号、添加时间等方式,填写信息并查询。? 2.系统查找数据库,找到符合条件的信息。?3.返回找到的信息。? 备选事件流:?输入不存在的设备信息,系统提示未找到该设备信息。? 后置条件:?查询成功。?

特殊需求:?没有和本用例有关的特殊需求。 ?扩展点:?没有和本用例有关的扩展点。?

5.性能需求

5.1数据精确度

该软件计算设备时以“台”、“件”等为实物计件单位,报表输出中的金额保证到0.01的精度。

5.2时间特性

查询在3秒内完成,表项输出在8秒内完成

5.3适应性

考虑到工作人员有时候办公地点的移动性,在设计时应该注意软件的适应性,对于查询功能应尽可能方便地将其移植到笔记本、掌上电脑等硬件平台

6.运行需求

6.1用户界面

采用Windows的通用图形界,对用户友好,且必须对鼠标和键盘提供支持。

6.2硬件接口

支持一般x86系列微机和Windows?CE,即一般的PC机。

四、系统设计

1.状态图

2.输出设计

输入:

a. 输入数据数字信息符合输入精度要求 b. 输入可选信息完全使用下拉框完成 输出:

a. 输出数据符合输出精度要求

输出数据格式字体大小统一

3.数据库结构设计

(1) 实体表

【1】 用户表(UserInfo) 字段 类型 uId Varchar(15) uName Varchar(15) uPasswd Varchar(15) uPosition Varchar(15) 【2实验室管理员表(StoreManagerInfo) 字段 类型 uId lId 【3实验室表(LabInfo) 字段 lId lName lPlace 【4设备表(EquipInfo) 字段 eId eName Varchar(15) Varchar(15) 备注 用户名,主键 姓名 密码 身份,主键 备注 用户名,主键 仓库编号,外键约束于实验室表 备注 实验室编号,主键 实验室名称 所在校区 备注 设备编号,主键 设备名称 类型 Varchar(15) Varchar(15) Varchar(15) 类型 Varchar(15) Varchar(15) eStandard Varchar(15) eProCompany Varchar(15) eType Varchar(15) (2) 关系表 【1】 入库登记表(InInfo) 字段 类型 eId Varchar(15) sId Varchar(15) 规格型号 生产厂商 设备类型 iDate DateTime iNum int (3) 记录表 【1】购买申请表(BuyApplyInfo) 字段 类型 baId Varchar(15) eId Varchar(15) smName Varchar(15) 备注 设备编号,主键,外键约束于设备表 仓库编号,主键,外键约束于仓库表 入库时间,主键 入库数量 baDate DateTime baNum Int 【2】维修申请表(MaintainInfo) 字段 类型 maId Varchar(15) pId Varchar(15) lmName Varchar(15) 备注 序列号,主键 设备编号,外键约束于设备表 申请人,外键约束于仓库管理员表 申请时间 申请数量 备注 序列号,主键 固定资产编号,外键约束于固定资产表 申请人,外键约束于实验室管理员表 申请时间 备注 序列号,主键 设备编号,外键约束于设备表 购买单价 购买时间 购买数量 备注 序列号,主键 固定资产编号,外键约束于固定资产表 维修时间 maDate DateTime 【3】购买登记表(BuyInfo) 字段 类型 bId Varchar(15) eId Varchar(15) bPrice Money bDate DateTime bNum Int 【4】维修记录表(MaintainInfo) 字段 类型 mId Varchar(15) pId Varchar(15) mDate DateTime 【5】报废记录表(DiscardInfo) 字段 dId pId 类型 Varchar(15) Varchar(15) dDate DateTime 【6】 购买审核表(BuyCheckInfo) 字段 类型 bcId Varchar(15) baId Varchar(15) olName Varchar(15) 备注 序列号,主键 固定资产编号,外键约束于固定资产表 报废时间 备注 序列号,主键 申请序列号,外键约束于购买申请表 审核人,外键约束于上级领导表 审核时间 备注 序列号,主键 申请序列号,外键约束于维修申请表 审核人,外键约束于上级领导表 审核时间 bcDate DateTime 【7】维修审核表(MaintainCheckInfo) 字段 类型 mcId Varchar(15) maId Varchar(15) olName mcDate Varchar(15) DateTime 4.模块详细设计

设备管理员操作模块 设备管理员

五、课程设计总结 六、代码

1、用户登录界面:

package import

import java.awt.*; import

import javax.swing.*;

public class Login extends JFrame {

/** * */

private static final long serialVersionUID = 1L; // 控件声明

private JLabel lPosition, lName, lPasswd, lTitle;

private JComboBox cbPosition, cbName; private JPasswordField pfPasswd; private JButton bConfirm, bCancel; private Container con; private JPanel[] pCon; private User info; public Login() { }

public void launch() {

// 控件添加

con.setLayout(new GridLayout(5, 1)); pCon[0].add(lPosition); pCon[0].add(cbPosition); pCon[1].add(lName); super(\"用户登录\"); // 控件初始化

con = getContentPane();

lPosition = new JLabel(\"身 份:\"); lName = new JLabel(\"用户名:\"); lPasswd = new JLabel(\"密 码:\");

lTitle = new JLabel(\"实验室设备管理系统\"); lTitle.setForeground(Color.RED); pfPasswd = new JPasswordField(); bConfirm = new JButton(\"确定\"); bCancel = new JButton(\"取消\");

String[] aPosition = new String[] { \"系统管理员\", \"仓库管理员\", \"实验室管理员\",

\"购买登记员\", \"上级领导\" };

cbPosition = new JComboBox(aPosition); int index = cbPosition.getSelectedIndex(); if (index == 0) { }

// 数组初始化

pCon = new JPanel[5];

String[] cName = info.getIdByPosition(info); cbName = new JComboBox(cName); for (int i = 0; i < pCon.length; i++)

pCon[i] = new JPanel(); info = new Administration(); info = new StoreManager(); info = new LabManager(); info = new BuyManager(); info = new OverLeader(); } else if (index == 1) { } else if (index == 2) { } else if (index == 3) { } else {

}

pCon[1].add(cbName); pCon[2].add(lPasswd); pCon[2].add(pfPasswd); pCon[3].add(bConfirm); pCon[3].add(bCancel); pCon[4].add(lTitle); add(pCon[4]);

for (int i = 0; i < pCon.length - 1; i++)

con.add(pCon[i]); // 控件设置

pfPasswd.setEchoChar('*'); pfPasswd.setColumns(10); setBounds(400, 100, 400, 400); setVisible(true);

setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // 添加

cbPosition.addActionListener(new ListenAction()); bConfirm.addActionListener(new ListenAction()); bCancel.addActionListener(new ListenAction()); pfPasswd.addKeyListener(new ListenKey());

// 定义按钮,下拉框处理器

class ListenAction implements ActionListener {

public void actionPerformed(ActionEvent e) {

if (e.getSource() == bConfirm) {//点击确定按钮

info.setuId(cbName.getSelectedItem().toString()); info.setuPasswd(new String(pfPasswd.getPassword())); info.setuPosition(cbPosition.getSelectedItem().toString()); if (info.login(info)) { }

int index = cbPosition.getSelectedIndex(); if (index == 0) {

info = new Administration(); info = new StoreManager(); info = new LabManager(); info = new BuyManager(); } else if (index == 1) { } else if (index == 2) { } else if (index == 3) {

new Main(info).launch(); setVisible(false); pfPasswd.setText(null);

JOptionPane.showMessageDialog(new Login(), \"用户名,密码或身份错误\"); pfPasswd.setText(null);

} else {

} else if (e.getSource() == cbPosition) {//身份下拉框改变时

}

}

}

}

} else { }

String[] cName = info.getIdByPosition(info); //刷新用户名列表

cbName.removeAllItems();

for (int i = 0; i < cName.length; i++)

cbName.addItem(cName[i]); info = new OverLeader();

} else {

System.exit(0);

pfPasswd.setText(null);

//定义键盘处理器

class ListenKey extends KeyAdapter { }

@SuppressWarnings(\"static-access\") public void keyPressed(KeyEvent e) { }

if (e.getKeyText(e.getKeyCode()).compareToIgnoreCase(\"ENTER\") == 0) { }

bConfirm.doClick();

2、主界面:

package

import javax.swing.*; import import

public class Main extends JFrame {

/** * */

private static final long serialVersionUID = 1L; private JTabbedPane tp; private JPanel p[]; private User info; public Main() { }

public Main(User info){

this();

this.info=info;

super(\"实验室设备管理系统\"); tp = new JTabbedPane(); p = new JPanel[8];

}

p[0] = new UserManage(); p[1] = new EquipIn(); p[2] = new EquipOut(); p[3] = new Register(info); p[4] = new Apply(info); p[5] = new Checks(info); p[6]= new Search();

p[7]=new PasswdModyfy(info);

public void launch() {

tp.addTab(\"用户管理\", p[0]); tp.addTab(\"设备入库\", p[1]); tp.addTab(\"设备出库\", p[2]); tp.addTab(\"设备登记\", p[3]); tp.addTab(\"设备申请\", p[4]); tp.addTab(\"审核申请\", p[5]); tp.addTab(\"统计查询\", p[6]); tp.addTab(\"个人信息维护\", p[7]); if(info instanceof Administration){

tp.setEnabledAt(1, false); tp.setEnabledAt(2, false); tp.setEnabledAt(3, false); tp.setEnabledAt(4, false); tp.setEnabledAt(5, false); tp.setEnabledAt(6, false); tp.setEnabledAt(0, false); tp.setEnabledAt(3, false); tp.setEnabledAt(5, false); tp.setSelectedIndex(1); tp.setEnabledAt(0, false); tp.setEnabledAt(1, false); tp.setEnabledAt(2, false); tp.setEnabledAt(5, false); tp.setSelectedIndex(3); tp.setEnabledAt(0, false); tp.setEnabledAt(1, false); tp.setEnabledAt(2, false); tp.setEnabledAt(4, false); tp.setEnabledAt(5, false); tp.setSelectedIndex(3); tp.setEnabledAt(0, false); tp.setEnabledAt(1, false);

}else if(info instanceof StoreManager){

}else if(info instanceof LabManager){

}else if(info instanceof BuyManager){

}else if(info instanceof OverLeader){

}

}

}

tp.setEnabledAt(2, false); tp.setEnabledAt(3, false); tp.setEnabledAt(4, false); tp.setSelectedIndex(5);

getContentPane().add(tp); setSize(1280, 780); setVisible(true);

addWindowListener(new WindowAdapter(){

public void windowClosing(WindowEvent e){ }

System.exit(0);

});

3、购买设备:

package

import javax.swing.*; import

import java.awt.*; import import

import java.sql.*;

public class MaintainApply extends JPanel {

/** * */

private static final long serialVersionUID = 1L; private JLabel lpId; private JTextField tf;

private JButton bApply, bAgain, bDelete; private JPanel pUp, pDown; private JTable t; private JScrollPane jsp; private User user; private LabManager lm;

private MaintainApplyData maInfo; public MaintainApply(User user) {

super(new BorderLayout()); this.user = user;

lpId = new JLabel(\"固定资产编号\"); tf = new JTextField(); tf.setColumns(15);

bApply = new JButton(\"申请\"); bAgain = new JButton(\"重置\");

}

bDelete = new JButton(\"取消申请\"); pUp = new JPanel(); pDown = new JPanel(); lm = new LabManager();

maInfo = new MaintainApplyData();

String[] head = new String[] { \"序列号\", \"固定资产编号\", \"申请人\", \"申请时间\" }; Object[][] data = lm.getMaintainApplyAll(); t = new JTable(data, head); t.setRowHeight(25); jsp = new JScrollPane(t); pUp.add(lpId); pUp.add(tf); pUp.add(bApply); pUp.add(bAgain); pDown.add(bDelete);

add(pUp, BorderLayout.NORTH); add(jsp, BorderLayout.CENTER); add(pDown, BorderLayout.SOUTH); // 添加

bApply.addActionListener(new ListenButton()); bAgain.addActionListener(new ListenButton()); bDelete.addActionListener(new ListenButton());

// 处理器

class ListenButton implements ActionListener {

public void actionPerformed(ActionEvent e) {

if (e.getSource() == bApply) {// 申请按钮

maInfo.setpId(new Integer(tf.getText())); maInfo.setuId(user.getuId());

maInfo.setDate(new Date(System.currentTimeMillis())); lm.add(maInfo); bAgain.doClick(); tf.setText(null); int selectedIndex = -1;

for (int i = 0; i < t.getRowCount(); i++) { }

if (selectedIndex == -1) {

JOptionPane.showMessageDialog(null, \"请先选择某一项!\"); return;

int option = JOptionPane.showConfirmDialog(null, \"是否确定删除?\",

\"提示\", JOptionPane.YES_NO_CANCEL_OPTION);

if (t.isRowSelected(i) == true)

selectedIndex = i;

} else if (e.getSource() == bAgain) {// 重置按钮 } else if (e.getSource() == bDelete) {// 删除按钮

} else {

}

}

if (option == JOptionPane.YES_OPTION) { }

maInfo.setId(new Integer(t.getValueAt(selectedIndex, 0)

.toString()));

lm.delete(maInfo);

// 刷新数据表 remove(jsp);

String[] head = new String[] { \"序列号\", \"固定资产编号\", \"申请人\", \"申请时间\" }; Object[][] data = lm.getMaintainApplyAll(); t = new JTable(data, head); t.setRowHeight(25); t.validate();

jsp = new JScrollPane(t); add(jsp, BorderLayout.CENTER); validate();

}

}

}

4、维修设备:

package import import

import javax.swing.*; import java.awt.*; import import import import

public class EquipIn extends JPanel { /** * */

private static final long serialVersionUID = 1L; private JLabel leId, lsId, liNum, lPara; private JTextField tfiNum; private JComboBox cbeId, cbsId; private JButton bIn, bAgain, bDelete; private JPanel pUp, pDown; private JScrollPane jsp; private JTable t;

private StoreManager sma; private InData inInfo;

public EquipIn() {

}

super(new BorderLayout());// 设置布局管理器 // 控件初始化

leId = new JLabel(\"设备编号\"); lsId = new JLabel(\"仓库编号\"); liNum = new JLabel(\"入库数量\"); lPara = new JLabel(\"参数设置\"); lPara.setForeground(Color.RED); tfiNum = new JTextField(); tfiNum.setColumns(10); bIn = new JButton(\"入库\"); bAgain = new JButton(\"重置\"); bDelete = new JButton(\"删除\"); pUp = new JPanel(); pDown = new JPanel(); sma = new StoreManager(); inInfo = new InData(); String[] eId = sma.geteId(); String[] sId = sma.getsIdAll(); cbeId = new JComboBox(eId); cbsId = new JComboBox(sId); String[] head = new String[] { \"设备编号\", \"仓库编号\", \"入库时间\", \"入库数量\" }; Object[][] data = sma.getInAll(); t = new JTable(data, head); t.setRowHeight(25); jsp = new JScrollPane(t); // 添加控件 pUp.add(leId); pUp.add(cbeId); pUp.add(lsId); pUp.add(cbsId); pUp.add(liNum); pUp.add(tfiNum); pUp.add(bIn); pUp.add(bAgain); pUp.add(lPara); pDown.add(bDelete);

add(pUp, BorderLayout.NORTH); add(jsp, BorderLayout.CENTER); add(pDown, BorderLayout.SOUTH); // 添加

bIn.addActionListener(new ListenButton()); bAgain.addActionListener(new ListenButton()); bDelete.addActionListener(new ListenButton()); lPara.addMouseListener(new ListenMouse());

// 定义按钮处理器

class ListenButton implements ActionListener { }

// 定义鼠标处理器

class ListenMouse extends MouseAdapter {

public void mouseEntered(MouseEvent e) { public void actionPerformed(ActionEvent e) { }

if (e.getSource() == bIn) {// 点击入库按钮 }

// 刷新数据表 remove(jsp);

String[] head = new String[] { \"设备编号\", \"仓库编号\", \"入库时间\", \"入库数量\" }; Object[][] data = sma.getInAll(); t = new JTable(data, head); t.setRowHeight(25); t.validate();

jsp = new JScrollPane(t); add(jsp, BorderLayout.CENTER); validate();

inInfo.seteId(cbeId.getSelectedItem().toString()); inInfo.setsId(cbsId.getSelectedItem().toString()); inInfo.setDate(new Date(System.currentTimeMillis())); inInfo.setNum(new Integer(tfiNum.getText())); sma.add(inInfo); bAgain.doClick(); tfiNum.setText(null); int selectedIndex = -1;

for (int i = 0; i < t.getRowCount(); i++) { }

if (selectedIndex == -1) { }

JOptionPane.showMessageDialog(null, \"请先选择某一项!\"); return;

int option = JOptionPane.showConfirmDialog(null, \"是否确定删除?\", }

\"提示\", JOptionPane.YES_NO_CANCEL_OPTION);

if (option == JOptionPane.YES_OPTION) {

inInfo.seteId((String) t.getValueAt(selectedIndex, 0)); inInfo.setsId((String) t.getValueAt(selectedIndex, 1)); inInfo.setDate((Date) t.getValueAt(selectedIndex, 2)); sma.delete(inInfo);

if (t.isRowSelected(i) == true)

selectedIndex = i;

} else if (e.getSource() == bAgain) {// 点击重置按钮 } else if (e.getSource() == bDelete) {// 点击删除按钮

} else {

}

}

}

lPara.setCursor(new Cursor(Cursor.HAND_CURSOR));

public void mousePressed(MouseEvent e) { }

new ParameterSet();

5、用户管理

package import import import

import java.awt.*; import javax.swing.*; import

public class UserManage extends JPanel {

/** * */

private static final long serialVersionUID = 1L; private JLabel[] lArray = new JLabel[7]; private JButton[] bArray = new JButton[3]; private JTextField[] tfArray = new JTextField[2];

private JPasswordField[] pfArray = new JPasswordField[2]; private JPanel[] pArray = new JPanel[4]; private JComboBox cbPosition, cbSL; private JScrollPane jsp; private JTable t;

private Administration Admin; private StoreManager sma; private LabManager lm; public UserManage() {

super(new BorderLayout());// 设置布局管理器 // 控件初始化

lArray[0] = new JLabel(\"注册身份\"); lArray[1] = new JLabel(\"用户名\"); lArray[2] = new JLabel(\"姓名\"); lArray[3] = new JLabel(\"密码\"); lArray[4] = new JLabel(\"确认密码\"); lArray[5] = new JLabel(\"编号\"); lArray[6] = new JLabel(\"参数设置\"); bArray[0] = new JButton(\"注册\"); bArray[1] = new JButton(\"重置\"); bArray[2] = new JButton(\"删除\"); for (int i = 0; i < 2; i++) {

}

tfArray[i] = new JTextField(); tfArray[i].setColumns(10);

pfArray[i] = new JPasswordField(); pfArray[i].setColumns(10); pArray[i] = new JPanel();

pArray[2] = new JPanel();

pArray[3] = new JPanel(new GridLayout(2, 1));

String[] position = new String[] { \"系统管理员\", \"仓库管理员\", \"实验室管理员\", \"购

\"上级领导\" };

买登记员\",

cbPosition = new JComboBox(position); cbSL = new JComboBox(); Admin = new Administration(); sma = new StoreManager(); lm = new LabManager();

String[] head = new String[] { \"用户名\", \"姓名\", \"身份\" }; Object[][] data = Admin.getAll(); t = new JTable(data, head); t.setRowHeight(25); jsp = new JScrollPane(t); // 属性设置

lArray[5].setVisible(false); cbSL.setVisible(false);

lArray[6].setForeground(Color.RED); // 控件添加

pArray[0].add(lArray[0]); pArray[0].add(cbPosition); pArray[0].add(lArray[1]); pArray[0].add(tfArray[0]); pArray[0].add(lArray[2]); pArray[0].add(tfArray[1]); pArray[1].add(lArray[3]); pArray[1].add(pfArray[0]); pArray[1].add(lArray[4]); pArray[1].add(pfArray[1]); pArray[1].add(lArray[5]); pArray[1].add(cbSL); pArray[1].add(bArray[0]); pArray[1].add(bArray[1]); pArray[1].add(lArray[6]); pArray[2].add(bArray[2]); pArray[3].add(pArray[0]); pArray[3].add(pArray[1]);

add(pArray[3], BorderLayout.NORTH); add(jsp, BorderLayout.CENTER);

}

add(pArray[2], BorderLayout.SOUTH); // 添加

bArray[0].addActionListener(new ListenAction()); bArray[1].addActionListener(new ListenAction()); bArray[2].addActionListener(new ListenAction()); cbPosition.addActionListener(new ListenAction()); lArray[6].addMouseListener(new ListenMouse());

// 定义按钮,下拉框动作处理器

class ListenAction implements ActionListener {

public void actionPerformed(ActionEvent e) {

Admin.setuId(tfArray[0].getText()); Admin.setuName(tfArray[1].getText());

Admin.setuPasswd(new String(pfArray[0].getPassword())); Admin.setuPosition(cbPosition.getSelectedItem().toString()); if (e.getSource() == bArray[0]) {// 点击注册按钮

if (tfArray[0].getText().equals(\"\") }

String[] strKey = new String[] { Admin.getuId(), }

if (!new String(pfArray[0].getPassword()).equals(new String( }

Admin.add(Admin);

if (cbPosition.getSelectedItem().equals(\"仓库管理员\")) { }

sma.setuId(tfArray[0].getText());

sma.setsId(cbSL.getSelectedItem().toString()); Admin.add(sma);

lm.setuId(tfArray[0].getText());

lm.setlId(cbSL.getSelectedItem().toString()); Admin.add(lm);

pfArray[1].getPassword()))) {

JOptionPane.showMessageDialog(null, \"密码不一致!\"); bArray[1].doClick(); return;

Admin.getuPosition() };

if (Admin.getKey().contains(strKey)) {

JOptionPane.showMessageDialog(null, \"用户已存在!\"); bArray[1].doClick(); return;

|| new String(pfArray[0].getPassword()).toString()

.equals(\"\")) {

JOptionPane.showMessageDialog(null, \"用户名或密码不可为空\"); bArray[1].doClick(); return;

} else if (cbPosition.getSelectedItem().equals(\"实验室管理员\")) {

bArray[1].doClick(); tfArray[0].setText(null); tfArray[1].setText(null); pfArray[0].setText(null); pfArray[1].setText(null); int selectedIndex = -1;

for (int i = 0; i < t.getRowCount(); i++) { }

if (selectedIndex == -1) { }

if (cbPosition.getSelectedItem().equals(\"仓库管理员\")) { }

lArray[5].setText(\"仓库编号\"); lArray[5].setVisible(true); cbSL.setVisible(true); cbSL.removeAllItems();

String[] sId = Admin.getsIdAll(); for (int i = 0; i < sId.length; i++)

cbSL.addItem(sId[i]); JOptionPane.showMessageDialog(null, \"请先选择某一项!\"); return;

int option = JOptionPane.showConfirmDialog(null, \"是否确定删除?\", }

\"提示\", JOptionPane.YES_NO_CANCEL_OPTION);

if (option == JOptionPane.YES_OPTION) {

Admin.setuId((String) t.getValueAt(selectedIndex, 0)); Admin.setuPosition((String) t.getValueAt(selectedIndex,

2));

Admin.delete(Admin); if (t.isRowSelected(i) == true)

selectedIndex = i;

} else if (e.getSource() == bArray[1]) {// 点击重置按钮

} else if (e.getSource() == bArray[2]) {// 点击删除按钮

} else {

} else if (e.getSource() == cbPosition) {// 改变身份下拉框时

} else if (cbPosition.getSelectedItem().equals(\"实验室管理员\")) {

lArray[5].setText(\"实验室编号\"); lArray[5].setVisible(true); cbSL.setVisible(true); cbSL.removeAllItems();

String[] sId = Admin.getlIdAll(); for (int i = 0; i < sId.length; i++)

cbSL.addItem(sId[i]); } else {

lArray[5].setVisible(false); cbSL.setVisible(false);

}

}

}

}

// 刷新数据表 remove(jsp);

String[] head = new String[] { \"用户名\", \"姓名\", \"身份\" }; Object[][] data = Admin.getAll(); t = new JTable(data, head); t.setRowHeight(25); t.validate();

jsp = new JScrollPane(t); add(jsp, BorderLayout.CENTER); validate();

// 定义鼠标事件处理器

class ListenMouse extends MouseAdapter { }

public void mouseEntered(MouseEvent e) { }

public void mousePressed(MouseEvent e) { }

new ParameterSet();

lArray[6].setCursor(new Cursor(Cursor.HAND_CURSOR));

6、设备统计查询:

package

import java.awt.*; import import

import javax.swing.*; import import import import

public class Search extends JPanel {

/** * */

private static final long serialVersionUID = 1L;

private JRadioButton rbStore, rbLab, rbeId, rbSingleeId; private JComboBox cbStore, cbLab, cbeId; private JLabel lStore, lLab, leId; private JTable t; private JScrollPane jsp; private JPanel pUp, pDown, p; private StoreManager sma;

private InData inInfo; public Search() {

super(new BorderLayout());

rbStore = new JRadioButton(\"仓库库存统计\", true); rbLab = new JRadioButton(\"实验室库存统计\"); rbeId = new JRadioButton(\"所有设备\", true); rbSingleeId = new JRadioButton(\"单个设备\"); sma = new StoreManager(); inInfo = new InData();

cbStore = new JComboBox(sma.getsIdAll()); cbLab = new JComboBox(sma.getlIdAll()); cbeId = new JComboBox(sma.geteId()); lStore = new JLabel(\"仓库编号\"); lLab = new JLabel(\"实验室编号\"); leId = new JLabel(\"设备编号\"); cbLab.setVisible(false); lLab.setVisible(false); leId.setVisible(false); cbeId.setVisible(false); pUp = new JPanel(); pDown = new JPanel(); p = new JPanel(); pUp.add(rbStore); pUp.add(lStore); pUp.add(cbStore); pUp.add(rbLab); pUp.add(lLab); pUp.add(cbLab); pDown.add(rbeId); pDown.add(rbSingleeId); pDown.add(leId); pDown.add(cbeId);

p.setLayout(new GridLayout(2, 1)); p.add(pUp); p.add(pDown);

inInfo.setsId(cbStore.getSelectedItem().toString());

String[] head = new String[] { \"设备编号\", \"仓库编号\", \"库存量\" }; Object[][] data = sma.getCountKunCunAll(inInfo); t = new JTable(data, head); t.setRowHeight(25); jsp = new JScrollPane(t); add(p, BorderLayout.NORTH); add(jsp, BorderLayout.CENTER); // 添加

rbStore.addActionListener(new ListenAction()); rbLab.addActionListener(new ListenAction());

}

rbeId.addActionListener(new ListenAction()); rbSingleeId.addActionListener(new ListenAction()); cbStore.addActionListener(new ListenAction()); cbLab.addActionListener(new ListenAction()); cbeId.addActionListener(new ListenAction());

// 定义处理器

class ListenAction implements ActionListener {

public void actionPerformed(ActionEvent e) {

if (e.getSource() == rbStore) { }

StoreManager sma = new StoreManager(); LabManager lm = new LabManager(); String[] head = null; Object[][] data = null; InData idInfo = new InData(); OutData odInfo = new OutData();

idInfo.seteId(cbeId.getSelectedItem().toString()); idInfo.setsId(cbStore.getSelectedItem().toString()); odInfo.seteId(cbeId.getSelectedItem().toString()); odInfo.setlId(cbLab.getSelectedItem().toString()); if (rbStore.isSelected()) {

lStore.setVisible(true); cbStore.setVisible(true); lLab.setVisible(false); cbLab.setVisible(false); rbLab.setSelected(false);

head = new String[] { \"设备编号\", \"仓库编号\", \"库存量\" }; if (rbeId.isSelected()) { }

leId.setVisible(false); cbeId.setVisible(false); rbSingleeId.setSelected(false); data = sma.getCountKunCunAll(idInfo); leId.setVisible(true); cbeId.setVisible(true); rbeId.setSelected(false);

data = sma.getCountKunCun(idInfo); rbLab.setSelected(false); rbStore.setSelected(false); rbSingleeId.setSelected(false); rbeId.setSelected(false); } else if (e.getSource() == rbLab) { } else if (e.getSource() == rbeId) { } else if (e.getSource() == rbSingleeId) {

} else {

}

}

} else { }

// 刷新数据表 remove(jsp);

t = new JTable(data, head); t.setRowHeight(25); t.validate();

jsp = new JScrollPane(t); add(jsp, BorderLayout.CENTER); validate();

lStore.setVisible(false); cbStore.setVisible(false); lLab.setVisible(true); cbLab.setVisible(true); rbStore.setSelected(false);

head = new String[] { \"设备编号\", \"实验室编号\", \"库存量\" }; if (rbeId.isSelected()) { }

leId.setVisible(false); cbeId.setVisible(false); rbSingleeId.setSelected(false); data = lm.getCountKunCunAll(odInfo); leId.setVisible(true); cbeId.setVisible(true); rbeId.setSelected(false);

data = lm.getCountKunCun(odInfo);

} else {

}

package shebeiguanli; /*

*

Title实验室设备管理系统报废记录查询页面

* @author gengdexin */

import java.io.*; import java.net.*; import java.sql.*; import java.lang.*; import javax.sql.*; import java.awt.*; import

import javax.swing.*; import import

public class Frame6 extends JFrame {

JPanel contentPane;

JLabel jLabel1 = new JLabel(); XYLayout xYLayout1 = new XYLayout(); JLabel jLabel2 = new JLabel(); JLabel jLabel3 = new JLabel();

JTextField jTextField1 = new JTextField(); JLabel jLabel4 = new JLabel();

JTextField jTextField2 = new JTextField(); JPanel jPanel1 = new JPanel(); XYLayout xYLayout2 = new XYLayout();

JScrollPane jScrollPane1 = new JScrollPane(); JLabel jLabel5 = new JLabel();

JTextField jTextField3 = new JTextField(); public Frame6() {

enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); }

catch(Exception e) { e.printStackTrace(); } }

private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(xYLayout1); this.setSize(new Dimension(600, 500)); this.setTitle(\"实验室设备管理系统\"); this.addHierarchyBoundsListener(new Frame6_this_hierarchyBoundsAdapter(this)); jLabel1.setFont(new\"SansSerif\", 0, 25)); jLabel1.setForeground(Color.red); jLabel1.setText(\"实验室设备管理系统\");

contentPane.setForeground(Color.black); jLabel2.setFont(new\"SansSerif\", 0, 30)); jLabel2.setText(\"设备报废记录查询\");

jLabel3.setFont(new\"SansSerif\", 0, 20)); jLabel3.setText(\"设备名称\"); jTextField1.setText(\"\"); jLabel4.setEnabled(true);

jLabel4.setFont(new\"SansSerif\", 0, 20)); jLabel4.setText(\"设备型号\"); jTextField2.setText(\"\");

jTextField2.addActionListener(new Frame6_jTextField2_actionAdapter(this)); jPanel1.setLayout(xYLayout2);

jLabel5.setFont(new\"SansSerif\", 0, 25)); jLabel5.setForeground(Color.red);

jLabel5.setText(\"该报废设备详细信息\"); jTextField3.setText(\"\");

contentPane.add(jLabel1, new XYConstraints(200, 0, 300,50)); contentPane.add(jLabel2, new XYConstraints(200, 47, 300, 58)); contentPane.add(jLabel3, new XYConstraints(47, 102, 101, 42));

contentPane.add(jTextField1, new XYConstraints(128, 108, 112, 34)); contentPane.add(jTextField2, new XYConstraints(361, 107, 109, 36)); contentPane.add(jPanel1, new XYConstraints(75, 166, 453, 277)); jPanel1.add(jScrollPane1, new XYConstraints(14, 8, 433, 221)); jScrollPane1.getViewport().add(jTextField3, null);

jPanel1.add(jLabel5, new XYConstraints(112, 240, -1, -1)); contentPane.add(jLabel4, new XYConstraints(278, 111, -1, -1)); }

protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e);

if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }

void Select() { try {

String str1, str2;

str1 = jTextField1.getText(); str2 = jTextField2.getText(); Connection con = null;

String url = \"jdbc:odbc:shebeiguanli\"; String user = \"\"; String password = \"\"; Class.forName();

con = DriverManager.getConnection(url,user,password);

Statement stmt =con.createStatement();

PreparedStatement pstmt = con.prepareStatement(

\"use shebeiguanli select * from 报废记录 where 设备型号=? and 设备名=? \" pstmt.setString(2, str1); pstmt.setString(1, str2);

ResultSet res = pstmt.executeQuery(); String id; String name;

String guige,danjia,day,changjia,peo,num;

String outputarea=\" 设备型号 \" +\" 设备名称 \"+\" 报废记录 \"+\" \"+'\\n'; if(res.next()){ do{ id = res.getString(1); name = res.getString(2);

day=res.getString(5);

); 责任人

}

}

peo=res.getString(7);

outputarea+=\" \"+id+\" \"+name+\" \"+day+\" \"+peo+\" \"+\"\\n\"; jTextField3.setText(outputarea);

while(res.next());

else{

jTextField3.setText(\"不存在\"); }

}catch (ClassNotFoundException e) { System.out.println(e.getMessage()); }catch (SQLException edd) { edd.printStackTrace() ;

System.out.println(edd.getMessage()); } }

void this_ancestorMoved(HierarchyEvent e) { }

void jTextField2_actionPerformed(ActionEvent e) { Select(); } }

class Frame6_this_hierarchyBoundsAdapter extends Frame6 adaptee;

Frame6_this_hierarchyBoundsAdapter(Frame6 adaptee) { this.adaptee = adaptee; }

public void ancestorMoved(HierarchyEvent e) { adaptee.this_ancestorMoved(e); } }

class Frame6_jTextField2_actionAdapter implements Frame6 adaptee;

Frame6_jTextField2_actionAdapter(Frame6 adaptee) { this.adaptee = adaptee; }

public void actionPerformed(ActionEvent e) { adaptee.jTextField2_actionPerformed(e); } }

7、报废设备:

package

import java.awt.*; import

import javax.swing.*;

import import import

public class BuyApply extends JPanel {

/** * */

private static final long serialVersionUID = 1L; private JLabel leId, lNum; private JPanel pUp, pDown;

private JButton bApply, bAgain, bDelete; private JTable t; private JScrollPane jsp; private JComboBox cbeId; private JTextField tfNum; private User user; private StoreManager sma; private BuyApplyData baInfo; public BuyApply(User user) {

super(new BorderLayout());// 设置布局管理器 this.user = user; // 控件初始化

leId = new JLabel(\"设备编号\"); lNum = new JLabel(\"申请数量\"); bApply = new JButton(\"申请\"); bAgain = new JButton(\"重置\"); bDelete = new JButton(\"删除\"); sma = new StoreManager(); baInfo = new BuyApplyData();

String[] head = new String[] { \"序列号\", \"设备编号\", \"申请人\", \"申请时间\", \"申请数Object[][] data = sma.getBuyApplyAll(); t = new JTable(data, head); t.setRowHeight(25); jsp = new JScrollPane(t); String[] eId = sma.geteId(); cbeId = new JComboBox(eId); tfNum = new JTextField(); tfNum.setColumns(15); pUp = new JPanel(); pDown = new JPanel(); // 控件添加 pUp.add(leId); pUp.add(cbeId); pUp.add(lNum); pUp.add(tfNum);

量\" };

}

pUp.add(bApply); pUp.add(bAgain); pDown.add(bDelete);

add(pUp, BorderLayout.NORTH); add(jsp, BorderLayout.CENTER); add(pDown, BorderLayout.SOUTH); // 添加

bApply.addActionListener(new ListenButton()); bAgain.addActionListener(new ListenButton()); bDelete.addActionListener(new ListenButton());

// 定义按钮处理器

class ListenButton implements ActionListener {

public void actionPerformed(ActionEvent e) {

if (e.getSource() == bApply) {// 点击申请按钮 }

// 刷新数据表 remove(jsp);

String[] head = new String[] { \"序列号\", \"设备编号\", \"申请人\", \"申请时间\", \"申

baInfo.seteId(cbeId.getSelectedItem().toString()); baInfo.setuId(user.getuId());

baInfo.setDate(new Date(System.currentTimeMillis())); baInfo.setbaNum(new Integer(tfNum.getText())); sma.add(baInfo); bAgain.doClick(); tfNum.setText(null); int selectedIndex = -1;

for (int i = 0; i < t.getRowCount(); i++) { }

if (selectedIndex == -1) { }

JOptionPane.showMessageDialog(null, \"请先选择某一项!\"); return;

int option = JOptionPane.showConfirmDialog(null, \"是否确定删除?\", }

\"提示\", JOptionPane.YES_NO_CANCEL_OPTION);

if (option == JOptionPane.YES_OPTION) {

baInfo.setId(new Integer(t.getValueAt(selectedIndex, 0)

.toString()));

sma.delete(baInfo);

if (t.isRowSelected(i) == true)

selectedIndex = i;

} else if (e.getSource() == bAgain) {// 点击重置按钮 } else if (e.getSource() == bDelete) {// 点击删除按钮

} else {

请数量\" };

}

}

}

Object[][] data = sma.getBuyApplyAll(); t = new JTable(data, head); t.setRowHeight(25); t.validate();

jsp = new JScrollPane(t); add(jsp, BorderLayout.CENTER); validate();

8、审核:

package

import java.awt.*; import import

import javax.swing.*; import import

class MaintainCheck extends JPanel{

/** * */

private static final long serialVersionUID = 1L; private JLabel lLeft,lRight;

private JPanel pLeft,pRight,pCenter,pCUp,pCDown; private JButton bUp,bDown; private JTable tLeft,tRight;

private JScrollPane jspLeft,jspRight; private User user;

public MaintainCheck(User user){ this.user=user;

lLeft=new JLabel(\"未审核列表\"); lRight=new JLabel(\"已审核列表\"); bUp=new JButton(\"通过\"); bDown=new JButton(\"不通过\"); pLeft=new JPanel(); pRight=new JPanel(); pCenter=new JPanel(); pCUp=new JPanel(); pCUp.add(bUp); pCDown=new JPanel(); pCDown.add(bDown);

pCenter.setLayout(new GridLayout(2,1)); pCenter.add(pCUp); pCenter.add(pCDown);

OverLeader ol=new OverLeader();

String[] headRight=new String[]{\"审核表序列号\",\"申请表序列号\",\"审核人\",\"审核时间\",\"审核结果\"};

Object[][] dataRight=ol.getMaintainCheckAll(); tRight=new JTable(dataRight,headRight); tRight.setRowHeight(25);

jspRight=new JScrollPane(tRight);

String[] headLeft=new String[]{\"序列号\",\"固定资产编号\",\"申请人\",\"申请时间\"}; Object[][] dataLeft=ol.getMaintainApplyAll(); tLeft=new JTable(dataLeft,headLeft); tLeft.setRowHeight(25);

jspLeft=new JScrollPane(tLeft); pLeft.setLayout(new BorderLayout()); pRight.setLayout(new BorderLayout()); pLeft.add(lLeft,BorderLayout.NORTH); pLeft.add(jspLeft,BorderLayout.CENTER); pRight.add(lRight,BorderLayout.NORTH); pRight.add(jspRight,BorderLayout.CENTER); setLayout(new GridLayout(1,3)); add(pLeft); add(pCenter); add(pRight);

bUp.addActionListener(new ListenButton()); bDown.addActionListener(new ListenButton()); }

class ListenButton implements ActionListener{ public void actionPerformed(ActionEvent e){

int selectedIndex = -1;

for (int i = 0; i < tLeft.getRowCount(); i++) { }

if (selectedIndex == -1) {

JOptionPane.showMessageDialog(null, \"请先选择某一项!\"); return;

int option = JOptionPane.showConfirmDialog(null,

\"是否确定审核此申请?\", \"提示\", JOptionPane.YES_NO_CANCEL_OPTION);

if (option == JOptionPane.YES_OPTION) {

MaintainCheckData info = new MaintainCheckData(); info.setaId(new Integer(tLeft.getValueAt(selectedIndex, info.setuId(user.getuId());

info.setDate(new Date(System.currentTimeMillis())); if (tLeft.isRowSelected(i) == true)

selectedIndex = i;

} else {

0).toString()));

if(e.getSource()==bUp){ info.setResult(\"通过\");

}else if(e.getSource()==bDown){ info.setResult(\"不通过\"); }

OverLeader ol=new OverLeader(); ol.add(info);

} //刷新

remove(jspLeft); remove(jspRight);

OverLeader ol=new OverLeader();

}

String[] headRight=new String[]{\"审核表序列号\",\"申请表序列号\",\"审核人\",\"审核时 Object[][] dataRight=ol.getMaintainCheckAll(); tRight=new JTable(dataRight,headRight); tRight.setRowHeight(25); tRight.validate();

jspRight=new JScrollPane(tRight);

String[] headLeft=new String[]{\"序列号\",\"固定资产编号\",\"申请人\",\"申请时间\"}; Object[][] dataLeft=ol.getMaintainApplyAll(); tLeft=new JTable(dataLeft,headLeft); tLeft.setRowHeight(25); tLeft.validate();

jspLeft=new JScrollPane(tLeft); pLeft.setLayout(new BorderLayout()); pRight.setLayout(new BorderLayout()); pLeft.add(lLeft,BorderLayout.NORTH); pLeft.add(jspLeft,BorderLayout.CENTER); pRight.add(lRight,BorderLayout.NORTH); pRight.add(jspRight,BorderLayout.CENTER); setLayout(new GridLayout(1,3));

validate();

间\",\"审核结果\"};

} } }

七、参考文献

《软件工程》 王忠群 中国科学技术大学出版社 《Java程序设计》 电子科技大学出版社

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 91gzw.com 版权所有 湘ICP备2023023988号-2

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务