Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            YearProducts yearproducts = db.YearProducts.Find(id);

            db.YearProducts.Remove(yearproducts);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        //
        // GET: /YearProductsAdmin/Details/5

        public ActionResult Details(int id = 0)
        {
            YearProducts yearproducts = db.YearProducts.Find(id);

            if (yearproducts == null)
            {
                return(HttpNotFound());
            }
            return(View(yearproducts));
        }
Esempio n. 3
0
 public ActionResult Edit(YearProducts yearproducts)
 {
     if (ModelState.IsValid)
     {
         db.Entry(yearproducts).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(yearproducts));
 }
Esempio n. 4
0
        public ActionResult Create(YearProducts yearproducts)
        {
            if (ModelState.IsValid)
            {
                db.YearProducts.Add(yearproducts);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(yearproducts));
        }