protected void rptrCart_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        if (e.CommandName == "AddCart")
        {
            Label   lblSize   = (Label)e.Item.FindControl("lblSize");
            Label   lblColor  = (Label)e.Item.FindControl("lblColor");
            string  ProductId = e.CommandArgument.ToString();
            TextBox txtQty    = (TextBox)e.Item.FindControl("txtQty");
            Qty = Convert.ToDouble(txtQty.Text);

            Addingitemincart(ProductId, lblSize.Text, lblColor.Text, Qty);
            clsWishlist = new clsWishlist();
            clsWishlist.RemoveItem(e.Item.ItemIndex);
            Response.Redirect("Cart.aspx");
        }
        else if (e.CommandName == "Remove")
        {
            clsWishlist = new clsWishlist();
            clsWishlist.RemoveItem(e.Item.ItemIndex);
        }

        BindWishList();
        BindFinalAmt();
        BindTopCartItems();
    }
    protected void btnSaveWishList_Click(object sender, EventArgs e)
    {
        DataTable dtMember = new DataTable();

        dtMember = (DataTable)Session["MemberInfo"];

        //delete from wishlsit

        cls.ExecuteDA("Delete_WishList", new SqlParameter("@MemberId", Convert.ToInt32(dtMember.Rows[0]["MemberId"])));

        //insert into Wishlist

        DataTable dt = new DataTable();

        clsWishlist = new clsWishlist();
        dt          = clsWishlist.BindWishlist();
        foreach (DataRow dr in dt.Rows)
        {
            cls.ExecuteDA("Insert_WishList", new SqlParameter("@MemberId", Convert.ToInt32(dtMember.Rows[0]["MemberId"])),
                          new SqlParameter("@ProductId", Convert.ToInt32(dr["ProductId"])),
                          new SqlParameter("@CategoryName", dr["CategoryName"]),
                          new SqlParameter("@SubCategoryName", dr["SubCategoryName"]),
                          new SqlParameter("@ProductName", dr["ProductName"]),
                          new SqlParameter("@Productdescp", dr["Productdescp"]),
                          new SqlParameter("@BrandName", dr["BrandName"]),
                          new SqlParameter("@SupplierName", dr["SupplierName"]),
                          new SqlParameter("@Unit", dr["Unit"]),
                          new SqlParameter("@ColourName", dr["ColourName"]),
                          new SqlParameter("@SizeName", dr["SizeName"]),
                          new SqlParameter("@ProductCode", dr["ProductCode"]),
                          new SqlParameter("@SupplierProductCode", dr["SupplierProductCode"]),
                          new SqlParameter("@PackSize", dr["PackSize"]),
                          new SqlParameter("@ProductCost", dr["ProductCost"]),
                          new SqlParameter("@ProductWeight", dr["ProductWeight"]),
                          new SqlParameter("@Image", dr["Image"]),
                          new SqlParameter("@Certification", dr["Certification"]),
                          new SqlParameter("@Description", dr["Description"]),
                          new SqlParameter("@Margin", Convert.ToDouble(dr["Margin"])),
                          new SqlParameter("@SalePrice", Convert.ToDouble(dr["SalePrice"])),
                          new SqlParameter("@Tax", Convert.ToDouble(dr["Tax"])),
                          new SqlParameter("@SalesPrice_Incl", Convert.ToDouble(dr["SalesPrice_Incl"])),
                          new SqlParameter("@MRP", Convert.ToDouble(dr["MRP"])),
                          new SqlParameter("@Discount", Convert.ToDouble(dr["Discount"])),
                          new SqlParameter("@CalDiscount", Convert.ToDouble(dr["CalDiscount"])),
                          new SqlParameter("@ShippingCost", Convert.ToDouble(dr["ShippingCost"])),
                          new SqlParameter("@FinalSellingPrice", Convert.ToDouble(dr["FinalSellingPrice"])),
                          new SqlParameter("@TaxFinalPrice", Convert.ToDouble(dr["TaxFinalPrice"])),
                          new SqlParameter("@Quantity", Convert.ToDouble(dr["Qty"])),
                          new SqlParameter("@ShippingDays", dr["ShippingDays"]),
                          new SqlParameter("@IsCOD", Convert.ToBoolean(dr["IsCOD"])));
        }
        MsgBox("Wishlist Saved Successfully.");
    }
    protected void BindWishList()
    {
        clsWishlist = new clsWishlist();


        rptrCart.DataSource = clsWishlist.BindWishlist();
        rptrCart.DataBind();

        if (rptrCart.Items.Count <= 0)
        {
            Response.Redirect("MemberDashboard.aspx");
        }
    }
    protected void BindFinalAmt()
    {
        //double ftotal = 0;

        //foreach (RepeaterItem rptitem in dlMail.Items)
        //{
        //    Label lblamt = (Label)rptitem.FindControl("lblfprice");
        //    ftotal = ftotal + Convert.ToDouble(lblamt.Text);
        //}
        Control footer        = rptrCart.Controls[rptrCart.Controls.Count - 1].Controls[0];
        Label   lblFinalTotal = (Label)footer.FindControl("lblFinalTotal");

        clsWishlist        = new clsWishlist();
        lblFinalTotal.Text = Math.Round(clsWishlist.TotalPrice()).ToString();
    }
    protected void btnAddCart_Click(object sender, EventArgs e)
    {
        string removeid = "";

        foreach (RepeaterItem ri in rptrCart.Items)
        {
            CheckBox chk = (CheckBox)ri.FindControl("chk");
            if (chk != null)
            {
                if (chk.Checked)
                {
                    Label lblpid = (Label)ri.FindControl("lblpid");
                    if (lblpid != null)
                    {
                        Label   lblSize   = (Label)ri.FindControl("lblSize");
                        Label   lblColor  = (Label)ri.FindControl("lblColor");
                        string  ProductId = lblpid.Text.ToString();
                        TextBox txtQty    = (TextBox)ri.FindControl("txtQty");
                        Qty = Convert.ToDouble(txtQty.Text);

                        Addingitemincart(ProductId, lblSize.Text, lblColor.Text, Qty);
                        removeid = ri.ItemIndex + "," + removeid;
                        //clsWishlist.RemoveItem(ri.ItemIndex);
                        Response.Redirect("Cart.aspx");
                    }
                }
            }
        }
        if (removeid != "")
        {
            clsWishlist = new clsWishlist();
            removeid    = removeid.TrimEnd(',');
            clsWishlist.RemoveMultipleItems(removeid);
            Response.Redirect("Cart.aspx");
        }
        else
        {
            MsgBox("Please select product to add in cart.");
        }
    }
    protected void Addingitemincart(string ProductId, string size, string color, double quantity)
    {
        DataTable dt = new DataTable();

        clsWishlist = new clsWishlist();
        dt          = clsWishlist.BindWishlistOnProductSizeColor(ProductId, size, color);


        foreach (DataRow dr in dt.Rows)
        {
            ProductId           = dr["ProductId"].ToString();
            CategoryName        = dr["CategoryName"].ToString();
            SubCategoryName     = dr["SubCategoryName"].ToString();
            ProductName         = dr["ProductName"].ToString();
            Productdescp        = dr["Productdescp"].ToString();
            BrandName           = dr["BrandName"].ToString();
            SupplierName        = dr["SupplierName"].ToString();
            Unit                = dr["Unit"].ToString();
            ProductCode         = dr["ProductCode"].ToString();
            SupplierProductCode = dr["SupplierProductCode"].ToString();
            PackSize            = dr["PackSize"].ToString();
            ProductCost         = Convert.ToDouble(dr["ProductCost"].ToString());
            ProductWeight       = Convert.ToDouble(dr["ProductWeight"].ToString());
            Image               = dr["Image"].ToString();
            Certification       = dr["Certification"].ToString();
            Description         = dr["Description"].ToString();
            Margin              = Convert.ToDouble(dr["Margin"].ToString());
            SalePrice           = Convert.ToDouble(dr["SalePrice"].ToString());
            Tax               = Convert.ToDouble(dr["Tax"].ToString());
            SalesPrice_Incl   = Convert.ToDouble(dr["SalesPrice_Incl"].ToString());
            MRP               = Convert.ToDouble(dr["MRP"].ToString());
            Discount          = Convert.ToDouble(dr["Discount"].ToString());
            CalDiscount       = Convert.ToDouble(dr["CalDiscount"].ToString());
            ShippingCost      = Convert.ToDouble(dr["ShippingCost"].ToString());
            FinalSellingPrice = Convert.ToDouble(dr["FinalSellingPrice"].ToString());
            TaxFinalPrice     = Convert.ToDouble(dr["TaxFinalPrice"].ToString());
            MinQty            = Convert.ToDouble(dr["Qty"].ToString());
            ShippingDays      = dr["ShippingDays"].ToString();
            IsCOD             = Convert.ToBoolean(dr["IsCOD"]);
        }

        SizeName   = size;
        ColourName = color;

        if (quantity < MinQty)
        {
            MsgBox("Minimum Qty required for order is : " + MinQty);
            return;
        }

        Price = quantity * FinalSellingPrice;

        clsCart = new clsAddToCart();

        if (quantity != 0)
        {
            if (clsCart.FindExistItemWithSizeColor(ProductId, SizeName, ColourName))
            {
                clsCart.UpdateQtyAndPriceWithSizeColor(ProductId, Qty, FinalSellingPrice, SizeName, ColourName);
            }
            else
            {
                clsCart.AddToCart(ProductId, CategoryName, SubCategoryName, ProductName, Productdescp, BrandName, SupplierName, Unit, ColourName, SizeName, ProductCode, SupplierProductCode, PackSize, ProductCost, ProductWeight, Image, Certification, Description, Margin, SalePrice, Tax, SalesPrice_Incl, MRP, Discount, CalDiscount, ShippingCost, FinalSellingPrice, TaxFinalPrice, Qty, ShippingDays, IsCOD, Price);
            }
        }
    }
    protected void rptrProductDetail_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        bool IsLogin;

        // Add to Cart
        if (e.CommandName == "AddCart")
        {
            RadioButtonList rdbSize = (RadioButtonList)e.Item.FindControl("rdbSize");
            Panel           pnlSize = (Panel)e.Item.FindControl("pnlSize");

            if (!pnlSize.Visible)
            {
                SizeName = "NA";
            }
            else if (rdbSize.SelectedIndex > -1)
            {
                SizeName = rdbSize.SelectedItem.Text;
            }
            else
            {
                MsgBox("Please Select Size");
                return;
            }

            RadioButtonList rdbColor = (RadioButtonList)e.Item.FindControl("rdbColor");
            Panel           pnlColor = (Panel)e.Item.FindControl("pnlColour");

            if (!pnlColor.Visible)
            {
                ColourName = "NA";
            }
            else if (rdbColor.SelectedIndex > -1)
            {
                ColourName = rdbColor.SelectedItem.Text;
            }
            else
            {
                MsgBox("Please Select Color");
                return;
            }

            TextBox txtQty = (TextBox)e.Item.FindControl("txtQty");

            Qty = Convert.ToDouble(txtQty.Text);

            dtproduct = new DataTable();
            dtproduct = cl.getdataset("select ProductCategory.CategoryName,ProductSubCategory.SubCategoryName,Brand.BrandName,product.*,(case Productdescp when '' then ProductName else ProductName +'&nbsp;('+Productdescp+')'  end ) as pname, (case Productdescp when '' then '' else '('+Productdescp+')'  end ) as pline2,  Supplier.SupplierName,Unit.Unit,  c.*,c.discount as crmdiscount from  Product inner join ProductCategory on Product.ProductCategoryId=ProductCategory.Id  inner join ProductSubCategory on Product.ProductSubCategoryId=ProductSubCategory.Id  inner join Brand on Product.BrandId=Brand.Id  left join unit on Product.UnitId=Unit.Id inner join crm c on c.productid=Product.id left join Supplier on Product.SupplierId=Supplier.Id   where Product.IsActive=1 and Product.Id='" + pid + "' and c.cusotmerid='" + memberid + "'");

            if (dtproduct != null)
            {
                foreach (DataRow dr in dtproduct.Rows)
                {
                    ProductId           = dr["Id"].ToString();
                    CategoryName        = dr["CategoryName"].ToString();
                    SubCategoryName     = dr["SubCategoryName"].ToString();
                    ProductName         = dr["ProductName"].ToString();
                    Productdescp        = dr["Productdescp"].ToString();
                    BrandName           = dr["BrandName"].ToString();
                    SupplierName        = dr["SupplierName"].ToString();
                    Unit                = dr["Unit"].ToString();
                    ProductCode         = dr["ProductCode"].ToString();
                    SupplierProductCode = dr["SupplierProductCode"].ToString();
                    PackSize            = dr["PackSize"].ToString();
                    ProductCost         = Convert.ToDouble(dr["ProductCost"].ToString());
                    ProductWeight       = Convert.ToDouble(dr["ProductWeight"].ToString());
                    Image               = dr["Image"].ToString();
                    Certification       = dr["Certification"].ToString();
                    Description         = dr["Description"].ToString();
                    Margin              = Convert.ToDouble(dr["Margin"].ToString());
                    SalePrice           = Convert.ToDouble(dr["SalePrice"].ToString());
                    Tax               = Convert.ToDouble(dr["Tax"].ToString());
                    SalesPrice_Incl   = Convert.ToDouble(dr["SalesPrice_Incl"].ToString());
                    MRP               = Convert.ToDouble(dr["MRP"].ToString());
                    Discount          = Convert.ToDouble(dr["Discount"].ToString());
                    CalDiscount       = Convert.ToDouble(dr["CalDiscount"].ToString());
                    ShippingCost      = Convert.ToDouble(dr["ShippingCost"].ToString());
                    FinalSellingPrice = Convert.ToDouble(dr["netsaleprice"].ToString());
                    TaxFinalPrice     = Convert.ToDouble(dr["TaxFinalPrice"].ToString());
                    MinQty            = Convert.ToDouble(dr["Quantity"].ToString());
                    ShippingDays      = dr["ShippingDays"].ToString();
                    IsCOD             = Convert.ToBoolean(dr["IsCOD"]);
                }

                if (Qty < MinQty)
                {
                    MsgBox("Minimum Qty required for order is : " + MinQty);
                    return;
                }

                Price = Qty * FinalSellingPrice;

                clsCart = new clsAddToCart();
                if (clsCart.FindExistItemWithSizeColor(ProductId, SizeName, ColourName))
                {
                    clsCart.UpdateQtyAndPriceWithSizeColor(ProductId, Qty, FinalSellingPrice, SizeName, ColourName);
                }
                else
                {
                    clsCart.AddToCart(ProductId, CategoryName, SubCategoryName, ProductName, Productdescp, BrandName, SupplierName, Unit, ColourName, SizeName, ProductCode, SupplierProductCode, PackSize, ProductCost, ProductWeight, Image, Certification, Description, Margin, SalePrice, Tax, SalesPrice_Incl, MRP, Discount, CalDiscount, ShippingCost, FinalSellingPrice, TaxFinalPrice, Qty, ShippingDays, IsCOD, Price);
                }
                if (Qty > 0)
                {
                    Response.Redirect("Cart.aspx");
                }
                else
                {
                    //Response.Redirect("Cart.aspx");
                    //BindTopCartItems();

                    MsgBox("Please Select Color");
                }
            }
            else
            {
                BindProductDetail(pid);
            }
        }
        // Add to Wishlist
        else if (e.CommandName == "AddWishlist")
        {
            RadioButtonList rdbSize = (RadioButtonList)e.Item.FindControl("rdbSize");
            Panel           pnlSize = (Panel)e.Item.FindControl("pnlSize");

            if (!pnlSize.Visible)
            {
                SizeName = "NA";
            }
            else if (rdbSize.SelectedIndex > -1)
            {
                SizeName = rdbSize.SelectedItem.Text;
            }
            else
            {
                MsgBox("Please Select Size");
                return;
            }

            RadioButtonList rdbColor = (RadioButtonList)e.Item.FindControl("rdbColor");
            Panel           pnlColor = (Panel)e.Item.FindControl("pnlColour");

            if (!pnlColor.Visible)
            {
                ColourName = "NA";
            }
            else if (rdbColor.SelectedIndex > -1)
            {
                ColourName = rdbColor.SelectedItem.Text;
            }
            else
            {
                MsgBox("Please Select Color");
                return;
            }

            //TextBox txtQty = (TextBox)e.Item.FindControl("txtQty");

            //if (string.IsNullOrEmpty(txtQty.Text))
            //{
            //    Qty = 0;
            //}
            //else
            //{
            //    Qty = Convert.ToDouble(txtQty.Text);
            //}
            dtproduct = new DataTable();
            dtproduct = cl.getdataset("select ProductCategory.CategoryName,ProductSubCategory.SubCategoryName,Brand.BrandName,product.*,(case Productdescp when '' then ProductName else ProductName +'&nbsp;('+Productdescp+')'  end ) as pname, (case Productdescp when '' then '' else '('+Productdescp+')'  end ) as pline2,  Supplier.SupplierName,Unit.Unit,  c.*,c.discount as crmdiscount from  Product inner join ProductCategory on Product.ProductCategoryId=ProductCategory.Id  inner join ProductSubCategory on Product.ProductSubCategoryId=ProductSubCategory.Id  inner join Brand on Product.BrandId=Brand.Id  left join unit on Product.UnitId=Unit.Id inner join crm c on c.productid=Product.id left join Supplier on Product.SupplierId=Supplier.Id   where Product.IsActive=1 and Product.Id='" + pid + "' and c.cusotmerid='" + memberid + "'");

            foreach (DataRow dr in dtproduct.Rows)
            {
                ProductId           = dr["Id"].ToString();
                CategoryName        = dr["CategoryName"].ToString();
                SubCategoryName     = dr["SubCategoryName"].ToString();
                ProductName         = dr["ProductName"].ToString();
                Productdescp        = dr["Productdescp"].ToString();
                BrandName           = dr["BrandName"].ToString();
                SupplierName        = dr["SupplierName"].ToString();
                Unit                = dr["Unit"].ToString();
                ProductCode         = dr["ProductCode"].ToString();
                SupplierProductCode = dr["SupplierProductCode"].ToString();
                PackSize            = dr["PackSize"].ToString();
                ProductCost         = Convert.ToDouble(dr["ProductCost"].ToString());
                ProductWeight       = Convert.ToDouble(dr["ProductWeight"].ToString());
                Image               = dr["Image"].ToString();
                Certification       = dr["Certification"].ToString();
                Description         = dr["Description"].ToString();
                Margin              = Convert.ToDouble(dr["Margin"].ToString());
                SalePrice           = Convert.ToDouble(dr["SalePrice"].ToString());
                Tax               = Convert.ToDouble(dr["Tax"].ToString());
                SalesPrice_Incl   = Convert.ToDouble(dr["SalesPrice_Incl"].ToString());
                MRP               = Convert.ToDouble(dr["MRP"].ToString());
                Discount          = Convert.ToDouble(dr["Discount"].ToString());
                CalDiscount       = Convert.ToDouble(dr["CalDiscount"].ToString());
                ShippingCost      = Convert.ToDouble(dr["ShippingCost"].ToString());
                FinalSellingPrice = Convert.ToDouble(dr["netsaleprice"].ToString());
                TaxFinalPrice     = Convert.ToDouble(dr["TaxFinalPrice"].ToString());
                MinQty            = Convert.ToDouble(dr["Quantity"].ToString());
                ShippingDays      = dr["ShippingDays"].ToString();
                IsCOD             = Convert.ToBoolean(dr["IsCOD"]);
            }

            Price = MinQty * FinalSellingPrice;

            clsWishlist = new clsWishlist();
            if (clsWishlist.FindExistItemWithSizeColor(ProductId, SizeName, ColourName))
            {
                clsWishlist.UpdateQtyAndPriceWithSizeColor(ProductId, MinQty, FinalSellingPrice, SizeName, ColourName);
            }
            else
            {
                clsWishlist.AddToWishlist(ProductId, CategoryName, SubCategoryName, ProductName, Productdescp, BrandName, SupplierName, Unit, ColourName, SizeName, ProductCode, SupplierProductCode, PackSize, ProductCost, ProductWeight, Image, Certification, Description, Margin, SalePrice, Tax, SalesPrice_Incl, MRP, Discount, CalDiscount, ShippingCost, FinalSellingPrice, TaxFinalPrice, MinQty, ShippingDays, IsCOD, Price);
            }
            IsLogin = CheckUserSession();
            if (!IsLogin)
            {
                Session["CameFrom"] = "Wishlist";
                MessageThenRedirectTo("Please Login to Save Wishlist", "Register");
                return;
            }
            else
            {
                Response.Redirect("WishList.aspx");
            }
        }
        //check pincode
        else if (e.CommandName == "CheckPincode")
        {
            TextBox txtPinCode = (TextBox)e.Item.FindControl("txtPinCode");
            if (txtPinCode != null)
            {
                DataTable dt = new DataTable();
                dt = getStateCityOnPincode(Convert.ToInt64(txtPinCode.Text));
                Panel pnlShippingAvailable = (Panel)e.Item.FindControl("pnlShippingAvailable");
                Panel pnlShippingPin       = (Panel)e.Item.FindControl("pnlShippingPin");

                if (dt.Rows.Count > 0)
                {
                    pnlShippingAvailable.Visible = true;
                    pnlShippingPin.Visible       = false;
                }
                else
                {
                    pnlShippingAvailable.Visible = false;
                    pnlShippingPin.Visible       = true;
                }
            }
        }
    }
