Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PlannedMaintenance plannedMaintenance = db.PlannedMaintenance.Find(id);

            db.PlannedMaintenance.Remove(plannedMaintenance);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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));
        }
Beispiel #4
0
        // 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));
        }