Esempio n. 1
0
        private void btnEnvoi_Click(object sender, EventArgs e)
        {
            if (cboMateriel1.SelectedIndex != -1)
            {
                sql msql = new sql("INSERT INTO dbo.Numero_Materiel VALUES (" + (cboParticipant.SelectedIndex + 1) + "," + (cboMateriel1.SelectedIndex + 1) + "," + nUDMateriel1.Value.ToString() + ")", "A18_Sim_Eq07");
                msql.executeNonQuery();
            }
            if (cboMateriel2.SelectedIndex != -1)
            {
                sql msql = new sql("INSERT INTO dbo.Numero_Materiel VALUES (" + (cboParticipant.SelectedIndex + 1) + "," + (cboMateriel2.SelectedIndex + 1) + "," + nUDMateriel12.Value.ToString() + ")", "A18_Sim_Eq07");
                msql.executeNonQuery();
            }
            if (cboMateriel3.SelectedIndex != -1)
            {
                sql msql = new sql("INSERT INTO dbo.Numero_Materiel VALUES (" + (cboParticipant.SelectedIndex + 1) + "," + (cboMateriel3.SelectedIndex + 1) + "," + nUDMateriel13.Value.ToString() + ")", "A18_Sim_Eq07");
                msql.executeNonQuery();
            }
            if (cboMateriel4.SelectedIndex != -1)
            {
                sql msql = new sql("INSERT INTO dbo.Numero_Materiel VALUES (" + (cboParticipant.SelectedIndex + 1) + "," + (cboMateriel4.SelectedIndex + 1) + "," + nUDMateriel14.Value.ToString() + ")", "A18_Sim_Eq07");
                msql.executeNonQuery();
            }
            if (cboMateriel5.SelectedIndex != -1)
            {
                sql msql = new sql("INSERT INTO dbo.Numero_Materiel VALUES (" + (cboParticipant.SelectedIndex + 1) + "," + (cboMateriel5.SelectedIndex + 1) + "," + nUDMateriel15.Value.ToString() + ")", "A18_Sim_Eq07");
                msql.executeNonQuery();
            }

            MessageBox.Show("Envoyé!");
        }
Esempio n. 2
0
        private void PopulerChampsGroupes()
        {
            sql           msql = new sql("SELECT * FROM Participant ORDER BY 6", "A18_Sim_Eq07");
            SqlDataReader read = msql.execute();

            while (read.Read())
            {
                cboParticipant.Items.Add(read["nomGroupe"]);
            }
            read.Close();
        }
Esempio n. 3
0
        private void ChargerPersonnes()
        {
            sql           msql = new sql("SELECT * FROM Personne ORDER BY 1", "A18_Sim_Eq07");
            SqlDataReader read = msql.execute();

            while (read.Read())
            {
                m_listPersonnes.Add(new Personne(read["Nom"].ToString(), read["Prenom"].ToString(), read["Couriel"].ToString()));
            }
            read.Close();
        }
Esempio n. 4
0
        private void PopulerChampsCategories()
        {
            sql           msql = new sql("SELECT * FROM Categorie ORDER BY 2", "A18_Sim_Eq07");
            SqlDataReader read = msql.execute();

            while (read.Read())
            {
                cmbCategorie.Items.Add(read["NomCategorie"]);
            }
            read.Close();
        }
Esempio n. 5
0
        private void PopulerChampsCegeps()
        {
            sql           msql = new sql("SELECT * FROM Cegep ORDER BY 3", "A18_Sim_Eq07");
            SqlDataReader read = msql.execute();

            while (read.Read())
            {
                cmbCegep.Items.Add(read["nomCegep"]);
            }
            read.Close();
        }
Esempio n. 6
0
        private void PopulerChampsGroupes()
        {
            cmbGroupesExistants.Items.Add("Aucun");
            cmbGroupesExistants.SelectedIndex = 0;
            sql           msql = new sql("SELECT * FROM Participant ORDER BY 6", "A18_Sim_Eq07");
            SqlDataReader read = msql.execute();

            while (read.Read())
            {
                cmbGroupesExistants.Items.Add(read["nomGroupe"]);
            }
            read.Close();
        }
Esempio n. 7
0
        private void PopulerChampsMatériel()
        {
            sql           msql = new sql("SELECT * FROM ClubDeGo.Materiel ORDER BY 2", "A18_Sim_Eq07");
            SqlDataReader read = msql.execute();

            while (read.Read())
            {
                cboMateriel1.Items.Add(read["NomMateriel"]);
                cboMateriel2.Items.Add(read["NomMateriel"]);
                cboMateriel3.Items.Add(read["NomMateriel"]);
                cboMateriel4.Items.Add(read["NomMateriel"]);
                cboMateriel5.Items.Add(read["NomMateriel"]);
            }
            read.Close();
        }
Esempio n. 8
0
        private void btnInscrire_Click(object sender, EventArgs e)
        {
            if (txtNom.Text != "" && txtPrenom.Text != "" && txtCourriel.Text != "" && cmbCategorie.SelectedIndex != -1 && cmbCegep.SelectedIndex != -1)
            {
                foreach (Personne personne in m_listPersonnes)
                {
                    if (personne.Nom == txtNom.Text && personne.Prenom == txtPrenom.Text)
                    {
                        return;
                    }
                }
                sql insertionPersonneSQL = new sql("INSERT INTO [dbo].[Personne] VALUES ('" + txtPrenom.Text + "', '" + txtNom.Text + "', '" + txtCourriel.Text + "', " + "123123" + ")", "A18_Sim_Eq07");
                insertionPersonneSQL.executeNonQuery();

                //sql insertioInscriptionnSQL = new sql("INSERT INTO [dbo].[Inscription] VALUES ()", "A18_Sim_Eq07");
                //insertioInscriptionnSQL.executeNonQuery();


                // Ajouter à la liste locale
                m_objPersonne = new Personne(txtNom.Text, txtPrenom.Text, txtCourriel.Text);
                if (cmbGroupesExistants.SelectedIndex != -1)
                {
                    foreach (Participant participant in m_listParticipant)
                    {
                        if (participant.Nom == txtGroupe.Text)
                        {
                            participant.Ajouter(m_objPersonne);
                        }
                    }
                }
                else
                {
                    m_objParticipant = new Participant(txtGroupe.Text);
                    m_listParticipant.Add(m_objParticipant);
                    m_objParticipant.Ajouter(m_objPersonne);
                }
                MessageBox.Show("Vous avez bien étés enrigistrés");
            }
        }