net网上购物车课程设计.docx
- 文档编号:4267969
- 上传时间:2022-11-28
- 格式:DOCX
- 页数:25
- 大小:570.99KB
net网上购物车课程设计.docx
《net网上购物车课程设计.docx》由会员分享,可在线阅读,更多相关《net网上购物车课程设计.docx(25页珍藏版)》请在冰豆网上搜索。
net网上购物车课程设计
课程设计报告书
课程名称.NET框架程序设计
设计题目网上购物车
专业班级
学号
姓名
指导教师
1设计时间
2设计目的
此次的.net框架课程设计是对所学网页设计课程的一个阶段性的锻炼,是提高我们对所学知识综合应用能力的一种方式,是集中实践性环节之一。
要求我们对理论课中所学习到的知识综合运用,实现有一定规模的.net框架的开发和应用。
.net框架课程设计是计算机相关专业的必修专业基础课程,其实践性、应用性很强。
实践环节对我们来说是必不可少的一个重要环节。
我们可以通过本次课程设计更好的练习并掌握所学知识,在实际的应用中掌握所学知识,让我们能过更好的理解课堂所学知识,并将它融入到所能涉及到的日常生活中,从而更好地掌握它,更好的在以后的工作中熟练运用。
3设计任务
完成对网上购物车系统设计,并写出规范的设计文档。
本系统是一个网上食品商店的小型网站,几个核心问题包括:
主页面的设计;商品的分类显示;选购和调整购物车;集中结算;存储订单;查看订单。
将此些功能完好的结合在一起。
4设计内容
4.1用户控件和主控页的设计
4.1.1创建用户控件
用户控件源代码:
<%@ControlLanguage="C#"AutoEventWireup="true"CodeFile="WebUserControl.ascx.cs"Inherits="WebUserControl"%>
center"> 20cm;height: 3cm"> 7cm;height: 3cm"> ImageID="Image1"runat="server"ImageUrl="~/image/r1.jpg"/> 13cm;height: 1cm"> 13cm;height: 1cm"> LabelID="Label1"runat="server"Text="美食在线"> Label> HyperLinkID="HyperLink1"runat="server"NavigateUrl="~/主页.aspx">主页 HyperLink> HyperLinkID="HyperLink2"runat="server"NavigateUrl="~/购物车.aspx">购物车 HyperLink> HyperLinkID="HyperLink3"runat="server"NavigateUrl="~/结账.aspx">结账 HyperLink> HyperLinkID="HyperLink4"runat="server"NavigateUrl="~/订单.aspx">订单 HyperLink> ButtonID="Button1"runat="server"Text="查询"/>: TextBoxID="TextBox1"runat="server"Width="49px"> TextBox>
13cm;height: 1cm"> LabelID="Label2"runat="server"> Label>
用户控件后台文件:
usingSystem;
usingSystem.Data;
usingSystem.Configuration;
usingSystem.Collections;
usingSystem.Web;
usingSystem.Web.Security;
usingSystem.Web.UI;
usingSystem.Web.UI.WebControls;
usingSystem.Web.UI.WebControls.WebParts;
usingSystem.Web.UI.HtmlControls;
publicpartialclassWebUserControl:
System.Web.UI.UserControl
{
protectedvoidPage_Load(objectsender,EventArgse)
{
DateTimed=DateTime.Now;
Label2.Text=d.ToLongDateString()+d.ToLongTimeString();
}
}
4.1.2主控页的设计
主控页源代码:
<%@MasterLanguage="C#"AutoEventWireup="true"CodeFile="MasterPage.master.cs"Inherits="MasterPage"%>
<%@RegisterSrc="WebUserControl.ascx"TagName="WebUserControl"TagPrefix="uc1"%>
DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http:
//www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
//www.w3.org/1999/xhtml">
center"> 20cm;height: 15cm;background-image: url(image/h.jpg);"> 20cm;height: 3cm"> WebUserControlID="WebUserControl1"runat="server"/> 10cm;height: 10cm"> GridViewID="GridView1"runat="server"AutoGenerateColumns="False"DataKeyNames="CategoryID" DataSourceID="SqlDataSource1"> HyperLinkFieldDataNavigateUrlFields="CategoryID"DataNavigateUrlFormatString="商品.aspx? CategoryID={0}" HeaderText="选择"Text="商品"/> BoundFieldDataField="CategoryID"HeaderText="类型ID"InsertVisible="False"ReadOnly="True" SortExpression="CategoryID"/> BoundFieldDataField="CategoryName"HeaderText="类型名"SortExpression="CategoryName"/> GridView> SqlDataSourceID="SqlDataSource1"runat="server"ConnectionString="<%$ConnectionStrings: NorthwindConnectionString%>" SelectCommand="SELECT[CategoryName],[CategoryID]FROM[Categories]"> SqlDataSource> 10cm;height: 10cm"> contentplaceholderid="ContentPlaceHolder1"runat="server"> contentplaceholder>
20cm;height: 2cm">Copyright©2012网络食品在线