public ActionResult DeleteConfirmed(int id) { SubjStudent subjStudent = db.SubjStudent.Find(id); db.SubjStudent.Remove(subjStudent); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id_subj,Dni,Subjects")] SubjStudent subjStudent) { if (ModelState.IsValid) { db.Entry(subjStudent).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subjStudent)); }
public ActionResult Create([Bind(Include = "Id_subj,Dni,Subjects")] SubjStudent subjStudent) { if (ModelState.IsValid) { db.SubjStudent.Add(subjStudent); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(subjStudent)); }
// GET: SubjStudents/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } SubjStudent subjStudent = db.SubjStudent.Find(id); if (subjStudent == null) { return(HttpNotFound()); } return(View(subjStudent)); }