示例#1
0
 public ActionResult EditPeopleType(PeopleType type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(type).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("PeopleType");
     }
     return View(type);
 }
示例#2
0
        public ActionResult CreatePeopleType(PeopleType type)
        {
            if (ModelState.IsValid)
            {
                db.PeopleTypes.Add(type);
                db.SaveChanges();
                return RedirectToAction("PeopleType");
            }

            return View(type);
        }