【文件属性】:
文件名称:基于asp.net的购物车系统
文件大小:2.78MB
文件格式:RAR
更新时间:2013-06-13 15:09:15
购物车
经典的购物车系统:
关键词: Internet 网上书店开发 购书系统
开发一套网上购书系统,可以让顾客通过浏览器浏览网站售书目录,从而挑选自己满意的图书,并下订单购买。而网站后台人员需要维护网站会员信息、书籍信息以及订单信息。本系统的目的就是要开发一套既方便客户网上购书,又方便网站维护人员维护网站WEB服务系统。
用户信息显示:
protected void Button1_Click(object sender, EventArgs e)
{
Book book =new Book();
DetailsViewRowCollection rows=DetailsView1.Rows;
book.Bookname = rows[1].Cells[1].Text;
book.Bookid =(String)rows[0].Cells[1].Text;
book.Introduce = rows[8].Cells[1].Text;
CartItem item = new CartItem();
item.Book = book;
item.Quantity = Int32.Parse(TextBoxQuerty.Text);
Profile.ShoppingCart.AddItem(item);
Response.Redirect(@"~\products\CartInfor.aspx");
Labelnfor.Text ="Bookname"+ item.Book.Bookname+"
数量:"+item.Quantity;
}
订单生成:
protected void Page_Load(object sender, EventArgs e)
{
ShowInfor();
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Redirect(@"~\products\BookInforByCatalog.aspx");
}
private void ShowInfor()
{
ListBox1.Items.Clear();
CartItem[] items = Profile.ShoppingCart.GetAllItems();
for (int i = 0; i < items.Length; ++i)
{
CartItem item =items[i];
String str = String.Format("Bookname:{0} Quantity:{1}",item.Book.Bookname,item.Quantity);
ListBox1.Items.Add(str);
}
}
protected void Button3_Click(object sender, EventArgs e)
{
ListBox1.Items.Remove(ListBox1.Items[index]);
}
protected void Button4_Click(object sender, EventArgs e)
{
ListBox1.Items.Clear();
}
protected void Button2_Click(object sender, EventArgs e)
{
}
}
网友评论
- 还可以,学习借鉴一下
- 程序运行不了,提示报错:This application is currently offline. To enable the application, remove the app_offline.htm file from the application root directory.
- 还可以,学习借鉴一下
- 有的地方写的不错,有的地方还差一些,总体不错
- 功能不够完善。
- 还可以把。功能简单,分析比较方便
- 功能很完善 数据库的设计有待提高 值得学习
- 有些地方还是有错的。
- 功能不错 不过帮助不是太大
- 功能不完善 ,对我没有起到帮助!