Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            MttoPreventivo mttoPreventivo = db.MttoPreventivos.Find(id);

            db.MttoPreventivos.Remove(mttoPreventivo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,CodMtto,DesMtto,Activo")] MttoPreventivo mttoPreventivo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mttoPreventivo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mttoPreventivo));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Id,CodMtto,DesMtto,Activo")] MttoPreventivo mttoPreventivo)
        {
            if (ModelState.IsValid)
            {
                db.MttoPreventivos.Add(mttoPreventivo);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mttoPreventivo));
        }
Esempio n. 4
0
        // GET: MttoPreventivo/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MttoPreventivo mttoPreventivo = db.MttoPreventivos.Find(id);

            if (mttoPreventivo == null)
            {
                return(HttpNotFound());
            }
            return(View(mttoPreventivo));
        }