public ActionResult DeleteConfirmed(int id) { YearProducts yearproducts = db.YearProducts.Find(id); db.YearProducts.Remove(yearproducts); db.SaveChanges(); return(RedirectToAction("Index")); }
// // GET: /YearProductsAdmin/Details/5 public ActionResult Details(int id = 0) { YearProducts yearproducts = db.YearProducts.Find(id); if (yearproducts == null) { return(HttpNotFound()); } return(View(yearproducts)); }
public ActionResult Edit(YearProducts yearproducts) { if (ModelState.IsValid) { db.Entry(yearproducts).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearproducts)); }
public ActionResult Create(YearProducts yearproducts) { if (ModelState.IsValid) { db.YearProducts.Add(yearproducts); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(yearproducts)); }