数据结构课程设计-设备管理系统.doc

上传人:rrsccc 文档编号:8924962 上传时间:2021-01-25 格式:DOC 页数:30 大小:426KB
返回 下载 相关 举报
数据结构课程设计-设备管理系统.doc_第1页
第1页 / 共30页
数据结构课程设计-设备管理系统.doc_第2页
第2页 / 共30页
数据结构课程设计-设备管理系统.doc_第3页
第3页 / 共30页
数据结构课程设计-设备管理系统.doc_第4页
第4页 / 共30页
数据结构课程设计-设备管理系统.doc_第5页
第5页 / 共30页
点击查看更多>>
资源描述

《数据结构课程设计-设备管理系统.doc》由会员分享,可在线阅读,更多相关《数据结构课程设计-设备管理系统.doc(30页珍藏版)》请在三一文库上搜索。

1、数据结构课程设计(论文)设备管理系统 院(系)名称电子与信息工程学院 专业班级 学号 学生姓名 指导教师起 止 时 间: 2016.1.42016.1.15课程设计(论文)任务及评语院(系):电子与信息工程学院 教研室:软件工程学 号1学生姓名专业班级课程设计(论文)题目设备管理系统课程设计(论文)任务任务要求:设备管理系统具备以下几个功能:(1)可录入设备的编号、名称、价格。(2)可修改录入的一切设备信息。(3)可查询每个存入档案库的设备信息。(4)可删除某个设备的一切详细信息。技术要求:1、数据的逻辑结构采用线性结构,物理结构采用顺序存储结构。2、软件能正常运行,界面清晰,操作要简单。3、

2、系统要有主界面设计,调用各个功能项。4、采用JAVA编写代码,可读性强。5、数据类型用自定义。指导教师评语及成绩平时成绩: 答辩成绩: 论文成绩: 总成绩: 指导教师签字: 年 月 日注:平时成绩占20%,答辩成绩占40%,论文成绩占40%。本科生课程设计(论文)摘 要如何利用先进的网络技术和日新月异的计算机设备来有效地收集、处理这些设备,建立以信息化为核心的管理体制,减轻管理人员和业务人员的数据处理负担,极大地提高设备管理效率和管理手段,己经成为当今社会的潮流。在现代化大型研究所信息化管理体系建设中,设备管理系统被看作是重中之重。因为设备是工厂生产中的主体,随着科学技术的不断发展,生产设备日

3、益机械化、自动化、大型化、高速化和复杂化,设备在现代工业生产中的作用和影响也随之增大,在整个工业生产过程中对设备的依赖程度也越来越高。设备管理的各项制度、流程涉及的点多面广。设备管理系统则是一个以人为主导,利用计算机硬件、软件、网络设备通信设备以及其他办公设备,进行信息的收集、传输、加工、储存、更新和维护,以战略竟优、提高效率为目的,支持高层决策、中层控制、基层运作的集成化的人机系统。而设备管理是管理系统的一个子系统,它具有管理信息系统的共性,同时也具有其特殊性。设备是生产的生命线,对研究所正常生产起着决定性的作用。信息安全设备管理已成为现代研究所管理的一个重要组成部分。把信息安全设备管理纳入

4、研究所管理的重要组成部分己经成为一种趋势。关键词:设备管理;科学技术;管理信息 目 录第1章 绪论11.1系统的开发背景11.2开发工具及语言1第2章 概要设计22.1模块划分22.2 数据结构的选择3第3章 系统详细设计与编码43.1完整的源程序43.2程序的输入和输出233.3调试程序中遇到的问题及解决方案24第4章 总结25参考文献26II第1章 绪论1.1研究背景设备管理系统是企业内部的信息管理系统,是连接企业内部各生产部门的桥梁与纽带,起着核心作用。目前企业设备自动化管理水平不是很高。大多数设备管理办法是设备的采购进来以后,将设备的基本情况和相关信息登记存档,然后将档案存档。以后的档

