public ActionResult DeleteConfirmed(int id) { StudentsCours studentCourse = db.StudentsCourses.Find(id); db.StudentsCourses.Remove(studentCourse); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "StudentId,StudentName,CourseId,CourseName,CourseDescription")] StudentsCours StudentCourse) { if (ModelState.IsValid) { db.Entry(StudentCourse).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(StudentCourse)); }
public ActionResult Create([Bind(Include = "StudentId,StudentName,CourseId,CourseName,CourseDescription,Something")] StudentsCours StudentCourse) { if (ModelState.IsValid) { db.StudentsCourses.Add(StudentCourse); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(StudentCourse)); }
// GET: RentalRecords/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } StudentsCours studentCourse = db.StudentsCourses.Find(id); if (studentCourse == null) { return(HttpNotFound()); } return(View(studentCourse)); }