Example #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            TEMPORALIDAD tEMPORALIDAD = db.TEMPORALIDAD.Find(id);

            db.TEMPORALIDAD.Remove(tEMPORALIDAD);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #2
0
 public ActionResult Edit([Bind(Include = "id,nombre,descripcion,auxiliar,fecha_inicio,fecha_termino")] TEMPORALIDAD tEMPORALIDAD)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tEMPORALIDAD).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tEMPORALIDAD));
 }
Example #3
0
        public ActionResult Create([Bind(Include = "id,nombre,descripcion,auxiliar,fecha_inicio,fecha_termino")] TEMPORALIDAD tEMPORALIDAD)
        {
            if (ModelState.IsValid)
            {
                tEMPORALIDAD.id = db.TEMPORALIDAD.Max(x => x.id) + 1;
                db.TEMPORALIDAD.Add(tEMPORALIDAD);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tEMPORALIDAD));
        }
Example #4
0
        // GET: TEMPORALIDADs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            TEMPORALIDAD tEMPORALIDAD = db.TEMPORALIDAD.Find(id);

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