public override IAnswer execute()
        {
            Database.FlightRequest fr = new Database.FlightRequest ();
            List<Database.Flight> flights = fr.fetchFlightFromCodeAndStartDate (flight.Template.Code, flight.StartDate);
            if (flights.Count != 1) {
                return new AnswerAdd ("No (unique) flight with code " + flight.Template.Code + " at " + flight.StartDate);
            }
            int flightID = flights [0].ID;

            Database.SeatRequest sr = new Database.SeatRequest ();
            List<Database.Seat> seats = sr.fetchSeatFromFlightAndNumber (flightID, seat.Number);
            if (seats.Count != 1) {
                return new AnswerAdd("No (unique) seat with number " + seat.Number + " at flight with code " + flight.Template.Code + " at " + flight.StartDate);
            }
            int seatID = seats[0].ID;
            Database.SeatPrice sp = new Database.SeatPrice(seatID, flightID, price);

            try{
                sp.insert();
            } catch(Exception e){
                return new AnswerAdd(e.Message);
            }

            return new AnswerAdd();
        }
        public override IAnswer execute()
        {
            Database.SeatPriceRequest spr = new Database.SeatPriceRequest ();
            Database.SeatRequest sr = new Database.SeatRequest ();
            Database.FlightRequest fr = new Database.FlightRequest ();

            List<Database.Flight> flights = fr.fetchFlightFromCodeAndStartDate (flight.Template.Code, flight.StartDate);
            if (flights.Count != 1) {
                throw new Exception ("No (unique) flight with code " + flight.Template.Code + " and start date " + flight.StartDate + " could be found");
            }
            int flightID = flights [0].ID;

            List<Database.Seat> seats = sr.fetchSeatFromFlightAndNumber (flightID, seat.Number);
            if (seats.Count != 1) {
                throw new Exception ("No (unique) seat with number " + seat.Number + " is found on flight with code " + flight.Template.Code + " and start date " + flight.StartDate);
            }
            int seatID = seats [0].ID;

            List<Database.SeatPrice> seatPrices = spr.fetchSeatPriceFromSeatAndFlight (seatID, flightID);
            if (seatPrices.Count != 1) {
                throw new Exception("No (unique) seat price found for seat with number " + seat.Number + " is found on flight with code " + flight.Template.Code + " and start date " + flight.StartDate);
            }

            SeatPrice sp = new SeatPrice(seat, flight, seatPrices[0].price);
            return new AnswerGetSeatPrice(sp);
        }
        public override IAnswer execute()
        {
            Database.SeatRequest sr = new Database.SeatRequest ();
            Database.FlightRequest fr = new Database.FlightRequest ();

            List<Database.Seat> databaseSeats = new List<Database.Seat> ();

            List<Database.Flight> flights = fr.fetchFlightFromCodeAndStartDate (flight.Template.Code, flight.StartDate);
            if (flights.Count != 1) {
                throw new Exception("No (unique) flight found with code " + flight.Template.Code + " and start date " + flight.StartDate);
            }
            int flightID =  flights[0].ID;

            if (seatClass != null) {
                Database.ClassRequest cr = new Database.ClassRequest ();
                List<Database.Class> classes = cr.fetchClassFromName (seatClass.Name);
                if(classes.Count != 1){
                    throw new Exception("No (unique) class found with name " + seatClass.Name);
                }
                int classID =  classes[0].ID;

                databaseSeats = sr.fetchSeatFromFlighAndClass (flightID, classID);
            } else {
                databaseSeats = sr.fetchSeatFromFlight (flightID);
            }

            List<Seat> seats = new List<Seat>();
            Database.ClassRequest clr = new Database.ClassRequest();
            foreach (Database.Seat s in databaseSeats) {
                SeatClass sc = new SeatClass(clr.fetchFromID(s.class_)[0].name);
                seats.Add(new Seat(sc, s.number));
            }

            return new AnswerGetSeats(seats);
        }
        public override IAnswer execute()
        {
            Database.FlightRequest fr = new Database.FlightRequest ();
            Database.PassengerRequest pr = new Database.PassengerRequest ();
            Database.SeatRequest sr = new Database.SeatRequest ();
            Database.ClassRequest cr = new Database.ClassRequest ();
            Database.AirplaneRequest ar = new Database.AirplaneRequest ();

            List<Database.Class> classes = cr.fetchClassFromName (this.Booking.Seat.SeatClass.Name);
            if (classes.Count != 1) {
                return new AnswerAdd ("No (unique) class found with name " + this.Booking.Seat.SeatClass.Name);
            }
            int classID = classes [0].ID;

            List<Database.Flight> flights = fr.fetchFlightFromCodeAndStartDate (code: this.Booking.Flight.Template.Code, startDate: this.Booking.Flight.StartDate);
            if (flights.Count != 1) {
                return new AnswerAdd("No (unique) flight found with code " + this.Booking.Flight.Template.Code + " at " + this.Booking.Flight.StartDate);
            }
            Database.Flight flight = flights[0];
            int flightID = flight.ID;

            List<Database.Airplane> airplanes = ar.fetchFromID (flight.airplane);
            int airplaneID = airplanes[0].ID;

            List<Database.Seat> seats = sr.fetchSeatFromClassNumberAndAirplane (class_: classID, number: this.Booking.Seat.Number, airplane: airplaneID);
            if (seats.Count != 1) {
                return new AnswerAdd ("No (unique) seat found with number " + this.Booking.Seat.Number + " from class " + this.Booking.Seat.SeatClass.Name);
            }
            int seatID = seats [0].ID;

            List<Database.Passenger> passengers = pr.fetchPassengerFromName (this.Booking.Passenger.Name);
            if (passengers.Count != 1) {
                return new AnswerAdd ("No (unique) passenger found with name " + this.Booking.Passenger.Name);
            }
            int passengerID = passengers [0].ID;

            Database.Booking booking = new Database.Booking (flight: flightID, passenger: passengerID, seat: seatID);
            AnswerAdd aa = new AnswerAdd ();

            try {
                booking.insert();
            } catch (Exception e) {
                aa = new AnswerAdd(e.Message);
            }

            return aa;
        }