




已阅读5页,还剩37页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
滨州学院数据库原理与应用课程设计 数据库原理与应用课 程 设 计题 目 ASP+MSSQL的手机销售管理系统系 (院) 计算机科学技术系 专 业 计算机网络技术 班 级 2006级网一 学生姓名 42数据库原理与应用课程设计一、课程设计概述(一)、课程设计的目的数据库原理及应用课程设计是计算机专业集中实践性环节之一,是学习完数据库原理及应用课程后进行的一次全面的综合练习。本课程设计主要在于加深学生对数据库基础理论和基本知识的理解,掌握数据库应用系统设计开发的基本方法,达到进一步使学生综合运用所学知识和增强实际动手能力的目的。(二)、课程设计的任务与要求要求学生根据自身的情况,构思一个系统,以MS SQL Server作为后台数据库平台,结合自己掌握的所有语言和平台,完成一个小型数据库应用系统的系统的分析、设计和开发。二、系统概述 (一)、系统需求分析现在随着网络、计算机以及数据库的快速发展,手机的销售也不再是传统的实体店铺模式,已经转向网络。本系统就是面向一个企业的手机销售管理系统。此系统是一种比较智能化的管理系统,它能够实现手机销售的基本功能商品管理和订单管理,用户管理和网站管理。可以很好的实现于用户之间的互动.管理员在后台必须输入有效密码才能成功进入此系统然后进行一系列的操作。对于非法操作,系统有识别和防护措施。(二)、系统功能需求分析本系统主要面向的用户为系统管理员。简单介绍下本系统的主要功能模块:、登陆功能:登陆系统为身份验证登录。、商品管理:添加 删除 修改 图片上传、订单管理:查看,删除,确认订单 查看,删除已确认订单 查看,删除订单投诉、用户管理:查看修改用户资料,删除用户,设置用户等级(普通,VIP) 管理员添加删除、分类管理:添加,修改,删除一级分类,二级分类、信息管理:添加,修改,删除网站新闻 三、系统总体设计(一)、系统总体结构设计报刊订阅管理系统主要是由登录、使用帮助、商品管理、订单管理、用户管理、分类管理、信息管理等主要模块构成。本系统的结构功能图:手机销售管理系统登陆使用帮助商品管理订单管理用户管理网站管理返回首页注销登陆查看服务器变量添加新厂商使用帮助添加新分类添加新手机查看新修改最新订单已确认订单查看投诉订单管理网站用户添加用户添加新闻修改新闻添加评测修改评测添加软件修改软件添加故事修改故事图3-1 系统结构功能图(二)、系统数据模型设计1. 系统E-R图本系统采用E-R图(实体-关系图)的方法进行数据库概念结构设计。系统主要部分的E-R图如下所示: 厂商:厂商名字厂 商I D图3-2 厂商ER图手机编号出品日期价格型号尺码颜色出品公司包装类型品牌手机:图3-3 手机ER图订单订 单订单号订货人地址日期送出图3-4 订单的ER图用户:用户用户名EMAIL邮政编码类型注册时间地址ID图3-5 用户ER图2. 关系模式厂商(id,名称)手机(品牌,型号,编号,出品日期,出品公司,颜色,尺码,包装类型,价格)订单(订单号,订货人,日期,地址,送出)用户(ID,用户名,EMAIL,邮政编码,地址,注册时间,类型)新闻(标题,内容)评测(标题,内容)软件(标题,内容)故事(标题,内容)3. 数据表下述为本系统关键表,其他非关键表不在叙述。、厂商表(表 sort)sort_namer为厂商名,如图3-6图3-6 厂商数据表、用户表(表member)user_name是用户名,Usrmail是EMAIl地址,User_pass是密码,User_adds是地址,user_tel是联系电话,User_regtime是注册时间, User_lasttime是最后登陆时间,User_lastip是最后登陆IP,User_buymoney是所有资金.如图3-7图3-7 用户数据表、手机表(表 hw)hw_name是货物名字,hw_cash是价格,hw_content是描述,hw_date是添加时间,hw_pic是手机图片,daili是代理价格,pifa是批发价格yeshu是颜色。如图3-8图3-8 手机数据表、订单表(表 sub)user_name 是订货人,sub_numbersub_date是订单时间,sub_emil是订人EMAiL,sub_tel是订货人电话,sub_adds是订货人地址,qian是支付方式;如图3-9图3-9 订单数据表4系统实施主要开发步骤:1 打开SQL SERVER 建立数据库和相关数据表2 创业CONN.ASP,实现对数据库的链接;代码:3. 制作后台登录验证界面index.asp,2login.asp对数据库操作部分的代码如下,它主要对应的是数据库中的admin表 0 or InStr(admin_pass,) 0 thenresponse.write 请不要使用非法字符else%set rs=server.createobject(adodb.recordset)sql=select * from admin where admin_name=&admin_name& and admin_pass=&admin_pass&rs.open sql,conn,3,3 if rs.eof then response.write 用户名和密码不匹配 else session(admin_name)=rs(admin_name) response.redirect manage.asp end ifrs.closeset rs=nothingconn.closeset conn=nothingend ifend if%图3-10 管理员登陆窗口4. 制作管理员主操作界面主界面采用了框架结合代码如下: 5. 制作主操作界面中的 使用帮助模块本模块包括四个文件1.Index.asp(返回管理员登陆验证界面)2.quit.asp(注销登录)3.aspchenk.asp(查看服务器变量)如图3-11图3-11 查看服务器变量4. main.asp(使用帮助)图3-12 使用帮助界面6. 制作主操作界面中的商品管理模块本模块有四部分组成:图3-13 商品管理界面、 addnewgrp.asp,addnewgrp1.asp(添加新厂商)本部分主要对应数据库中的sort表操作。 addnewgrp.asp代码 %if rs.eof and rs.bof then response.write 请增加类别else Do while not rs.eof response.write + rs(sort_name) + rs.MoveNext Loopend if% addnewgrp1.asp代码% dim cmdTemp select case request.form(options) case rename on error resume next Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM sort where sort_id= & request.form(subject) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 then err.clear response.write 数 据 库 操 作 失 败 ! else rs(sort_name) = request.form(reTitle) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if case delRem 删除栏目on error resume next sql=delete from sort where sort_id= & request.form(subject) conn.execute sql if err.Number0 then err.clear response.write 数 据 库 操 作 失 败 ! else finished end if case new on error resume next Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM sort where (sort_id IS NULL) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 then err.clear response.write 数 据 库 操 作 失 败 ! else rs.AddNew rs(sort_name) = request.form(newTitle) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if end selectsub finished() %图3-14 添加新厂商页面、addsort.asp,addsort2.asp(添加新分类)本部分主要对应数据可中的NSORT表操作。addsort2.asp代码如下:% dim cmdTemp select case request.form(options) case rename on error resume next Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM Nsort where Nsort_id= & request.form(subject) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 then err.clear response.write 数 据 库 操 作 失 败 ! else rs(Nsort_name) = trim(request.form(reTitle) rs(sort_id) = request.form(sort_id) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if case delRem 删除子栏目 on error resume next sql=delete from Nsort where Nsort_id= & request.form(subject) conn.execute sqlRem 删除相关子栏目程序 sql=delete from hw where Nsort_id= & request.form(subject) conn.execute sql if err.Number0 then err.clear response.write 数 据 库 操 作 失 败 ! else finished end if case new Set cmdTemp = Server.CreateObject(ADODB.Command) set rs=server.createobject(adodb.recordset) cmdTemp.CommandText = SELECT * FROM Nsort where (Nsort_id IS NULL) cmdTemp.CommandType = 1 Set cmdTemp.ActiveConnection = conn rs.Open cmdTemp, , 1, 3 if err.Number0 or request.form(psubject)= then err.clear response.write 数 据 库 操 作 失 败 ! else rs.AddNew rs(Nsort_name) = request.form(newTitle) rs(sort_id) = request.form(psubject) rs.Update rs.Close set rs=nothing set cmdTemp=nothing finished end if end select sub finished() %图3-15 添加新分类页面、ddnewtp.asp(添加新手机)本部分主要对数据库中的NSORT表进行操作%if request(action)=save then hw_name=request(hw_name) hw_content=htmlencode2(request(hw_content)hw_content2=htmlencode2(request(hw_content2) hw_cash=request(hw_cash) hw_pic=request(hw_pic)chubsh=request(chubsh)zhuang=request(zhuang)yeshu=request(yeshu)isbn=request(isbn) sort_id=request(sort_id) Nsort_id=request(Nsort_id) company=request(company) pifa=request(pifa)daili=request(daili)hwsn=request(hwsn)data=request(data)kaiben=request(kaiben)tuijian=request(tuijian)jia=request(jia) if not(isnumeric(hw_cash) then errmsg=+价格应该为数字 founderr=true end if if hw_name= then errmsg=errmsg+名称不能为空 founderr=true end if if hw_content= then errmsg=errmsg+介绍不能为空 founderr=true end if if sort_id= then errmsg=errmsg+类别不能为空 founderr=true end if if nsort_id= then errmsg=errmsg+类别不能为空 founderr=true end if if hw_pic= then hw_pic=image/noimage.gif if founderr=true then response.write errmsg response.write response.write 返回 response.end else hw_name=server.htmlencode(hw_name) hw_name=replace(hw_name, , ) hw_name=replace(hw_name,chr(13)&chr(10),) hw_content=server.htmlencode(hw_content) hw_content=replace(hw_content, , ) hw_content=replace(hw_content,chr(13)&chr(10),) hw_pic=server.htmlencode(hw_pic) sql=select * from hwset rs=server.createobject(adodb.recordset) rs.open sql,conn,3,3 rs.addnew rs(hw_name)=hw_name rs(hw_content)=hw_contentrs(hw_content2)=hw_content2 rs(hw_cash)=hw_cash rs(sort_id)=sort_id rs(Nsort_id)=Nsort_id rs(company)=company rs(daili)=daili rs(pifa)=pifa rs(hw_sn)=hwsn rs(chubsh)=chubsh rs(kaiben)=kaiben rs(yeshu)=yeshu rs(data)=data rs(isbn)=isbn rs(zhuang)=zhuang rs(hw_pic)=hw_pic rs(tuijian)=tuijian rs(jia)=jia rs.update end if response.write 货物添加成功 response.write response.write 返回 rs.close else%var onecount;onecount=0;subcat = new Array(); subcat = new Array(,); onecount=;function changelocation(locationid) document.myform.Nsort_id.length = 0; var locationid=locationid; var i; for (i=0;i onecount; i+) if (subcati1 = locationid) document.myform.Nsort_id.optionsdocument.myform.Nsort_id.length = new Option(subcati0, subcati2); option selected value= option value= option selected value= option value=图3-16 添加新手机页面、elhw.asp changehw.asp(查看与修改)%if request(action)=del then sql=select * from hw where hw_id=&request(hw_id)set rs=server.createobject(adodb.recordset) rs.open sql,conn,3,3 if rs.eof then response.redirect delhw.asp else rs.delete rs.update end if rs.close response.write 货物删除成功 response.write response.write 返回else% % page=request.querystring(page) if page= then page=1 if not(isnumeric(page) then page=1 if pagetotalpage then page=totalpage rs.absolutepage=page rs.absolutepage=page i=0 dim hw_id(),hw_name(),hw_cash(),hw_pic(),hw_date(),sort_id(),isbn(),hw_sn(),Nsort_ind() do while not rs.eof and (i修改部分代码如下:%if request(action)=save then hw_name=request(hw_name) hw_content=request(hw_content)hw_content2=request(hw_content2) hw_cash=request(hw_cash) hw_pic=request(hw_pic)chubsh=request(chubsh)zhuang=request(zhuang)yeshu=request(yeshu)isbn=request(isbn) sort_id=request(sort_id)Nsort_id=request(Nsort_id)tuijian=request(tuijian) company=request(company) pifa=request(pifa)daili=request(daili)hw_sn=request(hw_sn)data=request(data)kaiben=request(kaiben) if not(isnumeric(hw_cash) then errmsg=+价格应该为数字 founderr=true end if if hw_name= then errmsg=errmsg+名称不能为空 founderr=true end if if hw_content= then errmsg=errmsg+介绍不能为空 founderr=true end if if sort_id= then errmsg=errmsg+类别不能为空 founderr=true end if if hw_pic= then hw_pic=image/noimage.gif if founderr=true then response.write errmsg response.write response.write 返回 response.end else hw_name=server.htmlencode(hw_name) hw_name=replace(hw_name, , ) hw_name=replace(hw_name,chr(13)&chr(10),) hw_content=server.htmlencode(hw_content) hw_content=replace(hw_content, , ) hw_content=replace(hw_content,chr(13)&chr(10),) hw_pic=server.htmlencode(hw_pic) sql=select * from hw where hw_id=&request(hw_id) rs.open sql,conn,3,3 rs(hw_name)=hw_name rs(hw_content)=hw_contentrs(hw_content2)=hw_content2 rs(hw_cash)=hw_cash rs(sort_id)=sort_id rs(company)=company rs(daili)=daili rs(pifa)=pifa rs(hw_sn)=hw_sn rs(chubsh)=chubsh rs(kaiben)=kaiben rs(yeshu)=yeshu rs(data)=data rs(isbn)=isbn rs(zhuang)=zhuang rs(hw_pic)=hw_picrs(Nsort_id)=Nsort_idrs(tuijian)=tuijian rs.update end if response.write 商品修改成功! response.write response.write 返回 rs.close else% %dim rs,sqldim content,selsort_id=request(sort_id)Nsort_id=request(Nsort_id) set rs=server.createobject(adodb.recordset) sql=
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 防疫预案考试题库及答案
- 森林运动会课件科学序数
- 2025年影视剧组招聘演员面试模拟题目
- 《机械员》考试题库及完整答案【历真题】
- 2025年粮食购销企业招聘财务人员的笔试技巧与策略
- 2025年老年人健康管理培训考核试题及答案
- 2025年初种心理咨询师实操技能考核模拟题集解析
- 2025年村级红白理事会司仪招聘考试模拟试题及解析
- 2025年轨道交通信号工中级考试备考攻略模拟题及解析
- 2026届山东滕州市第一中学化学高一上期末联考模拟试题含解析
- 成都理工大学工程技术学院毕业实习报告
- 2022年新高考II卷高考语文试卷试题深度解读及答案详解(精校版)
- 第六章会谈中的阻力与干扰
- LY/T 2737-2016古树名木鉴定规范
- GB/T 4669-2008纺织品机织物单位长度质量和单位面积质量的测定
- GB/T 30790.4-2014色漆和清漆防护涂料体系对钢结构的防腐蚀保护第4部分:表面类型和表面处理
- 药物竹罐临床应用课件
- 2022年咸阳经开城市发展集团有限公司招聘笔试试题及答案解析
- 不等式的基本性质说课课件
- T∕CTSS 24-2021 烘青栗香绿茶加工技术规程
- 江苏省住宅工程质量分户验收规则完整版课件
评论
0/150
提交评论