Пример #1
0
 public override void OnActionExecuting(ActionExecutingContext filterContext)
 {
     MediviseEntities db = new MediviseEntities();
     int patientId = Convert.ToInt32(filterContext.ActionParameters["id"].ToString());
     Patient patient = db.Patients.Find(patientId);
     if (patient == null || !patient.IsRegistedBy(filterContext.RequestContext.HttpContext.User.Identity.Name))
     {
         filterContext.Result = new RedirectToRouteResult(new RouteValueDictionary {{"controller", "PatientManager"},
             {"action", "Index"}});
     }
 }
Пример #2
0
 public void Execute(IJobExecutionContext context)
 {
     sender = new TwilioSender();
     db = new MediviseEntities();
     sendReminders();
 }