Ejemplo n.º 1
0
        public PastMatchLayout(PastMatch pastMatch) : base(pastMatch)
        {
            weighIns = pastMatch.WeighIns;
            WeighIn weighIn   = pastMatch.FindWeighIn();
            string  placement = pastMatch.GetPlacement(weighIn);

            this.Children.Add(new Label()
            {
                Text = placement, Style = labelStyle
            });

            if (placement != "Did Not Weigh In")
            {
                this.Children.Add(new Label()
                {
                    Text = pastMatch.GetWeight(weighIn), Style = labelStyle
                });
            }

            Button scoreboardButton = new Button {
                Text = "Scoreboard", Style = buttonStyle
            };

            this.Children.Add(scoreboardButton);
            scoreboardButton.Clicked += OnScoreboardClicked;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Учёт дома/ в гостях будет осущетвляться за счёт bool IsHome
        /// </summary>
        /// <param name="match"></param>
        /// <param name="teamId"></param>
        /// <returns></returns>
        private LastMatch ConvertToLastMatch(PastMatch match, decimal teamId)
        {
            var entities = _dalExecute.NewEntities;
            var teamA = entities.Comands.First(it => it.id_team == match.Team_A);
            var teamB = entities.Comands.First(it => it.id_team == match.Team_B);
            var isHome = (match.Team_A == teamId);

            return new LastMatch()
            {
                Team_A = match.Team_A,
                Team_B = match.Team_B,
                Name_A = teamA.team_name,
                Name_B = teamB.team_name,
                tier_A = teamA.tier_team,
                tier_B = teamB.tier_team,
                Score_A = match.Score_A,
                Score_B = match.Score_B,
                Important_A = match.Important_A,
                Important_B = match.Important_B,
                Violations_A = match.Violations_A,
                Violations_B = match.Violations_B,
                shot_on_target_A = match.shot_on_target_A,
                shot_on_target_B = match.shot_on_target_B,
                save_A = match.save_A,
                save_B = match.save_B,
                tournament = match.tournament,
                tier_tournament = match.Tournament1.Tournament_size,
                replacements_A = match.replacements_A,
                replacements_B = match.replacements_B,
                match_date = match.match_date,
                is_ready_for_learning = match.is_ready_for_learning,
                IsHome = isHome
            };
        }
Ejemplo n.º 3
0
        private async void OnEndMatchClicked(object sender, EventArgs e)
        {
            bool endMatch = await page.DisplayAlert("End Match", "Are You Sure You Want To End The Match?", "Yes", "No");

            if (endMatch)
            {
                PastMatch pastMatch = new PastMatch(App.CurrentMatch.DateTime, App.CurrentMatch.Venue, App.CurrentMatch.Pool)
                {
                    WeighIns = App.CurrentMatch.WeighIns
                };
                App.CurrentMatch = null;
                App.SerializeCurrentMatch();
                App.PastMatches.Insert(0, pastMatch);
                App.SerializePastMatches();
                page.DisplayCurrentMatch();
            }
        }