public ActionResult Agregar(CuentaModel model) { try { if (ModelState.IsValid) { using (CPMEntities datos = new CPMEntities()) { datos.sp_AgregarCuenta(model.NCuenta, model.IdBanco, model.Saldo); } return(Redirect("~/Cuenta/")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }