コード例 #1
0
        private void FenetreAccueil_Load(object sender, EventArgs e)
        {
            // Remplie le dataGrid avec les Personnes
            PersonneServices pServices = new PersonneServices();
            List <Personne>  p         = pServices.GetPersonnes();

            dataGridView1.DataSource = null;
            dataGridView1.DataSource = p;

            FormationServices fServices = new FormationServices();
            List <Formation>  l         = fServices.GetFormations();

            dataGridView2.DataSource = null;
            dataGridView2.DataSource = l;

            ModuleServices mServices = new ModuleServices();
            List <Module>  m         = mServices.GetModules();

            dataGridView3.DataSource = null;
            dataGridView3.DataSource = m;

            SessionServices sServices = new SessionServices();
            List <Session>  s         = sServices.GetSessions();

            dataGridView4.DataSource = null;
            dataGridView4.DataSource = s;

            dataGridView2.Visible = false;
            dataGridView3.Visible = false;
            dataGridView4.Visible = false;

            //Remplie le label de Bienvenue
            lbBienvenue.Text = lbBienvenue.Text + " " + Personne.Civilite + " " + Personne.Nom + " " + Personne.Prenom;
        }
コード例 #2
0
        private void btValider_Click(object sender, EventArgs e)
        {
            PersonneServices pServ = new PersonneServices();
            bool             res   = pServ.ModifierPersonne(Cible.Mail, txtNom.Text, txtPrenom.Text, txtMail.Text, cbCivilite.Text, txtAdresse.Text, txtCodePostal.Text, txtVille.Text, Cible.Password, txtTelephone.Text);

            if (res == false)
            {
                MessageBox.Show("Erreur lors de la modification");
            }
            Datagrid.DataSource = null;
            Datagrid.DataSource = pServ.GetPersonnes();
            this.Close();
        }
コード例 #3
0
 public void SupprLigne(DataGridView dataGridView1)
 {
     try
     {
         PersonneServices pServ = new PersonneServices();
         string           nom   = dataGridView1.SelectedCells[0].Value.ToString();
         string           mail  = dataGridView1.SelectedCells[2].Value.ToString();
         if (pServ.SupprPersonne(nom, mail) == true)
         {
             MessageBox.Show("Personne supprimee avec succes");
             dataGridView1.DataSource = null;
             dataGridView1.DataSource = pServ.GetPersonnes();
         }
         else
         {
             MessageBox.Show("Erreur lors de la suppression");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Veuillez selectionner la ligne a supprimer");
     }
 }