public ActionResult DeleteConfirmed(int id) { ClassArrangement classArrangement = db.ClassArrangements.Find(id); db.ClassArrangements.Remove(classArrangement); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "ClassID,Available,ActivityID,StaffID,Id")] ClassArrangement classArrangement) { if (ModelState.IsValid) { db.Entry(classArrangement).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ActivityID = new SelectList(db.Activities, "ActivityID", "Description", classArrangement.ActivityID); ViewBag.Id = new SelectList(db.Clients, "Id", "LastName", classArrangement.Id); ViewBag.StaffID = new SelectList(db.Staffs, "StaffID", "LastName", classArrangement.StaffID); return(View(classArrangement)); }
// GET: ClassArrangements/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassArrangement classArrangement = db.ClassArrangements.Find(id); if (classArrangement == null) { return(HttpNotFound()); } return(View(classArrangement)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ClassArrangement classArrangement = db.ClassArrangements.Find(id); if (classArrangement == null) { return(HttpNotFound()); } ViewBag.ActivityID = new SelectList(db.Activities, "ActivityID", "Description", classArrangement.ActivityID); ViewBag.Id = new SelectList(db.Clients, "Id", "LastName", classArrangement.Id); ViewBag.StaffID = new SelectList(db.Staffs, "StaffID", "LastName", classArrangement.StaffID); return(View(classArrangement)); }