コード例 #1
0
        public MatchProtocolPage(Match match)
        {
            InitializeComponent();
            _leagueService = new LeagueService();

            var league = _leagueService.GetAll().First(x => x.TeamIds.Contains(match.HomeTeamId));

            LeagueName.Text = league.Name.Value;
            var teamService       = new TeamService();
            var matchEventService = new MatchEventService();

            var homeTeamEvents = match.MatchEventIds
                                 .Select(matchEventService.FindById)
                                 .Where(mEvent => match.HomeTeamSquadId.Contains(mEvent.PlayerId));

            var awayTeamEvents = match.MatchEventIds
                                 .Select(matchEventService.FindById)
                                 .Where(mEvent => match.AwayTeamSquadId.Contains(mEvent.PlayerId));

            var homeTeamGoals = homeTeamEvents.Where(e => e.GetType() == MatchEvents.Goal);
            var awayTeamGoals = awayTeamEvents.Where(e => e.GetType() == MatchEvents.Goal);


            ShowDate.Text = match.MatchDate.ToString("dd-MM-yy");
            //MatchWeek.Text = matchWeek.ToString();
            HomeTeamName.Text  = teamService.FindById(match.HomeTeamId).Name.Value;
            AwayTeamName.Text  = teamService.FindById(match.AwayTeamId).Name.Value;
            HomeTeamGoals.Text = homeTeamGoals.ToList().Count.ToString();
            AwayTeamGoals.Text = awayTeamGoals.ToList().Count.ToString();
            HomeTeamMatchEvents.ItemsSource = homeTeamEvents;
            AwayTeamMatchEvents.ItemsSource = awayTeamEvents;
        }
コード例 #2
0
 protected override void OnInitialized()
 {
     if (Leagues == null)
     {
         Leagues = LeagueService.GetAll().ToList();
     }
 }
コード例 #3
0
 public PlayerStatsPage(Team team) : this(new List <Team> {
     team
 })
 {
     PlayersDataGrid.Columns[1].Visibility = Visibility.Collapsed;
     Header.Text          = team.Name.Value;
     SubHeader.Text       = _leagueService.GetAll().First(x => x.TeamIds.Contains(team.Id)).Name.Value;
     SubHeader.Visibility = Visibility.Visible;
 }
コード例 #4
0
 public PlayerStatsPage(IEnumerable <Team> teams)
 {
     DataContext = this;
     InitializeComponent();
     SubHeader.Visibility = Visibility.Collapsed;
     PlayersDataGrid.AutoGenerateColumns = false;
     PlayersDataGrid.ItemsSource         = SortingAlgorithm.Sort(teams, SortingAlgorithm.PlayerSortByTypes.Goal, true);
     _leagueService = new LeagueService();
     Header.Text    = _leagueService.GetAll().First(x => x.TeamIds.Contains(teams.First().Id)).Name.Value;
 }
コード例 #5
0
        public MainPage()
        {
            InitializeComponent();
            _searchService = new SearchService();
            _leagueService = new LeagueService();
            _teamService   = new TeamService();

            var leagues = _leagueService.GetAll().ToList();

            LeagueList.ItemsSource = leagues;
        }
コード例 #6
0
ファイル: MainPage.xaml.cs プロジェクト: Zexuz/knatteligan
 public MainPage()
 {
     Trace.WriteLine(PersonalNumberHelper.GetPersonalTypeForString("961107454831"));
     InitializeComponent();
     _leagueService = new LeagueService();
     Leagues        = new ObservableCollection <League>(_leagueService.GetAll().ToList());
     if (Leagues != null)
     {
         LeagueList.ItemsSource = Leagues;
     }
 }
コード例 #7
0
 public IHttpActionResult GetLeagues()
 {
     try
     {
         var leagues = _leagueService.GetAll();
         return(Ok(leagues));
     }
     catch (Exception e)
     {
         return(InternalServerError(e));
     }
 }
コード例 #8
0
ファイル: TeamPage.xaml.cs プロジェクト: Zexuz/knatteligan
        public TeamPage(Team team)

        {
            InitializeComponent();
            _team         = team;
            _matchService = new MatchService();
            _teamService  = new TeamService();
            var teamMatches = _matchService.GetAll().Where(m => m.HomeTeamId == team.Id || m.AwayTeamId == team.Id).OrderBy(m => m.MatchDate);

            TeamMatchList.ItemsSource = teamMatches;
            TeamNameTxt.Text          = _teamService.FindById(team.Id).Name.Value;
            var leagueService = new LeagueService();

            LgName.Text = leagueService.GetAll().First(x => x.TeamIds.Contains(team.Id)).Name.Value;
        }