public ActionResult DeleteConfirmed(int id) { OtherCropsProduction otherCropsProduction = db.OtherCropsProductions.Find(id); db.OtherCropsProductions.Remove(otherCropsProduction); db.SaveChanges(); return(RedirectToAction("Create")); }
public ActionResult Edit([Bind(Include = "OtherCropsProdID,HighValueCropID,AreaHectares,ProdMetricTons,YearTaken")] OtherCropsProduction otherCropsProduction) { if (ModelState.IsValid) { db.Entry(otherCropsProduction).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Create")); } return(View(otherCropsProduction)); }
public ActionResult Create([Bind(Prefix = "Item1", Include = "OtherCropsProdID,HighValueCropID,AreaHectares,ProdMetricTons,YearTaken")] OtherCropsProduction otherCropsProduction) { if (ModelState.IsValid) { db.OtherCropsProductions.Add(otherCropsProduction); db.SaveChanges(); return(RedirectToAction("Create")); } return(View(otherCropsProduction)); }
// GET: OtherHighValueCropsAreaAndProduction/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } OtherCropsProduction otherCropsProduction = db.OtherCropsProductions.Find(id); if (otherCropsProduction == null) { return(HttpNotFound()); } return(View(otherCropsProduction)); }