private void LoadData(string dni)
        {
            if (dni != null)
            {
                try {
                    var atleList = new AthletesService().SelectAthleteTable();
                    Athlete = atleList.First(a => a.Dni.ToUpper().Equals(dni.ToUpper()));
                    LbNameSurname.Content = $"{Athlete.Name} {Athlete.Surname}";

                    var category = _competitionService.SelectCompetitionByAthleteAndCompetition(Competition, Athlete);
                    LbCategory.Content = $"{category.Name.Replace('_', ' ')} ({category.MinAge} - {category.MaxAge})";

                    var p    = _service.SelectCompetitionHasParticipated(Competition, Athlete);
                    var time = PartialTimeString(p.FinishTime == 0 ? 0 : p.FinishTime - p.InitialTime);
                    LbTiempoTotal.Content = $"T. Final: {time}";

                    var partial = _service.SelectPartialTimesByAthlete(Competition, Athlete);

                    IEnumerable <PartialTimesDto> lista = new List <PartialTimesDto> {
                        partial
                    };
                    GenerateTable(lista);
                }
                catch (InvalidOperationException) { }
            }
        }
Example #2
0
        private void DataGridTimes_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            PartialTimesAthletes.Competition = Competition;

            var atleList = new AthletesService().SelectAthleteTable();

            try {
                var dni = _columnDNI[DataGridTimes.SelectedIndex];
                PartialTimesAthletes.Athlete = atleList.First(a => a.Dni.ToUpper().Equals(dni.ToUpper()));

                DataGridTimes.SelectedIndex = -1;

                MainMenu.ChangeMenuSelected(Properties.Resources.TileTimes, Properties.Resources.SubMenuPartialTimes);
            }
            catch (IndexOutOfRangeException) { }
        }
Example #3
0
        private void DataGridPosiciones_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var id = _tableCat.Rows[DataGridPosiciones.SelectedIndex].ItemArray.ElementAt(0).ToString();

            Competition.ID            = long.Parse(id);
            TimesAthletes.Competition = Competition;


            var atleList = new AthletesService().SelectAthleteTable();

            try {
                TimesAthletes.Athlete = atleList.First(a => a.Dni.ToUpper().Equals(Dni.Text.ToUpper()));


                MainMenu.ChangeMenuSelected(Properties.Resources.TileTimes, Properties.Resources.TitleTimesCompetition);
            }
            catch (IndexOutOfRangeException) { }
        }