예제 #1
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         GroupeDAO.Delete_client(int.Parse(txt_ID.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #2
0
 private void modifier_Click(object sender, EventArgs e)
 {
     try
     {
         GroupeDAO.Update_client(int.Parse(tbID.Text), tbnom.Text, int.Parse(tbnbre.Text), int.Parse(tbniv.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #3
0
 private void Ajouter_Click(object sender, EventArgs e)
 {
     try
     {
         GroupeDAO.Insert_client(tbnom.Text, int.Parse(tbnbre.Text), int.Parse(tbniv.Text));
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #4
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         List <Groupes> ListClients = GroupeDAO.Get_clients(int.Parse(tbnivlist.Text));
         grid_clients.DataSource = ListClients;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
예제 #5
0
        private void button3_Click(object sender, EventArgs e)
        {
            try
            {
                Groupes clt = GroupeDAO.Get_client_ID(int.Parse(tbID.Text));
                tbnom.Text  = clt.nom;
                tbnbre.Text = clt.nbre.ToString();

                tbniv.Text = clt.num_niv.ToString();
                List <Groupes> L = new List <Groupes>();
                L.Add(clt);
                grid_clients.DataSource = L;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 public CentreSportifCreateur()
 {
     try
     {
         //Init la connexion
         this.con = new MySqlConnection(connectionString);
         //Init les DAOs
         this.personneDAO = new PersonneDAO(this.con);
         this.activiteDAO = new ActiviteDAO(this.con);
         this.groupeDAO   = new GroupeDAO(this.con);
         //Init les service
         this.servicePersonne = new ServicePersonne(personneDAO);
         this.serviceActivite = new ServiceActivite(activiteDAO);
         this.serviceGroupe   = new ServiceGroupe(groupeDAO);
     }
     catch (Exception e)
     {
         Console.WriteLine("Erreur dans l'initialisation des singleton details : \n" + e.Message);
     }
 }
예제 #7
0
 public ServiceGroupe(GroupeDAO groupeDAO)
 {
     this.groupeDAO = groupeDAO;
 }