private void clear() { dpFromCity.Items.Clear(); dpToCity.Items.Clear(); dpAirlineName.Items.Clear(); dpFlightName.Items.Clear(); DropDownList1.Items.Clear(); DropDownList2.Items.Clear(); DropDownList4.Items.Clear(); DropDownList5.Items.Clear(); DropDownList1.Items.Add("None"); DropDownList4.Items.Add("None"); for (int i = 1; i <= 24; i++) { DropDownList1.Items.Add(i.ToString()); DropDownList4.Items.Add(i.ToString()); } DropDownList1.DataBind(); DropDownList4.DataBind(); DropDownList2.Items.Add("None"); DropDownList5.Items.Add("None"); for (int i = 0; i <= 59; i++) { DropDownList2.Items.Add(i.ToString()); DropDownList5.Items.Add(i.ToString()); } DropDownList2.DataBind(); DropDownList5.DataBind(); txtDuration.Enabled = false; txtDuration.Text = ""; chkStatus.Checked = false; ICityManager cityManager = (ICityManager)AirTravelManagerFactory.Create("City"); try { List <City> cities = cityManager.GetCities(); dpFromCity.Items.Add("None"); foreach (City c in cities) { ListItem item = new ListItem(c.Name, c.CityId.ToString()); dpFromCity.Items.Add(item); } dpFromCity.DataBind(); dpToCity.Items.Add("None"); foreach (City c in cities) { ListItem item = new ListItem(c.Name, c.CityId.ToString()); dpToCity.Items.Add(item); } dpToCity.DataBind(); } catch (CityManagerException e) { lblError.Text = e.Message; } IAirLineManager airlineManager = (IAirLineManager)AirTravelManagerFactory.Create("Airline"); try { List <Airline> airlines = airlineManager.GetAirLines(); dpAirlineName.Items.Add("None"); foreach (Airline c in airlines) { ListItem item = new ListItem(c.Name, c.Id.ToString()); dpAirlineName.Items.Add(item); } dpAirlineName.DataBind(); } catch (AirlineManagerException e) { lblError.Text = e.Message; } var travelClassvalues = Enum.GetValues(typeof(TravelClass)).Cast <TravelClass>(); Repeater1.DataSource = travelClassvalues; Repeater1.DataBind(); }
private void clear() { dpAirlineName.Items.Clear(); dpFlightName.Items.Clear(); dpDepartHours.Items.Clear(); dpDepartMins.Items.Clear(); dpArrivalHours.Items.Clear(); dpArrivalMins.Items.Clear(); dpDepartHours.Items.Add("None"); dpArrivalHours.Items.Add("None"); for (int i = 0; i < 24; i++) { dpDepartHours.Items.Add(i.ToString()); dpArrivalHours.Items.Add(i.ToString()); } //dpDepartMins.Items.Add("None"); //dpArrivalMins.Items.Add("None"); for (int i = 0; i <= 59; i += 10) { dpDepartMins.Items.Add(i.ToString()); dpArrivalMins.Items.Add(i.ToString()); } txtDuration.Enabled = false; txtDuration.Text = ""; chkStatus.Checked = false; IRouteManager routeManager = (IRouteManager)BusinessObjectManager.GetRouteManager(); try { List <Route> routes = routeManager.GetRoutes(); dpRoute.Items.Add(new ListItem("Select Route...", "-1")); foreach (Route route in routes) { string r = route.FromCity.Name + " (" + route.FromCity.StateInfo.Name + ")" + " ==> " + route.ToCity.Name + " (" + route.ToCity.StateInfo.Name + ")"; string v = route.ID.ToString(); dpRoute.Items.Add(new ListItem(r, v)); } } catch (RouteManagerException e) { ctlAdminMaster.ErrorMessage = e.Message; } IAirLineManager airlineManager = (IAirLineManager)AirTravelManagerFactory.Create("AirlineManager"); try { List <Airline> airlines = airlineManager.GetAirLines(); dpAirlineName.Items.Add("None"); foreach (Airline c in airlines) { ListItem item = new ListItem(c.Name, c.Id.ToString()); dpAirlineName.Items.Add(item); } dpAirlineName.DataBind(); } catch (AirlineManagerException e) { ctlAdminMaster.ErrorMessage = e.Message; } ShowDefaultClasses(); }