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