コード例 #1
0
 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;
 }
コード例 #2
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 );
 }
コード例 #3
0
 private void CreateAndSetStaff(String username)
 {
     currentStaff = DBFacade.GetStaffByUsername(username);
 }
コード例 #4
0
 public void AddStaff(Staff staff)
 {
     staffs.Add(staff);
 }
コード例 #5
0
        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("خطا در رزرو");
        }