示例#1
0
 private void btnRemoveLuggage_Click(object sender, RoutedEventArgs e)
 {
     if (lbxLuggage.SelectedItem != null)
     {
         L = (Luggage)lbxLuggage.SelectedItem;
         luggage.Remove(L);
         lbxLuggage.Items.Refresh();
     }
 }
示例#2
0
 //METHODS
 //Adds luggage to list
 public void AddLuggage(Luggage l)
 {
     //Evaluates if weight is higher than 0
     if (l.Weight > 0)
     {
         //Adds luggage to list
         luggage.Add(l);
     }
 }
示例#3
0
        //EVENT HANDLERS
        private void btnAddPassenger_Click(object sender, RoutedEventArgs e)
        {
            int result;

            int.TryParse(tbxLuggage.Text, out result);
            Luggage luggage = new Luggage(result);

            newPassenger = new Passenger(tbxTicketNumber.Text, tbxFirstName.Text, tbxLastName.Text, luggage);
            Close();
        }
示例#4
0
 //CONSTRUCTORS
 public Passenger(string ticketNumber, string firstName, string lastName, Luggage l)
 {
     TicketNumber = ticketNumber;
     FirstName    = firstName;
     LastName     = lastName;
     //Evaluates if weight is larger than 0
     if (l.Weight > 0)
     {
         //Adds luggage to list
         luggage.Add(l);
     }
 }
示例#5
0
 //Removes luggage from list
 public void RemoveLuggage(Luggage l)
 {
     //Removes luggage from list
     luggage.Remove(l);
 }