资源简介
适合初学web开发的学着
各功能模块概述:
注册和登录模块:主要实现用户的注册、登录等功能。
浏览模块:主要实现用户浏览、并把商品加入购物车功能。
购物车模块:主要实现顾客对商品收藏及商品信息等功能。
充值付款模块:主要顾客的个人账户进行管理,用户可以进行缴费。
退出模块:主要实现顾客退出系统的友好界面管理。
代码片段和文件信息
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;
using System.Data.SqlClient;
public partial class BrowserGoods : System.Web.UI.Page
{
SqlConnection myConn = DBClass.GetConnection();
protected void Page_Load(object sender EventArgs e)
{
if (!IsPostBack)
{
//接受传送数据
Label7.Text = Request.QueryString[“id“];
DLBind();
}
}
public void DLBind()
{
//绑定商品展示台信息
myConn.Open();
string sqlStr = “select * from tb_GoodsInfo“;
SqlDataAdapter da = new SqlDataAdapter(sqlStr myConn);
DataSet ds = new DataSet();
da.Fill(ds “GoodsInfo“);
DataList1.DataSource = ds.Tables[“GoodsInfo“].DefaultView;
DataList1.DataBind();
da.Dispose();
ds.Dispose();
myConn.Close();
}
//当购买商品时,获取商品信息
public SaveSubGoodsClass GetSubGoodsInformation(DataListCommandEventArgs e)
{
//获取购物车中的信息
SaveSubGoodsClass Goods = new SaveSubGoodsClass();
Goods.GoodsID = int.Parse(DataList1.DataKeys[e.Item.ItemIndex].ToString());
Goods.OrderDate = DateTime.Now;
//获取商品价格
Label PriceLable = (Label)e.Item.FindControl(“Label8“);
if (PriceLable == null)
{
//显示错误信息
Response.Write(“ript>alert(‘没有可用的数据‘)ript>“);
return null;
}
Goods.GoodsPrice = decimal.Parse(PriceLable.Text.Trim());
string Goodsstyle = e.CommandArgument.ToString();
int index = Goodsstyle.IndexOf(“|“);
if (index < -1 || index + 1 >= Goodsstyle.Length)
return Goods;
Goods.GoodsName = Goodsstyle.Substring(0 index);
Goods.GoodsIntroduce = Goodsstyle.Substring(index + 1);
return (Goods);
}
//向购物车中添加商品信息
public void AddOrderInfo(int GoodsID int GoodsNum DateTime OrderDate string UserIP)
{
SqlCommand cmd = new SqlCommand(“InsertOrderInfo“ myConn);
cmd.CommandType = CommandType.StoredProcedure;
//添加参数
SqlParameter goodsID = new SqlParameter(“@GoodsID“ SqlDbType.Int 4);
goodsID.Value = GoodsID;
cmd.Parameters.Add(goodsID);
SqlParameter goodsNum = new SqlParameter(“@GoodsNum“ SqlDbType.Int 4);
goodsNum.Value = GoodsNum;
cmd.Parameters.Add(goodsNum);
SqlParameter orderDate = new SqlParameter(“@OrderDate“ SqlDbType.DateTime 8);
orderDate.Value = OrderDate;
cmd.Parameters.Add(orderDate);
SqlParameter userIP = new SqlParameter(“@UserIP“ SqlDbType.VarChar 50);
userIP.Value = UserIP;
cmd.Parameters.Add(userIP);
//执行存储过程
myConn.O
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 5560 2010-03-19 16:27 GouWuChe_51apx\aspxba.com.gif
文件 5271 2010-03-19 16:27 GouWuChe_51apx\BrowserGoods.aspx
文件 8134 2010-03-19 16:27 GouWuChe_51apx\BrowserGoods.aspx.cs
文件 2029 2010-03-19 16:27 GouWuChe_51apx\CheckOut.aspx
文件 820 2010-03-19 16:27 GouWuChe_51apx\CheckOut.aspx.cs
文件 4544 2010-03-19 16:27 GouWuChe_51apx\chongqian.aspx
文件 3882 2010-03-19 16:27 GouWuChe_51apx\chongqian.aspx.cs
文件 4700 2010-03-19 16:27 GouWuChe_51apx\CommitGoods.aspx
文件 7081 2010-03-19 16:27 GouWuChe_51apx\CommitGoods.aspx.cs
文件 6360 2010-03-19 16:27 GouWuChe_51apx\Default.aspx
文件 2997 2010-03-19 16:27 GouWuChe_51apx\Default.aspx.cs
文件 40818 2010-03-19 16:27 GouWuChe_51apx\Image\040824130917171.jpg
文件 19136 2010-03-19 16:28 GouWuChe_51apx\Image\图片\冰箱.jpg
文件 21740 2010-03-19 16:28 GouWuChe_51apx\Image\图片\圆珠笔.jpg
文件 21476 2010-03-19 16:28 GouWuChe_51apx\Image\图片\文具盒.jpg
文件 23454 2010-03-19 16:28 GouWuChe_51apx\Image\图片\毛巾.jpg
文件 24163 2010-03-19 16:28 GouWuChe_51apx\Image\图片\注册头像.jpg
文件 24778 2010-03-19 16:28 GouWuChe_51apx\Image\图片\牙刷.jpg
文件 23467 2010-03-19 16:28 GouWuChe_51apx\Image\图片\电视机.jpg
文件 22090 2010-03-19 16:28 GouWuChe_51apx\Image\图片\空调2.jpg
文件 23812 2010-03-19 16:28 GouWuChe_51apx\Image\图片\衣服.jpg
文件 21407 2010-03-19 16:28 GouWuChe_51apx\Image\图片\裤子.jpg
文件 21192 2010-03-19 16:28 GouWuChe_51apx\Image\图片\钢笔.jpg
文件 38354 2010-03-19 16:28 GouWuChe_51apx\Image\图片\链接图片1.jpg
文件 26290 2010-03-19 16:28 GouWuChe_51apx\Image\图片\链接图片2.jpg
文件 25198 2010-03-19 16:28 GouWuChe_51apx\Image\图片\鞋.jpg
文件 3981 2010-03-19 16:27 GouWuChe_51apx\qianbao.aspx
文件 2515 2010-03-19 16:27 GouWuChe_51apx\qianbao.aspx.cs
文件 1650 2010-03-19 16:27 GouWuChe_51apx\Web.config
文件 9624 2010-03-19 16:27 GouWuChe_51apx\yinhang.aspx
............此处省略10个文件信息
- 上一篇:北京浮生记
- 下一篇:Linux_期末考试试题8套(含答案)245892
评论
共有 条评论