public void citiesList() { var data = CitiesRepo.getCities(); Cities_ListView.DataSource = data; Cities_ListView.DataBind(); }
public void cityDetail() { try { var cities = CitiesRepo.getCities(); fromCity_dropDown.DataSource = cities; fromCity_dropDown.DataTextField = "cityName"; fromCity_dropDown.DataValueField = "cityID"; fromCity_dropDown.DataBind(); toCity_dropDown.DataSource = cities; toCity_dropDown.DataTextField = "cityName"; toCity_dropDown.DataValueField = "cityID"; toCity_dropDown.DataBind(); txt_charges.Value = ""; VehicleTypeSedan.Checked = true; VehicleTypeEconomy.Checked = true; } catch (Exception) { Response.Redirect("CitiesPricing.aspx"); } }
public void cityDetail() { try { string chargesID = Request.QueryString["chargesID"]; if ((!string.IsNullOrEmpty(chargesID.Trim())) && (!chargesID.Trim().Equals("0"))) { var cities = CitiesRepo.getCities(); var data = CitiesRepo.getCityPrice(int.Parse(chargesID)); fromCity_dropDown.DataSource = cities; fromCity_dropDown.DataTextField = "cityName"; fromCity_dropDown.DataValueField = "cityID"; fromCity_dropDown.SelectedValue = data.tbl_cities.cityID.ToString(); fromCity_dropDown.DataBind(); toCity_dropDown.DataSource = cities; toCity_dropDown.DataTextField = "cityName"; toCity_dropDown.DataValueField = "cityID"; toCity_dropDown.SelectedValue = data.tbl_cities1.cityID.ToString(); toCity_dropDown.DataBind(); txt_charges.Value = data.charges; if (data.type.ToLower().Trim().Equals("sedan")) { VehicleTypeBus.Checked = false; VehicleTypeSedan.Checked = true; VehicleTypeVan.Checked = false; } else if (data.type.ToLower().Trim().Equals("van")) { VehicleTypeBus.Checked = false; VehicleTypeSedan.Checked = false; VehicleTypeVan.Checked = true; } else if (data.type.ToLower().Trim().Equals("bus")) { VehicleTypeBus.Checked = true; VehicleTypeSedan.Checked = false; VehicleTypeVan.Checked = false; } if (data.VehicleTypeIsNormal == true) { VehicleTypeEconomy.Checked = true; VehicleTypeLuxury.Checked = false; } else if (data.VehicleTypeIsNormal == false) { VehicleTypeEconomy.Checked = false; VehicleTypeLuxury.Checked = true; } } else { Response.Redirect("CitiesPricing.aspx"); } } catch (Exception) { Response.Redirect("CitiesPricing.aspx"); } }