超市管理系统毕业论文_第1页
超市管理系统毕业论文_第2页
超市管理系统毕业论文_第3页
超市管理系统毕业论文_第4页
超市管理系统毕业论文_第5页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

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

文档简介

1、安徽国防科技学院毕业论文论文题目:超市管理系统学生姓名: 方友娣 学 号: 3212151023 专 业: 软件技术 班 级: 软 件 121 指导教师: 朱小娟 2015年2月25日摘 要 随着计算机网络的普及,网络已经逐渐成为人们生活中的一部分。本次毕业设计基于asp.net和c#超市管理系统,是在windows 下,以sql server 2005为数据库开发平台,采用asp.net技术和sql server数据库原理以及c#语言开发的。在本论文中详细地论述了超市管理系统的设计方案及实现,介绍了相关的基本技术,包括asp.net,sql server 2005的一些简介。讲述了系统的需求

2、分析与设计目标,还有系统的总体设计,包括系统业务流程,系统功能模块和数据库的设计,以及系统的具体实现,包括前台和后台两个大的部分,前台部分由职员使用,主要是用来与客户进行交易和查询商品信息;后台部分由管理员使用,主要包括商品管理,职员管理,销售管理管理和用户管理等功能。关键词:数据库,超市管理,asp.netabstract with the popularity of computer network, the network has gradually become a part of people's life.the graduation design based on asp

3、.net and c # supermarket management system, is under the windows, based on sql server 2005 database development platform, using asp.net technology and sql server database principle as well as the c # language development.in this paper in detail discusses the design and realization of the supermarket

4、 management system, this paper introduces the related basic technology, including asp.net, some brief introduction of sql server 2005.tells the story of the demand of the system analysis and design target, and the overall design of the system, including the system business processes, system function

5、 module and database design, and system implementation, including the front desk and backstage two parts, front part used by staff, mainly used to deal with the customers and commodity information query;background part by the administrator use, mainly including commodity management, staff management

6、, sales management and user management, and other functions.keywords: the database ,the supermarket management ,asp.net目 录 第1章 绪论21.关键技术介绍21.1asp.net21.2 sql server2 2.开发背景以及课题意义3第2章 系统分析32.系统功能需求分析32.1 前台需求分析42.2 管理员需求分析42.3 数据流程分析5第3章 系统设计53总体结构设计63.1 系统框架63.2 模块功能设计83.3数据库、数据表设计83.4 创建数据表103.5 数据

7、库关系图10第4章 系统实现104.1 母版页114.2 管理员登陆界面164.3 前台界面204.4 后台界面235 测试35总结36参考文献37第1章 绪论如今随着社会的发展,工作的效率是越来越高,那么是什么方便了我们得工作使得效率明显提高呢?这则需要我们用相关的手段来实现。譬如编写一套系统来方便超市里的流水服务,增加付款方式,一方面方便用户,另一方面提高工作效率获取更大的收益,这是现如今超市运行的最佳选择。 1.关键技术介绍1.1asp.netasp.net 具有如下的性能特点:1、由于asp页面每次打开都必须经过先编译后解释的过程,所以页面在反复打开时速度没有任何提升,而asp.net

8、 页面只需要一次编译后不需要重新编译,这使得在多次访问时速度有了极大的提升。2、由于asp没有提供任何输出数据为内容的元件,所以在使用a s p撰写数据库页面时只能借助a d o 的recordset 对象逐笔读取记录,而asp.net 通过ado.net 提供的datagrid 等数据库元件可以直接和数据库联系。3、asp. net 支持应用程序的实时更新。管理员不必关掉网络服务器或者甚至不用停止应用程序的运行就可以更新应用文件。4、asp.net 采取“code-behind”方式编写代码使得代码更易于编写,结构更清晰,降低了系统的开发与维护的复杂度和费用。1.2 sql server s

9、ql server是一个关系数据库管理系统,它最初是由microsoft sybase和ashton-tate三家公司共同开发的,于1988年推出了第一个os/2版本,在windows nt推出后microsoft与sybase在sql server的开发上就分道扬镳了。microsoft将sql server移植到windows nt系统上,专注于开发推广sql server的windows nt版本,sybase则较专注于sql server在unix操作系统上的应用。在本书中介绍的是 sql server2005。sql server 2005是microsoft公司推出的sql ser

