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