Examples of MerchantSession


Examples of org.bat.client.model.MerchantSession

          session.save(myCustomer);
          tx.commit();
          myHandler.debugInfo(".. added to the database with id: "+myCustomer.getId());
        }
        tx = session.beginTransaction();
        activeSession = new MerchantSession();
        activeSession.setCustomer(myCustomer);
        session.save(activeSession);
        tx.commit();
        session.close();
        myHandler.debugInfo("Started session for customer "+activeSession.getCustomer().getName()+".");
      }
      return "";
    } else if (COMMAND_MERCHANT_STOPSESSION.equals(commandName)) {
      if (activeSession == null) {
        printMerchantWarning("No merchant session active. Start session first.");
      } else {
        Session session = HibernateUtil.getSessionFactory().openSession();
        Transaction tx = session.beginTransaction();
        activeSession.setSessionEnd(new Date());
        session.update(activeSession);
        tx.commit();
        session.close();
        myHandler.debugInfo("Stopped session for customer "+activeSession.getCustomer().getName()+".");
        printMerchantWarning("Finished session for customer "+activeSession.getCustomer().getName()+".");
        myHandler.doCommand("mercview "+activeSession.getId());
        activeSession = null;
      }
      return "";
    } else if (COMMAND_MERCHANT_VIEWSESSION.equals(commandName) || COMMAND_MERCHANT_VIEWSESSION_DETAILS.equals(commandName)) {
      Session session = HibernateUtil.getSessionFactory().openSession();
      MerchantSessionHibernateDAO mercDAO = new MerchantSessionHibernateDAO();
      mercDAO.setSession(session);
      MerchantSession viewMS;
      try {
        Transaction tx = session.beginTransaction();
        viewMS = mercDAO.findById(new Integer(commandMatcher.group(1)), false);
        tx.commit();
        if (COMMAND_MERCHANT_VIEWSESSION.equals(commandName))
View Full Code Here

Examples of org.bat.client.model.MerchantSession

      }
    } else if (TRIGNAME_VIEW_RECEIPT.equals(triggerName) || TRIGNAME_VIEW_RECEIPT_DETAILS.equals(triggerName)) {
      Session session = HibernateUtil.getSessionFactory().openSession();
      MerchantSessionHibernateDAO mercDAO = new MerchantSessionHibernateDAO();
      mercDAO.setSession(session);
      MerchantSession viewMS;
      String queryPlayer = triggerMatcher.group(1);
      try {
        Transaction tx = session.beginTransaction();
        viewMS = mercDAO.findById(new Integer(triggerMatcher.group(2)), false);
        tx.commit();
        if (queryPlayer.equalsIgnoreCase(viewMS.getCustomer().getName())) {
          tx = session.beginTransaction();
          viewMS = mercDAO.fetchWithServices(viewMS);
          tx.commit();
          triggerPatterns.put(TRIGNAME_GAG_EMOTES, Pattern.compile("^Ok[.]$", Pattern.CASE_INSENSITIVE));
          if (TRIGNAME_VIEW_RECEIPT.equals(triggerName)) {
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.