Click here to Skip to main content
15,897,371 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
why this problem occuring plz give ans

add to cart mate three class i made CartItem,ShoppingCart.cs,cat_detail.cs
i don't no where is my mistake

this code is my CartItem.cs code
and
cart tbl have column like:Cart_ID,id,u_nm,name,type,image,price,qty,subTotal

C#
public class CartItem:IEquatable<CartItem>
{
    public int qty{get;set;}
    private int _cartid;
    public int Cart_ID
    {
        get { return _cartid; }
        set { _cartid = value;
        }
    }
    private cat_detail _book = null;
    public cat_detail cat
    {
        get {
            if (_book== null)
            {
               _book =new cat_detail(Cart_ID);
            }
            return _book;
        }
    }
    public string Name
    {
        get { return cat.name; }
    }
    public string Type
    {
        get { return cat.type; }

    }
    public decimal Price
    {
        get { return cat.price; }
    }
    public string Description
    {
        get { return cat.description; }
    }

    public decimal TotalPrice {
        get { return Price * qty; }
    }
    public CartItem(int id)
    {
        this.Cart_ID = id;
    }
    public bool Equals(CartItem id)
    {
        return id.Cart_ID ==this.Cart_ID;
    }
}
Posted
Updated 28-Feb-14 3:43am
v3
Comments
AnvilRanger 27-Feb-14 9:36am    
You need to include code, error message, and in general more information if you expect people to help. We cannot view your screen and no nothing about your code.
Maarten Kools 27-Feb-14 9:37am    
We don't either. Use the "Improve question" link to improve your question and post the relevant code.
JoCodes 28-Feb-14 11:39am    
Nothing was clear in your question. Improve your question and add the relevant code only

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900