}
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);
}
}