コード例 #1
0
        private void SetSearch()
        {
            if (Request.QueryString["q"] != null)
            {
                if (Request.QueryString["q"] == "all")
                {
                    var _mp = new DlMainpagepopulator();

                    GridView1.DataSource = _mp.GetJobssingle();
                    GridView1.DataBind();

                    //get count of all jobs
                    Label13.Text = _mp.Getcountjobs() + " Jobs Advertized from " + _mp.Getcountrecswadvert() + " Recruiters";
                }

                else if (Request.QueryString["filter"] != null)
                {
                    //textbox+criteria
                    var _criteria = Session["criteria"].ToString().ToLowerInvariant();
                    var _title    = Request.QueryString["q"];

                    var _sr = new Clsearchhelper();

                    GridView1.DataSource = _sr.Applytitlefilter(_title, _criteria);
                    GridView1.DataBind();

                    //set checkboxes
                    SetCheckBox(_criteria);

                    //show filters
                    ClearFilters.Visible = true;
                }

                else
                {
                    //textbox only
                    var _sr2    = new Clsearchhelper();
                    var __title = Request.QueryString["q"];

                    GridView1.DataSource = _sr2.Applytitlefilter(__title);
                    GridView1.DataBind();

                    //show filters
                    ClearFilters.Visible = true;
                }
            }

            else
            {
                if (Request.QueryString["filter"] == null)
                {
                    var _mp1 = new DlMainpagepopulator();

                    GridView1.DataSource = _mp1.GetJobssingle();
                    GridView1.DataBind();

                    //get count of all jobs
                    Label13.Text = _mp1.Getcountjobs() + " Jobs Advertized from " + _mp1.Getcountrecswadvert() + " Recruiters";
                }

                else
                {
                    //criteria only
                    var _criteria = Session["criteria"].ToString().ToLowerInvariant();
                    var _sr       = new Clsearchhelper();

                    GridView1.DataSource = _sr.Applycriteriafilter(_criteria);
                    GridView1.DataBind();

                    //setcheckbox
                    SetCheckBox(_criteria);

                    //show filter button
                    ClearFilters.Visible = true;
                }
            }

            //display filter sign
        }
コード例 #2
0
        private void GetPage(GridViewPageEventArgs e)
        {
            if (Request.QueryString["q"] != null)
            {
                if (Request.QueryString["q"] == "all")
                {
                    var _mp = new DlMainpagepopulator();

                    GridView1.DataSource = _mp.GetJobssingle();
                    GridView1.PageIndex  = e.NewPageIndex;
                    GridView1.DataBind();

                    //get count of all jobs
                    Label13.Text = _mp.Getcountjobs() + " Jobs Advertized from " + _mp.Getcountrecswadvert() + " Recruiters";
                }

                else if (Request.QueryString["filter"] != null)
                {
                    //textbox+criteria
                    var _criteria = Session["criteria"].ToString().ToLowerInvariant();
                    var _title    = Request.QueryString["q"];

                    var _sr = new Clsearchhelper();

                    GridView1.DataSource = _sr.Applytitlefilter(_title, _criteria);
                    GridView1.PageIndex  = e.NewPageIndex;
                    GridView1.DataBind();
                }

                else
                {
                    //textbox only
                    var _sr2    = new Clsearchhelper();
                    var __title = Request.QueryString["q"];

                    GridView1.DataSource = _sr2.Applytitlefilter(__title);
                    GridView1.PageIndex  = e.NewPageIndex;
                    GridView1.DataBind();
                }
            }

            else
            {
                if (Request.QueryString["filter"] == null)
                {
                    var _mp1 = new DlMainpagepopulator();

                    GridView1.DataSource = _mp1.GetJobssingle();
                    GridView1.PageIndex  = e.NewPageIndex;
                    GridView1.DataBind();

                    //get count of all jobs
                    Label13.Text = _mp1.Getcountjobs() + " Jobs Advertized from " + _mp1.Getcountrecswadvert() + " Recruiters";
                }

                else
                {
                    //criteria only
                    var _criteria = Session["criteria"].ToString().ToLowerInvariant();
                    var _sr       = new Clsearchhelper();

                    GridView1.DataSource = _sr.Applycriteriafilter(_criteria);
                    GridView1.PageIndex  = e.NewPageIndex;
                    GridView1.DataBind();
                }
            }
        }