private void Initial(Guid ID, Flight flight, Passenger passenger, Staff salesman, uint seatNumber, DateTime time, ReservationState state, Nullable<DateTime> cancelTime)
 {
     this.ID = ID;
     this.flight = flight;
     this.passenger = passenger;
     this.salesman = salesman;
     this.reservationDate = time;
     this.seatNumber = seatNumber;
     this.reservationState = state;
     this.cancelTime = cancelTime;
 }
Esempio n. 2
0
 public void AddPassenger(Passenger passenger)
 {
     passengers.Add(passenger);
 }
 public void AddPassenger(Passenger passenger)
 {
     passengers.Add(passenger);
 }
 public Reservation(Guid ID, Flight flight, Passenger passenger, Staff saleman, uint seatNumber, DateTime time, ReservationState state, Nullable<DateTime> cancelTime)
 {
     Initial(ID, flight, passenger, salesman, seatNumber, time, state, cancelTime );
 }
Esempio n. 5
0
 public Reservation(Guid ID, Flight flight, Passenger passenger, Staff saleman, uint seatNumber, DateTime time, ReservationState state, Nullable <DateTime> cancelTime)
 {
     Initial(ID, flight, passenger, salesman, seatNumber, time, state, cancelTime);
 }
        private void CreateAndInsertReservation(Flight flight, Passenger passenger, Staff salesman, uint seatNumber)
        {
            //TODO: I must set time to time inserted in DB
            Reservation reservation = new Reservation(flight, passenger, salesman, seatNumber,new DateTime(),ReservationState.Resereved, null);

            ServiceFactory.GetReservations().AddReservation(reservation);

            Nullable<Guid> reservationID = DBFacade.InsertReservationAndReturnID(flight.GetID(), passenger.GetID(), currentStaff.GetID(), seatNumber);
            if (reservationID != null)
            {
                reservation.SetID((Guid)reservationID);
                MessageBox.Show("رزرو با موافقیت انجام شد");
            }
            else
                MessageBox.Show("خطا در رزرو");
        }
        private Passenger CreateAndInsertPassenger(String fName, String lName, uint age, Gender gender, String nationalCode)
        {
            Passenger passenger = new Passenger(fName, lName, age, gender, nationalCode);

            ServiceFactory.GetPassengers().AddPassenger(passenger);

            Guid passengerID = DBFacade.InsertPassengerAndReturnID(fName, lName, age, gender.ToString(), nationalCode);
            passenger.SetID(passengerID);

            return passenger;
        }