Esempio n. 1
0
        public IActionResult MatchListSelectionDetails()
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();

            fullMatchDetailsModelView.MatchesListSelection = GetMatches();
            fullMatchDetailsModelView.MatchesGroups        = fullMatchDetailsModelView.MatchesListSelection?.GroupBy(x => x.MatchTypeName);
            return(PartialView("~/Views/PartialViews/InfoMatchDetailsSelectionListView.cshtml", fullMatchDetailsModelView));
        }
Esempio n. 2
0
        public IActionResult GetMatchListSelectionDetailsView(string matchesList)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();
            List <Matches>            allMatches = JsonConvert.DeserializeObject <List <Matches> >(matchesList);

            fullMatchDetailsModelView.MatchesListSelection = GetMatchesFromJson(allMatches);
            fullMatchDetailsModelView.MatchesGroups        = fullMatchDetailsModelView.MatchesListSelection?.GroupBy(x => x.MatchTypeName);
            return(PartialView("~/Views/PartialViews/InfoMatchDetailsSelectionListView.cshtml", fullMatchDetailsModelView));
        }
Esempio n. 3
0
        public FullMatchDetailsModelView GetFullMatchDetails(MatchDetails matchDetails)
        {
            var fullMatchDetails = new FullMatchDetailsModelView();

            fullMatchDetails.MatchDetails = matchDetails;
            fullMatchDetails.Summary      = GetSummary(matchDetails);
            fullMatchDetails.Commentary   = GetCommentary(matchDetails);
            fullMatchDetails.Statistics   = GetStatistics(matchDetails.EventsOfMatch, matchDetails.Match);
            return(fullMatchDetails);
        }
        public IActionResult MatchesList(string selectedMatchID)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();
            Matches  match = dbContext.Matches.Find(int.Parse(selectedMatchID));
            DateTime date  = match.Time.Value.Date;

            fullMatchDetailsModelView.MatchesListSelection = dbContext.Matches.Where(x => x.Time.Value.Date == date && x.MatchId != match.MatchId && x.StatusId < 13)
                                                             .OrderBy(x => x.MatchTypeId).ThenBy(x => x.Time).ToList();
            return(PartialView("~/Views/PartialViews/MatchDetailsSelectionListView.cshtml", fullMatchDetailsModelView));
        }
        public IActionResult GetMatchesList(string selectedMatchID, string matchesList)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();
            List <Matches>            allMatches = JsonConvert.DeserializeObject <List <Matches> >(matchesList);
            Matches  match = allMatches?.FirstOrDefault(x => x.MatchId == int.Parse(selectedMatchID));
            DateTime date  = match.Time.Value.Date;

            fullMatchDetailsModelView.MatchesListSelection = allMatches?.Where(x => x.Time.Value.Date == date && x.MatchId != match.MatchId && x.StatusId < 13)
                                                             .OrderBy(x => x.MatchTypeId).ThenBy(x => x.Time).ToList();
            return(PartialView("~/Views/PartialViews/MatchDetailsSelectionListView.cshtml", fullMatchDetailsModelView));
        }
Esempio n. 6
0
        private FullMatchDetailsModelView GetMatchDetails(string matchID)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();

            try
            {
                Matches  match = (new MatchesController(null, dbContext).GetMatches(int.Parse(matchID)) as OkObjectResult).Value as Matches;
                DateTime date  = match.Time.Value.Date;
                fullMatchDetailsModelView.MatchesListSelection = GetMatches();
                fullMatchDetailsModelView.MatchDetails         = new MatchDetailsController(dbContext).Get(int.Parse(matchID));
                fullMatchDetailsModelView.Summary       = GetSummary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Commentary    = GetCommentary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Statistics    = GetStatistics(fullMatchDetailsModelView.MatchDetails.EventsOfMatch, fullMatchDetailsModelView.MatchDetails.Match);
                fullMatchDetailsModelView.MatchesGroups = fullMatchDetailsModelView.MatchesListSelection?.GroupBy(x => x.MatchTypeName);
            }
            catch (Exception)
            {
            }
            return(fullMatchDetailsModelView);
        }
        private FullMatchDetailsModelView GetMatchDetails(string matchID)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();

            try
            {
                List <Matches> allMatches = dbContext.Matches.ToList();
                Matches        match      = allMatches.FirstOrDefault(x => x.MatchId == int.Parse(matchID));
                DateTime       date       = match.Time.Value.Date;
                fullMatchDetailsModelView.MatchesListSelection = allMatches.Where(x => x.Time.Value.Date == date && x.MatchId != match.MatchId && x.StatusId < 13)
                                                                 .OrderBy(x => x.MatchTypeId).ThenBy(x => x.Time).ToList();
                fullMatchDetailsModelView.MatchDetails = new MatchDetailsController(dbContext).Get(int.Parse(matchID));
                fullMatchDetailsModelView.Summary      = GetSummary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Commentary   = GetCommentary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Statistics   = GetStatistics(fullMatchDetailsModelView.MatchDetails.EventsOfMatch, fullMatchDetailsModelView.MatchDetails.Match);
            }
            catch (Exception ex)
            {
            }
            return(fullMatchDetailsModelView);
        }
