Пример #1
0
 private void constructAlert(Patient p)
 {
     Alert a = new Alert
     {
         PatientId = p.PatientId,
         AlertDate = DateTime.UtcNow,
         AlertTypeId = 1 // 1 = "missed medication"
     };
     db.Alerts.Add(a);
     db.SaveChanges();
 }
Пример #2
0
        public ActionResult Create(Alert alert)
        {
            if (ModelState.IsValid)
            {
                alert.Patient.RegisteredBy = User.Identity.Name;
                db.Alerts.Add(alert);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(alert);
        }
Пример #3
0
 public ActionResult Edit(Alert alert)
 {
     if (ModelState.IsValid)
     {
         alert.Patient.RegisteredBy = User.Identity.Name;
         db.Entry(alert).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(alert);
 }