/// <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"); } } }
/// <summary> /// Event handler for page_load event /// </summary> /// <param name="sender">a sender</param> /// <param name="e">a e</param> protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { GeoCityCollection col = new GeoCityCollection(); col.FetchWhenImages(); DataBindToDDLAccessMenu(col, "CityName", "Id"); lbAccessMenu.Text = "Select a city"; } }
protected void loadCityLists() { GeoCityCollection GCityCollection = new GeoCityCollection(); GCityCollection.FetchWhenImages(); drpCity.DataTextField = "CityName"; drpCity.DataValueField = "id"; drpCity.DataSource = GCityCollection; drpCity.DataBind(); }
/// <summary> /// Loads city data /// </summary> /// <param name="cityId"></param> private void LoadCity(int cityId) { _geoCity = new GeoCityCollection(); _geoCity.FetchForId(cityId); }