public ActionResult Create(ProductType producttype) { if (ModelState.IsValid) { db.ProductTypes.Add(producttype); db.SaveChanges(); return RedirectToAction("Index"); } return View(producttype); }
public ActionResult Edit(ProductType producttype) { if (ModelState.IsValid) { db.Entry(producttype).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(producttype); }