public String execute() throws Exception { Offer offer = new Offer(); offer.setDescription(description); offer.setStartingCity(startingCity); offer.setFinishingCity(finishingCity); offer.setNumberOfPlaceInitial(numberOfPassengers); offer.setNumberOfPlaceRemaining(numberOfPassengers); offer.setPricePerPassenger(pricePerPassenger); Route route = new Route(); route.setStartingAddress(""); route.setStartingCity(startingCity); route.setFinishingAddress(""); route.setFinishingCity(finishingCity); route.setRouteOrder(1); route.setPrice(0f); route.setConversionRateToEuro(0f); route.setCurrencyCode(""); List<Route> routes = new ArrayList<Route>(); routes.add(route); OfferDAO offerDAO = SpringDAO.getSpring().getOfferDAO(); offerDAO.saveOfferWithRoutes(offer, routes, idCustomerAccount, isDriver); return SUCCESS; }
public String execute() throws Exception { System.out.println("execute numberOfMessage"); // Gestion des messages MessageDAO messageDAO = SpringDAO.getSpring().getMessageDAO(); setNbMessageNotRead(messageDAO.nbMessageNotRead(getCustomerAccount().getId())); setNumberOfMessage(getNbMessageNotRead()); System.out.println("getNbMessageNotRead() : " + getNbMessageNotRead()); return SUCCESS; }