10、ver数据库管理系统的较新版本。2.开发背景以及课题意义本课题是在大学期间学习数据库相关知识的基础上,了解visual studio 2008开发环境并能通过自己的学习使用c#编程语言的同时,运用软件工程理论知识,开发出的一套基于asp.net的超市管理系统。在系统开发的过程中能够应用所学的知识以及通过自己的学习去了解其他相关知识,一方面提高自己的自学的能力,另一方面并促进作者更有信息=心的学习c#的相关特性、积累更多sql server 2005的相关应用知识,这样不仅能将所学的书面知识和实际应用结合起来达到学以致用的目的,同时也为以后的工作和学习积累经验。第2章 系统分析2.系统功能需求分

11、析 根据超市管理系统的逻辑过程,本系统的主要功能需求分为收银台和系统管理两大模块。其中收银台模块的功能由销售员使用,可以根据商品代码查询相关商品信息可以进行各类商品信息的浏览,系统管理功能由管理员使用,可以实现注册职员管理、商品信息管理、销售管理、用户管理。2.1 前台需求分析前台售货员可以直接查询商品,了解相应商品的价格及相关信息,并可根据商品的价格与客户进行交易 ,将交易过的商品打印订单写入数据库。2.2 管理员需求分析系统管理模块的功能由管理员使用,可以进行用户管理、商品管理、职员管理、销售管理,系统管理模块的功能需求如下:1. 用户管理:只有管理员才能对后台进行管理。 2. 商品管理:

12、管理商品信息,这些信息包括商品简介、价格、数量等。然后还能添加新产品以及类别。 3. 职员管理:能够添加新的职员,而且还能够对职员的相关信息进行修改。 4. 销售管理:查看相关产品的销售情况。 5. 管理员信息管理:可实现对系统管理员的基本信息进行管理。如添加管理员。一个管理员可维护所有会员的信息。6.管理员登录:只有通过登录才能进入系统管理主页面,进而使用系统管理模块的所有功能。7.注销退出:当管理员点击“注销”后实现安全退出。2.3 数据流程分析数据流图是描绘系统逻辑模型的图像工具,它描述了系统的组成部分及各部分的联系,以及信息流和数据转换。 对于系统销售模块来说,主要的数据由售货员输入,

13、主要包括商品信的输入 。对于系统管理模块来说,主要的数据由卖管理员输入,主要包括商品信息、职员以及用户信息的输入,输出的则是系统销售模块所看到的所有信息。总体数据流程如图1所示。 图1:总体数据流程第3章 系统设计3总体结构设计系统结构和功能是系统设计的核心部分,通过系统结构图可以清楚的看出整个系统的结构。针对每个结构模块分别做分析,为以后的设计和实现打下基础。根据功能需求,本系统总体上分销售模块和系统管理模块,销售模块功能供购买者使用,系统管理模块功能供商家管理员使用。系统总体结构如下图所示。3.1 系统框架 3.2 模块功能设计本系统分前台销售模块和系统后台管理模块,每个模块又有若干个子模

14、块构成,其中前台销售模块较为简单主要包括:商品销售、商品信息查询。系统管理模块主要包括:用户管理、商品管理、职员管理、销售管理 注销登录等子模块。具体的模块功能设计如下。3.2.1 前台销售模块系统销售模块主要让商品售货员使用,可以方便与顾客进行交易,提高工作效益,前台销售模块的结构如图2所示。 图2:前台销售模块的结构 3.2.2 系统管理模块系统后台管理模块的功能由发布商品的商家使用,即管理员使用,可以进行注册会员、商品管理、职员管理、销售管理,系统管理模块的结构如图3所示。图3 系统管理模块功能结构图系统后台管理模块商品管理销售管理职员管理用户管理添加商品编辑商品信息查询订单执行订单添加

