public ActionResult Delete(int id) { CountryProduce cp = db.CountryProduces.Find(id); if (cp == null) { return(HttpNotFound()); } return(View(cp)); }
public ActionResult DeleteConfirmed(int id) { CountryProduce cp = db.CountryProduces.Find(id); if (cp == null) { return(HttpNotFound()); } db.CountryProduces.Remove(cp); db.SaveChanges(); return(RedirectToAction("ShowCountries")); }
public ActionResult Edit(int?id) { if (id == null) { return(HttpNotFound()); } CountryProduce cp = db.CountryProduces.Find(id); if (cp == null) { return(HttpNotFound()); } return(View(cp)); }
public ActionResult Edit(CountryProduce cp) { db.Entry(cp).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("ShowCountries")); }
public ActionResult AddCountry(CountryProduce cp) { db.CountryProduces.Add(cp); db.SaveChanges(); return(RedirectToAction("ShowCountries")); }