Exemple #1
0
        public ActionResult Create(StoreItem storeitem)
        {
            if (ModelState.IsValid)
            {
                db.StoreItems.Add(storeitem);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

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