Esempio n. 8
0
        private FullMatchDetailsModelView GetMatchDetailsFromJson(string matchDetailsJson, string matchesListJson)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();

            try
            {
                List <Matches> allMatches   = JsonConvert.DeserializeObject <List <Matches> >(matchesListJson);
                MatchDetails   matchDetails = JsonConvert.DeserializeObject <MatchDetails>(matchDetailsJson);
                Matches        match        = matchDetails.Match;
                DateTime       date         = match.Time.Value.Date;
                fullMatchDetailsModelView.MatchesListSelection = GetMatchesFromJson(allMatches);
                fullMatchDetailsModelView.MatchDetails         = matchDetails;
                fullMatchDetailsModelView.Summary       = GetSummary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Commentary    = GetCommentary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Statistics    = GetStatistics(fullMatchDetailsModelView.MatchDetails.EventsOfMatch, fullMatchDetailsModelView.MatchDetails.Match);
                fullMatchDetailsModelView.MatchesGroups = fullMatchDetailsModelView.MatchesListSelection?.GroupBy(x => x.MatchTypeName);
            }
            catch (Exception)
            {
            }
            return(fullMatchDetailsModelView);
        }
        private FullMatchDetailsModelView GetMatchDetailsFromJson(string matchDetailsJson, string matchesListJson)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = new FullMatchDetailsModelView();

            try
            {
                List <Matches> allMatches   = JsonConvert.DeserializeObject <List <Matches> >(matchesListJson);
                MatchDetails   matchDetails = JsonConvert.DeserializeObject <MatchDetails>(matchDetailsJson);
                Matches        match        = matchDetails.Match;
                DateTime       date         = match.Time.Value.Date;
                fullMatchDetailsModelView.MatchesListSelection = allMatches?.Where(x => x.Time.Value.Date == date && x.MatchId != match.MatchId && x.StatusId < 13)
                                                                 .OrderBy(x => x.MatchTypeId).ThenBy(x => x.Time).ToList();
                fullMatchDetailsModelView.MatchDetails = matchDetails;
                fullMatchDetailsModelView.Summary      = GetSummary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Commentary   = GetCommentary(fullMatchDetailsModelView.MatchDetails);
                fullMatchDetailsModelView.Statistics   = GetStatistics(fullMatchDetailsModelView.MatchDetails.EventsOfMatch, fullMatchDetailsModelView.MatchDetails.Match);
            }
            catch (Exception ex)
            {
            }
            return(fullMatchDetailsModelView);
        }
Esempio n. 10
0
        public async Task <FullMatchDetailsModelView> LoadMatchDetailsAsync(string matchID)
        {
            var fullMatchDetails = new FullMatchDetailsModelView();

            try
            {
                Matches match        = AllMatches?.FirstOrDefault(x => x.MatchID.ToString() == matchID);
                var     matchDetails = AllMatchesDetails.FirstOrDefault(x => x.Match?.MatchID.ToString() == matchID);
                if (matchDetails == null)
                {
                    var eventsOfMatchTask  = GetEventsOfMatchAsync(matchID);
                    var playersOfMatchTask = GetPlayersOfMatch(matchID);
                    await Task.WhenAll(eventsOfMatchTask, playersOfMatchTask);

                    var eventsOfMatch  = eventsOfMatchTask.Result;
                    var playersOfMatch = playersOfMatchTask.Result;
                    matchDetails = new MatchDetails()
                    {
                        Match         = match,
                        EventsOfMatch = eventsOfMatch?
                                        .OrderBy(x => x.EventPeriodId ?? 0)
                                        .ThenBy(x => x.EventTotalTime)
                                        .ThenBy(x => x.EventMinute)
                                        .ThenBy(x => x.EventOfMatchId).ToList(),
                        PlayersOfMatch = playersOfMatch.Where(x => x.PlayingStatus != 3).ToList()
                    };
                    UpdateMatchDetails(matchID, matchDetails);
                }
                fullMatchDetails = GetFullMatchDetails(matchDetails);
                fullMatchDetails.MatchesListSelection = GetMatchesListSameDay(match);
            }
            catch (Exception)
            {
            }
            return(fullMatchDetails);
        }
Esempio n. 11
0
        public IActionResult GetSelectedMatchDetailsView(string matchDetails, string matchesList)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = GetMatchDetailsFromJson(matchDetails, matchesList);

            return(PartialView("~/Views/PartialViews/InfoMatchDetailsPartialView.cshtml", fullMatchDetailsModelView));
        }
Esempio n. 12
0
        public IActionResult SelectedMatchDetails(string selectedMatchID)
        {
            FullMatchDetailsModelView fullMatchDetailsModelView = GetMatchDetails(selectedMatchID);

            return(PartialView("~/Views/PartialViews/InfoMatchDetailsPartialView.cshtml", fullMatchDetailsModelView));
        }