public ActionResult Eliminar(int id = 0) { //Eliminar la entrada si existe. Videogames videogames = Videogames.GetVideogames(id); if (videogames != null) { //Borrar videogames.Delete(); } return(Redirect("~/")); }
public ActionResult Modificar(int id = 0) //Modificar.cshtml { Videogames videogames = Videogames.GetVideogames(id); if (videogames == null) { return(Redirect("~/Home/crear/")); } else { return(View("~/Views/Home/VideogamesForm.cshtml", videogames)); } }
public ActionResult Ver(int id) { Videogames videogames = Videogames.GetVideogames(id); if (videogames != null) { return(View(videogames)); } else { return(Redirect("~/")); } }