Example #1
0
        public ActionResult Remove(int id = 0)
        {
            Videogames Videogame = Videogames.Get(id);

            if (Videogame != null)
            {
                Videogame.Remove();
            }
            return(Redirect("~/"));
        }
        public ActionResult Borrar(int id = 0)
        {
            Videogames videogame = Videogames.Get(id);

            if (videogame != null)
            {
                videogame.Delete();
            }
            return(Redirect("~/"));
        }
        public ActionResult Modificar(int id)
        {
            Videogames videogame = Videogames.Get(id);

            if (videogame == null)
            {
                return(Redirect("~/"));
            }
            return(View("~/Views/Home/Formulario.cshtml", videogame));
        }
Example #4
0
        public ActionResult Edit(int id = 0) //Modificar.cshtml
        {
            Videogames Videogame = Videogames.Get(id);

            if (Videogame == null)
            {
                return(Redirect("~/crear/"));
            }
            else
            {
                return(View("~/Views/Home/GameForm.cshtml", Videogame));
            }
        }
Example #5
0
        public ActionResult Game(int id)
        {
            Videogames Videogame = Videogames.Get(id);

            if (Videogame != null)
            {
                return(View(Videogame));
            }
            else
            {
                return(Redirect("~/"));
            }
        }