Beispiel #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;
        }
Beispiel #2
0
        private void FenetreTest_Load(object sender, EventArgs e)
        {
            ModuleServices s    = new ModuleServices();
            List <Module>  list = s.GetModules();

            dataGridView1.DataSource = null;
            dataGridView1.DataSource = list;
        }
Beispiel #3
0
 public void SupprLigne(DataGridView dataGridView3)
 {
     try
     {
         ModuleServices mServ    = new ModuleServices();
         string         intitule = dataGridView3.SelectedCells[0].Value.ToString();
         if (mServ.SupprModule(intitule) == true)
         {
             MessageBox.Show("Module supprime avec succes");
             dataGridView3.DataSource = null;
             dataGridView3.DataSource = mServ.GetModules();
         }
         else
         {
             MessageBox.Show("Erreur lors de la suppression");
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Veuillez selectionner la ligne a supprimer");
     }
 }
 private void btValider_Click(object sender, EventArgs e)
 {
     if (txtDescription.Text.Replace(" ", "") != "" && txtIntitule.Text.Replace(" ", "") != "" && txtNbJour.Text.Replace(" ", "") != "")
     {
         ModuleServices f   = new ModuleServices();
         bool           res = f.AjouterModule(txtIntitule.Text, txtDescription.Text, txtNbJour.Text);
         if (res == true)
         {
             MessageBox.Show("Module ajoute avec succes");
         }
         else
         {
             MessageBox.Show("Erreur lors de la creation du module");
         }
         Datagrid.DataSource = null;
         Datagrid.DataSource = f.GetModules();
         this.Close();
     }
     else
     {
         MessageBox.Show("Veuillez remplir tout les champs");
     }
 }