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