Examples of NotificationBean


Examples of burhan.bean.NotificationBean

    }*/
  }
 
  private void addTransaction(HttpServletRequest request, HttpServletResponse response) throws IOException
  {
    NotificationBean notificationBean =  new NotificationBean();
    if(isPost){
      // recive post data
      String type = request.getParameter("type");
      String dateStr = request.getParameter("date");
      String amountStr = request.getParameter("amount");
      String description = request.getParameter("description");
     
      // valiadation
      Date date = null;
      float amount = 0;     
      type = "EARNING".equals(type) ? "EARNING" : "EXPENSE";
      try {
        DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy");
        date = formatter.parse(dateStr);
      } catch (ParseException e) {
        // do nothing
      }
      try
      {
        amount = Float.valueOf(amountStr).floatValue();
      } catch (Exception e) {
        // do nothing
      }
     
      // set notifications
      if(date == null){
        notificationBean.addError("Please enter a valid date");
      }
      if(amount == 0){
        notificationBean.addError("Please enter an valid amount");
      }
     
      // store data
      if(notificationBean.getErrorCount() == 0 ){
       
            Key transactionKey = KeyFactory.createKey("UserTransactions", user.getUserId());

            Entity t = new Entity("Transaction", transactionKey);
            t.setProperty("type", type);
View Full Code Here

Examples of org.encuestame.utils.mail.NotificationBean

    /**
     * Test {@link NotificationBean}.
     */
    @Test
    public void testNotificationBean(){
        final NotificationBean ib = new NotificationBean();
        ib.setCode("code");
        ib.setEmail("juan@encuestame.org");
        ib.setMessage("message");
        ib.setUrlUnsuscribe("unUrl");
        assertNotNull(ib.getCode());
        assertNotNull(ib.getEmail());
        assertNotNull(ib.getMessage());
        assertNotNull(ib.getUrlUnsuscribe());
    }
View Full Code Here

Examples of org.encuestame.utils.mail.NotificationBean

    public void testSendNotificationEmail() throws Exception{
          final List<Email> emailList = getCatEmailDao().findEmailsByListId(
                  this.emailList.getIdList());
          for (Email emails : emailList) {
                assertNotNull(emails.getEmail());
                final NotificationBean notification = new NotificationBean();
                notification.setCode("5678");
                notification.setEmail(emails.getEmail());
                notification.setMessage("My personal message");
                notification.setUrlUnsuscribe(URLPOLL);
                mailService.sendEmailNotification(notification);
              }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.