예제 #1
0
 public ActionResult Edit(PersonModels personmodels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(personmodels).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(personmodels);
 }
예제 #2
0
        public ActionResult Create(PersonModels personmodels)
        {
            if (ModelState.IsValid)
            {
                db.PersonModels.Add(personmodels);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(personmodels);
        }