Package org.sis.ancmessaging.server.domain

Examples of org.sis.ancmessaging.server.domain.Reminder


                    LocalDate eddEth = eddGreg.withChronology(EthiopicChronology.getInstance()).toLocalDate();
                    String date = eddEth.getDayOfMonth() + "/" + eddEth.getMonthOfYear() + "/" + eddEth.getYear();
                    String gott = (mother.getGott() == null) ? "Urban" : mother.getGott();
                    String template = "ID: " + mother.getSeqId() + "\n" + mother.getFullName() + "\n" + gott + "\nEDD: " + date;

                    Reminder reminder = new Reminder();
                    reminder.setStatus("UNCONFIRMED");
                    reminder.setContent(template);
                    reminder.setMother(mother);
                    reminder.setReminderSentOn(new DateTime().toLocalDate().toDate());
                    reminder.setReminderType(textMessage.getMessageType());
                    reminderDao.save(reminder);
                } else {
                    if (textMessage.getStatus().equals("P")) {
                        textMessageDao.changeStatus(textMessage, "R");
                    }
                }
            }
            mainForm.setLogText("\nProcess completed.");
            return;
        }

        String content = inboundMessage.getText().trim();
        String identifier = content.substring(0, 1);
        int seqId = Integer.parseInt(content.substring(2).trim());
        Mother mother = motherDao.getMother(seqId);
       
        if (identifier.equals("1") || identifier.equals("2")) {
            mainForm.setLogText("\n\n" + new DateTime().toString());
        }
       
        if (identifier.equals("1")) {
           
            Reminder reminder = reminderDao.getLatestReminder(mother);
            if (reminder.getStatus().equals("UNCONFIRMED")) {
                reminder.setConfirmationArrivedOn(DateTime.now().toDate());
                reminder.setStatus("CONFIRMED");
                reminderDao.update(reminder);
            }
            mainForm.setLogText("\n1 Reminder Confirmed.");
        } else if (identifier.equals("2")) {
            SmsMessageHandler messageHandler = new SmsMessageHandler();
View Full Code Here


                    mainForm.setLogText("\n\n" + new DateTime().toString());
                }

                if (identifier.equals("1")) {

                    Reminder reminder = reminderDao.getLatestReminder(m);
                    if (reminder.getStatus().equals("UNCONFIRMED")) {
                        reminder.setConfirmationArrivedOn(DateTime.now().toDate());
                        reminder.setStatus("CONFIRMED");
                        reminderDao.update(reminder);
                    }
                    mainForm.setLogText("\n1 Reminder Confirmed.");
                } else if (identifier.equals("2")) {
                    //SmsMessageHandler messageHandler = new SmsMessageHandler();
View Full Code Here

    @Override
    public boolean hasMonthlyReminder(Mother mother) {
        Criteria criteria = getSession().createCriteria(Reminder.class)
                .add(Restrictions.eq("mother", mother))
                .add(Restrictions.eq("reminderType", "MONTHLY"));
        Reminder reminder = null;
        try {
            reminder = (Reminder) criteria.uniqueResult();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

    @Override
    public boolean hasWeeklyReminder(Mother mother) {
        Criteria criteria = getSession().createCriteria(Reminder.class)
                .add(Restrictions.eq("mother", mother))
                .add(Restrictions.eq("reminderType", "WEEKLY"));
        Reminder reminder = null;
        try {
             reminder = (Reminder) criteria.uniqueResult();
        } catch (Exception ex) {
            ex.printStackTrace();
        }
View Full Code Here

            textMessage.setRecipient(recipient);
            textMessage.setSeqId(mother.getSeqId());
            textMessage.setSmscCode(smscCode);
            if (smscCode > 0) {
                textMessage.setStatus("A");
                Reminder reminder = new Reminder();
                reminder.setStatus("UNCONFIRMED");
                reminder.setContent(template);
                reminder.setMother(mother);
                reminder.setReminderSentOn(new DateTime().toLocalDate().toDate());
                reminder.setReminderType(type);
                reminderDao.save(reminder);
            } else {
                textMessage.setStatus("P");
            }
View Full Code Here

TOP

Related Classes of org.sis.ancmessaging.server.domain.Reminder

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.