欢迎来到三一文库! | 帮助中心 三一文库31doc.com 一个上传文档投稿赚钱的网站
三一文库
全部分类
  • 研究报告>
  • 工作总结>
  • 合同范本>
  • 心得体会>
  • 工作报告>
  • 党团相关>
  • 幼儿/小学教育>
  • 高等教育>
  • 经济/贸易/财会>
  • 建筑/环境>
  • 金融/证券>
  • 医学/心理学>
  • ImageVerifierCode 换一换
    首页 三一文库 > 资源分类 > DOC文档下载  

    《医药销售系统》java课程设计报告.doc

    • 资源ID:11745363       资源大小:307.50KB        全文页数:27页
    • 资源格式: DOC        下载积分:6
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录 QQ登录   微博登录  
    二维码
    微信扫一扫登录
    下载资源需要6
    邮箱/手机:
    温馨提示:
    用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)
    支付方式: 支付宝    微信支付   
    验证码:   换一换

    加入VIP免费专享
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    《医药销售系统》java课程设计报告.doc

    面向对象程序设计面向对象程序设计 实验报告实验报告 题题 目目 医药销售系统医药销售系统 学学 院院 商学院商学院 专专 业业 信息管理与信息系统信息管理与信息系统 班班 级级 *班班 学学 号号 201052275* 学生姓名学生姓名 * 指导教师指导教师 * 编写日期编写日期 2013 年年 1 月月 5 号号 目目 录录 一、需求分析一、需求分析.1 1.1 功能需求.1 1.2 性能需求.1 1.3 数据需求.1 二、系统运行环境二、系统运行环境.1 三、系统总体设计三、系统总体设计.2 3.1 登录界面.2 3.2 系统功能.2 四、数据库设计四、数据库设计.3 4.1 概念结构设计.3 4.2 逻辑结构设计.3 4.3 物理结构设计.4 4.3.1 用户信息表 Users.4 4.3.2 药品信息表 MedicineInfos .4 4.3.3 订单信息表 WholesaleInfo.6 五、程序模块设计五、程序模块设计.6 5.1 运行界面及其效果图.6 5.2 程序代码.8 六、总结六、总结.22 七、参考资料七、参考资料.22 0 一、一、需求分析需求分析 根据课题调查和分析用户的业务活动、信息和处理的需求,以及各 种数据之间的约束条件关系,形成以下的系统的需求说明。 1.11.1 功能需求功能需求(功能划分,功能描述)(功能划分,功能描述) Login.java 实现注册和登录功能。注册,将用户姓名和密码写入数 据库用户表(Users) ,并反馈给注册用户。登录,按照用户填写的用户名和密 码,在数据库中查找相关信息,如果匹配则提示登录成功,并转至药品管理系 统的管理界面。否则提示登录失败。 ManageMain.java 实现用户管理界面功能选择。在功能选择界面中可 以选择添加、删除、修改、查询和统计药品信息,并且可以选择售出药品。 InsMedicineInfo.java 实现添加药品信息功能。在这一模块中,可 以将药品信息填写保存到数据库药品信息表(MedicineInfo)中。并返回 操作状态。 DelMedicineInfo.java 实现分别按药品编号或药品名称删除指定药 品信息,被删除的药品信息将从药品信息表中删除。并返回操作状态。 UpdMedicineInfo.java 实现按药品编号更新药品信息功能。被修改 的药品信息在数据库中也被相应修改。并返回操作状态。 QueMedicineInfo.java 实现分别按药品编号或药品进价范围查询药 品信息。数据库中符合条件的药品信息将被显示在查询界面的文本域中。 StaMedicineInfo.java 实现统计数据库中药品信息。统计的药品信 息将显示在统计药品信息界面,以表格的形式呈现。 SalMedicineInfo.java 实现出售药品功能。填写药品编号和售出数 量,并生成订单信息。出售药品订单信息将被存入到数据库药品订单信息 表(WholesaleInfo)中。 1.21.2 性能需求(性能需求(软件适应性和移植性等)软件适应性和移植性等) 在 Windows 平台测试无误。 使用 SQL Server 2008 数据库。 可用于一般的药品信息管理。 1.31.3 数据需求数据需求(数据之间的依赖和约束关系)(数据之间的依赖和约束关系) 本药品信息管理系统共有三张表,一张为独立的用户信息表 (Users) ,用于管理用户信息。其余两张为药品信息表 (MedicineInfo)和订单信息表(WholesaleInfo) 。 二、系统运行环境二、系统运行环境 本课题是在 SQL Server 2008、netbeans6.9.1 环境下运行的。 1 三、系统总体设计三、系统总体设计 3.13.1 登录界面登录界面 注册信息 用户登录 登录界面 2 3.23.2 系统功能系统功能 药品管理系统药品管理功能 添 加 药 品 信 息 删 除 药 品 信 息 修 改 药 品 信 息 查 询 药 品 信 息 统 计 药 品 信 息 出 售 药 品 功 能 3 4 四、数据库设计四、数据库设计 4.1 概念结构设计概念结构设计 用户表 用户名 用户密码 药品信息表 药品编号 药品名称 药品通称 药品规格 药品类别 药品进价 药品批发价 药品库存量 药品订单表 订单编号 药品编号 批发药品数量 外键约束 5 4.2 逻辑结构设计逻辑结构设计 Users Username Userpassword MedicineInfo medNumber medName medShortName medNors medCate medInPrice medWholesale medCount WholesaleInfo wsNumber medNumber wsMedCount 6 4.3 物理结构设计物理结构设计 4.3.1 用户信息表 Uses SQL: /*=*/ /* Table: Users */ /*=*/ create table Users ( username varchar(10) not null, userpassword varchar(20) null, constraint PK_USERS primary key (username) ) go Insert into Users values(aa,bb); if exists (select 1 from sysobjects where id = object_id(Users) and type = U) drop table Users go 4.3.2 药品信息表 MedicineInfo SQL: /*=*/ /* Table: MedicineInfo */ /*=*/ 7 create table MedicineInfo ( medNumber varchar(8) not null, medName varchar(40) not null, medShortName varchar(10) null, medNors varchar(4) null, medCate varchar(20) null, medInPrice float not null, medWholesalePrice float not null, medCount int not null, constraint PK_MEDICINEINFO primary key (medNumber) ) go insert into MedicineInfo values(95270001,葵花牌感冒灵颗粒,葵感,16*2,感 冒药,24.7,25.8,1000); insert into MedicineInfo values(95270002,双黄连口服液,双黄连液,12*1,感 冒药,29.2,30.1,1000); insert into MedicineInfo values(95270003,阿莫西林,莫西,1*1,消炎药 ,30,32.1,1000); insert into MedicineInfo values(95270004,吗丁啉,吗丁啉,1*1,胃肠道药 ,18.2,20,498); insert into MedicineInfo values(95270005,对乙酰氨基酚 ,扑热息痛,1*1,感 冒药,24.7,25.8,698); insert into MedicineInfo values(95270006,川贝枇杷膏,枇杷膏,1*1,止咳药 ,21,22.8,900); if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(WholesaleInfo) and o.name = FK_WHOLESAL_REFERENCE_MEDICINE) alter table WholesaleInfo drop constraint FK_WHOLESAL_REFERENCE_MEDICINE go if exists (select 1 from sysobjects where id = object_id(MedicineInfo) and type = U) drop table MedicineInfo go 8 4.3.3 订单信息表 WholesaleInfo SQL: /*=*/ /* Table: WholeInfo */ /*=*/ create table WholesaleInfo ( wsNumber varchar(8) not null, medNumber varchar(8) null, wsMedCount int not null, constraint PK_WHOLESALEINFO primary key (wsNumber) ) go if exists (select 1 from sys.sysreferences r join sys.sysobjects o on (o.id = r.constid and o.type = F) where r.fkeyid = object_id(WholesaleInfo) and o.name = FK_WHOLESAL_REFERENCE_MEDICINE) alter table WholesaleInfo drop constraint FK_WHOLESAL_REFERENCE_MEDICINE go if exists (select 1 from sysobjects where id = object_id(WholesaleInfo) and type = U) drop table WholesaleInfo go alter table WholesaleInfo add constraint FK_WHOLESAL_REFERENCE_MEDICINE foreign key (medNumber) references MedicineInfo (medNumber) go 五、五、程序模块设计程序模块设计 5.1 运行界面及其效果图运行界面及其效果图 1.功能选择界面 点击“增加”按钮,跳转到增加药品信息界面; 9 点击“删除”按钮,跳转到删除药品信息界面; 点击“修改”按钮,跳转到修改药品信息界面; 点击“查询”按钮,跳转到查询药品信息界面; 点击“统计”按钮,跳转到统计药品信息界面; 点击“出售”按钮,跳转到出售药品信息界面。 2.删除药品信息界面 按药品编号删除药拼信息: 按药品名称删除药品信息: 3.查询药品信息界面 10 按药品编号查询药品信息: 按药品进价范围查询药品信息: 4.出售药品信息界面 出售成功并生成订单写入到数据库药品订单信息表(WholesaleInfo)中: 5.2 程序代码程序代码 ManageMain.java import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; 11 public class ManageMain extends JFrame private static final long serialVersionUID = 1L; JLabel title=new JLabel(-请选择您的操作 -); JLabel insMedicineInfo=new JLabel(增加药品信息:); JButton btInsInfo=new JButton(增加); JLabel delMedicineInfo=new JLabel(删除药品信息:); JButton btDelInfo=new JButton(删除); JLabel updMedicineInfo=new JLabel(修改药品信息:); JButton btUpdInfo=new JButton(修改); JLabel queMedicineInfo=new JLabel(查询药品信息:); JButton btQueInfo=new JButton(查询); JLabel staMedicineInfo=new JLabel(统计药品信息:); JButton btStaInfo=new JButton(统计); JLabel salMedicineInfo=new JLabel(出售药品管理:); JButton btSalInfo=new JButton(出售); public ManageMain() super(药店管理系统-功能); this.title.setSize(200, 30); this.title.setLocation(200,10); this.insMedicineInfo.setSize(100,30); this.insMedicineInfo.setLocation(80,50); this.btInsInfo.setSize(60,30); this.btInsInfo.setLocation(190,50); this.delMedicineInfo.setSize(100,30); this.delMedicineInfo.setLocation(260,50); this.btDelInfo.setSize(60,30); this.btDelInfo.setLocation(360,50); this.updMedicineInfo.setSize(100,30); this.updMedicineInfo.setLocation(80,90); this.btUpdInfo.setSize(60,30); this.btUpdInfo.setLocation(190,90); this.queMedicineInfo.setSize(100,90); this.queMedicineInfo.setLocation(260,60); this.btQueInfo.setSize(60,30); this.btQueInfo.setLocation(360,90); this.staMedicineInfo.setSize(100,30); this.staMedicineInfo.setLocation(80,130); this.btStaInfo.setSize(60,30); this.btStaInfo.setLocation(190,130); this.salMedicineInfo.setSize(100,30); this.salMedicineInfo.setLocation(260,130); this.btSalInfo.setSize(60,30); this.btSalInfo.setLocation(360,130); 12 this.setLayout(null); this.getContentPane().add(title); this.getContentPane().add(insMedicineInfo); this.getContentPane().add(btInsInfo); this.getContentPane().add(delMedicineInfo); this.getContentPane().add(btDelInfo); this.getContentPane().add(updMedicineInfo); this.getContentPane().add(btUpdInfo); this.getContentPane().add(queMedicineInfo); this.getContentPane().add(btQueInfo); this.getContentPane().add(staMedicineInfo); this.getContentPane().add(btStaInfo); this.getContentPane().add(salMedicineInfo); this.getContentPane().add(btSalInfo); /-添加药品信息注册事件-/ btInsInfo.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub InsMedicineInfo insmedicineinfo=new InsMedicineInfo(); insmedicineinfo.show(); ); /-删除药品信息注册事件-/ this.btDelInfo.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub DelMedicineInfo delmedicineinfo=new DelMedicineInfo(); delmedicineinfo.show(); ); /-修改药品信息注册事件-/ this.btUpdInfo.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub UpdMedicineInfo updmedicineinfo=new UpdMedicineInfo(); updmedicineinfo.show(); ); /-查询药品信息注册事件-/ this.btQueInfo.addActionListener(new ActionListener() Override 13 public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub QueMedicineInfo quemedicineinfo=new QueMedicineInfo(); quemedicineinfo.show(); ); /-统计药品信息注册事件-/ this.btStaInfo.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub StaMedicineInfo stamedicineinfo=new StaMedicineInfo(); stamedicineinfo.show(); ); /-出售药品信息注册事件-/ this.btSalInfo.addActionListener(new ActionListener() Override public void actionPerformed(ActionEvent e) / TODO Auto-generated method stub SalMedicineInfo salmedicineinfo=new SalMedicineInfo(); salmedicineinfo.show(); ); this.setSize(550,230); this.setResizable(false); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setVisible(true); public static void main(String args) new ManageMain(); DelMedicineInfo.java import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.sql.Connection; import java.sql.DriverManager; import java.sql.Statement; import javax.swing.*; public class DelMedicineInfo extends JFrame private static final long serialVersionUID = 1L; 14 JLabel labTitle=new JLabel(-请选择删除药品信息的方法-); JLabel labMedNumber=new JLabel(请输入药品编号:); JTextField txtMedNumber=new JTextField(); JButton btnMedNumber=new JButton(确定); JLabel labMedName=new JLabel(请输入药品名称:); JTextField txtMedName=new JTextField(); JButton btnMedName=new JButton(确定); JButton btnQuit=new JButton(取消); public DelMedicineInfo() super(药店管理系统-删除); this.labTitle.setSize(200,30); this.labTitle.setLocation(80,10); this.labMedNumber.setSize(110,30); this.labMedNumber.setLocation(50,50); this.txtMedNumber.setSize(100,30); this.txtMedNumber.setLocation(160,50); this.btnMedNumber.setSize(60,30); this.btnMedNumber.setLocation(270,50); this.labMedName.setSize(110,30); this.labMedName.setLocation(50,90); this.txtMedName.setSize(100,30); this.txtMedName.setLocation(160,90); this.btnMedName.setSize(60,30); this.btnMedName.setLocation(270,90); this.btnQuit.setSize(60,30); this.btnQuit.setLocation(150,130); this.setLayout(null); this.getContentPane().add(labTitle); this.getContentPane().add(labMedNumber); this.getContentPane().add(txtMedNumber); this.getContentPane().add(btnMedNumber); this.getContentPane().add(labMedName); this.getContentPane().add(txtMedName); this.getContentPane().add(btnMedName); this.getContentPane().add(btnQuit); /-按药品编号删除的注册事件处理-/ this.btnMedNumber.addActionListener(new DelNumberActionListener(this); /-按药品名称删除的注册事件处理-/ this.btnMedName.addActionListener(new DelNameActionListener(this); /-取消按钮事件注册-/ this.btnQuit.addActionListener(new QuitDelActionListener(this); this.setSize(400,200); this.setResizable(false); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 15 this.setVisible(true); public static void main(String args) new DelMedicineInfo(); public void DelNumberActionPerformed(ActionEvent e) String MedNumber=txtMedNumber.getText(); try Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver); catch (ClassNotFoundException e1) JOptionPane.showMessageDialog(null,驱动未找到!); try String url=jdbc:sqlserver:/localhost:1433;DatabaseName=MedicineManage; String dbname=sa; String dbpassword=pwd; String sql=Delete From MedicineInfo where medNumber= +MedNumber+; Connection conn=DriverManager.getConnection(url,dbname,dbpassword); Statement stmt=conn.createStatement(); stmt.executeUpdate(sql); JOptionPane.showMessageDialog(null,药品编号为+MedNumber+的药 品删除成功!); this.setVisible(false); catch(Exception e1) e1.printStackTrace(); JOptionPane.showMessageDialog(null,按编号删除药品信息有误!); public void DelNameActionPerformed(ActionEvent e) String MedName=txtMedName.getText(); try Class.forName(com.microsoft.sqlserver.jdbc.SQLServerDriver); catch (ClassNotFoundException e1) JOptionPane.showMessageDialog(null,驱动未找到!); try String url=jdbc:sqlserver:/localhost:1433;DatabaseName=MedicineManage; String dbname=sa; String dbpassword=pwd; String sql=Delete From MedicineInfo where medName like %+MedName+%; 16 Connection conn=DriverManager.getConnection(url,dbname,dbpassword); Statement stmt=conn.createStatement(); stmt.executeUpdate(sql); JOptionPane.showMessageDialog(null,药品名称为+MedName+的药品 删除成功!); this.setVisible(false); catch(Exception e1) e1.printStackTrace(); JOptionPane.showMessageDialog(null,按名称删除药品信息有误!); public void QuitDelActionPerformed(ActionEvent e) this.setVisible(false); class DelNumberActionListener implements ActionListener DelMedicineInfo delmedicineinfo; public DelNumberActionList

    注意事项

    本文(《医药销售系统》java课程设计报告.doc)为本站会员(PIYPING)主动上传,三一文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三一文库(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




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

    三一文库
    收起
    展开