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); }
public ActionResult Refill(long id) { var n = DatabaseNotificationService.GetById(id); var pat = DatabasePatientService.GetById(n.PatientId); Pharmacy p = DatabasePharmacyService.GetById(pat.PharmacyId); p.GetTemplates(); string message = p.GetRefillTemplate().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/refillresponse/" + id), new XElement("Say", message ) ), new XElement("Say", "We didn't recieve any input, Goodbye!") ) ); return(new XmlActionResult(xml)); }