public void setStartDate(Date time) { try { _rentalApi.setStartDate(time); } catch (NoPermissionException e) { // TODO Auto-generated catch block e.printStackTrace(); } _rental = _rentalApi.getRental(); updateMessages(); }
public void loadExemplar(int exemplarId) { try { _rentalApi.setMediumExemplar(exemplarId); _rental = _rentalApi.getRental(); updateMessages(); } catch (NoPermissionException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void loadCustomer(int cardId) { try { _rentalApi.setCustomer(cardId); _rental = _rentalApi.getRental(); updateMessages(); } catch (NoPermissionException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void initialize() throws InvalidOperationException { try { _rentalApi = EjbContext.getInstance().getFactory().createRentalApi(); _rentalApi.newRental(); _rental = _rentalApi.getRental(); } catch (NoPermissionException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); throw new InvalidOperationException("Could not establish connection to server:", e); } }
public boolean store() { try { return _rentalApi.store(); } catch (NoPermissionException e) { // TODO Auto-generated catch block e.printStackTrace(); } return false; }
private void updateMessages() { java.util.List<ValidationMessage> remoteList = _rentalApi.getValidationMessages(); _warningMessages = new ArrayList<ValidationMessage>(); _errorMessages = new ArrayList<ValidationMessage>(); for (ValidationMessage validationMessage : remoteList) { if (validationMessage.getStatus() == ValidationMessageStatus.Warning) { _warningMessages.add(validationMessage); } else if (validationMessage.getStatus() == ValidationMessageStatus.Error) { _errorMessages.add(validationMessage); } } }