public ActionResult Create(Afpe afpe) { if (ModelState.IsValid) { db.Afpes.Add(afpe); var response = DBHelper.SaveChanges(db); if (response.Succeeded) { return(RedirectToAction("Index")); } ModelState. AddModelError( string.Empty, response.Message); } return(View(afpe)); }
public ActionResult Edit(Afpe afpe) { if (ModelState.IsValid) { db.Entry(afpe). State = EntityState.Modified; var response = DBHelper.SaveChanges(db); if (response.Succeeded) { return(RedirectToAction("Index")); } ModelState. AddModelError( string.Empty, response.Message); } return(View(afpe)); }