当前位置:文档之家› 网吧计费系统附完整源代码

网吧计费系统附完整源代码

简易的网吧计费系统设计
设计一个简易的网吧计费系统,要求上网人输入卡号和密码上机,卡号或密码不正确,不能上机,卡余额不足不能上机;正在使用的机器不能被再使用;上机需要记录卡号、机器号、上机时间;下机时需要记录下机时间、发生费用和自动从卡里扣款,该机器能再被使用;下机时,需要向用户显示本次上机的详细信息。

1) 上机业务流程
卡号和密码的校验;
卡的余额的检验;
获取当前系统时间作为上机开始时间;
记录上机操作;
修改该机器的使用标志
2) 下机业务流程
选择被使用的机器号;
获取系统当前时间作为下机时间;
计算费用;扣费;
记录下机时间和此次费用;
修改该机器的状态为可用
结构图
效果截图
如下
********************face类********************* package wbsys.view;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import wbsys.dao.huanji;
import wbsys.dao.yuechaxun;
public class Face extends JFrame {
JPanel contentPane;
JMenuBar jMenuBar1 = new JMenuBar();
JMenu jMenu1 = new JMenu();
JMenuItem jMenuItem1 = new JMenuItem();
JMenuItem jMenuItem2 = new JMenuItem();
JMenu jMenu2 = new JMenu();
JMenuItem jMenuItem3 = new JMenuItem();
JMenu jMenu3 = new JMenu();
JMenuItem jMenuItem4 = new JMenuItem();
JOptionPane jOptionPane1 = new JOptionPane();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JMenuItem jMenuItem5 = new JMenuItem();
JMenuItem jMenuItem6 = new JMenuItem();
JMenuItem jMenuItem7 = new JMenuItem();
public Face() {
try {
setDefaultCloseOperation(EXIT_ON_CLOSE);
jbInit();
} catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
contentPane = (JPanel) getContentPane();
contentPane.setLayout(null);
this.setJMenuBar(jMenuBar1);
setSize(new Dimension(650, 488));
setTitle("网吧记费管理器");
jMenuBar1.setBackground(Color.green);
jMenuBar1.setFont(new java.awt.Font("Tahoma", Font.PLAIN, 15));
jMenuBar1.setForeground(new Color(255, 0, 95));
jMenu1.setBackground(Color.green);
jMenu1.setForeground(Color.red);
jMenu1.setText("使用");
jMenuItem1.setForeground(Color.red);
jMenuItem1.setText("上机");
jMenuItem1.addActionListener(new Face_jMenuItem1_actionAdapter(this));
jMenuItem2.setForeground(Color.red);
jMenuItem2.setText("下机");
jMenuItem2.addActionListener(new Face_jMenuItem2_actionAdapter(this)); jMenu2.setBackground(Color.green);
jMenu2.setForeground(Color.red);
jMenu2.setText("管理");
jMenuItem3.setForeground(Color.red);
jMenuItem3.setText("关于");
jMenuItem3.addActionListener(new Face_jMenuItem3_actionAdapter(this)); jMenu3.setBackground(Color.green);
jMenu3.setForeground(Color.red);
jMenu3.setText("退出");
jMenuItem4.setForeground(Color.red);
jMenuItem4.setText("确定!");
jMenuItem4.addActionListener(new Face_jMenuItem4_actionAdapter(this)); contentPane.setBackground(Color.cyan);
jLabel1.setFont(new java.awt.Font("隶书", Font.PLAIN, 25));
jLabel1.setForeground(Color.magenta);
jLabel1.setText("网吧计费系统G16-制作");
jLabel1.setBounds(new Rectangle(200, 150, 300, 39));
jLabel2.setFont(new java.awt.Font("隶书", Font.PLAIN, 25));
jLabel2.setForeground(Color.magenta);
jLabel2.setText("2019-12-12 版本1.0");
jLabel2.setBounds(new Rectangle(215, 200, 250, 34));
jLabel3.setText("");
jLabel3.setBounds(new Rectangle(0, 0, 650, 488));
jMenuItem5.setForeground(Color.red);
jMenuItem5.setText("管理");
jMenuItem5.addActionListener(new Face_jMenuItem5_actionAdapter(this)); jMenuItem6.setForeground(Color.red);
jMenuItem6.setText("余额查询");
jMenuItem6.addActionListener(new Face_jMenuItem6_actionAdapter(this)); jMenuItem7.setForeground(Color.red);
jMenuItem7.setText("换机");
jMenuItem7.addActionListener(new Face_jMenuItem7_actionAdapter(this)); jMenuBar1.add(jMenu1);
jMenuBar1.add(jMenu2);
jMenuBar1.add(jMenu3);
jMenu1.add(jMenuItem1);
jMenu1.add(jMenuItem2);
jMenu1.add(jMenuItem7);
jMenu2.add(jMenuItem3);
jMenu2.add(jMenuItem5);
jMenu2.add(jMenuItem6);。

相关主题