public ActionResult Reset() { LeaderBoardDataCalls dc = new LeaderBoardDataCalls(); dc.Reset(); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { LeaderBoardDataCalls dc = new LeaderBoardDataCalls(); MatchViewModel mvm = new MatchViewModel(); mvm.Match = dc.FindMatch(id); return(View("Edit", mvm)); }
public IActionResult Index() { LeaderBoardDataCalls dc = new LeaderBoardDataCalls(); ViewBag.listAllLeaderboard = dc.getAllResults().OrderBy(sc => sc.rank).Take(10); ViewBag.listAllScores = dc.getMatchSummary(); return(View()); }
public ActionResult Create(MatchViewModel mvm) { if (!String.IsNullOrEmpty(mvm.Match.player) && !String.IsNullOrEmpty(mvm.Match.opponentName) && (mvm.Match.level >= 0) && (mvm.Match.opponentLevel >= 0)) { mvm.Match.player = mvm.Match.player.ToUpper(); mvm.Match.opponentName = mvm.Match.opponentName.ToUpper(); LeaderBoardDataCalls dc = new LeaderBoardDataCalls(); dc.CreateMatch(mvm.Match); } return(RedirectToAction("Index")); }
public ActionResult Edit(MatchViewModel mvm) { if (String.IsNullOrEmpty(mvm.Match.winner)) { return(RedirectToAction("Index")); } if (mvm.Match.winner.ToUpper() != mvm.Match.player.ToUpper() && mvm.Match.winner.ToUpper() != mvm.Match.opponentName.ToUpper()) { return(RedirectToAction("Index")); } mvm.Match.status = "complete"; mvm.Match.winner = mvm.Match.winner.ToUpper(); LeaderBoardDataCalls dc = new LeaderBoardDataCalls(); dc.EditMatch(mvm.Match); return(RedirectToAction("Index")); }