Esempio n. 1
0
        //GET : Home/VER

        public ActionResult Ver(int id = 0)
        {
            if (id == 0)
            {
                return(Redirect("~/home/"));
            }
            else
            {
                Videogames game = Videogames.GetGame(id);
                return(View(game));
            }
        }
        public ActionResult Remove(int id = 0)
        {
            //Eleminar datos de la db
            Videogames videogames = Videogames.GetGame(id);
            if (videogames != null)
            {
                //borrar
                videogames.Remove();
            }

            return Redirect("~/Home");
        }
        // GET : VER

        public ActionResult Show(int id = 0)
        {
            if (id==0)
            {
                return Redirect("~/Home/");
            }
            else
            {
                Videogames game = Videogames.GetGame(id);
                return View(game);
            }
        }
Esempio n. 4
0
        public ActionResult Editar(int id = 0)
        {
            Videogames game = Videogames.GetGame(id);

            if (game == null)
            {
                return(Redirect("~/Home/"));
            }
            else
            {
                return(View("~/Views/home/GameForm.cshtml", game));
            }
        }
Esempio n. 5
0
        public ActionResult Borrar(int id = 0)
        {
            //Eleminar datos de la db
            Videogames game = Videogames.GetGame(id);

            if (game != null)
            {
                //borrar
                game.Delete();
            }

            return(Redirect("~/Home"));
        }
        public ActionResult Edit(int id = 0)
        {
            Videogames game=Videogames.GetGame(id);
            if (game==null)
            {
                return Redirect("~/Home/show");
            }
            else
            {
                return View("~/Views/Home/VideoGamesForm.cshtml", game);
            }

        }