public ActionResult Editar(ConceptoDeGasto conceptoDeGasto) { if (ModelState.IsValid) { _db.Entry(conceptoDeGasto).State = EntityState.Modified; _db.SaveChanges(); TempData["exito"] = "Concepto modificado correctamente"; return(RedirectToAction("Index")); } return(View(conceptoDeGasto)); }
public ActionResult Agregar(ConceptoDeGasto conceptoDeGasto) { if (ModelState.IsValid) { _db.Set <ConceptoDeGasto>().Add(conceptoDeGasto); _db.SaveChanges(); TempData["exito"] = "Concepto agregado correctamente"; return(RedirectToAction("Index")); } return(View(conceptoDeGasto)); }