Example #1
0
    public void Bindspec()
    {
        if (Session["id"] != null && Session["pcid"] != null && Session["pcid"].ToString() != "" && Session["id"].ToString() != "")
        {
            objspec.ProductID         = long.Parse(Session["id"].ToString());
            objspec.ProductCategoryID = long.Parse(Session["pcid"].ToString());
            List <SpecificationValue> lstspec = objspec.GetSpec();

            if (lstspec.Count > 0)
            {
                //lblspecvalues.Text = "Update Specifications";
                gridview1.DataSource = lstspec;
                gridview1.DataBind();
                btnsaveGriddata.Text = "Update";
            }
            else
            {
                //lblspecvalues.Text = "Add Specifications";
                List <SpecificationValue> lstspe = objspec.GetProductSpec();
                gridview1.DataSource = lstspe;
                gridview1.DataBind();
                btnsaveGriddata.Text = "Save";
            }
        }
        else
        {
            Response.Redirect("Product.aspx");
        }
    }