Пример #1
0
 private List<Passenger> getListOfPassengers(IFlightBLL flightBLL, int iNum)
 {
     List<Passenger> lstPassenger = new List<Passenger>();
     for (int i = 0; i < iNum; i++)
     {
         Passenger p = new Passenger();
         p.PassengerName = "Temp" + i;
         p.PassportNo = generateReservationID(6).ToUpper();
         p.ExpiryDate = DateTime.Now.AddDays(150);
         lstPassenger.Add(p);
     }
     return lstPassenger;
 }
Пример #2
0
 public int savePassenger(Passenger p)
 {
     try
     {
         flightContext.AddToPassengers(p);
         return flightContext.SaveChanges();
     }
     catch (Exception e)
     {
         throw new FlightException("Error saving the Passenger details- "+e.Message);
     }
 }
 private List<Passenger> getPassengerList(PassengerInfo[] passengers)
 {
     List<Passenger> lstPassenger = new List<Passenger>();
     Passenger p;
     foreach (PassengerInfo pInfo in passengers)
     {
         p = new Passenger();
         p.PassengerName = pInfo.PassengerName;
         p.PassportNo = pInfo.PassportNo;
         p.ExpiryDate = pInfo.ExpiryDate;
         lstPassenger.Add(p);
     }
     return lstPassenger;
 }
 /// <summary>
 /// Create a new Passenger object.
 /// </summary>
 /// <param name="passengerID">Initial value of the PassengerID property.</param>
 /// <param name="passengerName">Initial value of the PassengerName property.</param>
 /// <param name="passportNo">Initial value of the PassportNo property.</param>
 /// <param name="expiryDate">Initial value of the ExpiryDate property.</param>
 /// <param name="reservationID">Initial value of the ReservationID property.</param>
 public static Passenger CreatePassenger(global::System.Int32 passengerID, global::System.String passengerName, global::System.String passportNo, global::System.DateTime expiryDate, global::System.String reservationID)
 {
     Passenger passenger = new Passenger();
     passenger.PassengerID = passengerID;
     passenger.PassengerName = passengerName;
     passenger.PassportNo = passportNo;
     passenger.ExpiryDate = expiryDate;
     passenger.ReservationID = reservationID;
     return passenger;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the Passengers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPassengers(Passenger passenger)
 {
     base.AddObject("Passengers", passenger);
 }
Пример #6
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Passengers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPassengers(Passenger passenger)
 {
     base.AddObject("Passengers", passenger);
 }