using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace Shopping { public class Cart { private int _IDproduct; private string _nameProduct; private int _Quantity; private string _ImageUrl; private double _Price; private double _Total; public Cart(){} public Cart(int IDProduct, string NameProduct, int Quantity, string ImageURL, double Price){ _IDproduct = IDProduct; _nameProduct = NameProduct; _Quantity = Quantity; _ImageUrl = ImageURL; ; _Price = Price; _Total = Price*Quantity; } public int IDProduct { get { return _IDproduct; } set { _IDproduct = value; } } public string NameProduct { get { return _nameProduct; } set { _nameProduct = value; } } public int Quantity { get { return _Quantity; } set { _Quantity = value; } } public string ImageURL { get { return _ImageUrl; } set { _ImageUrl = value; } } public double Price { get { return _Price; } set { _Price = value; } } public double Total { get { return _Price*_Quantity; } } } public class CartItem{ private DateTime _dateCreate; private DateTime _dateUpdate; private List<Cart> _Item; public CartItem() { if(this._Item==null){ this._Item = new List<Cart>(); this._dateCreate = DateTime.Now; } } public List<Cart> Item { get { return _Item; } set { _Item = value; } } public void Insert(int IDProduct, int Quantity, string ImageURL, string NameProuct, double Price) { int ItemIndex = ItemIndexOfID(ProductID);Error at ItemIndexOfID? } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)