Exemple #1
0
        private void GeneratePersonalDataTable()
        {
            _serviceAthlete = new AthletesService();

            _tablePersonal = _serviceAthlete.SelectAthleteByDni(Dni.Text.ToUpper());

            _tablePersonal.Columns[0].ColumnName = Properties.Resources.AthleteDni;
            _tablePersonal.Columns[1].ColumnName = Properties.Resources.AthleteName;
            _tablePersonal.Columns[2].ColumnName = Properties.Resources.AthleteSurname;
            _tablePersonal.Columns[3].ColumnName = Properties.Resources.Competition;
            _tablePersonal.Columns[4].ColumnName = Properties.Resources.AthleteGender;


            while (_tablePersonal.Rows.Count > 1)
            {
                _tablePersonal.Rows.RemoveAt(_tablePersonal.Rows.Count - 1);
            }

            _tablePersonal.Columns.RemoveAt(0);
            _tablePersonal.Columns.RemoveAt(2);
            _tablePersonal.Columns.RemoveAt(2);

            DataGridDataPersonal.ItemsSource = _tablePersonal.DefaultView;
            GenerateInscriptionsDataTable();
        }
Exemple #2
0
        private void BtSearch_Click(object sender, RoutedEventArgs e)
        {
            if (!ComprobarDNI(Dni.Text))
            {
                MessageBox.Show(Properties.Resources.InvalidDNI);
                return;
            }

            _serviceAthlete = new AthletesService();
            var table = _serviceAthlete.SelectAthleteByDni(Dni.Text.ToUpper());

            if (table.Rows.Count == 0)
            {
                MessageBox.Show(Properties.Resources.NoRegistered);
                return;
            }

            GeneratePersonalDataTable();
        }