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) { } } }
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) { } }
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) { } }