Ejemplo n.º 1
0
 public ActionResult Edit(ProductType producttype)
 {
     if (ModelState.IsValid)
     {
         db.Entry(producttype).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(producttype);
 }        
Ejemplo n.º 2
0
        public ActionResult Create(ProductType producttype, FormCollection collection)
        {
            if (ModelState.IsValid)
            {
                db.Types.Add(producttype);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(producttype);
        }