public ActionResult Agregar(ProductoModel model) { try { if (ModelState.IsValid) { using (CPMEntities datos = new CPMEntities()) { datos.sp_AgregarProducto(model.Nombre, model.ExistenciaMinima, model.Precio); } return(Redirect("~/Producto")); } return(View(model)); } catch (Exception ex) { throw new Exception(ex.Message); } }