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