5、案基本就没人维护,如设备修改、删除情况、设备的当前运行状态等信息本不会呈现在管理工作人员面前,由于散乱、复杂、查找和整理不便,即设备跟踪信息不能及时体现在设备的档案上。某些企业采用专门人工整点,对设备的跟踪信息即使能记录在案,但无形中增加了繁重的手工劳动,整个设备管理水平还是较低。本系统会提高办公效率和设备可靠性,减少工作人员的劳动强度,减少办公耗材,提高现代化管理水平。企业面对市场竞争的巨大压力,要求企业创造新的利润源,这为企业如何配置有限资源,利用先进计算机技术不断开发出操作简便、界面友好、灵活、实用、安全,更具时效性的设备信息管理系统有着更高的要求。1.2开发工具及语言本系统使用JAVA

6、语言MyEclipse工具开发,主界面清晰显示所有功能项,使用简单。各个功能项均定义一个函数来实现,在主函数中调用各个子函数实现不同的功能。第2章 概要设计2.1模块划分学生籍贯管理系统分为4大功能模块,分别为:录入学生籍贯、修改学生籍贯、查询学生籍贯、删除学生籍贯。1.系统各个部分及其包括的具体功能模块: 设备管理录入设备信息修改设备信息查询设备信息删除设备信息编号名称价格编号名称价格编号名称价格编号名称价格2.程序流程图:录入设备信息设备管理删除设备信息查询设备信息输出设备信息输出设备信息确定删除修改设备信息显示信息保存修改输出查询返回设备信息显示2.2 数据结构的选择系统数据的逻辑结构采

7、用线性结构,物理结构采用链式存储结构。存储结构定义如下:Hashtable 基本信息=null;JTextField 编号,名称,价格;第3章 系统详细设计与编码3.1完整的源程序/主函数代码public class Student implements java.io.Serializable String number,name,discipling,grade,borth,sex; public Student() public void setNumber(String number) this.number=number; public String getNumber() retu

8、rn number; public void setName(String name) this.name=name; public String getName() return name; public void setDiscipling(String discipling) this.discipling=discipling; public String getDisciping() return discipling; public void setGrade(String grade) this.grade=grade; public String getGrade() retu

9、rn grade; public void setBorth(String borth) this.borth=borth; public String getBorth() return borth; public void setSex(String sex) this.sex=sex; public String getSex() return sex; /登录界面代码 import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.io.*;class MyPanel extends JPanelpu

10、blic void paintComponent(Graphics g)super.paintComponent(g);Image image=new ImageIcon(203.jpg).getImage();g.drawImage(image,0,0,this);public class Register extends JFrame private MyPanel panel;private JLabel lab_zhanghao = new JLabel(账号:);private JTextField jta_text = new JTextField();Font lab = new

11、 Font(楷体,1,23);private JLabel lat_password = new JLabel(密码:);Font lat = new Font(楷体,1,23);private JTextField jtb_text = new JTextField();private JButton btn_register = new JButton(注册);private JButton btn_land = new JButton(OK);Font btn = new Font(楷体,2,15);public static int pd = 0;public static Strin

12、g ak1, ak2;File file=null;public Register() this.setSize(500,300);this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);this.setLocationRelativeTo(null);this.setTitle(欢迎登录设备管理系统);this.setResizable(false);btn_register.addActionListener(new ActionListener() public void actionPerformed(ActionEvent e) pd

13、= 1;ak1 = jta_text .getText();ak2 = jtb_text.getText(); String fileName = E:users.dat; try Writer writer = new FileWriter(fileName); catch (IOException e1) e1.printStackTrace(); jta_text.setText(); jtb_text.setText(); JOptionPane.showMessageDialog(null,注册成功! n您的用户名是+ak1+n密码是+ ak2););btn_land.addActi