15、管理员删除管理员查看销售表删除销售信息注销登录删除商品信息系统登录系统后台管理模块具体功能设计如下:1、商品管理功能:具体包括对商品信息进行添加、编辑、删除等操作。对于已录入数据库的商品信息,可进行编辑和删除等操作。2、用户管理功能:具体包括对已注册用户信息进行编辑、删除等操作,同时可手动添加用户信息。3、注销登录功能:保障管理员的信息安全。 3.3数据库、数据表设计 超市智能管理系统对后台管理的较多,由于比较复杂,我初期设计了五个表,以满足系统的基本需求,在后期的系统实现过程中,根据需要添加或修改相应表。五个表分别是 类别表,商品单表,销售清单表,用户表,职工表。3.3.1 创建数据库cre

16、ate database databaseon primary( name=database, filename='f:asp超市管理系统超市管理系统app_datadatabase.mdf', size=10mb, maxsize=50mb, filegrowth=1mb )3.4 创建数据表1.创建职工表:create table 职工表 (编号 char(10) primary key,姓名 char(10) not null,性别 char(10) not null,职位 char(20) not null, 工资 int(10)not null,电话 varchar(

17、12) not null,身份证 varchar(15) not null,聘用日期 datetime not null,)2.创建用户表:create table 用户表(用户名 nvarchar(20),密码 nvarchar(20) not null,身份证 varchar(18) not null,职位 nchar(2) not null,管理员标志 bit not null,)3.创建商品清单表:create table 商品清单( 商品代码 char(10) not null, 销售日期 datetime not null,)4.创建商品单表:create table 商品单表(

18、商品代码 char(10) not null, 供货商 nvarchar(20) not null, 名称 nvarchar(50) not null, 计量单位 narchar(50) not null, 类别 nvarchar(8) not null, 单位 char(8) not null, 单价 money(10) not null, 数量 nchar(10) not null,)5.创建类别表:create table 类别( 类别 char(10) not null,)3.5 数据库关系图图4 数据库关系图第4章 系统实现总体设计阶段完成了软件的结构设计,划分了模块,并规定了各个模

19、块的功能及他们之间的联系。在此之后,按软件开发工程化的观点,应进入系统的详细设计阶段,即系统实现。该阶段的根本目标是确定应该怎样实现所要求的系统,给出软件模块结构中各个模块的内部过程描述。本章将分模块对系统的实现给予介绍。4.1 母版页4.1.1 主要代码<% master language="c#" autoeventwireup="true" codebehind="site1.master.cs" inherits="超市管理系统.site1" %><!doctype html public

20、 "-/w3c/dtd xhtml 1.0 transitional/en" "/tr/xhtml1/dtd/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml" ><head runat="server"> <title>无标题页</title> <asp:contentplaceholder id="head" runat

21、="server"> </asp:contentplaceholder> <style type="text/css"> body margin:auto; .style5 width: 100%; height: 125px; .style6 width: 184px; .style7 #form1 height: 670px; .style8 height: 42px; .style12width: 929px; .style13 width: 283px; </style></head><

22、body> <form id="form1" runat="server" style="background-image: url('image/ground.jpg')"> <div style="height: 121px; background-image: url('image/daohantiao.jpg');"> <table class="style5"> <tr> <td style=&

23、quot;" colspan="3">&nbsp;</td></tr> <tr><td style="" colspan="3">&nbsp;</td></tr> <tr> <td style="" colspan="3">&nbsp;</td></tr> <tr> <td class="style12&quo

