Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            UnPlannedMaintenance unPlannedMaintenance = db.UnPlannedMaintenance.Find(id);

            db.UnPlannedMaintenance.Remove(unPlannedMaintenance);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 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));
 }
Пример #3
0
        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));
        }
Пример #4
0
        // 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));
        }