Beispiel #1
0
 public void SearchPassengerToMove(int pas)
 {
     try
     {
         if (pas == 1)
         {
             Passenger1 = Passengers.FirstOrDefault(p => p.Seat == Seat1);
             if (Passenger1 == null)
             {
                 ErrorMessage = "There is no passenger on this seat!";
             }
             else
             {
                 ErrorMessage = null;
             }
         }
         else if (pas == 2)
         {
             Model.Passenger ps = Passengers.FirstOrDefault(p => p.Seat == Seat2);
             if (ps != null)
             {
                 Passenger2    = ps;
                 ErrorMessage2 = null;
             }
             else
             {
                 ErrorMessage2 = "There is no passenger on this seat! You can move the passenger to this seat.";
             }
         }
     }
     catch (Exception)
     {
         ErrorMessage = "Something went wrong! Please try again later.";
     }
 }