Beispiel #1
0
        public ActionResult Create(ProductModels productmodels)
        {
            if (ModelState.IsValid)
            {
                db.Products.Add(productmodels);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(productmodels);
        }
Beispiel #2
0
 public ActionResult Edit(ProductModels productmodels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(productmodels).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(productmodels);
 }