Пример #1
0
        public ActionResult CreateDocumentType(DocumentType type)
        {
            if (ModelState.IsValid)
            {
                db.DocumentTypes.Add(type);
                db.SaveChanges();
                return RedirectToAction("DocumentType");
            }

            return View(type);
        }
Пример #2
0
 public ActionResult EditDocumentType(DocumentType type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(type).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("DocumentType");
     }
     return View(type);
 }