// GET: PossibleSymptoms/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PossibleSymptom possibleSymptom = db.PossibleSymptoms.Find(id); if (possibleSymptom == null) { return(HttpNotFound()); } int a = 0; SymptomsPivot[] tp = db.SymptomsPivots.ToArray(); while (a < db.SymptomsPivots.Count()) { if (tp[a].datapieceID == id) { return(RedirectToAction("FK_Error", "Home")); } a++; } if (User.Identity.IsAuthenticated) { ViewBag.displayMenu = "No"; if (isAdminUser()) { ViewBag.displayMenu = "Yes"; } } return(View(possibleSymptom)); }
public ActionResult DeleteConfirmed(int id) { PossibleSymptom possibleSymptom = db.PossibleSymptoms.Find(id); db.PossibleSymptoms.Remove(possibleSymptom); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Create([Bind(Include = "Id,PercentShowing,Name")] PossibleSymptom possibleSymptom) { if (ModelState.IsValid) { db.PossibleSymptoms.Add(possibleSymptom); db.SaveChanges(); return(RedirectToAction("Index")); } if (User.Identity.IsAuthenticated) { ViewBag.displayMenu = "No"; if (isAdminUser()) { ViewBag.displayMenu = "Yes"; } } return(View(possibleSymptom)); }
public ActionResult CreateFromPatient([Bind(Include = "Id,PercentShowing,Name,TempPatientID")] PossibleSymptom possibleSymptom) { if (ModelState.IsValid) { db.PossibleSymptoms.Add(possibleSymptom); db.SaveChanges(); return(RedirectToAction("Create", "SymptomsPivots", new { patientID = possibleSymptom.TempPatientID })); } if (User.Identity.IsAuthenticated) { ViewBag.displayMenu = "No"; if (isAdminUser()) { ViewBag.displayMenu = "Yes"; } } return(View(possibleSymptom)); }
// GET: PossibleSymptoms/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PossibleSymptom possibleSymptom = db.PossibleSymptoms.Find(id); if (possibleSymptom == null) { return(HttpNotFound()); } if (User.Identity.IsAuthenticated) { ViewBag.displayMenu = "No"; if (isAdminUser()) { ViewBag.displayMenu = "Yes"; } } return(View(possibleSymptom)); }