public ActionResult DeleteConfirmed(int id) { BSCourse bSCourse = db.BSCourses.Find(id); db.BSCourses.Remove(bSCourse); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "BSID,DegreeID,DegreeName,DurationInYears,Courses")] BSCourse bSCourse) { if (ModelState.IsValid) { db.Entry(bSCourse).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.DegreeID = new SelectList(db.Degrees, "DegreeID", "Degree1", bSCourse.DegreeID); return(View(bSCourse)); }
// GET: BachelorOfScienceCourses/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BSCourse bSCourse = db.BSCourses.Find(id); if (bSCourse == null) { return(HttpNotFound()); } return(View(bSCourse)); }
// GET: BachelorOfScienceCourses/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BSCourse bSCourse = db.BSCourses.Find(id); if (bSCourse == null) { return(HttpNotFound()); } ViewBag.DegreeID = new SelectList(db.Degrees, "DegreeID", "Degree1", bSCourse.DegreeID); return(View(bSCourse)); }