コード例 #1
0
 /*
  * For Prototype Testing Only
  */
 //private void sendDemoReminders(int id)
 //{
 //    ISchedulerFactory schedulePool = new StdSchedulerFactory();
 //    IScheduler sched = schedulePool.GetScheduler();
 //    sched.Start();
 //    //set up reminder sender
 //    try
 //    {
 //        JobDetail reminderJob = new JobDetail("AlertBuilder", null, typeof(SendReminderJob));
 //        reminderJob.JobDataMap["pid"] = id;
 //        Trigger trigger = TriggerUtils.MakeMinutelyTrigger("t1", 2, 1);
 //        trigger.StartTimeUtc = TriggerUtils.GetEvenMinuteDate(DateTime.UtcNow.AddMinutes(1));
 //        sched.ScheduleJob(reminderJob, trigger);
 //        //set up warning sender
 //        JobDetail warningJob = new JobDetail("Warnings", null, typeof(SendWarningJob));
 //        warningJob.JobDataMap["pid"] = id;
 //        Trigger trigger2 = TriggerUtils.MakeSecondlyTrigger("test2", 10, 0);
 //        trigger2.StartTimeUtc = TriggerUtils.GetEvenMinuteDate(DateTime.UtcNow).AddMinutes(2);
 //        sched.ScheduleJob(warningJob, trigger2);
 //    }
 //    catch (Exception e)
 //    {
 //        Trace.WriteLine(e.Message);
 //        throw e;
 //    }
 //}
 private void sendRegisterConfirmation(Patient p)
 {
     string msg = String.Format("Dear {0}, welcome to Medivise! Hope you get well soon!\n", p.FirstName);
     TwilioSender sender = new TwilioSender();
     sender.SendSMS(p.Phone, msg);
     Trace.WriteLine(msg);
 }
コード例 #2
0
ファイル: SendReminderJob.cs プロジェクト: aliken9/ic2012
 public void Execute(IJobExecutionContext context)
 {
     sender = new TwilioSender();
     db = new MediviseEntities();
     sendReminders();
 }