using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

 

 

[Serializable]

public class Cart :System.Collections.Generic.List<ProductItem>

{

      public void Remove(int productId)

      {

            ProductItem item = this.FindItemByProductId(productId);

                  if(item!=null)

                  {

                        base.Remove(item);

                  }

           

      }

      public ProductItem FindItemByProductId(int ProductId)

      {

            foreach (ProductItem item in this)

            {

                  if (item.ProductID.Equals(ProductId))

                  {

                        return item;

                  }

            }

            return null;

      }

}