⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wangbasystemmanage.txt

📁 简单的网吧管理系统
💻 TXT
📖 第 1 页 / 共 3 页
字号:
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */
public class Card {
    private String ID;
    private String password;
    private String balance;
    public Card() {
    }


    public void setID(String ID) {
        this.ID = ID;
    }

    public String getID() {
        return ID;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public void setBalance(String balance) {
        this.balance = balance;
    }

    public String getPassword() {
        return password;
    }

    public String getBalance() {
        return balance;
    }
}
-----------------------------------------------------------------文件分界线---------------------------------------------------------------------------------

package com.intermedium;
/**
 * <p>Title:机器实体类 </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */
public class Computer {
    private String ID;
    private String OnUse;
    private String noters;
    public Computer() {
    }

    public void SetID(String ID) {
        this.ID = ID;
    }

    public String getID() {
        return ID;
    }

    public void setOnUse(String OnUse) {
        this.OnUse = OnUse;
    }

    public String getOnUse() {
        return OnUse;
    }

    public void setNoters(String noters) {
        this.noters = noters;
    }

    public String getNoters() {
        return noters;
    }
}


-----------------------------------------------------------------文件分界线---------------------------------------------------------------------------------

package com.intermedium;
/**
 * <p>Title:上机记录实体类 </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */

public class Record {
    private String ID;
    private String CardID;
    private String ComputerID;
    private String BeginTime;
    private String EndTime;
    private int Fee;
    public Record() {
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getID() {
        return ID;
    }

    public void setCardID(String CardID) {
        this.CardID = CardID;
    }

    public String getCardID() {
        return CardID;
    }

    public void setComputerID(String ComputerID) {
        this.ComputerID = ComputerID;
    }

    public String getComputerID() {
        return ComputerID;
    }

    public void setBeginTime(String BeginTime) {
        this.BeginTime = BeginTime;
    }

    public String getBeginTime() {
        return BeginTime;
    }

    public void setEndTime(String EndTime) {
        this.EndTime = EndTime;
    }

    public String getEndTime() {
        return EndTime;
    }

    public void setFee(int Fee) {
        this.Fee = Fee;
    }

    public int getFee() {
        return Fee;
    }


}


-----------------------------------------------------------------文件分界线---------------------------------------------------------------------------------

package com.downwork;
/**
 * <p>Title:下机页面内容 </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import javax.swing.JComboBox;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.util.Calendar;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import com.database.DbControl;
import com.intermedium.*;
import javax.swing.JOptionPane;
import com.netbarview.*;

public class DownPanel extends JPanel {


    JLabel labJqh = new JLabel();
    JComboBox cboJph = new JComboBox();
    JLabel labdownTime = new JLabel();
    JTextField txtDowntime = new JTextField();
    JButton btnok = new JButton();
    JButton btnreset = new JButton();
    Calendar tm = Calendar.getInstance();
    SimpleDateFormat tm1 = new SimpleDateFormat("yyyy-MM-dd");
    Date ti = new Date();
    Record re = new Record();
    Computer co = new Computer();
    Card ca = new Card();
    Downput Dow;
    NetBar nb = new NetBar();
    public DownPanel(Downput Do) {
        Dow = Do;
        try {
            jbInit();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

    class btnok_ActionListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            if (JOptionPane.showConfirmDialog(null, "您确定下机(是/否)?", "消息",
                                              JOptionPane.ERROR_MESSAGE) == 0) {
                //获取结束时间
                String tim = tm1.format(tm.getTime()) + "  " +
                             ti.toString().substring(11, 16);
                txtDowntime.setText(tim);
                //更新记录并改变机器的使用状态;
                re.setEndTime(txtDowntime.getText());
                re.setComputerID(cboJph.getSelectedItem().toString());
                co.SetID(cboJph.getSelectedItem().toString());
                DbControl.updataEd(co, re);
                JOptionPane.showMessageDialog(null, "请您到收银台结账下机");
                //取出开始时间和结束时间
                ArrayList time = DbControl.timeContrast(re);
                String card = (String) time.get(0);
                String be = (String) time.get(1);
                String ed = (String) time.get(2);
                //修改本次上机费用和卡余额;
                re.setFee(Fee.couputeFee(be, ed));
                ca.setID(card);
                DbControl.updataFee(ca, re);
                //取出上机记录
                ArrayList lis=DbControl.selectNote(ca,re);
                FeePanel fep=new FeePanel(lis);
                fep.setBounds(0,0,500,400);
                fep.setVisible(true);
                NetBar ne=new NetBar();
                ne.setBounds(200, 200, 500, 400);
                ne.setVisible(true);
                ne.getContentPane().removeAll();
                ne.getContentPane().add(fep);
            } else {

            }
        }
    }


    class btnreset_ActionListener implements ActionListener {
        public void actionPerformed(ActionEvent e) {
            close();

        }
    }


    void close() {
        Dow.dispose();
        //System.exit(0);
    }

    private void jbInit() throws Exception {
        this.setLayout(null);
        labJqh.setText("机 器 号:");
        labJqh.setBounds(new Rectangle(47, 34, 60, 38));
        cboJph.setBounds(new Rectangle(119, 41, 107, 24));
        ArrayList onuse = DbControl.selectON();
        for (int i = 0; i < onuse.size(); i++) {
            String on = (String) onuse.get(i);
            cboJph.addItem(on);
        }

        labdownTime.setText("结束时间:");
        labdownTime.setBounds(new Rectangle(46, 92, 71, 31));
        txtDowntime.setEditable(false);
        txtDowntime.setBounds(new Rectangle(119, 96, 107, 23));
        btnok.setBounds(new Rectangle(37, 152, 71, 25));
        btnok.setText("确定");
        btnok_ActionListener ok = new btnok_ActionListener();
        btnok.addActionListener(ok);
        btnreset.setBounds(new Rectangle(158, 152, 71, 25));
        btnreset.setText("重置");
        btnreset_ActionListener reset = new btnreset_ActionListener();
        btnreset.addActionListener(reset);
        this.add(txtDowntime);
        this.add(labdownTime);
        this.add(btnreset);
        this.add(btnok);
        this.add(cboJph);
        this.add(labJqh);
    }
}


-----------------------------------------------------------------文件分界线---------------------------------------------------------------------------------

package com.downwork;
/**
 * <p>Title:下机界面 </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */
import javax.swing.JFrame;
public class Downput extends JFrame{
    public Downput() {
        try {
            jbInit();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }

   /* public static void main(String[] args) {
        Downput down = new Downput();
        down.setBounds(250,250,300,250);
        down.setVisible(true);
        down.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }*/

    private void jbInit() throws Exception {
        this.setTitle("欢迎再次光临");
        this.getContentPane().setLayout(null);
        DownPanel dow=new DownPanel(this);
        dow.setBounds(0,0,300,250);
        dow.setVisible(true);
        this.getContentPane().add(dow);

    }
}


-----------------------------------------------------------------文件分界线---------------------------------------------------------------------------------

package com.downwork;
/**
 * <p>Title:费用计算 </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */
public class Fee {
    public Fee() {
    }
    public static int couputeFee(String beginTime,String endTime) {
        int fee=0;
        System.out.println(beginTime);
        System.out.println(endTime);
        int beginYear=Integer.parseInt(beginTime.substring(0,4));
        int beginMonth=Integer.parseInt(beginTime.substring(5,7));
        int beginDay=Integer.parseInt(beginTime.substring(8,10));
        int beginHour=Integer.parseInt(beginTime.substring(11,13));
        int beginMinute=Integer.parseInt(beginTime.substring(14,16));
        int endYear=Integer.parseInt(endTime.substring(0,4));
        int endMonth = Integer.parseInt(endTime.substring(5, 7));
        int endDay = Integer.parseInt(endTime.substring(8, 10));
        int endHour = Integer.parseInt(endTime.substring(11, 13));
        int endMinute = Integer.parseInt(endTime.substring(14, 16));

        //计算上机的时间,单位为分钟;
        int playMinutes=0;
        playMinutes=((endYear-beginYear)*365*24*60+(endMonth-beginMonth)*30*24*60+
                    (endDay-beginDay)*24*60+(endHour-beginHour)*60+
                    (endMinute-beginMinute));
        int modNum=playMinutes%60;
        int playHours=0;
        playHours=playMinutes/60;
        if(playHours==0||(modNum>5 && playHours>0)) {
            playHours++;
        }
        fee=playHours*2;

        return fee;
    }

    public static void main(String[] args) {
        Fee fee = new Fee();
    }
}
-----------------------------------------------------------------文件分界线---------------------------------------------------------------------------------

package com.downwork;
/**
 * <p>Title:消费清况界面 </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2006</p>
 *
 * <p>Company: ACCP</p>
 *
 * @author xplu20000
 * @version 1.0
 */
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Rectangle;
import com.intermedium.*;
import java.util.ArrayList;
public class FeePanel extends JPanel{

    JLabel laljph = new JLabel();
    JLabel laljphData = new JLabel();
    JLabel lalCard = new JLabel();
    JLabel lalCardID = new JLabel();
    JLabel lalupTime = new JLabel();
    JLabel lalupData = new JLabel();
    JLabel laldownTime = new JLabel();
    JLabel laldownData = new JLabel();
    JLabel lalfee = new JLabel();
    JLabel lalFeeData = new JLabel();
    JLabel lalBalance = new JLabel();
    JLabel lalBalanceData = new JLabel();
    ArrayList list=new ArrayList();
    public FeePanel(ArrayList lis) {
        this.list=lis;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -