示例#1
0
  public Offer getOffer(String username) {
    if (username == null) {
      return null;
    }
    List<Offer> offers = offersDAO.getOffers(username);

    if (offers.size() == 0) {
      return null;
    }
    return offers.get(0);
  }
示例#2
0
  public boolean hasOffer(String name) {
    if (name == null) {
      return false;
    }

    List<Offer> offers = offersDAO.getOffers(name);
    if (offers.size() == 0) {
      return false;
    }

    return true;
  }
示例#3
0
 public void delete(int id) {
   offersDAO.delete(id);
 }
示例#4
0
 public void saveOrUpdate(Offer offer) {
   offersDAO.saveOrUpdate(offer);
 }
示例#5
0
 @Secured({"ROLE_USER", "ROLE_ADMIN"})
 public void create(Offer offer) {
   offersDAO.saveOrUpdate(offer);
 }
示例#6
0
 public List<Offer> getCurrent() {
   return offersDAO.getOffers();
 }