24、t;> <script language=javascript><!-calendar = new date();day = calendar.getday();month = calendar.getmonth();date = calendar.getdate();year = calendar.getyear();if (year< 100) year = 1900 + year;cent = parseint(year/100);g = year % 19;k = parseint(cent - 17)/25);i = (cent - parseint(c

25、ent/4) - parseint(cent - k)/3) + 19*g + 15) % 30;i = i - parseint(i/28)*(1 - parseint(i/28)*parseint(29/(i+1)*parseint(21-g)/11);j = (year + parseint(year/4) + i + 2 - cent + parseint(cent/4) % 7;l = i - j;emonth = 3 + parseint(l + 40)/44);edate = l + 28 - 31*parseint(emonth/4);emonth-;var dayname =

26、 new array ("星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六");var monthname =new array ("1月","2月","3月","4月","5月","6月","7月","8月","9月","10

27、月","11月","12月" )document.write("<font color=white>"+2015 +"年");document.write(monthnamemonth);document.write(date + "日");document.write(daynameday+" "+"</font>");/-></script> </td> <td class=&quo

28、t;style13" style="color: #ffcc99" align="right"> 欢迎您:<asp:label id="label1" runat="server" text="label"></asp:label></td><td style="color: #ffcc99" align="center"><a href="exit.aspx" st

29、yle="color: #ffcc99"> 注销</a></td></tr> </table> </div> <div style="width: 180px; height: 404px;"> <table class="style6" > <tr> <td class="style8"> </td> </tr> <tr><td class="sty

30、le7"> <asp:menu id="menu1" runat="server" font-bold="true" font-size="x-large" forecolor="#ffcc99"> <dynamicmenustyle backcolor="#0099ff" /> <items> <asp:menuitem imageurl="/image/b.jpg" text="用户管

31、理" value="用户管理" navigateurl="/用户管理.aspx"></asp:menuitem> </items> </asp:menu> </td> </tr> <tr> <td class="style7"> &nbsp;</td> </tr> <tr> <td class="style7"> &nbsp;</td> &l

32、t;/tr> <tr> <td class="style7"> <asp:menu id="menu2" runat="server" font-bold="true" font-size="x-large" forecolor="#ffcc99"> <dynamicmenustyle backcolor="#0099ff" /> <items> <asp:menuitem image

33、url="/image/b.jpg" text="商品管理" value="商品管理"> <asp:menuitem imageurl="/image/b.jpg" text="商品查询" value="商品查询" navigateurl="/商品查询.aspx"></asp:menuitem> <asp:menuitem imageurl="/image/b.jpg" text="商品添加

34、" value="商品添加" navigateurl="/商品添加1.aspx"></asp:menuitem> <asp:menuitem imageurl="/image/b.jpg" text="商品修改" value="商品修改"></asp:menuitem> <asp:menuitem imageurl="/image/b.jpg" text="类别添加" value="类别添

35、加" navigateurl="/类别添加.aspx"></asp:menuitem> </asp:menuitem> </items> </asp:menu> </td> </tr> <tr> <td class="style7"> &nbsp;</td> </tr> <tr> <td class="style7"> &nbsp;</td> <

36、;/tr> <tr> <td class="style7"> <asp:menu id="menu3" runat="server" font-bold="true" font-size="x-large" forecolor="#ffcc99"> <dynamicmenustyle backcolor="#0099ff" /> <items> <asp:menuitem imageu

37、rl="/image/b.jpg" text="职员管理" value="职员管理"> <asp:menuitem imageurl="/image/b.jpg" text="职员添加" value="职员添加" navigateurl="/职员添加.aspx"></asp:menuitem> <asp:menuitem imageurl="/image/b.jpg" text="职员修改&

38、quot; value="职员修改" navigateurl="/职员.aspx"></asp:menuitem> </asp:menuitem> </items> </asp:menu> </td> </tr> <tr> <td class="style7"> &nbsp;</td> </tr> <tr> <td class="style7"> &n

39、bsp;</td> </tr> <tr> <td class="style7"> <asp:menu id="menu4" runat="server" bordercolor="#ffffcc" font-bold="true" font-size="x-large" forecolor="#ffcc99"> <dynamicmenustyle backcolor="#0099f

40、f" /> <items> <asp:menuitem imageurl="/image/b.jpg" text="销售管理" value="销售管理"></asp:menuitem> </items> </asp:menu> </td> </tr> <tr> <td class="style7"> &nbsp;</td> </tr> </table>

41、; </div> <div style="width:190px; margin-left: 1123px; margin-top: -400px; height: 398px;"> </div> <div style="width: 934px; margin-left: 185px; margin-top: -400px; height: 524px;"> <asp:contentplaceholder id="contentplaceholder1" runat="

42、server"> </asp:contentplaceholder> </div> </form> </body></html>c#:using system;using system.collections;using system.configuration;using system.data;using system.data.sqlclient ;using system.linq;using system.web;using system.web.security;using system.web.ui;us

43、ing system.web.ui.htmlcontrols;using system.web.ui.webcontrols;using system.web.ui.webcontrols.webparts;using system.xml.linq;namespace 超市管理系统 public partial class site1 : system.web.ui.masterpage protected void page_load(object sender, eventargs e) if (session"name" != null) label1.text =

44、session"name".tostring(); 4.2.2 部分功能设置了1个table用来放置4个menu控件,from中用来显示系统的标识;一个footer盒子,用来显示系统制作这的信息。点击“注销”,进入前台,label显示管理员的用户名 。4.1.3 截图图5母版页4.2 管理员登陆界面4.2.1 主要代码 c#:using system;using system.collections;using system.configuration;using system.data;using system.data.sqlclient;using system.li

45、nq;using system.web;using system.web.security;using system.web.ui;using system.web.ui.htmlcontrols;using system.web.ui.webcontrols;using system.web.ui.webcontrols.webparts;using system.xml.linq;namespace 超市管理系统 public partial class _default : system.web.ui.page baseclass baseclass1 = new baseclass()

46、; protected void imagebutton1_click1(object sender, imageclickeventargs e) baseclass baseclass1 = new baseclass(); string strsql = "select * from 用户表 where 管理员标志=1 and 用户名 ='" + textbox1.text + "' and 密码 = '" + textbox2.text + "'" dataset ds = new datase

47、t(); ds = baseclass1.getdataset(strsql, "username"); if (ds.tables"username".rows.count = 0) /response.write("<script>alert("用户名不存在或密码错误,请确认后再登录!");</script>"); string scriptstring = "alert('" + "用户名不存在或密码错误,请确认后再登录!" + &quo

48、t;');" page.clientscript.registerclientscriptblock(this.gettype(), "warning", scriptstring, true); else session"name" = textbox1.text; /string scriptstring = "alert('" + "登录成功!" + "');" /page.clientscript.registerclientscriptblock(th

49、is.gettype(), "warning", scriptstring, true); response.write("<script>window.location='welcome.aspx'</script>"); public class baseclass : system.web.ui.page string strconn; public baseclass() strconn = configurationmanager.connectionstrings"connectionstri

50、ng".connectionstring; /读写数据表-datatable public datatable readtable(string strsql) datatable dt = new datatable();/创建一个数据表dt sqlconnection conn = new sqlconnection(strconn);/定义新的数据连接控件并初始化 conn.open();/打开连接 sqldataadapter cmd = new sqldataadapter(strsql, conn);/定义并初始化数据适配器 cmd.fill(dt);/将数据适配器中的数

51、据填充到数据集dt中 conn.close();/关闭连接 return dt; /读写数据集-dataset public dataset readdataset(string strsql) dataset ds = new dataset();/创建一个数据集ds sqlconnection conn = new sqlconnection(strconn);/定义新的数据连接控件并初始化 conn.open();/打开连接 sqldataadapter cmd = new sqldataadapter(strsql, conn);/定义并初始化数据适配器 cmd.fill(ds);/将

52、数据适配器中的数据填充到数据集ds中 conn.close();/关闭连接 return ds; public dataset getdataset(string strsql, string tablename) dataset ds = new dataset();/创建一个数据集ds sqlconnection conn = new sqlconnection(strconn);/定义新的数据连接控件并初始化 conn.open();/打开连接 sqldataadapter cmd = new sqldataadapter(strsql, conn);/定义并初始化数据适配器 cmd.f

53、ill(ds, tablename);/将数据适配器中的数据填充到数据集 ds中 conn.close();/关闭连接 return ds; public sqldatareader readrow(string sql) sqlconnection conn = new sqlconnection(strconn); conn.open(); sqlcommand comm = new sqlcommand(sql, conn); sqldatareader reader = comm.executereader(); if (reader.read() comm.dispose(); re

54、turn reader; else comm.dispose(); return null; /读某一行中某一字段的值 public string readstr(string strsql, int flag) dataset ds = new dataset();/创建一个数据集ds string str; sqlconnection conn = new sqlconnection(strconn);/定义新的数据连接控件并初始化 conn.open();/打开连接 sqldataadapter cmd = new sqldataadapter(strsql, conn);/定义并初始化数据适配器 cmd.fill(ds);/将数据适配器中的数据填充到数据集ds中 str = ds.tables0.rows0.itemarrayflag.tostring(); conn.close();/关闭连接 return str; public void execsql(string strsql) sqlconnection conn = new sqlconnection(strcon

温馨提示

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

评论

0/150

提交评论