您的位置:首页 > 运维架构

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也可以实现购物车。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: