Exemplo n.º 1
0
        public ActionResult Index()
        {
            IEnumerable <Leaderboard> leaderboardList;

            LeaderboardController leaderboard = new LeaderboardController();

            leaderboardList = leaderboard.Get();

            return(View(leaderboardList));
        }
Exemplo n.º 2
0
        public ActionResult Edit(int id)
        {
            LeaderboardController leaderboard = new LeaderboardController();
            Leaderboard           editEntry   = leaderboard.FindEntryToEdit(id);

            if (editEntry == null)
            {
                return(HttpNotFound());
            }

            return(View(editEntry));
        }
Exemplo n.º 3
0
        public ActionResult Edit(Leaderboard editEntry)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    LeaderboardController leaderboard = new LeaderboardController();
                    leaderboard.EditEntry(editEntry);
                }

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }