




已阅读5页,还剩12页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
网上商城设计详细说明书姓名: lclboss班级:微机1024 学号:1000005442网上商城设计详细说明书11.引言31.1编写目的31.2 前期工作31.3编写背景32.技术概述42.1 目标42.2 硬件支持42.3 软件支持43.功能需求43.1 功能块划分44.具体设计54.1首页设计54.2商品详细信息页面设计84.3 实现商品搜索功能104.4商城后台管理登录设计114.5商城后台商城管理页面设计114.6 建立删除商品信息页面155.总结161.引言1.1编写目的通过学习ASP.NET,以及结合教师给的源代码,进一步修改,从而实现网上商城系统1.2 前期工作在编写该需求前,首先是对各大网上销售网站进行了调查,其中包括:网页排版、顾客消费流程、以及管理员的操作,这三大块进行了调查。并总结出了有自己特色的设计思路。1.3编写背景随着Internet国际互联网的发展,越来越多的企业开始建造自己的网站。基于Internet的信息服务,商务服务已经成为现代企业一项不可缺少的内容。很多企业都已不满足于建立一个简单的仅仅能够发布信息的静态网站。现代企业需要的是一个功能强大的,能提供完善的电子商务服务的动态商务网站。本网上商城系统就是根据电子商务和互联网的发展,针对网上顾客所开发的网络购物系统,本商城系统主要有:1)用户浏览、注册、登录与购买商品;2)商品的入库资料登记;3)商城访问者的在线留言、查看留言,管理员的在线管理留言等;4)商城最新的新闻显示,历史新闻的分页显示,新闻详细情况的显示,后台管理员添加、删除、修改新闻等。本数据采用access作为数据库,亦可以使用SQL作为数据库,项目的重点是商品的添加、删除、显示与修改,需要克服的难点是商品图片的上传和删除。2.技术概述2.1 目标我们使用C#以及数据库技术构建网站,争取将本网站做成一个界面友好、用户购物方便、管理员管理方便的购物系统。2.2 硬件支持Cpu: 弄个四核最好 比如老一代core Q84002.3 软件支持 操作系统:Windows xp/vista/seven均可,C#开发环境。3.功能需求3.1 功能块划分1)用户浏览、注册、登录与购买商品;2)商品的入库资料登记;3)商城访问者的在线留言、查看留言,管理员的在线管理留言等;4)商城最新的新闻显示,历史新闻的分页显示,新闻详细情况的显示,后台管理员添加、删除、修改新闻等。网上购物系统在线购物添加留言显示留言管理留言购物车管理商品管理分类展示生成订单商城留言4.具体设计4.1首页设计新建web窗体default.aspx,其代码为: .style23 width: 116px; height: 94px; .style24 width: 600px; height: 132px; .style25 width: 104px; .style26 width: 598px; .style27 width: 106px; 热点促销 更多>>> a href=newsshow.aspx?id= target=_blank 最新产品 a href=show.aspx?id= altimg src=images/ class=style23 style=border-style: none / asp:Label ID=titleLabel runat=server Text= / asp:Label ID=priceLabel runat=server Text= / 接着,切换到程序文件.cs编辑栏里,写入代码:using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) string strSQL = select top 7 * from news order by id desc; Repeater1.DataSource =DbManager.ExecuteQuery(strSQL); Repeater1.DataBind(); 4.2商品详细信息页面设计新建show.aspx,配置好各项值以后,载入代码: .style3 width: 100%; .style4 text-align: center; width: 253px; 售价: 购买数量:1 接着建立.cs程序文件,编辑写入以下代码:using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data;public partial class show : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) string sql = select * from product where bh= + Request.QueryStringid; DataTable dt= DbManager.ExecuteQuery(sql); Image1.ImageUrl =images/+dt.Rows0pic.ToString(); txtTitle.Text = dt.Rows0productName.ToString(); txtContents.Text = dt.Rows0contents.ToString(); txtPrice.Text = dt.Rows0price.ToString(); protected void ImageButton1_Click(object sender, ImageClickEventArgs e) Response.Redirect(buy.aspx?id= + Request.QueryStringid + &num= + Convert.ToInt32(num.Text); 4.3 实现商品搜索功能新建search.aspx,配置相关参数,载入以下代码: 查询结果 a href=show.aspx?id= target=_blank 然后编辑.cs文件using System;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class search : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) string strSQL = select * from product where productName like % + Server.UrlDecode(Request.QueryStringtxtSearchName) + %; DataTable dt = DbManager.ExecuteQuery(strSQL); Repeater1.DataSource = dt; Repeater1.DataBind(); 4.4商城后台管理登录设计新建一个login.aspx,添加所需要的元件,在.cs程序文件中编写ImageButton的事件代码:using System;public partial class login : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) Sessionpass = 0; protected void Button1_Click(object sender, EventArgs e) if (TextBox3.Text != Request.CookiesCheckCode.Value.ToString() Response.Write(alert(验证码错误!); else string strSQL = select * from users where userName= + TextBox1.Text + and pwd= + TextBox2.Text + ; if (DbManager.ExecuteQuery(strSQL).Rows.Count 0) Sessionpass = 1; Response.Redirect(manageProduct.aspx); else Response.Write(alert(用户名或密码错误!); 4.5商城后台商城管理页面设计新建.aspx文件,添加好所需控件元件以后,载入源代码: a href=showpro.aspx?id= img src=images/ class=style23 style=border-style: none height=80 width=111 / asp:Label ID=titleLabel runat=server Text= / 单价:asp:Label ID=priceLabel runat=server Text= / 元 a href=updatepro.aspx?id= target=_blank修改 a href=delpro.aspx?id= target=_blank删除 首页 上一页 下一页 末页 第 页 然后编辑.cs程序文件,其代码为:using System;public partial class fenyepro : System.Web.UI.UserControl protected void Page_Load(object sender, EventArgs e) int iPageSize = 9; /每页几条 string strTableName = product; /要显示的数据表 string strKey = bh; /说明数据表的关键字段 string strOrder = desc; /按关键字段升序asc,降序desc排列 string strFields = *; /要显示的字段,用*表示或用英文逗号分隔开如产品名称,单价,单位数量 int iCurPage; int iMaxPage = 1; string sql = ; string sqlstr = select count(*) from + strTableName; if (Request.QueryStringpage != ) iCurPage = Convert.ToInt32(Request.QueryStringpage); else iCurPage = 1; int intTotalRec = Convert.ToInt32(DbManager.ExecuteScalar(sqlstr);/求总记录数 if (intTotalRec % iPageSize = 0) iMaxPage = intTotalRec / iPageSize;/求总页数 else iMaxPage = intTotalRec / iPageSize + 1; if (iMaxPage = 0) iMaxPage = 1; if (iCurPage iMaxPage) iCurPage = iMaxPage; if (intTotalRec != 0) if (iCurPage = 1) sql = select top + iPageSize + + strFields + from + strTableName + order by + strKey + + strOrder; else sql = select top + iPageSize + + strFields + from + strTableName + where + strKey + not in(select top + (iCurPage - 1) * iPageSize + + strKey + from + strTableName + order by + strKey + + strOrder + ) order by + strKey + + strOrder; DataList1.DataSource = DbManager.ExecuteQuery(sql);/显示控件名称要根据实际使用控件名修改 DataList1.DataBind(); lblTotal.Text = 共有 + intTotalRec.ToString() + 条记录 当前是第 + iCurPage.ToString() + / + iMaxPage.ToString() + 页 ; if (iCurPage != 1) hlFirst.NavigateUrl = Request.FilePath + ?page=1; hlPre.NavigateUrl = Request.FilePath + ?page= + (iCurPage - 1); if (iCurPage != iMaxPage) hlNext.NavigateUrl = Request.FilePath + ?page= + (iCurPage + 1); hlLast.NavigateUrl = Request.FilePath + ?page= + iMaxPage; if (intTotalRec = iPageSize) Panel1.Visible = false; else Panel1.Visible = true; protected void Button1_Click(object sender, EventArgs e) int iCurPage = 1; if (txtGoPage.Text != ) iCurPage = Convert.ToInt32(txtGoPage.Text); Response.Redirect(Request.FilePath + ?page= + iCurPage); 然后建立商品显示窗体页,新建manageProduct.aspx,拖fenyePro.aspx到其中,添加一个“增加新商品”link,链接指向insertPro.aspx。接着,为manageProduct.aspx.cs添加程序代码:using System;using System.Collections.Generic;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;public partial class manageProduct : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e) if (Convert.ToInt32(Sessionpass) != 1) Response.Write(alert(用户名或密码不对,请重新登录); Response.Write(location.assign(login.aspx); Response.End(); protected void Button1_Click(object sender, EventArgs e) Session.Clear(); Response.Redirect(default.aspx);4.6 建立删除商品信息页面在manageProduct.aspx中建立一个删除链接。指向delpro.aspx,并为程序文件添加代码:using System;using System.Data;u
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 金融岗专业面试题及答案
- 服务熔断降级策略-洞察及研究
- 新任教师成长汇报
- 脊髓占位切除术教学课件
- 村团支部工作总结
- 极低出生体重护理查房
- 消防安全月线上培训课件
- 2025至2030中国质量空气流量传感器(MAF)行业产业运行态势及投资规划深度研究报告
- 识谱教学法课件
- 护士岗前培训小结
- 2025年广西梧州市辅警招聘考试题题库(含参考答案)
- 2025年公文写作基础知识竞赛试题库及答案
- 面部桃花灸培训专业知识课件
- (2025)汽车驾驶员(技师)考试题库及答案
- 应急预案试题及答案
- 人工智能在威胁情报中的应用-洞察及研究
- 2025年教科版(2024)小学科学二年级上册(全册)教学设计(附目录)
- 阳光体育大课间知识培训课件
- 2025年玉树州公安局面向社会公开招聘警务辅助人员(第二批)考试参考试题及答案解析
- 建筑工程临电监理细则
- 四川省绵阳市涪城区绵阳南山中学2025-2026学年高三上学期开学英语试题(含答案无听力音频有听力原文)
评论
0/150
提交评论