public ActionResult DeleteConfirmed(int id) { granjas granjas = db.granjas.Find(id); db.granjas.Remove(granjas); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "id,nomenclatura,descripcion")] granjas granjas) { if (ModelState.IsValid) { db.Entry(granjas).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(granjas)); }
public ActionResult Create([Bind(Include = "id,nomenclatura,descripcion")] granjas granjas) { if (ModelState.IsValid) { db.granjas.Add(granjas); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(granjas)); }
// GET: granjas/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } granjas granjas = db.granjas.Find(id); if (granjas == null) { return(HttpNotFound()); } return(View(granjas)); }