public LeagueDetailsPage(Leagues league) { InitializeComponent(); BindingContext = model = new LeagueDetailsViewModel() { selectedLeague = league }; }
public ActionResult Index(string season_Id, LeagueDetailsViewModel model, FormCollection collection) { List <ListOfMatch> _listOfAllMatche; MatchProcessor _matchProcessor = new MatchProcessor(); _listOfAllMatche = _matchProcessor.RetrieveListOfAllMatch(); model.result = new List <FixtureResultViewModel>(); model.clubStatus = new List <LeagueClubDetailsViewModel>(); string leagueID = collection["ligaID"].ToString(); string seasonId = collection["sezonaID"].ToString(); string fixtureId = collection["koloID"].ToString(); foreach (ListOfMatch _lom in _listOfAllMatche) { if (_lom.Season_Id.ToString() == seasonId && _lom.Competition_Id.ToString() == leagueID && _lom.Fixture_Id.ToString() == fixtureId && _lom.Type == 1) { FixtureResultViewModel rlvm = new FixtureResultViewModel(); rlvm.matchId = _lom.Id; rlvm.guestClub = _lom.HomeName; rlvm.guestGoals = _lom.SecondOrgScore; rlvm.homeGoals = _lom.FirstOrgScore; rlvm.homeClub = _lom.GuestName; model.result.Add(rlvm); } if (_lom.Type == 1) { if (!leagues.Exists(x => x.Value == _lom.Competition_Id.ToString())) { leagues.Add(new SelectListItem { Text = _lom.CompetitionName, Value = _lom.Competition_Id.ToString() }); } if (!seasons.Exists(x => x.Value == _lom.Season_Id.ToString())) { seasons.Add(new SelectListItem { Text = _lom.SeasonName, Value = _lom.Season_Id.ToString() }); } if (!fixtures.Exists(x => x.Value == _lom.Fixture_Id.ToString())) { fixtures.Add(new SelectListItem { Text = _lom.FixtureName, Value = _lom.Fixture_Id.ToString() }); } } } ViewBag.sezonaID = seasons; ViewBag.koloID = fixtures; ViewBag.ligaID = leagues; return(View(model)); }
public LeagueDetails() { InitializeComponent(); _vm = new LeagueDetailsViewModel(); this.DataContext = _vm; LoadingPopup ovr = new LoadingPopup(); loadingGrid.Visibility = System.Windows.Visibility.Collapsed; loadingGrid.Children.Add(ovr); }
public async Task <IActionResult> Details(string id) { if (id == null) { throw new ApplicationException($"Passed ID parameter is absent."); } var league = await _leagueService.FindAsync(id); if (league == null) { throw new ApplicationException($"Unable to find league with ID '{id}'."); } var model = new LeagueDetailsViewModel(league); return(View(model)); }
// GET: Leagues/Details/5 public async Task <IActionResult> Details(int id) { League league = _leaguesService.GetLeague(id); if (league == null) { return(NotFound()); } var model = new LeagueDetailsViewModel() { LeagueId = league.Id, LeagueName = league.Name, Matches = _matchesService.GetMatchesForLeague(league.Id), LeagueStats = _leaguesService.GetLeagueStats(league.Id), IsAdmin = User.Identity.Name != null && league.LeagueAdminEmails.Contains(User.Identity.Name) }; return(View(model)); }