using System; using System.Data; using System.Configuration; using System.Web; using System.Collections.Specialized; using System.Text; public class ShoppingCartItem { private int _CartItemID = 0; private int _ItemID = 0; private string _Name = ""; private decimal _Price = 0; private double _Weight = 0; private int _Inventory = -1; private string _SKU = ""; private int? _PhotoSetID = null; private int _Quantity = 0; private decimal _CustomizationCost = 0; private string _CustomizationText = ""; #region Accessors public int CartItemID { get { return _CartItemID; } set { _CartItemID = value; } } public int ItemID { get { return _ItemID; } set { _ItemID = value; } } public string Name { get { return _Name; } set { _Name = value; } } public decimal Price { get { return _Price; } set { _Price = value; } } public double Weight { get { return _Weight; } set { _Weight = value; } } public int Inventory { get { return _Inventory; } set { _Inventory = value; } } public string SKU { get { return _SKU; } set { _SKU = value; } } public int? PhotoSetID { get { return _PhotoSetID; } set { _PhotoSetID = value; } } public int Quantity { get { return _Quantity; } set { _Quantity = value; } } public decimal CustomizationCost { get { return _CustomizationCost; } set { _CustomizationCost = value; } } public string CustomizationText { get { return _CustomizationText; } set { _CustomizationText = value; } } #endregion public ShoppingCartItem() { } // methods public decimal CustomizedPrice { get { return _Price + CustomizationCost; } } public decimal ItemTotal { get { return CustomizedPrice * Quantity; } } // overrides public bool Equals(ShoppingCartItem right) { return (this.ItemID == right.ItemID); } }