Exemple #1
0
 private void sendNotification(ArrayList<Integer> idlist) {
   userDAO = new UserDao();
   emailnotification = new EmailNotification();
   for (Integer i : idlist) {
     try {
       User u = userDAO.find(i);
       emailnotification.sendVIPStatusNotification(u.getEmail(), u.getName(), true);
     } catch (MyException e) {
       e
           .printStackTrace(); // To change body of catch statement use File | Settings | File
                               // Templates.
     }
   }
 }
  @Override
  public String execute(HttpServletRequest request, HttpServletResponse response) throws Exception {
    // If User is not Sales Manager or Administrator
    if (request.getSession().getAttribute("utype") == null
        || (request.getSession().getAttribute("utype").toString()).equals("1")) {
      return "home";
    }

    try {
      SMDAO smDao = new SMDAO();
      PromoCodeDAO pcdao = new PromoCodeDAO();
      int idSm = smDao.getSmanagerId(request.getSession().getAttribute("email").toString());
      List<PromoCode> pclist = pcdao.getAllPCbySMid(idSm);
      request.setAttribute("allpromocodes", pclist);
    } catch (MyException ex) {
      request.setAttribute("error_message", ex.getMessage());
      return "exception";
    }
    return "smsettings";
  }