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