public ActionResult DeleteConfirmed(string id) { if ((string)Session["Accesslevel"] != "Admin") { return(RedirectToAction("Index", "Home")); } tbintake tbintake = db.tbintakes.Find(id); db.tbintakes.Remove(tbintake); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ClassID,ProgramID")] tbintake tbintake) { if ((string)Session["Accesslevel"] != "Admin") { return(RedirectToAction("Index", "Home")); } if (ModelState.IsValid) { db.Entry(tbintake).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ProgramID = new SelectList(db.tbprograms, "ProgramID", "Name", tbintake.ProgramID); return(View(tbintake)); }
// GET: Intake/Details/5 public ActionResult Details(string id) { if ((string)Session["Accesslevel"] != "Admin") { return(RedirectToAction("Index", "Home")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbintake tbintake = db.tbintakes.Find(id); if (tbintake == null) { return(HttpNotFound()); } return(View(tbintake)); }
// GET: Intake/Edit/5 public ActionResult Edit(string id) { if ((string)Session["Accesslevel"] != "Admin") { return(RedirectToAction("Index", "Home")); } if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } tbintake tbintake = db.tbintakes.Find(id); if (tbintake == null) { return(HttpNotFound()); } ViewBag.ProgramID = new SelectList(db.tbprograms, "ProgramID", "Name", tbintake.ProgramID); return(View(tbintake)); }