public ActionResult CreateDocumentType(DocumentType type) { if (ModelState.IsValid) { db.DocumentTypes.Add(type); db.SaveChanges(); return RedirectToAction("DocumentType"); } return View(type); }
public ActionResult EditDocumentType(DocumentType type) { if (ModelState.IsValid) { db.Entry(type).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("DocumentType"); } return View(type); }