public ActionResult DeleteConfirmed(int id) { IncompatibleAgriculture incompatibleAgriculture = db.IncompatibleAgricultures.Find(id); db.IncompatibleAgricultures.Remove(incompatibleAgriculture); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "Id,FirstCulureId,SecondCulureId")] IncompatibleAgriculture incompatibleAgriculture) { if (ModelState.IsValid) { db.Entry(incompatibleAgriculture).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.FirstCulureId = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.FirstCulureId); ViewBag.SecondCulureId = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.SecondCulureId); return(View(incompatibleAgriculture)); }
public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IncompatibleAgriculture incompatibleAgriculture = db.IncompatibleAgricultures.Find(id); if (incompatibleAgriculture == null) { return(HttpNotFound()); } return(View(incompatibleAgriculture)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } IncompatibleAgriculture incompatibleAgriculture = db.IncompatibleAgricultures.Find(id); if (incompatibleAgriculture == null) { return(HttpNotFound()); } ViewBag.FirstCulureId = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.FirstCulureId); ViewBag.SecondCulureId = new SelectList(db.AgricultureTypes, "Id", "Name", incompatibleAgriculture.SecondCulureId); return(View(incompatibleAgriculture)); }