Ejemplo n.º 1
0
    protected void btnClubSearch_Click(object sender, EventArgs e)
    {
        string       searchValue = txtClubFilter.Text;
        Clubs        club        = new Clubs(_connString);
        List <Clubs> tblClubs    = null;

        if (ClubSearchType.SelectedValue == "c")
        {
            searchValue = string.Format("%{0}", searchValue);
        }

        switch (ClubFilterBy.SelectedValue)
        {
        case "Club_Long_Name":
            tblClubs = club.GetClubsLikeClub_Long_Name(searchValue);
            break;

        case "Club_Short_Name":
            tblClubs = club.GetClubsLikeClub_Short_Name(searchValue);
            break;

        default:
            tblClubs = club.GetClubs();
            break;
        }

        ClubGridView.DataSource = tblClubs;
        ClubGridView.DataBind();
        txtClubFilter.Text           = string.Empty;
        ClubFilterBy.SelectedIndex   = -1;
        ClubSearchType.SelectedIndex = -1;
    }
Ejemplo n.º 2
0
    private void PopulateClubGridView()
    {
        Clubs        club     = new Clubs(_connString);
        List <Clubs> tblClubs = club.GetClubs();

        ClubGridView.DataSource = tblClubs;
        ClubGridView.DataBind();
    }