Package databeans

Examples of databeans.MedLog


    }
  }
  public void create(MedLog med) throws DAOException {
    try{
      Transaction.begin();
      MedLog dbMed = factory.create(med.getMedId());
      factory.copyInto(med,dbMed);
      Transaction.commit();
    }catch(DuplicateKeyException e){
      throw new DAOException("A log medication belongs to " + med.getOwner() + "has already existed.");
    }catch(RollbackException e){
View Full Code Here


          }
          dayCheckDL = dayCheckDL.substring(4,dayCheckDL.length());*/
          //if user want some medication schedule be deleted.
          if(delMed != null){
            newMed = delMed;
            addLogMed = new MedLog(Integer.parseInt(newMed));
            addLogMed.setOwner(user.getEmailAddress());
            createLogMed(addLogMed,form);
            //create a new user.
            logmedDAO.create(addLogMed);
          //if no scheduled medication be deleted.
          }else{
            int allSize = logmedDAO.size();
            //initialization situation.
            if(allSize == 0){
              newMed = Integer.toString(allSize);
              addLogMed = new MedLog(Integer.parseInt(newMed));
              addLogMed.setOwner(user.getEmailAddress());
                createLogMed(addLogMed,form);
                logmedDAO.create(addLogMed);
            }else{
              allSize = logmedDAO.getLastId();
              newMed = Integer.toString(allSize);
              addLogMed = new MedLog(Integer.parseInt(newMed) + 1);
              addLogMed.setOwner(user.getEmailAddress());
                createLogMed(addLogMed,form);
                logmedDAO.create(addLogMed);
            }
          }
View Full Code Here

TOP

Related Classes of databeans.MedLog

Copyright © 2018 www.massapicom. 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.