Пример #1
0
        private void buttonValider_Click(object sender, EventArgs e)
        {
            ValidateName();
            ValidateSurname();
            ValidateNumber();
            ValidateNumber2();
            ValidateEmail();
            ValidateSexe();
            ValidateAutoPrelev();
            ValidateBirth();

            bool num1 = textBoxNumAdherent.Text.All(char.IsDigit);
            bool num2 = textBoxNumParent.Text.All(char.IsDigit);

            if (String.IsNullOrEmpty(dateTimePicker1.Text) == true || String.IsNullOrEmpty(textBoxNumAdherent.Text) == true || String.IsNullOrEmpty(textBoxNumParent.Text) == true ||
                String.IsNullOrEmpty(comboBoxAutoPrelev.Text) == true || String.IsNullOrEmpty(textBoxNom.Text) == true ||
                String.IsNullOrEmpty(textBoxPrenom.Text) == true || String.IsNullOrEmpty(textBoxEmail.Text) == true || String.IsNullOrEmpty(comboBoxSexe.Text) == true || !num1 || !num2)
            {
                MessageBox.Show("Veuillez remplir tous les champs");
            }
            else
            {
                string   dateInput           = dateTimePicker1.Text;
                var      parsedDateNaissance = DateTime.Parse(dateInput);
                int      numAdherent         = int.Parse(textBoxNumAdherent.Text);
                int      numParent           = int.Parse(textBoxNumParent.Text);
                int      libelle_classe      = (int)comboBox1.SelectedValue;
                DateTime thisDay             = DateTime.Today;
                string   autoprelev          = comboBoxAutoPrelev.Text;
                Adherent unAdherent          = new Adherent(textBoxNom.Text, textBoxPrenom.Text, parsedDateNaissance, numAdherent, textBoxEmail.Text, numParent, autoprelev, comboBoxSexe.Text, thisDay, libelle_classe);
                GestionAdherents.AjoutUtilisateur(unAdherent);
                MessageBox.Show("L'adhérent a bien été modifié");
                this.Close();
            }
        }
Пример #2
0
 private void supp_Click(object sender, EventArgs e)
 {
     try
     {
         DialogResult res = MessageBox.Show("Voulez vous vraiment supprimer cet élève ?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
         if (res == DialogResult.OK)
         {
             if (dataGridView1.SelectedRows.Count > 0)
             {
                 int             selectedDrowIndex = dataGridView1.SelectedCells[0].RowIndex;
                 DataGridViewRow selectedRow       = dataGridView1.Rows[selectedDrowIndex];
                 string          a = Convert.ToString(selectedRow.Cells[0].Value);
                 int             value;
                 int.TryParse(a, out value);
                 GestionAdherents.SupprimerAdherent(value);
                 MessageBox.Show("Suppression réussie.");
             }
         }
         else
         {
             MessageBox.Show("Suppression avortée.");
         }
     }
     catch (Exception)
     {
         MessageBox.Show("Il n'y a pas d'élèves.");
     }
 }
Пример #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            // Création d'un objet List d'Utilisateur à afficher dans le datagridview

            List <Adherent> liste = new List <Adherent>();

            liste = GestionAdherents.GetDetailAdherents();
            // Rattachement de la List à la source de données du datagridview

            dataGridView1.DataSource = liste;
        }
Пример #4
0
        private void button2_Click(object sender, EventArgs e)
        {
            // Création d'un objet List d'adherents à afficher dans le datagridview
            string          nom   = textBoxRechercher.Text;
            List <Adherent> liste = new List <Adherent>();

            liste = GestionAdherents.FiltreUtilisateur(nom);


            // Rattachement de la List à la source de données du datagridview
            dataGridView1.DataSource = liste;
        }
Пример #5
0
        public Statistiques()
        {
            InitializeComponent();

            //Remplissage graphique qui représente le nombre de licenciés par genre
            chart1.DataSource = GestionAdherents.StatsGenre();
            chart1.Series["Genre"].XValueMember  = "sexe_adherent";
            chart1.Series["Genre"].YValueMembers = "nb";

            //Remplissage graphique qui représente le nombre de licenciés par date de naissance
            ddnChart.DataSource = GestionAdherents.StatsDdn();
            ddnChart.Series["Nombre d'adhérent par date de naissance"].XValueMember  = "year";
            ddnChart.Series["Nombre d'adhérent par date de naissance"].YValueMembers = "nbParDdn";

            //Remplissage graphique qui représente le nombre de compétition par licencié
            chartEvenement.DataSource = GestionAdherents.StatsEvenementEleve();
            chartEvenement.Series["Eleve"].XValueMember  = "nom_adherent";
            chartEvenement.Series["Eleve"].YValueMembers = "nbEvenement";
        }
        private void buttonValider_Click(object sender, EventArgs e)
        {
            ValidateName();
            ValidateSurname();
            ValidateNumber();
            ValidateNumber2();
            ValidateEmail();
            ValidateSexe();
            ValidateArchive();
            ValidateAutoPrelev();
            ValidateBirth();

            bool num1 = textBoxNumAdherent.Text.All(char.IsDigit);
            bool num2 = textBoxNumParent.Text.All(char.IsDigit);


            //Vérification si le formulaire est plein
            if (String.IsNullOrEmpty(dateTimePicker1.Text) == true || String.IsNullOrEmpty(textBoxNumAdherent.Text) == true || String.IsNullOrEmpty(textBoxNumParent.Text) == true ||
                String.IsNullOrEmpty(comboBox2.Text) == true || String.IsNullOrEmpty(textBoxNom.Text) == true ||
                String.IsNullOrEmpty(textBoxPrenom.Text) == true || String.IsNullOrEmpty(textBoxEmail.Text) == true || String.IsNullOrEmpty(comboBox3.Text) == true || !num1 || !num2)
            {
                MessageBox.Show("Veuillez remplir tous les champs correctement");
            }
            else
            {
                string   dateInput           = dateTimePicker1.Text;
                var      parsedDateNaissance = DateTime.Parse(dateInput);
                long     numAdherent         = long.Parse(textBoxNumAdherent.Text);
                long     numParent           = long.Parse(textBoxNumParent.Text);
                string   archive_adherent    = comboBox3.Text;
                DateTime thisDay             = DateTime.Today;
                string   autoprelev          = comboBox2.Text;
                /*Adherent unAdherent = new Adherent(value, textBoxNom.Text, textBoxPrenom.Text, parsedDateNaissance, numAdherent, textBoxEmail.Text, numParent, autoprelev, textBoxSexe.Text, dateMaj, textBoxArchive.Text);*/
                Adherent unAdherent = new Adherent(value, textBoxNom.Text, textBoxPrenom.Text, parsedDateNaissance, numAdherent, textBoxEmail.Text, numParent, autoprelev, comboBox1.Text, thisDay, archive_adherent, 1);
                GestionAdherents.ModificationAdherent(unAdherent);
                MessageBox.Show("L'adhérent a bien été modifié");
                this.Close();
            }
        }