public ActionResult DeleteConfirmed(int id) { habitos habitos = db.habitos.Find(id); db.habitos.Remove(habitos); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Details(int id = 0) { habitos habitos = db.habitos.Find(id); if (habitos == null) { return(HttpNotFound()); } return(PartialView(habitos)); }
public ActionResult Delete(int id = 0) { habitos habitos = db.habitos.Find(id); if (habitos == null) { return(HttpNotFound()); } return(View(habitos)); }
public ActionResult Edit(habitos habitos) { if (ModelState.IsValid) { db.Entry(habitos).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create", "Familiar", new { id = habitos.hab_id })); } ViewBag.hab_fumo = opcion(habitos.hab_fumo); ViewBag.hab_fuma = opcion(habitos.hab_fuma); ViewBag.hab_alcohol = opcion(habitos.hab_alcohol); ViewBag.hab_drogas = opcion(habitos.hab_drogas); ViewBag.hab_ejercicio = opcion(habitos.hab_ejercicio); return(PartialView(habitos)); }
public ActionResult Edit(int id = 0) { habitos habitos = db.habitos.Find(id); if (habitos == null) { return(RedirectToAction("Create", new { id = id })); } ViewBag.hab_fumo = opcion(habitos.hab_fumo); ViewBag.hab_fuma = opcion(habitos.hab_fuma); ViewBag.hab_alcohol = opcion(habitos.hab_alcohol); ViewBag.hab_drogas = opcion(habitos.hab_drogas); ViewBag.hab_ejercicio = opcion(habitos.hab_ejercicio); return(PartialView(habitos)); }
public ActionResult Create(int id) { habitos habitos = db.habitos.Find(id); if (habitos != null) { return(RedirectToAction("Edit", new { id = id })); } ViewBag.hab_id = id; ViewBag.hab_fumo = opcion(); ViewBag.hab_fuma = opcion(); ViewBag.hab_alcohol = opcion(); ViewBag.hab_drogas = opcion(); ViewBag.hab_ejercicio = opcion(); return(PartialView()); }