14、onListener(new ActionListener() public void actionPerformed(ActionEvent e) if(pd=1) if(ak1.equals(jta_text.getText() & ak2.equals(jtb_text.getText() JOptionPane.showMessageDialog(null, 登录成功!);dispose(); new StudentMain(); else JOptionPane.showMessageDialog(null,登陆失败!检查账号密码是否正确,null, JOptionPane.ERRO

15、R_MESSAGE, null); jta_text .setText(); jtb_text .setText(); );init();panel=new MyPanel();panel.add(lab_zhanghao);panel.add(lat_password);panel.add(jta_text);panel.add(jtb_text);panel.add(btn_register);panel.add(btn_land);panel.setLayout(null);getContentPane().add(panel);private void init() lab_zhang

16、hao.setSize(200,100);lab_zhanghao. setLocation(80,20);lab_zhanghao.setFont(lab);lat_password.setSize(200,100);lat_password.setLocation(80,80);lat_password.setFont(lat);jta_text.setSize(190,30);jta_text.setLocation(150,55);jtb_text.setSize(190,30);jtb_text.setLocation(150,115);btn_register.setSize(60

17、, 30);btn_register.setLocation(150, 180);btn_land.setSize(60, 30);btn_land.setLocation(250, 180);btn_register.setFont(btn);btn_land.setFont(btn);public static void main(String args) throws ClassNotFoundException,InstantiationException, IllegalAccessException,UnsupportedLookAndFeelException UIManager

18、.setLookAndFeel(com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel);new Register().setVisible(true);/主界面代码import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.io.*;import java.util.Hashtable;public class StudentMain extends JFrame implements ActionListener JMenuBar bar; JMenu fil

19、eMenu; JMenuItem 录入,修改,查询,删除; Container con=null; Hashtable 基本信息=null; File file=null; CardLayout card=null; JLabel label=null; JPanel pCenter; StudentSituation 基本信息录入=null; ModifySituation 基本信息修改=null; Inquest 基本信息查询=null; Delete 基本信息删除=null; public StudentMain() this.setTitle(设备管理界面); 录入=new JMenu

20、Item(录入); 修改=new JMenuItem(修改); 查询=new JMenuItem(查询); 删除=new JMenuItem(删除); bar=new JMenuBar(); fileMenu=new JMenu(请点击这里!); fileMenu.add(录入); fileMenu.add(修改); fileMenu.add(查询); fileMenu.add(删除); bar.add(fileMenu); setJMenuBar(bar); label=new JLabel(欢迎进入设备管理系统,JLabel.CENTER); label.setFont(new Font(

21、SansSerif,Font.BOLD+Font.ITALIC,25); label.setForeground(Color.GRAY); 基本信息=new Hashtable(); 录入.addActionListener(this); 修改.addActionListener(this); 查询.addActionListener(this); 删除.addActionListener(this); card=new CardLayout(); con=getContentPane(); pCenter=new JPanel(); pCenter.setLayout(card); pCen

22、ter.setBackground(Color.YELLOW); file=new File(基本信息.txt); if(!file.exists() try FileOutputStream out=new FileOutputStream(file); ObjectOutputStream objectOut=new ObjectOutputStream(out); objectOut.writeObject(基本信息); objectOut.close(); out.close(); catch(IOException e) 基本信息录入=new StudentSituation(fil

23、e); 基本信息修改=new ModifySituation(file); 基本信息查询=new Inquest(this,file); 基本信息删除=new Delete(file); pCenter.add(欢迎语界面,label); pCenter.add(录入界面,基本信息录入); pCenter.add(修改界面,基本信息修改); pCenter.add(删除界面,基本信息删除); con.add(pCenter,BorderLayout.CENTER); con.validate(); addWindowListener(new WindowAdapter() public voi

24、d windowClosing(WindowEvent e) System.exit(0); ); setVisible(true); setBounds(200,180,400,200); validate(); public void actionPerformed(ActionEvent e) if(e.getSource()=录入) card.show(pCenter,录入界面); else if(e.getSource()=修改) card.show(pCenter,修改界面); else if(e.getSource()=查询) 基本信息查询.setVisible(true); e

25、lse if(e.getSource()=删除) card.show(pCenter,删除界面); public static void main(String args) new StudentMain(); /录入代码import java.awt.*;import java.awt.event.*;import javax.swing.*;import java.io.*;import java.util.*;public class StudentSituation extends JPanel implements ActionListener Hashtable 基本信息表=nul

26、l; JTextField 编号,名称,价格; Student 学生=null; ButtonGroup group=null; JButton 录入; FileInputStream inOne=null; ObjectInputStream inTwo=null; FileOutputStream outOne=null; ObjectOutputStream outTwo=null; File file=null; public StudentSituation(File file) this.file=file; 编号=new JTextField(10); 名称=new JTextF

27、ield(10); 价格=new JTextField(10); group=new ButtonGroup(); 录入=new JButton(录入); 录入.addActionListener(this); Box box1=Box.createHorizontalBox(); box1.add(new JLabel(编号:,JLabel.CENTER); box1.add(编号); Box box2=Box.createHorizontalBox(); box2.add(new JLabel(名称:,JLabel.CENTER); box2.add(名称); Box box3=Box.c

28、reateHorizontalBox(); Box box4=Box.createHorizontalBox(); Box box5=Box.createHorizontalBox(); box5.add(new JLabel(价格:,JLabel.CENTER); box5.add(价格); Box box6=Box.createHorizontalBox(); box6.add(new JLabel( ,JLabel.CENTER); Box boxH=Box.createVerticalBox(); boxH.add(box1); boxH.add(box2); boxH.add(box

29、3); boxH.add(box5); boxH.add(box6); boxH.add(box4); boxH.add(Box.createVerticalGlue(); JPanel pCenter=new JPanel(); pCenter.add(boxH); setLayout(new BorderLayout(); add(pCenter,BorderLayout.CENTER); JPanel pSouth=new JPanel(); pSouth.add(录入); add(pSouth,BorderLayout.SOUTH); validate(); public void a

30、ctionPerformed(ActionEvent e) if(e.getSource()=录入) String number=; number=编号 .getText(); if(number.length()0) try inOne=new FileInputStream(file); inTwo=new ObjectInputStream(inOne); 基本信息表=(Hashtable)inTwo.readObject(); inOne.close(); inTwo.close(); catch(Exception ee) if(基本信息表.containsKey(number) S

31、tring warning=该价格已存在,请到修改页面修改!; JOptionPane.showMessageDialog(this,warning,警告,JOptionPane.WARNING_MESSAGE); else String m=价格将被录入!; int ok=JOptionPane.showConfirmDialog(this,m,确认,JOptionPane.YES_NO_OPTION, JOptionPane.INFORMATION_MESSAGE); if(ok=JOptionPane.YES_OPTION) String name=名称.getText(); Strin

32、g grade=价格.getText(); String sex=null; 学生=new Student(); 学生.setNumber(number); 学生.setName(name); 学生.setGrade(grade); try outOne=new FileOutputStream(file); outTwo=new ObjectOutputStream(outOne); 基本信息表.put(number,学生); outTwo.writeObject(基本信息表); outTwo.close(); outOne.close(); 编号.setText(null); 名称.set

33、Text(null); 价格.setText(null); catch(Exception ee) System.out.println(ee); else String warning=必须要输入编号!; JOptionPane.showMessageDialog(this,warning,警告,JOptionPane.WARNING_MESSAGE); 编号.setText(null); 名称.setText(null); 价格.setText(null); /查询代码import java.awt.*;import java.awt.event.*;import javax.swing.

34、*;import java.io.*;import java.util.*;public class Inquest extends JDialog implements ActionListener Hashtable 基本信息表=null; JTextField 编号,名称,价格; JButton 查询;ButtonGroup group=null;FileInputStream inOne=null;ObjectInputStream inTwo=null;File file=null; public Inquest(JFrame f,File file)super(f,查询对话框,fa

35、lse); this.file=file;编号=new JTextField(10);查询=new JButton(查询);编号.addActionListener(this);查询.addActionListener(this);名称=new JTextField(10);名称.setEditable(false);价格=new JTextField(10);价格.setEditable(false);Box box1=Box.createHorizontalBox(); box1.add(new JLabel(输入要查询的编号:,JLabel.CENTER);box1.add(编号);bo

36、x1.add(查询);Box box2=Box.createHorizontalBox(); box2.add(new JLabel(名称:,JLabel.CENTER);box2.add(名称);Box box5=Box.createHorizontalBox(); box5.add(new JLabel(价格:,JLabel.CENTER);box5.add(价格);Box boxH=Box.createVerticalBox(); boxH.add(box1);boxH.add(box2);boxH.add(box5);boxH.add(Box.createVerticalGlue(); JPanel pCenter=new JPanel();

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 社会民生


经营许可证编号:宁ICP备18001539号-1