コード例 #1
0
 /// <summary>
 /// Event handler for the rbAccess_CheckedChanged event
 /// </summary>
 /// <param name="sender">a sender</param>
 /// <param name="e">a e</param>
 protected void rbAccess_CheckedChanged(object sender, EventArgs e)
 {
     if (rbCity.Checked)
     {
         GeoCityCollection col = new GeoCityCollection();
         col.FetchWhenImages();
         DataBindToDDLAccessMenu(col, "CityName", "Id");
         lbAccessMenu.Text = "Select a city";
     }
     else if (rbCountry.Checked)
     {
         lbAccessMenu.Text = "Select a country";
         GeoCountryCollection col = new GeoCountryCollection();
         col.FetchWhenImages();
         DataBindToDDLAccessMenu(col, "CountryName", "Id");
     }
     else
     {
         if (rbContinent.Checked)
         {
             lbAccessMenu.Text = "Select a continent";
             GeoContinentCollection col = new GeoContinentCollection();
             col.FetchAll();
             DataBindToDDLAccessMenu(col, "ContinentName", "Id");
         }
     }
 }
コード例 #2
0
    /// <summary>
    /// Event handler for the rbBrowseCriteria_CheckedChanged event
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void rbBrowseCriteria_CheckedChanged(object sender, EventArgs e)
    {
        ddlBrowseCriteria.Visible = true;
        btnBrowseCriteria.Visible = true;

        _collectionImages = new TravelImageCollection();

        if (rbContinent.Checked)
        {
            GeoContinentCollection col = new GeoContinentCollection();
            col.FetchAllSorted(true);
            gvImage.DataSource = _collectionImages;
            DataBindToDDLAccessMenu(col, "ContinentName", "Id");
            lbBrowseCriteria.Text = "Select a continent:";
        }
        else if (rbCountry.Checked)
        {
            GeoCountryCollection col = new GeoCountryCollection();
            col.FetchWhenImages();
            gvImage.DataSource = _collectionImages;
            DataBindToDDLAccessMenu(col, "CountryName", "Id");
            lbBrowseCriteria.Text = "Select a country:";
        }
        else
        {
            if (rbNormal.Checked)
            {
                _collectionImages.FetchAllSorted(true);
                gvImage.DataSource        = _collectionImages;
                ddlBrowseCriteria.Visible = false;
                btnBrowseCriteria.Visible = false;
                lbBrowseCriteria.Text     = "";
            }
        }
        gvImage.DataBind();
    }