public ActionResult DeleteConfirmed(int id) { LateFine lateFine = db.LateFines.Find(id); db.LateFines.Remove(lateFine); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,RollNumber,DisciplineType,DisciplineAmount,SubmitTime")] LateFine lateFine) { if (ModelState.IsValid) { db.Entry(lateFine).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lateFine)); }
public ActionResult Create([Bind(Include = "Id,RollNumber,DisciplineType,DisciplineAmount,SubmitTime")] LateFine lateFine) { if (ModelState.IsValid) { lateFine.SubmitTime = DateTime.Now; db.LateFines.Add(lateFine); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(lateFine)); }
// GET: LateFines/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LateFine lateFine = db.LateFines.Find(id); if (lateFine == null) { return(HttpNotFound()); } return(View(lateFine)); }