public ActionResult DeleteConfirmed(int id) { fine_p fine_p = db.fines.Find(id); db.fines.Remove(fine_p); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Rollno,course,Lastdate,Fine")] fine_p fine_p) { if (ModelState.IsValid) { db.Entry(fine_p).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fine_p)); }
public ActionResult Create([Bind(Include = "Id,Rollno,course,Lastdate,Fine")] fine_p fine_p) { if (ModelState.IsValid) { db.fines.Add(fine_p); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(fine_p)); }
// GET: fine_p/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } fine_p fine_p = db.fines.Find(id); if (fine_p == null) { return(HttpNotFound()); } return(View(fine_p)); }