//GUARDAR
 public ActionResult Save(Videogames videogames)
 {
     //guardar datos en db
     videogames.Save();
     //Rediccionar a una vista
     return Redirect("~/Home/Show/" + videogames.id);
 }
Exemple #2
0
 public ActionResult Guardar(Videogames Videogame)
 {
     //Guardar esos datos en db
     Videogame.Save();
     //Redireccionar a una vista
     return(Redirect("~/home/game/" + Videogame.id));
 }
Exemple #3
0
 public ActionResult Guardar(Videogames videogames)
 {
     //Guardar esos datos en db.
     videogames.Save();
     //Redireccionar a una vista.
     return(Redirect("~/Home/Ver/" + videogames.id));
 }
 public ActionResult Guardar(Videogames game)
 {
     //guardar datos en db
     game.Update();
     //Rediccionar a una vista de ver
     return(Redirect("~/"));
 }
Exemple #5
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));
        }
 public ActionResult Buscar(Videogames data)
 {
     if (data.name != "")
     {
         Videogames game = Videogames.GetGameByString(data.name);
         return(View("Ver", game));
     }
     else
     {
         return(View("SearchGame"));
     }
 }
Exemple #9
0
        public ActionResult Eliminar(int id = 0)
        {
            //Eliminar la entrada si existe.
            Videogames videogames = Videogames.GetVideogames(id);

            if (videogames != null)
            {
                //Borrar
                videogames.Delete();
            }
            return(Redirect("~/"));
        }
        // GET : VER

        public ActionResult Show(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 : 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 Edit(int id = 0)
        {
            Videogames game=Videogames.GetGame(id);
            if (game==null)
            {
                return Redirect("~/Home/show");
            }
            else
            {
                return View("~/Views/Home/VideoGamesForm.cshtml", game);
            }

        }
        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));
            }
        }
Exemple #15
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));
            }
        }
        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"));
        }
Exemple #17
0
        public ActionResult Ver(int id)
        {
            Videogames videogames = Videogames.GetVideogames(id);

            if (videogames != null)
            {
                return(View(videogames));
            }
            else
            {
                return(Redirect("~/"));
            }
        }
Exemple #18
0
        public ActionResult Game(int id)
        {
            Videogames Videogame = Videogames.Get(id);

            if (Videogame != null)
            {
                return(View(Videogame));
            }
            else
            {
                return(Redirect("~/"));
            }
        }
Exemple #19
0
        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));
            }
        }
Exemple #20
0
 public VideoGame ParseVideoGame(Videogames videogame)
 {
     return(new VideoGame()
     {
         id = videogame.Id,
         name = videogame.Name,
         cost = videogame.Cost,
         platform = videogame.Platform,
         esrb = videogame.Esrb,
         description = videogame.Description,
         apiId = videogame.ApiId,
         imageURL = videogame.ImageURL
     });
 }
Exemple #21
0
        public ActionResult Search(string text)
        {
            try
            {
                Videogames temp = Singleton.Instance.dictionary[text];

                return(View("Details", temp));
            }
            catch (Exception e)
            {
                ViewBag.Error        = "Error 000000x1";
                ViewBag.MessageError = e.Message;
                return(View("Index", Singleton.Instance.DictionaryToList()));
            }
        }
Exemple #22
0
        public ActionResult Create(FormCollection collection)
        {
            try
            {
                Videogames newGame = (new Videogames
                {
                    Name = collection["Name"],
                    RealeseDAte = collection["RealeseDate"],
                    Gender = collection["Gender"],
                    Ranking = int.Parse(collection["Ranking"]),
                    platform = collection["platform"],
                    Players = int.Parse(collection["Players"])
                });

                Singleton.Instance.dictionary.Add(collection["Name"], newGame);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemple #23
0
        public ActionResult Edit(string id, FormCollection collection)
        {
            try
            {
                Videogames temp = (new Videogames
                {
                    Name = collection["Name"],
                    RealeseDAte = collection["RealeseDate"],
                    Gender = collection["Gender"],
                    Ranking = int.Parse(collection["Ranking"]),
                    platform = collection["platform"],
                    Players = int.Parse(collection["Players"])
                });
                Singleton.Instance.dictionary.Remove(id);
                Singleton.Instance.dictionary.Add(id, temp);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemple #24
0
        public ActionResult Ranking()
        {
            List <Videogames> ranking = Videogames.Ranking();

            return(View("~/Views/Home/Ranking.cshtml", ranking));
        }
        public ActionResult SearchGame()
        {
            Videogames game = new Videogames();

            return(View(game));
        }
        public ActionResult ranking()
        {
            List <Videogames> games = Videogames.GetRankings();

            return(View(games));
        }
Exemple #27
0
        public ActionResult Newgame() //Crear.cshmtl <-- Formulario
        {
            Videogames Newgame = new Videogames();

            return(View("~/Views/Home/GameForm.cshtml", Newgame));
        }
        public ActionResult Crear()
        {
            Videogames game = new Videogames();

            return(View("~/Views/Home/GameForm.cshtml", game));
        }
        // GET: Home
        public ActionResult Index()
        {
            List <Videogames> games = Videogames.GetGames();

            return(View(games));
        }
 //CREAR
 public ActionResult Crear()
 {
     Videogames videogames = new Videogames();
     return View("~/Views/Home/VideoGamesForm.cshtml", videogames);
 }