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

            LeaderboardController leaderboard = new LeaderboardController();

            leaderboardList = leaderboard.Get();

            return(View(leaderboardList));
        }
Esempio 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));
        }
Esempio 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());
            }
        }