Пример #1
0
        public ActionResult Create(ProductType producttype)
        {
            if (ModelState.IsValid)
            {
                db.ProductTypes.Add(producttype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(producttype);
        }
Пример #2
0
 public ActionResult Edit(ProductType producttype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(producttype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(producttype);
 }