private void cargaPasajeros(ListaVuelos lv) { lpO.Clear(); foreach (Vuelo v in lv) { foreach (Pasajero p in v.getLp()) { lpO.Add(p); actializarListBoxt(lpO); } } lpF = lpO; }
public void setPasajero(Pasajero p) { lp.Add(p); }
public ListaPasajeros busquedaPasajeros(int opc, string dato) { ListaPasajeros lpF = new ListaPasajeros(); dato = dato.ToUpper(); int aux; switch (opc) { case 1: for (int i = 0; i < this.Count; i++) { int j; for (j = 0; j < dato.Length; j++) { if (this[i].getNomAp()[j] != dato[j]) { break; } } if (j == dato.Length) { lpF.Add(this[i]); } } break; case 2: for (int i = 0; i < this.Count; i++) { int j; for (j = 0; j < dato.Length; j++) { if (this[i].getRuta()[j] != dato[j]) { break; } } if (j == dato.Length) { lpF.Add(this[i]); } } break; case 3: Int32.TryParse(dato, out aux); for (int i = 0; i < this.Count; i++) { int j; for (j = 0; j < dato.Length; j++) { if (this[i].getAsiento() != aux) { break; } } if (j == dato.Length) { lpF.Add(this[i]); } } break; } return(lpF); }