public ActionResult DeleteConfirmed(int id) { ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id); db.ExtraMuralAgeGroups.Remove(extraMuralAgeGroups); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "MuralAgeGroupId,MuralName,ExtraMuralId,ExtraMuralName,AgeGroupName,NoAssignedStudents,StaffId,AssignedTeacher")] ExtraMuralAgeGroups extraMuralAgeGroups) { if (ModelState.IsValid) { db.Entry(extraMuralAgeGroups).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId); ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId); return(View(extraMuralAgeGroups)); }
// GET: ExtraMuralAgeGroups1/Create public ActionResult Create() { Dictionary <int, string> teacherCollection = GetTeacherNameComboCollection(); var mural = new ExtraMuralAgeGroups { TeacherNameCollection = teacherCollection.Values.ToList() }; ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName"); ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title"); return(View(mural)); }
// GET: ExtraMuralAgeGroups1/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id); if (extraMuralAgeGroups == null) { return(HttpNotFound()); } return(View(extraMuralAgeGroups)); }
public ActionResult Edit([Bind(Include = "MuralAgeGroupId,ExtraMuralId,ExtraMuralName,AgeGroupName,NoAssignedStudents,StaffId,AssignedTeacher")] ExtraMuralAgeGroups extraMuralAgeGroups) { Dictionary <int, string> teacherCollection = GetTeacherNameComboCollection(); extraMuralAgeGroups.TeacherNameCollection = teacherCollection.Values.ToList(); if (ModelState.IsValid) { db.Entry(extraMuralAgeGroups).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId); //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId); return(View(extraMuralAgeGroups)); }
// GET: ExtraMuralAgeGroups/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id); if (extraMuralAgeGroups == null) { return(HttpNotFound()); } ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId); ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId); return(View(extraMuralAgeGroups)); }
// GET: ExtraMuralAgeGroups1/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ExtraMuralAgeGroups extraMuralAgeGroups = db.ExtraMuralAgeGroups.Find(id); Dictionary <int, string> teacherCollection = GetTeacherNameComboCollection(); extraMuralAgeGroups.TeacherNameCollection = teacherCollection.Values.ToList(); if (extraMuralAgeGroups == null) { return(HttpNotFound()); } ViewBag.ExtraMuralId = new SelectList(db.ExtraMurals, "MuralId", "MuralName", extraMuralAgeGroups.ExtraMuralId); //ViewBag.StaffId = new SelectList(db.Staffs, "StaffId", "Title", extraMuralAgeGroups.StaffId); return(View(extraMuralAgeGroups)); }