private void UpdateAllTable() { FlightsService service = Service.getInstanse().flightService; DataTable FlightPriceTable; if (service.GetFlightsPrice(out FlightPriceTable)) { GridView.DataSource = FlightPriceTable; GridView.DataBind(); } DataTable FlightCitiesTable; if (service.GetFlightsCities(out FlightCitiesTable)) { DropDownListDeparture.Items.Clear(); DropDownListArrival.Items.Clear(); foreach (DataRow row in FlightCitiesTable.Rows) { DropDownListDeparture.Items.Add((string)row[0]); DropDownListArrival.Items.Add((string)row[0]); } } }
private void LoadData() { FlightsService service = Service.getInstanse().flightService; DataTable AllFlightsTable; if (service.GetAllFlights(out AllFlightsTable)) { IdTickets.Clear(); foreach (DataRow row in AllFlightsTable.Rows) { IdTickets.Add(Convert.ToInt32(row[0])); } AllFlightsTable.PrimaryKey = null; AllFlightsTable.Columns.RemoveAt(0); GridView.DataSource = AllFlightsTable; GridView.DataBind(); } DropDownListDeparture.Items.Clear(); DataTable FlightCityTable; if (service.GetFlightsCities(out FlightCityTable)) { foreach (DataRow row in FlightCityTable.Rows) { DropDownListDeparture.Items.Add((string)row[0]); } } OnChangeDepartureCity(null, EventArgs.Empty); UpdateEnableAddTicket(); }