public string GetTicketInfo(int id, Passenger[] passengers, Flight[] flights, string ticketID) { if (id == this.id) { for (int i = 0; i < tickets.Count; i++) { if (((Ticket)tickets[i]).ticketFound(ticketID)) { return ((Ticket)tickets[i]).getInfo(passengers, flights, ticketID); } } } return "Ticket not found!\n"; }
public virtual string GetTicketInfo(int id, Passenger[] passengers, Flight[] flights) { string txt = ""; if (id == this.id) { for (int i = 0; i < tickets.Count; i++) { if (txt != "") txt += "\n"; txt += ((Ticket)tickets[i]).getInfo(passengers, flights); txt += "\nTicket type: Economy"; txt += "\nLuggage limit: " + luggageWeight + " [kg]"; txt += "\n ----------- "; } } return txt; }
public string getInfo(Passenger[] passangers, Flight[] flights, string ticketID) { string text = ""; if (ticketID == this.ticketID) { for (int i = 0; i < passangers.Length; i++) { if (((Passenger)passangers[i]).customerFound(passengerID)) { text += "Ticket ID : " + this.ticketID + "\n"; text += (((Passenger)passangers[i]).GetInfo(passengerID)) + "\n"; } } for (int i = 0; i < flights.Length; i++) { if (((Flight)flights[i]).flightFound(flight.getFlightID())) { text += (((Flight)flights[i]).getFlightInfo(flight.getFlightID())); } } float price = getPrice(ticketID); if (price != -1) text += "\nPrice: " + price + " Euro"; } return text; }
public override string GetTicketInfo(int id, Passenger[] passengers, Flight[] flights) { string txt = ""; if (id == this.id) { for (int i = 0; i < tickets.Count; i++) { if (txt != "") txt += "\n"; txt += ((Ticket)tickets[i]).getInfo(passengers, flights); txt += "\nTicket type: First Class"; txt += "\nLuggage limit: " + luggageWeight + " [kg]"; txt += "\nMeal menu: " + mealMenu; txt += "\n ----------- "; } } return txt; }