ShoppingCart
2008-06-12 16:17
183 查看
1:Cookie
using System;
using System.Web;
namespace Gtide.ShoppingMall.Common
2:HashTable
using System;
using System.Collections;
[Serializable]
public class ShoppingCart
//实现表示商品的业务实体类
[Serializable]
public class CartItem
{
private int _ID;
private string _Name;
private decimal _Price;
private int _Quantity = 1;
// 创建属性ID
public int ID
{
get { return _ID; }
}
// 创建属性Name
public string Name
{
get { return _Name; }
}
// 创建属性Price
public decimal Price
{
get { return _Price; }
}
// 创建属性Quantity
public int Quantity
{
get { return _Quantity; }
set { _Quantity = value; }
}
// 创建类构造函数
public CartItem(int ID, string Name, decimal Price)
{
_ID = ID;
_Name = Name;
_Price = Price;
}
}
Session结合Hashtable也可以实现购物车。
using System;
using System.Web;
namespace Gtide.ShoppingMall.Common
2:HashTable
using System;
using System.Collections;
[Serializable]
public class ShoppingCart
//实现表示商品的业务实体类
[Serializable]
public class CartItem
{
private int _ID;
private string _Name;
private decimal _Price;
private int _Quantity = 1;
// 创建属性ID
public int ID
{
get { return _ID; }
}
// 创建属性Name
public string Name
{
get { return _Name; }
}
// 创建属性Price
public decimal Price
{
get { return _Price; }
}
// 创建属性Quantity
public int Quantity
{
get { return _Quantity; }
set { _Quantity = value; }
}
// 创建类构造函数
public CartItem(int ID, string Name, decimal Price)
{
_ID = ID;
_Name = Name;
_Price = Price;
}
}
Session结合Hashtable也可以实现购物车。
相关文章推荐
- shopping_cart
- MVC Music Store 在线音乐商店示例分析(10)ShoppingCartController
- Magento——利用购物车促销规则(Shopping Cart Price Rules)实现自己的功能第一章: 添加新的动作(Actions)
- 10 best Ecommerce dominant shopping cart applications
- MyShoppingCart.cs代码
- SHOPPING MALL OPENCART 自适应主题模板 ABC-0157
- SHOPPING MALL OPENCART 自适应主题模板 ABC-0157
- 购物车(Shopping cart) —— B2C网站核心产品设计 (二)
- ASP.NET 2.0个性化配置(profile实现shoppingcart) 转..
- MVC Music Store 在线音乐商店示例分析(13)View(Account、Checkout、Home、Shared、ShoppingCart)
- magento -- 推荐插件 --Ajax更新购物车数量 --Ajax Shopping Cart Quantity Update
- SHOPPING MALL OPENCART 自适应主题模板 ABC-0157
- SHOPPING MALL OPENCART 自适应主题模板 ABC-0157
- 购物车shopping-cart问题
- ShoppingCart2
- How to Pick a Shopping Cart(如何为网站选择一个网络购物车)
- web层的控件之四-----ShoppingCartControl
- WordPress Simple Paypal Shopping Cart插件跨站请求伪造漏洞
- shoppingCart.js
- magento Shopping Cart Price Rule 购物车促销规则