public DisplayTable(DataBase1Client _client) { client = _client; InitializeComponent(); Task <getStopsResponse> __stops = client.getStopsAsync(); stops = __stops.Result.stop; foreach (stop s in stops) { ListBusStops.Items.Add(s.name); } }
public DriverSession(DataBase1Client _client) { client = _client; InitializeComponent(); Task <getDriversResponse> __drivers = client.getDriversAsync(); Task <getBusesResponse> __buses = client.getBusesAsync(); Task <getLinesResponse> __lines = client.getLinesAsync(); Task <getStopsResponse> __stops = client.getStopsAsync(); drivers = __drivers.Result.driver; buses = __buses.Result.bus; lines = __lines.Result.line; stops = __stops.Result.stop; if (drivers.Length == 0) { MessageBox.Show("No drivers found. Can't proceed"); Close(); } if (buses.Length == 0) { MessageBox.Show("No buses found. Can't proceed"); Close(); } if (lines.Length == 0) { MessageBox.Show("No lines found. Can't proceed"); Close(); } foreach (driver d in drivers) { ListDrivers.Items.Add(string.Format("{0} {1}", d.firstName, d.lastName)); } foreach (line l in lines) { ListLines.Items.Add(string.Format("{0}: {1} - {2}", l.name, getStopName(l.stops.First().a), getStopName(l.stops.Last().b))); } foreach (bus b in buses) { ListBuses.Items.Add(string.Format("#{0}: {1} {2}", b.id, b.brand, b.model)); } ListDrivers.SelectedIndex = 0; ListLines.SelectedIndex = 0; ListBuses.SelectedIndex = 0; }
public MainWindow() { InitializeComponent(); client = new DataBase1Client(); }