private Template GetTempFromPharmacy(Notification.NotificationType type)
        {
            Template temp = null;

            pharmacy.GetTemplates();
            switch (type)
            {
            case Notification.NotificationType.Refill:
                temp = pharmacy.GetRefillTemplate();
                break;

            case Notification.NotificationType.Recall:
                temp = pharmacy.GetRecallTemplate();
                break;

            case Notification.NotificationType.Ready:
                temp = pharmacy.GetReadyTemplate();
                break;

            case Notification.NotificationType.Birthday:
                temp = pharmacy.GetBirthdayTemplate();
                break;
            }
            return(temp);
        }
Exemplo n.º 2
0
        public ActionResult Ready(long id)
        {
            var      n   = DatabaseNotificationService.GetById(id);
            var      pat = DatabasePatientService.GetById(n.PatientId);
            Pharmacy p   = DatabasePharmacyService.GetById(pat.PharmacyId);

            p.GetTemplates();
            string message = p.GetReadyTemplate().TemplatePhone;
            var    xml     = new XDocument(
                new XElement("Response",
                             new XElement("Gather",
                                          new XAttribute("timeout", "10"),
                                          new XAttribute("numDigits", "1"),
                                          new XAttribute("action", "https://ocharambe.localtunnel.me/twilioresponse/readyresponse"),
                                          new XElement("Say",
                                                       message
                                                       )
                                          ),
                             new XElement("Say",
                                          "We didn't recognize that input, Goodbye!")
                             )
                );

            return(new XmlActionResult(xml));
        }