public ActionResult DeleteConfirmed(int id) { EnrollTarget enrollTarget = db.EnrollTargets.Find(id); db.EnrollTargets.Remove(enrollTarget); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Year,Target,DepartmentId")] EnrollTarget enrollTarget) { if (ModelState.IsValid) { db.Entry(enrollTarget).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", enrollTarget.DepartmentId); return(View(enrollTarget)); }
// GET: EnrollTargets/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EnrollTarget enrollTarget = db.EnrollTargets.Find(id); if (enrollTarget == null) { return(HttpNotFound()); } return(View(enrollTarget)); }
// GET: EnrollTargets/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } EnrollTarget enrollTarget = db.EnrollTargets.Find(id); if (enrollTarget == null) { return(HttpNotFound()); } ViewBag.DepartmentId = new SelectList(db.Departments, "Id", "Name", enrollTarget.DepartmentId); return(View(enrollTarget)); }