public ActionResult DeleteConfirmed(int id) { Defuncion defuncion = db.Defuncion.Find(id); db.Defuncion.Remove(defuncion); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,ObservacionDefuncion,CausaDefuncion,FechaDefuncion,Defuncion1,MascotaId,MascotaMicrochip")] Defuncion defuncion) { if (ModelState.IsValid) { db.Entry(defuncion).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.MascotaId = new SelectList(db.Mascota, "Id", "Nombre", defuncion.MascotaId); return(View(defuncion)); }
public ActionResult Create([Bind(Include = "Id,ObservacionDefuncion,CausaDefuncion,FechaDefuncion,Defuncion1,MascotaId,MascotaMicrochip")] Defuncion defuncion) { if (ModelState.IsValid) { db.Defuncion.Add(defuncion); db.SaveChanges(); return(RedirectToAction("Index", "VW_Defunciones")); } ViewBag.MascotaId = new SelectList(db.Mascota, "Id", "Nombre", defuncion.MascotaId); ViewBag.MascotaMicrochip = new SelectList(db.Mascota, "Microchip", "Nombre", defuncion.MascotaId); return(PartialView(defuncion)); }
// GET: Defuncions/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Defuncion defuncion = db.Defuncion.Find(id); if (defuncion == null) { return(HttpNotFound()); } return(View(defuncion)); }
// GET: Defuncions/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } Defuncion defuncion = db.Defuncion.Find(id); if (defuncion == null) { return(HttpNotFound()); } ViewBag.MascotaId = new SelectList(db.Mascota, "Id", "Nombre", defuncion.MascotaId); return(View(defuncion)); }