Exemple #1
0
 private void btnSearchClick(object sender, RoutedEventArgs e)
 {
     try
     {
         var busData = BusDataService.GetBusDataByName(tbSearch.Text);
         if (busData != null)
         {
             ShowBusView();
             tbName.Text         = busData.Name;
             tbModel.Text        = busData.Model;
             tbSeats.Text        = busData.Seats.ToString();
             tbLocalization.Text = busData.Localization;
             tbWidth.Text        = busData.Width.ToString();
             tbLength.Text       = busData.Length.ToString();
         }
         else
         {
             HideBusView();
             lblNoResult.Visibility = Visibility.Visible;
         }
     }
     catch (Exception ex)
     {
         // TODO: Show dialog box
     }
 }
Exemple #2
0
        private void btnShowPassengers_Click(object sender, RoutedEventArgs e)
        {
            var busData = BusDataService.GetBusDataByName(tbName.Text);



            PassengersWindow passengersWindow = new PassengersWindow(busData.Passengers);

            passengersWindow.Show();
        }