public ActionResult DeleteConfirmed(int id) { UnPlannedMaintenance unPlannedMaintenance = db.UnPlannedMaintenance.Find(id); db.UnPlannedMaintenance.Remove(unPlannedMaintenance); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,Report,ReportCategory,ReportDate,UploadTime,TimeStamp,DayOftheWeek")] UnPlannedMaintenance unPlannedMaintenance) { if (ModelState.IsValid) { db.Entry(unPlannedMaintenance).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(unPlannedMaintenance)); }
public ActionResult Create([Bind(Include = "Id,Report,ReportCategory,ReportDate,UploadTime,TimeStamp,DayOftheWeek")] UnPlannedMaintenance unPlannedMaintenance) { if (ModelState.IsValid) { db.UnPlannedMaintenance.Add(unPlannedMaintenance); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(unPlannedMaintenance)); }
// GET: UnPlannedMaintenances/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UnPlannedMaintenance unPlannedMaintenance = db.UnPlannedMaintenance.Find(id); if (unPlannedMaintenance == null) { return(HttpNotFound()); } return(View(unPlannedMaintenance)); }