public String addHistory() { history.setDriver(dm.getDriver(driverId)); history.setBus(bm.getBus(busId)); history.setRoute(rm.getRoute(routeId)); history.setDate(date); hm.addHistory(history); history = new History(); driverId = 0L; busId = 0L; routeId = 0L; historiesForDate = hm.getHistoryByDate(date); return "showLines?faces-redirect=true"; }
public String deleteHistory() { History historyToDelete = histories.getRowData(); hm.deleteHistory(historyToDelete); return null; }
public ListDataModel<History> getAllHistories() { histories.setWrappedData(hm.getAllHistory()); return histories; }
public void setDate(Date date) { historiesForDate = hm.getHistoryByDate(date); this.date = date; }