public ActionResult Index() { FootballApiClient client = new FootballApiClient(); JsonGroupStageResult groupStageMatches = client.GetGroupStageMatches(); JsonTeamResult teams = client.GetTeams(); AdminViewModel viewModel = new AdminViewModel(teams, groupStageMatches); return(View(viewModel)); }
public ActionResult Index(string userName) { FootballApiClient client = new FootballApiClient(); JsonGroupStageResult groupStageMatches = client.GetGroupStageMatches(); JsonTeamResult teams = client.GetTeams(); MyPageViewModel currentGamlePage = new MyPageViewModel(teams, groupStageMatches, userName); return(View(currentGamlePage)); }
public List <string> GetResultList(UserBet currentUserbet) { FootballApiClient client = new FootballApiClient(); List <string> currentUserMatchBet = new List <string>(); if (currentUserbet != null) { foreach (var match in currentUserbet.Matches) { currentUserMatchBet.Add(match.HomeTeam + match.AwayTeam); } } return(client.GetResults(currentUserMatchBet)); }
static void Main(string[] args) { var proxy = new FootballApiClient(); CompetitionModel competitionProxy = proxy.GetCompetition(); List <FootballMatchModel> matchesProxy = proxy.GetMatches(competitionProxy.Code); var competition = new Competition { CompetitionId = competitionProxy.Id, Code = competitionProxy.Code, Name = competitionProxy.Name, EmblemUrl = competitionProxy.EmblemUrl, Matches = matchesProxy.Select(x => MapMatch(x, competitionProxy.Id)).ToList() }; var dal = new Repository(); dal.AddCompetition(competition); }
public ActionResult Index() { object message = string.Empty; FootballApiClient client = new FootballApiClient(); JsonGroupStageResult groupStageMatches = client.GetGroupStageMatches(); HomeViewModel currentViewModel = new HomeViewModel(groupStageMatches); ViewData["Logout"] = TempData["Logout"]; if (TempData.TryGetValue("signuperror", out message)) { currentViewModel.SignupErrorMessage = message.ToString(); } if (TempData.TryGetValue("loginerror", out message)) { currentViewModel.LoginErrorMessage = message.ToString(); } return(View(currentViewModel)); }