Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         Session["gemsize"] = null;
         Session["price"]   = null;
         Session["descen"]  = null;
         Session["ascen"]   = null;
         //List<Products> lstobjp = objproducts.GetProductsData();
         List <ProductCategories> lstpc   = new List <ProductCategories>();
         ProductCategories        objpcid = new ProductCategories();
         lstpc = objpcid.GetAllProductCategory();
         PcGridview.DataSource = lstpc;
         PcGridview.DataBind();
         //PCNameGridview.DataSource = lstobjp;
         //PCNameGridview.DataBind();
     }
     else
     {
         Session["gemsize"] = null;
         Session["price"]   = null;
         Session["descen"]  = null;
         Session["ascen"]   = null;
         //List<Products> lstobjp = objproducts.GetProductsData();
         List <ProductCategories> lstpc   = new List <ProductCategories>();
         ProductCategories        objpcid = new ProductCategories();
         lstpc = objpcid.GetAllProductCategory();
         PcGridview.DataSource = lstpc;
         PcGridview.DataBind();
     }
 }
Пример #2
0
    public void BindAscenDecenData()
    {
        List <ProductCategories> lstpc   = new List <ProductCategories>();
        ProductCategories        objpcid = new ProductCategories();

        if (CheckBoxList3.SelectedValue != "")
        {
            lstpc = objpcid.GetPCDetails(long.Parse(CheckBoxList3.SelectedValue));
        }
        else
        {
            lstpc = objpcid.GetAllProductCategory();
        }
        PcGridview.DataSource = lstpc;
        PcGridview.DataBind();
    }
Пример #3
0
    protected void btncheck_Click(object sender, EventArgs e)
    {
        List <ProductCategories> lstpcat = new List <ProductCategories>();
        ProductCategories        objpcid = new ProductCategories();

        Session["price"]   = null;
        Session["gemsize"] = null;
        if (CheckBoxList3.SelectedValue != "")
        {
            if (CheckBoxList1.SelectedValue != "")
            {
                if (CheckBoxList1.SelectedValue == "1")
                {
                    Session["price"] = "0-9999";
                }
                else if (CheckBoxList1.SelectedValue == "2")
                {
                    Session["price"] = "10000-19999";
                }
                else if (CheckBoxList1.SelectedValue == "3")
                {
                    Session["price"] = "20000-29999";
                }
                else if (CheckBoxList1.SelectedValue == "4")
                {
                    Session["price"] = "30000-39999";
                }
                else if (CheckBoxList1.SelectedValue == "5")
                {
                    Session["price"] = "40000-49999";
                }
                else if (CheckBoxList1.SelectedValue == "6")
                {
                    Session["price"] = "50000";
                }
            }
            else if (CheckBoxList2.SelectedValue != "")
            {
                Session["gemsize"] = CheckBoxList2.SelectedValue;
            }
            lstpcat = objpcid.GetPCDetails(long.Parse(CheckBoxList3.SelectedValue));
        }

        else
        {
            if (CheckBoxList1.SelectedValue != "")
            {
                if (CheckBoxList1.SelectedValue == "1")
                {
                    Session["price"] = "0-9999";
                }
                else if (CheckBoxList1.SelectedValue == "2")
                {
                    Session["price"] = "10000-19999";
                }
                else if (CheckBoxList1.SelectedValue == "3")
                {
                    Session["price"] = "20000-29999";
                }
                else if (CheckBoxList1.SelectedValue == "4")
                {
                    Session["price"] = "30000-39999";
                }
                else if (CheckBoxList1.SelectedValue == "5")
                {
                    Session["price"] = "40000-49999";
                }
                else if (CheckBoxList1.SelectedValue == "6")
                {
                    Session["price"] = "50000";
                }
            }
            if (CheckBoxList2.SelectedValue != "")
            {
                Session["gemsize"] = CheckBoxList2.SelectedValue;
            }
            lstpcat = objpcid.GetAllProductCategory();
        }

        PcGridview.DataSource = lstpcat;
        PcGridview.DataBind();
    }