超市管理系统.doc_第1页
超市管理系统.doc_第2页
超市管理系统.doc_第3页
超市管理系统.doc_第4页
超市管理系统.doc_第5页
已阅读5页,还剩44页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

20102010 届毕业论文(设计)届毕业论文(设计) 材材 料料 系 、 部: 数计系 学生姓名: 指导教师: 职称 讲师 专 业: 计算机教育 班 级: 一班 2010 年 5 月 i 2010 届届毕业论毕业论文(文(设计设计) )课题课题任任务书务书 系: 数计系 专业: 计算机教育 指导教师学生姓名 课题名称超市管理系统 内 容 及 任 务 主要内容: 通过 visual basic 6.0 和 sql server2000 构造出一个小型的超市管理系统。此系 统能够实现以下功能: 1. 库存管理(包括录入商品、修改和删除商品、查询商品) (1)录入商品 (2)修改和删除商品 (3)查询商品 2. 商品销售 (1)销售商品 (2)查询销售情况 3. 系统设置 (1)用户管理 (2)修改密码 要求: 1. 查阅相关的国内外文献,按时提交开题报告; 2. 论文内容正确无误,有一定的创新或个人见解; 3. 开发的系统必须在计算机上测试通过,程序运行良好; 4. 论文必须按照学校规定的统一格式撰写; 5. 论文严禁抄袭,引用别人的成果必须在文中注明。 ii 拟 达 到 的 要 求 或 技 术 指 标 工资管理系统的主要任务是用计算机对各种工资信息进行日常管理,如修改、增加、 删除及查询等,针对系统服务对象的具体要求,迅速、准确地完成各种信息的工作。 1可行性 要力求最大限度地满足实际工作的需要,充分考虑各层次、各环节数据处理的实用 性,满足小型超市的管理。而且操作简便实用。 2安全性 应用软件与数据库系统的设计要做到安全可靠,防止非法用户的入侵。数据库的备 份策略恰当,同时设置多种管理人员。以防他人盗取有用的信息。 3实用性 用户界面应当直观、明了、条理清晰。实现了易学、易用、易管理。 起止日期工作内容备注 进 度 安 排 1 月 10 日2 月 12 日 2 月 14 日2 月 20 日 2 月 20 日4 月 18 日 4 月 18 日5 月 10 日 收集信息以及进行系统整体规划 写任务书以及开题报告 开始进行系统开发,初步定稿 对系统进行进一步修改完善,最后定稿 iii 主 要 参 考 资 料 1叶俊民,汪望珠.面向对象软件工程.第二版.清华大学出版社 2戴志诚. sqlserver 2005 数据库系统开发与实例. 电子工业出版社 3郑阿奇.sql server 教程.清华大学出版社 4胡胜利.动态报表在 vb6.0 中的设计和实现.江苏技术师范学院学报 5李占宣.数据库中面向复杂应用的查询方法.电脑学习 研室意见 年 月 日 系主管领导 意见 年 月 日 iv 株洲师专 200 届毕业论文(设计)指导教师评阅表 系: 学生姓名学 号10107120班 级计教一班 专 业计算机教育指导教师姓名 课题名称超市管理系统 评语:(包括以下方面,学习态度工作量完成情况;检索和利用文献能力、外文翻译和计 算机应用能力;学术水平或技术水平、综合运用知识能力和创新能力;限 300 字以上) 是否同意参加答辩:是 否 指导教师评定 (满分:20 分) 分值: 20 指导教师签字: 年 月 日 v 株洲师专 200 届毕业论文(设计)评阅教师评阅表 系: 学生姓名学 号10107120班 级计教一班 专 业评阅教师姓名 课 题 评语:(对论文学术评语(包括选题意义;文献利用能力;所用资料、实验数据和计算结果可靠性;创新成 果及写作规范化和逻辑性。注意对其中可能存在的剽窃、论据作假等把好关,如果发现请详细说明) 针对课题内容给设计者(作者)提出不少于 3 个问题,作为答辩时的必答题 1. 2. 3. 选题与文献综述(20 分) 分值: 创新性(15 分) 分值: 基础理论和专门知识(35 分) 分值: 作者写作、表达能力(30 分) 分值: 综合评价(满分:30 分)分值: 30 是否同意参加答辩是 否 评阅人(签名): 年 月 日 vi 株洲师专 200 届毕业论文(设计)答辩及最终成绩 评 定 表 系(公章): 学生姓名学号 10107120 班级计教一班 答辩 日期 5 月 课题名称超市管理系统 指导 教师 评 定 成 绩 评 定 分 值教师 1教师 2教师 3教师 4教师 5 总 评 课 题 介 绍 思路清晰,语 言表达准确,概念 清楚,论点正确, 实验方法科学,分 析归纳合理,结论 严谨,论文(设计) 有应用价值。 30 必 答 题 40 答 辩 表 现 思维敏捷, 回答问题有 理论根据, 基本概念清 楚,主要问 题回答准确 大、深入,知 识面宽。 自 由 提 问 30 答辩评定 (满分: 50 分) 分值: 50 答辩小组长签名: 指导教师评定分值: 评阅教师评定分值: 最终评定成绩: 分数: 等级: 答辩委员会主任签名: 年 月 日 vii 株株 洲洲 师师 范范 高高 等等 专专 科科 学学 校校 2010 届届毕业设计说毕业设计说明明书书 题 目 系、部: 数计系 学生姓名: 指导教师: 职称 讲师 专 业: 计算机教育 班 级: 计教一班 完成时间: 2010-5-4 viii 摘 要 伴随着社会的复杂化,传统的“一支笔,一本帐簿”的物品销售管理方式也慢慢的 无法适应形势的变化。随着信息技术的发展,计算机已被广泛的用于社会的各个领域, 成为推动社会发展的技术动力。而在计算机应用中,软件的作用十分突出,软件已经 发展成为信息技术的核心,主导着信息产品的开发和信息技术市场的进一步的开拓。 软件产业已成为社会信息化进程中的一个战略性产业。在软件技术的应用中软件的开 发技术尤其是应用型软件产品的开发技术成了重中之重。不断开发适应用户需求、市 场需要的新型软件产品。随着社会的发展,软件也在不断的更新换代。随着信息化的 发展,为了让管理更快捷、更准确,实现商业活动的信息化管理已经成为各个领域的 当务之急。 本次课设就是利用 visual basic 来开发的应用系统的。我们的这个系统主要是针 对小型超市管理行业的,主要是用来对商品销售的商业活动进行管理的。应用本系统, 我们可以使商品销售管理简单而有效的运行,这就是计算机的优点。下来我来简单介 绍一下我们所开发出来的这个系统,在我们的这个系统中,主要有三大方面的功能, 即库存管理、商品销售管理、系统设置管理。另外,利用我们利用文件来对数据进行 管理,从而使系统更加完善,功能更加强大。 关键词:visual basic;文件;超市;系统 ix summary with the social complexity, the traditional “a pen, a book,“ sales management articles can also slow to adapt to changing situations. with the development of information technology, computers have been widely used in various fields of society, as the technical driving force for promoting social development. in computer applications, a very prominent role in the software, the software has become the core of information technology, leading the development of information products and information technology market to develop further. software industry has become the information in the process of a strategic industry. software applications in the development of software technology, in particular the development of applied software technology has become the top priority. constantly develop to meet the customer needs, market needs, new software products. with the development of society, are constantly upgrading the software. with the development of information technology, in order to make management more efficient, more accurate information to achieve commercial activities in various areas of management has become an urgent task. the course design is to use visual basic to develop the application system. this system is mainly our supermarket management for small industry is primarily used for sales of goods to manage the commercial activities. application of this system, we can make product sales management simple and effective operation, which is the computers advantages. i came down briefly what we have developed this system, this system in our three main areas of functionality, inventory management, sales management, and system settings management. in addition, the use of the data we use to manage documents, making the system more complete, more features. key words: visual basic ;file; supermarket ;system x 目 录 摘摘 要要x 第 1 章 绪 论 1 第 2 章 系统功能介绍2 2.1 系统功能总框图2 2.2 模块功能介绍3 第 3 章 系统功能实现4 3.1 系统登录模块的实现4 3.2 录入商品模块的实现 5 3.3 修改和删除商品的实现 7 3.4 查询商品功能的实现11 3.5 销售商品功能的实现13 3.6 查询销售情况功能的实现17 3.7 用户管理界面 20 结 论23 致 谢24 参考文献25 附 录 26 1 第 1 章 绪 论 紧张而又繁忙的课程设计过去了,在这一个星期里,让我尝到了以前我没有体验过的辛 苦与劳累。经过本次的课程设计,使我克服了很多在程序设计上的弊端和难点,也让我体会 到了冲出重围的幸福与喜悦。 编写了几百行的代码最后写出一个程序觉得很有成就感。对 visual basic 的掌握提高到 了一个新的水平,能够利用 visual basic 编程平台编写出一个实用的程序,很大程度提高了 程序综合设计能力、分析能力和编程能力。 世纪之初,以微电子、计算机、软件和通信技术为主导的信息技术革命给我们生存的社 会所带来的变化令人目不暇接。我选择超市管理系统,它可以应用在小型的超市管理中,为 商品销售的各项管理及信息保存提供了一个良好的操作环境,为这些单位提供了很大的方便。 随着科学技术的不断提高,计算机科学日渐成熟,其强大的功能已为人们深刻认识,它已进 入人类社会的各个领域并发挥着越来越重要的作用。作为计算机应用的一部分,使用计算机 对超市管理,具有着手工管理所无法比拟的优点.例如:检索迅速、查找方便、可靠性高、存储 量大、保密性好、寿命长、成本低等。这些优点能够极大地提高超市管理的效率,从而使企 业取得更大的利润。 课程设计结束了,但是它留给我的印象是不可磨灭的。无论我以后会不会涉及这方面的 研究,我想,我至少掌握了一种系统的研究方法,我们学习的目的就在于运用,我们运用这 种研究方法的时候会很多,我最后要感谢课程设计,它的确教会我很多。 1 第 2 章 系统功能介绍 2.1 系统功能总框图 在本次课程设计中,我所做的课设题目是超市销售管理系统,根据它的基本要求和经过我们 查阅相关资料。经过自己的研究,最后我制定出了本系统的总体功能。因为我所做的系统涉 及到了销售,所以我们为它设计了三个主要的功能模块,即库存管理模块、商品销售模块、 和系统设置模块。另外还有两个文件管理模块,即文件的保存和文件的打开。系统总体功能 框图如图 2.1 所示。 超市管理系统 商品 销售 系统 设置 库存 管理 图 2.1 药品销售管理总框图 录 入 商 品 修 改 和 删 除 商 品 查 询 商 品 销 售 商 品 查 询 销 售 情 况 用 户 管 理 修 改 密 码 2 2.2 模块功能介绍 在系统功能总框图中我们已经介绍了我们这个系统的总体功能模块,即库存管理模块、 商品销售模块、和系统设置模块。下面我来具体介绍一下它们。 (1)库存管理模块:此模块用来录入商品、修改和删除商品还有查询商品。 (2)商品销售模块:此模块主要用来销售商品和查询销售商品的情况。 (3)系统管理模块:此模块主要用来管理系统用户中的一些操作,可以管理用户和修 改用户的密码。 3 第 3 章 系统功能实现 3.1 系统登录模块的实现 (1)在此模块中,主要实现对用户登录系统的管理。我们知道,对于每个软件应用系 统都有其特定的使用人员,尤其是用于商业活动的软件系统,就更应该注意它的保密功能, 所以我们必须为我们的系统设计一个用于保护本系统的密码登录功能。如图 4.1 所示为我们 超市管理管理系统的登录界面。它所具有的功能是验证用户的登录信息,即用户名和对应的 用户密码,检验预进入本系统的用户是不是合法用户。 图 3.1 登录界面 (2)核心代码 private sub cmdok_click() dim sql as string dim rs as adodb.recordset dim strusername as string dim intuserkey as integer on error goto errhandler: if trim(txtusername.text = “) then msgbox “请输入用户名称!“, vbexclamation txtusername.setfocus else sql = “select * from users where username = “ integrated security=sspi;persist security info=false;initial catalog=pos;data source=40f4d4dcb9dc46c“ adodc1.recordsource = “select * from products“ adodc1.commandtype = 1 adodc1.refresh cbounit.additem “个“ cbounit.additem “箱“ cbounit.additem “瓶“ cbounit.additem “盒“ cbounit.additem “袋“ changeformpos frmmain, me end sub 10 private sub txtproductinfo_change(index as integer) end sub 3.4 查询商品功能的实现 (1)超市管理系统的查询功能模块,如图 3.5 所示,为查询商品功能界面。本功能界 面由 1 个 ado data 控件用来连接数据源;1 个 datagrid 控件用来显示查询的数据;3 个 optionbutton 控件用来选择查询条件;1 个组合框用来选择商品编号,3 个文本框用来输入 商品名称,商品价格。 图 3.5 查询商品功能模块界面 (2)各控件的说明如表 3.6 控件属性属性值 textbos名称txtproductname textbos名称txtlowprice textbos名称txthighprice combobox名称cboproductid 名称optcode optionbutton caption商品价格 名称optname optionbutton caption商品名称 名称optprice optionbutton caption商品价格 表 3.6 11 (3)核心代码 private sub cmdexit_click() unload me end sub private sub cmdqurey_click() dim strquery as string on error goto errhandler: 按商品编号查询 if optcode.value = true then if trim(cboproductid.text) = “ then strquery = “select * from products“ else strquery = “select * from products where productid = “ integrated security=sspi;persist security info=false;initial catalog=pos;data source=40f4d4dcb9dc46c“ adodc1.recordsource = “select * from products“ adodc1.commandtype = 1 adodc1.refresh cbounit.additem “个“ cbounit.additem “箱“ cbounit.additem “瓶“ cbounit.additem “盒“ cbounit.additem “袋“ 30 changeformpos frmmain, me end sub private sub txtproductinfo_change(index as integer) end sub private sub cmdexit_click() unload me end sub private sub cmdqurey_click() dim strquery as string on error goto errhandler: 按商品编号查询 if optcode.value = true then if trim(cboproductid.text) = “ then strquery = “select * from products“ else strquery = “select * from products where productid = “ & cboproductid & “ end if end if 按商品名称查询 if optname.value = true then if trim(txtproductname.text) = “ then strquery = “select * from products“ else strquery = “select * from products where productname like %“ & txtproductname.text & “%“ end if end if 按商品价格查询 if optprice.value = true then if trim(txtlowprice.text) = “ and trim(txthighprice.text) = “ then strquery = “select * from products“ else if isnumeric(txtlowprice.text) = false then msgbox “价格必须为数字量!“, vbexclamation txtlowprice.setfocus exit sub end if if isnumeric(txthighprice.text) = false then msgbox “价格必须为数字量!“, vbexclamation txthighprice.setfocus exit sub end if strquery = “select * from products where unitprice=“ & txtlowprice.text & _ “and unitprice=“ & txthighprice.text end if end if adodc1.commandtype = 1 31 adodc1.recordsource = strquery adodc1.refresh exit sub errhandler: msgbox “错误号:“ & err.number & “ 错误信息:“ & err.description, vbexclamatio end sub private sub form_load() dim rs as new adodb.recordset dim sql as string sql = “select productid from products“ set rs = exesql(sql) rs.movefirst while not rs.eof cboproductid.additem rs!productid rs.movenext wend optcode.value = true changeformpos frmmain, frmproductquery end sub private sub o_click() end sub dim intbuy as integer private sub cmdcancel_click() lblproductinfo.caption = “ txtproductid.text = “ txtproductqty = “ txtsum.text = “ txtcash.text = “ txtchange.text = “ msgsale.rows = 1 intbuy = 0 txtproductid.setfocus end sub private sub cmdok_click() dim sql as string dim rs as adodb.recordset dim lngidspace as long dim lngnamespace as long dim lngpricespace as long dim lngstringlen as long dim strproductname as string dim strproductprice as string dim intproductqty as integer 32 if trim(txtproductid.text = “) then msgbox “请输入商品编号!“, vbexclamation txtproductid.setfocus else if trim(txtproductqty = “) then msgbox “请输入商品数量!“, vbexclamation txtproductqty.setfocus exit sub end if sql = “select * from products where productid = “ & txtproductid.text & “ set rs = exesql(sql) if rs.eof = true then msgbox “没有此编号商品,请重新输入商品编号!“, vbexclamation txtproductid.setfocus txtproductid.text = “ exit sub else 取出对应商品编号的商品名称 strproductname = rs!productname 取出对应商品编号的商品价格 strproductprice = rs!unitprice rs.close end if end if 将当前购买的商品信息放大显示 lngidspace = 8 - len(txtproductid.text) lngnamespace = 15 - 2 * len(strproductname) lngpricespace = 9 - len(strproductprice) lblproductinfo.caption = txtproductid & space(2 * lngidspace) & strproductname & space(2 * lngnamespace) & strproductprice & space(2 * lngpricespace) & txtproductqty 商品购卖数量加 1 intbuy = intbuy + 1 在表格中加入商品购买信息 fillgrid strproductname, strproductprice end sub private sub cmdpayment_click() dim sql as string dim intcount as integer dim intproductid as integer dim intproductqty as integer dim curproductprice as currency dim cursum as currency for intcount = 1 to intbuy curproductprice = msgsale.textmatrix(intcount, 4) intproductqty = msgsale.textmatrix(intcount, 5) 计算商品价格总和 cursum = cursum + curproductprice * intproductqty next intcount 33 for intcount = 1 to intbuy intproductid = msgsale.textmatrix(intcount, 2) intproductqty = msgsale.textmatrix(intcount, 5) if frmluserid = 0 then exit sub sql = “insert sales values(“ & intproductid & “,“ & frmluserid & “,“ & intproductqty & “,getdate()“ exesql (sql) next intcount txtsum.text = cursum txtcash.setfocus end sub private sub cmdquit_click() unload me end sub private sub form_activate() dim sql as string dim rs as adodb.recordset sql = “select * from machineuser where userid = “ & frmluserid & “ set rs = exesql(sql) lblmachineid.caption = rs!machineid lbluserid.caption = frmluserid txtproductid.setfocus end sub private sub form_load() dim i as integer 设置窗体位置 changeformpos frmmain, frmsales intbuy = 0 with msgsale .formatstring = “|序号|商品编码|商品名称|商品单价|数量“ .colwidth(0) = 0 .colwidth(1) = 1100 .colwidth(2) = 1400 .colwidth(3) = 1600 .colwidth(4) = 1600 .colwidth(5) = 1600 .rows = 1 end with end sub private sub msgsale_click() end sub private sub txtcash_change() dim curcash as currency 34 if txtcash.text = “ then exit sub curcash = txtcash.text txtchange.text = curcash - txtsum end sub private sub fillgrid(byval strproductname as string, byval curunitprice as currency) with msgsale .rows = .rows + 1 .textmatrix(intbuy, 1) = intbuy .textmatrix(intbuy, 2) = txtproductid.text .textmatrix(intbuy, 3) = strproductname .textmatrix(intbuy, 4) = curunitprice .textmatrix(intbuy, 5) = txtproductqty.text end with end sub private sub cmdexit_click() unload me end sub private sub cmdquery_click() dim strcmand as string on error goto errhandler 姓名为空查询全部员工的销售情况 if trim(cbousername.text) = “ then if chktime.value = vbchecked then if datediff(“d“, dtpstartdate.value, dtpenddate.value) = “ & dtpstartdate.value & _ “ and sales.saledate= “ & dtpenddate.value & “ end if else strcmand = “select users.username, products.productname,“ & _ “products.unitprice , sales.salequantiy, sales.saledate “ & _ “from products inner join sales on products.productid = sales.productid “ & _ “inner join users on sales.userid = users.userid “ end if else 姓名不为空查询查询当前员工的销售情况 if chktime.value = vbchecked then if datediff(“d“, dtpstartdate.value, dtpenddate.value) = “ & dtpstartdate.value & _ “ and sales.saledate= “ & dtpenddate.value & _ “ and users.username = “ & cbousername.text & “ end if else strcmand = “select users.username, products.productname,“ & _ “products.unitprice , sales.salequantiy, sales.saledate “ & _ “from products inner join sales on products.productid = sales.productid “ & _ “inner join users on sales.userid = users.userid “ & _ “where users.username = “ & cbousername.text & “ end if end if adodc2.commandtype = 1 adodc2.recordsource = strcmand adodc2.refresh exit sub errhandler: msgbox “错误号:“ & err.number & “ 错误信息:“ & err.description end sub private sub datagrid2_click() end sub private sub form_load() dim sql as string dim rs as adodb.recordset 设置窗体位置 changeformpos frmmain, frmsalesquery sql = “select username from users“ set rs = exesql(sql) if rs.eof = true then msgbox “当前数据库中没有信息!“, vbexclamation else rs.movefirst do until rs.eof strusername = rs!username cbousername.additem strusername rs.movenext loop rs.close end if dtpstartdate.value = now dtpenddate.value =

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论