/*USED IN THE MODIFICATION OF THE TRIP'S INFORMATIONS: * * DETAILS : This function update the informations of a selected trip * RETURN :TRUE if the trip had been updated, FALSE otherwise * */ public bool updateTrip(int numTrip, String nombre, DateTime date, String notes, Boolean state, String ville, String pais, String continente) { bool updated = false; TripCAD trip = new TripCAD(); updated = trip.updateTripCAD(numTrip, nombre, date, notes, state, ville, pais, continente); return updated; }
/*USED IN THE EDITION OF TRIP * * DETAILS :This function edit the information of a selected trip * RETURN :An object trip. * */ public TripClass printOneTrip(int numTrip) { TripClass trip = new TripClass(); TripCAD tripDB = new TripCAD(); trip = tripDB.printOneTripCAD(numTrip); return trip; }
/*USED FOR DELETE A TRIP * * DETAILS :Delete a trip * PARAMETERS :The ID of the trip * RETURN :TRUE is the trip has been deleted, FALSE orthewise * */ public bool deleteTrip(int numTrip) { bool added = false; TripCAD trip = new TripCAD(); added = trip.deleteTripCAD(numTrip); return added; }
/*USED IN THE EDITION OF ALL THE TRIPS OF A GIVEN USER * * DETAILS :Retrieve a collection of all the trip in the DB. * PARAMETERS :numUser => The ID of the user * RETURN :An object DATASET with all the trip * */ public DataSet printAllTrip(int numUser) { DataSet bdvirtual = new DataSet(); TripCAD trip = new TripCAD(); bdvirtual = trip.printAllTripCAD(numUser); return bdvirtual; }
/************************************ * METHODS OF CLASS * **********************************/ /*USED IN THE TRIP CREATION PROCESS * * DETAILS : This function create a new trip * PARAMETERS :Name of trip, city, country, continente, date of trip, state of trip, comments about the trip, the user ID owner of the trip * RETURN :TRUE if the trip has been create, FALSE orthewise * */ public bool addTrip(String nombre, DateTime date, String notes, Boolean state, String ville, String pais, String continente, int user) { bool added = false; TripCAD trip = new TripCAD(); added = trip.addTripCAD(nombre, date, notes, state, ville, pais, continente, user); return added; }