Exemplo n.º 8
0
    protected void BindWishList(int MemberId)
    {
        clsWishlist = new clsWishlist();
        DataTable dtWishList = new DataTable();

        dtWishList = cls.ReturnDataTable("Select_WishListOnMemberId", new SqlParameter("@MemberId", MemberId));

        // retrived from wishlist db

        //foreach (DataRow drWishList in dtWishList.Rows)
        //{
        //    ProductId = drWishList["ProductId"].ToString();
        //    CategoryName = drWishList["CategoryName"].ToString();
        //    SubCategoryName = drWishList["SubCategoryName"].ToString();
        //    ProductName = drWishList["ProductName"].ToString();
        //    Productdescp = drWishList["Productdescp"].ToString();
        //    BrandName = drWishList["BrandName"].ToString();
        //    SupplierName = drWishList["SupplierName"].ToString();
        //    Unit = drWishList["Unit"].ToString();
        //    ProductCode = drWishList["ProductCode"].ToString();
        //    SupplierProductCode = drWishList["SupplierProductCode"].ToString();
        //    PackSize = drWishList["PackSize"].ToString();
        //    ProductCost = Convert.ToDouble(drWishList["ProductCost"].ToString());
        //    ProductWeight = Convert.ToDouble(drWishList["ProductWeight"].ToString());
        //    Image = drWishList["Image"].ToString();
        //    Certification = drWishList["Certification"].ToString();
        //    Description = drWishList["Description"].ToString();
        //    Margin = Convert.ToDouble(drWishList["Margin"].ToString());
        //    SalePrice = Convert.ToDouble(drWishList["SalePrice"].ToString());
        //    Tax = Convert.ToDouble(drWishList["Tax"].ToString());
        //    SalesPrice_Incl = Convert.ToDouble(drWishList["SalesPrice_Incl"].ToString());
        //    MRP = Convert.ToDouble(drWishList["MRP"].ToString());
        //    Discount = Convert.ToDouble(drWishList["Discount"].ToString());
        //    CalDiscount = Convert.ToDouble(drWishList["CalDiscount"].ToString());
        //    ShippingCost = Convert.ToDouble(drWishList["ShippingCost"].ToString());
        //    FinalSellingPrice = Convert.ToDouble(drWishList["FinalSellingPrice"].ToString());
        //    TaxFinalPrice = Convert.ToDouble(drWishList["TaxFinalPrice"].ToString());
        //    MinQty = Convert.ToDouble(drWishList["Quantity"].ToString());
        //    ShippingDays = drWishList["ShippingDays"].ToString();
        //    IsCOD = Convert.ToBoolean(drWishList["IsCOD"]);
        //    ColourName = drWishList["ColourName"].ToString();
        //    SizeName = drWishList["SizeName"].ToString();

        //    Price = MinQty * FinalSellingPrice;

        //    if (clsWishlist.FindExistItemWithSizeColor(ProductId, SizeName, ColourName))
        //    {
        //        clsWishlist.UpdateQtyAndPriceWithSizeColor(ProductId, Qty, FinalSellingPrice, SizeName, ColourName);
        //    }
        //    else
        //    {
        //        clsWishlist.AddToWishlist(ProductId, CategoryName, SubCategoryName, ProductName, Productdescp, BrandName, SupplierName, Unit, ColourName, SizeName, ProductCode, SupplierProductCode, PackSize, ProductCost, ProductWeight, Image, Certification, Description, Margin, SalePrice, Tax, SalesPrice_Incl, MRP, Discount, CalDiscount, ShippingCost, FinalSellingPrice, TaxFinalPrice, MinQty, ShippingDays, IsCOD, Price);
        //    }
        //}

        //retrving from product db

        DataTable dtproduct;

        dtproduct = new DataTable();
        foreach (DataRow drWishList in dtWishList.Rows)
        {
            ProductId  = drWishList["ProductId"].ToString();
            ColourName = drWishList["ColourName"].ToString();
            SizeName   = drWishList["SizeName"].ToString();

            dtproduct = cls.ReturnDataTable("Select_ProductDetailOnId", new SqlParameter("@pid", ProductId));

            if (dtproduct.Rows.Count <= 0)
            {
            }
            else
            {
                foreach (DataRow dr in dtproduct.Rows)
                {
                    ProductId           = dr["Id"].ToString();
                    CategoryName        = dr["CategoryName"].ToString();
                    SubCategoryName     = dr["SubCategoryName"].ToString();
                    ProductName         = dr["ProductName"].ToString();
                    Productdescp        = dr["Productdescp"].ToString();
                    BrandName           = dr["BrandName"].ToString();
                    SupplierName        = dr["SupplierName"].ToString();
                    Unit                = dr["Unit"].ToString();
                    ProductCode         = dr["ProductCode"].ToString();
                    SupplierProductCode = dr["SupplierProductCode"].ToString();
                    PackSize            = dr["PackSize"].ToString();
                    ProductCost         = Convert.ToDouble(dr["ProductCost"].ToString());
                    ProductWeight       = Convert.ToDouble(dr["ProductWeight"].ToString());
                    Image               = dr["Image"].ToString();
                    Certification       = dr["Certification"].ToString();
                    Description         = dr["Description"].ToString();
                    Margin              = Convert.ToDouble(dr["Margin"].ToString());
                    SalePrice           = Convert.ToDouble(dr["SalePrice"].ToString());
                    Tax               = Convert.ToDouble(dr["Tax"].ToString());
                    SalesPrice_Incl   = Convert.ToDouble(dr["SalesPrice_Incl"].ToString());
                    MRP               = Convert.ToDouble(dr["MRP"].ToString());
                    Discount          = Convert.ToDouble(dr["Discount"].ToString());
                    CalDiscount       = Convert.ToDouble(dr["CalDiscount"].ToString());
                    ShippingCost      = Convert.ToDouble(dr["ShippingCost"].ToString());
                    FinalSellingPrice = Convert.ToDouble(dr["FinalSellingPrice"].ToString());
                    TaxFinalPrice     = Convert.ToDouble(dr["TaxFinalPrice"].ToString());
                    MinQty            = Convert.ToDouble(dr["Quantity"].ToString());
                    ShippingDays      = dr["ShippingDays"].ToString();
                    IsCOD             = Convert.ToBoolean(dr["IsCOD"]);
                }

                Price = MinQty * FinalSellingPrice;

                if (clsWishlist.FindExistItemWithSizeColor(ProductId, SizeName, ColourName))
                {
                    clsWishlist.UpdateQtyAndPriceWithSizeColor(ProductId, MinQty, FinalSellingPrice, SizeName, ColourName);
                }
                else
                {
                    clsWishlist.AddToWishlist(ProductId, CategoryName, SubCategoryName, ProductName, Productdescp, BrandName, SupplierName, Unit, ColourName, SizeName, ProductCode, SupplierProductCode, PackSize, ProductCost, ProductWeight, Image, Certification, Description, Margin, SalePrice, Tax, SalesPrice_Incl, MRP, Discount, CalDiscount, ShippingCost, FinalSellingPrice, TaxFinalPrice, MinQty, ShippingDays, IsCOD, Price);
                }
            }
        }
    }