public void RemoveLuggage(Luggage l) { if (Luggage.Exists(x => x == l)) { Luggage.Remove(l); } }
public Ticket(string travelClass, int ticketNo, Luggage luggage, Passenger passenger, Flight flight, bool hasHandLuggage) { TravelClass = travelClass; TicketNo = ticketNo; Luggage = luggage; Passenger = passenger; Flight = flight; HasHandLuggage = hasHandLuggage; CalculateTotalPrice(); CalculateTotalWeight(); Date = flight.DepartureTime.ToString("dd-MM-yyyy"); Time = flight.DepartureTime.ToString("HH:mm:ss"); }
public bool AddLuggage(Luggage luggage) { bool success = true; if (luggage.Weight < AvailableLoadCapacity()) { Luggage.Add(luggage); success = true; } else { success = false; } return(success); }