コード例 #1
0
        public ActionResult Create(TypeOfBeneficiary typeofbeneficiary)
        {
            if (ModelState.IsValid)
            {
                db.TypeOfBeneficiaries.Add(typeofbeneficiary);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(typeofbeneficiary);
        }
コード例 #2
0
 public ActionResult Edit(TypeOfBeneficiary typeofbeneficiary)
 {
     if (ModelState.IsValid)
     {
         db.Entry(typeofbeneficiary).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(typeofbeneficiary);
 }