private void buttonDelete_Click(object sender, EventArgs e) { if (condition()) { int id = Int32.Parse(textID.Text); try { ModeleBDD con = new ModeleBDD(); con.supEvent(id); textID.Text = ""; textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; dateTimePicker1.Value = DateTime.Now; textBox7.Text = ""; comboBox1.Text = ""; comboBox2.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); }catch (Exception e3) { MessageBox.Show("Message d'erreur : " + e3.Message + " \nType de l'exception " + e3.GetType() + " \nPile d'appel" + e3.StackTrace); } } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
private void buttonUpdate_Click(object sender, EventArgs e) { if (condition()) { Clubs club = new Clubs(); club.setNom(comboBox1.Text); Evenements Event = new Evenements(); Event.setId(Int32.Parse(textID.Text)); Event.setClub(club); Event.setTitre(textBox1.Text); Event.setMoment(dateTimePicker1.Value); Event.setLienSite(textBox2.Text); Event.setType(comboBox2.Text); Event.setAdresse(textBox3.Text); Event.setVille(textBox7.Text); Event.setCPT(Int32.Parse(textBox4.Text)); ModeleBDD con = new ModeleBDD(); con.UPDATEEvent(Event); //labelInfo.Text = club.getNom() + " a été modifié "; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
void FillDataGridView() { DataTable Table = new DataTable(); Table.Columns.Add("ID", typeof(int)); Table.Columns.Add("CLUB", typeof(string)); Table.Columns.Add("TITRE", typeof(string)); Table.Columns.Add("TYPE", typeof(string)); Table.Columns.Add("LIENSITE", typeof(string)); Table.Columns.Add("ADRESSE", typeof(string)); Table.Columns.Add("VILLE", typeof(string)); Table.Columns.Add("CODEPOSTAL", typeof(int)); Table.Columns.Add("DATE", typeof(DateTime)); try { ModeleBDD con = new ModeleBDD(); foreach (Evenements E in con.getEvent()) { Table.Rows.Add(E.getId(), E.getClub().getNom(), E.getTitre(), E.getType(), E.getLienSite(), E.getAdresse(), E.getVille(), E.getCPT(), E.getMoment()); } dataGridView1.DataSource = Table; dataGridView1.AutoResizeColumns(); } catch (Exception e) { MessageBox.Show("Message d'erreur : " + e.Message + " \nType de l'exception " + e.GetType() + " \nPile d'appel" + e.StackTrace); } }
/// <summary> /// Alimente la datagriedview avec la base de donnée /// </summary> private void FillDataGridView() { DataTable Table = new DataTable(); Table.Columns.Add("ID", typeof(int)); Table.Columns.Add("CLUB", typeof(string)); Table.Columns.Add("SEXE", typeof(string)); Table.Columns.Add("NOM", typeof(string)); Table.Columns.Add("PRENOM", typeof(string)); Table.Columns.Add("ADRESSE", typeof(string)); Table.Columns.Add("CODEPOSTAL", typeof(int)); Table.Columns.Add("LICENCE", typeof(string)); Table.Columns.Add("COTISATION", typeof(int)); Table.Columns.Add("VILLE", typeof(string)); Table.Columns.Add("NAISSANCE", typeof(DateTime)); ModeleBDD con = new ModeleBDD(); foreach (Adherents adherent in con.getAdherents()) { Table.Rows.Add(adherent.getId(), adherent.getClub().getNom(), adherent.getSexe(), adherent.getNom(), adherent.getPrenom(), adherent.getAdresse(), adherent.getCPT(), adherent.getLicence(), adherent.getCotisation(), adherent.getVille(), adherent.getNaissance()); } dataGridView1.DataSource = Table; dataGridView1.AutoResizeColumns(); }
/// <summary> /// Supprime un évènement /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonDelete_Click(object sender, EventArgs e) { if (condition()) { int id = Int32.Parse(textID.Text); ModeleBDD con = new ModeleBDD(); con.supAdherents(id); label10.Text = textNom.Text + " a été supprimé "; comboBox1.Text = ""; comboBox2.Text = ""; textID.Text = ""; textNom.Text = ""; textPrenom.Text = ""; textLicence.Text = ""; //dateTimePicker1.Value = DateTime.Now; textAdresse.Text = ""; textCodePostal.Text = ""; textVille.Text = ""; textCotisation.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("Veuilez remplir tout les champs"); } }
private void buttonDelete_Click(object sender, EventArgs e) { if (condition()) { int id = Int32.Parse(textID.Text); ModeleBDD con = new ModeleBDD(); con.supEvent(id); textID.Text = ""; textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; dateTimePicker1.Value = DateTime.Now; textBox7.Text = ""; comboBox1.Text = ""; comboBox2.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
/// <summary> /// Alimente la datagriedview avec la base de donnée /// </summary> private void FillDataGridView() { DataTable Table = new DataTable(); Table.Columns.Add("ID", typeof(int)); Table.Columns.Add("CLUB", typeof(string)); Table.Columns.Add("SEXE", typeof(string)); Table.Columns.Add("NOM", typeof(string)); Table.Columns.Add("PRENOM", typeof(string)); Table.Columns.Add("ADRESSE", typeof(string)); Table.Columns.Add("CODEPOSTAL", typeof(int)); Table.Columns.Add("LICENCE", typeof(string)); Table.Columns.Add("COTISATION", typeof(int)); Table.Columns.Add("VILLE", typeof(string)); Table.Columns.Add("NAISSANCE", typeof(DateTime)); try { ModeleBDD con = new ModeleBDD(); foreach (Adherents adherent in con.getAdherents()) { Table.Rows.Add(adherent.getId(), adherent.getClub().getNom(), adherent.getSexe(), adherent.getNom(), adherent.getPrenom(), adherent.getAdresse(), adherent.getCPT(), adherent.getLicence(), adherent.getCotisation(), adherent.getVille(), adherent.getNaissance()); } dataGridView1.DataSource = Table; dataGridView1.AutoResizeColumns(); }catch (Exception e) { MessageBox.Show("Message d'erreur : " + e.Message + " \nType de l'exception " + e.GetType() + " \nPile d'appel" + e.StackTrace); } }
private void buttonUpdate_Click(object sender, EventArgs e) { if (condition()) { TypeClub letype = new TypeClub(); letype.setLibelle(comboBox1.Text); Clubs club = new Clubs(); club.setId(Int32.Parse(textID.Text)); club.setLienSite(textLienSite.Text); club.setNom(textNom.Text); club.setMail(textEmail.Text); club.setType(letype); club.setAdresse(textAdresse.Text); club.setCPT(Int32.Parse(textCPT.Text)); club.setVille(textVille.Text); club.setTel(Int32.Parse(textTel.Text)); ModeleBDD bd = new ModeleBDD(); bd.UPDATEClub(club); labelInfo.Text = club.getNom() + " a été modifié "; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
private void buttonDelete_Click(object sender, EventArgs e) { if (condition()) { int id = Int32.Parse(textID.Text); ModeleBDD con = new ModeleBDD(); con.subClub(id); labelInfo.Text = textNom + " a été supprimé"; textID.Text = ""; textNom.Text = ""; textLienSite.Text = ""; comboBox1.Text = ""; textEmail.Text = ""; textAdresse.Text = ""; textCPT.Text = ""; textVille.Text = ""; textTel.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
void FillDataGridView() { DataTable Table = new DataTable(); Table.Columns.Add("ID", typeof(int)); Table.Columns.Add("NOM", typeof(string)); Table.Columns.Add("LIENSITE", typeof(string)); Table.Columns.Add("ADRESSE", typeof(string)); Table.Columns.Add("VILLE", typeof(string)); Table.Columns.Add("CODEPOSTAL", typeof(int)); Table.Columns.Add("TELEPHONE", typeof(int)); Table.Columns.Add("EMAIL", typeof(string)); Table.Columns.Add("TYPE", typeof(string)); try { ModeleBDD con = new ModeleBDD(); foreach (Clubs Club in con.getClubs()) { Table.Rows.Add(Club.getId(), Club.getNom(), Club.getLienSite(), Club.getAdresse(), Club.getVille(), Club.getCPT(), Club.getTel(), Club.getEMail(), Club.getType().getLibelle()); } dataGridView1.DataSource = Table; dataGridView1.AutoResizeColumns(); }catch (Exception e) { MessageBox.Show("Message d'erreur : " + e.Message + " \nType de l'exception " + e.GetType() + " \nPile d'appel" + e.StackTrace); } }
private void buttonAdd_Click(object sender, EventArgs e) { if (textSport.Text != "") { try { ModeleBDD con = new ModeleBDD(); TypeClub Type = new TypeClub(); Type.setLibelle(textSport.Text); con.setTypeSport(Type); textSport.Text = ""; listBox1.Items.Clear(); FillList(); }catch (Exception e1) { MessageBox.Show("Message d'erreur : " + e1.Message + " \nType de l'exception " + e1.GetType() + " \nPile d'appel" + e1.StackTrace); } } else { MessageBox.Show("...."); } }
private void buttonDelete_Click(object sender, EventArgs e) { if (condition()) { int id = Int32.Parse(textID.Text); try { ModeleBDD con = new ModeleBDD(); con.subClub(id); labelInfo.Text = textNom + " a été supprimé"; textID.Text = ""; textNom.Text = ""; textLienSite.Text = ""; comboBox1.Text = ""; textEmail.Text = ""; textAdresse.Text = ""; textCPT.Text = ""; textVille.Text = ""; textTel.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); }catch (Exception e3) { MessageBox.Show("Message d'erreur : " + e3.Message + " \nType de l'exception " + e3.GetType() + " \nPile d'appel" + e3.StackTrace); } } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
/// <summary> /// Supprime un évènement /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonDelete_Click(object sender, EventArgs e) { if (condition()) { int id = Int32.Parse(textID.Text); try { ModeleBDD con = new ModeleBDD(); con.supAdherents(id); label10.Text = textNom.Text + " a été supprimé "; comboBox1.Text = ""; comboBox2.Text = ""; textID.Text = ""; textNom.Text = ""; textPrenom.Text = ""; textLicence.Text = ""; //dateTimePicker1.Value = DateTime.Now; textAdresse.Text = ""; textCodePostal.Text = ""; textVille.Text = ""; textCotisation.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); }catch (Exception e3) { MessageBox.Show("Message d'erreur : " + e3.Message + " \nType de l'exception " + e3.GetType() + " \nPile d'appel" + e3.StackTrace); } } else { MessageBox.Show("Veuilez remplir tout les champs"); } }
void FillList() { ModeleBDD con = new ModeleBDD(); List <TypeClub> ListType = con.getTypeClub(); foreach (TypeClub leType in ListType) { listBox1.Items.Add(leType.getLibelle().ToString()); } }
/// <summary> /// Modifie l'évènement /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonUpdate_Click(object sender, EventArgs e) { if (condition()) { if (verifiLicence()) { Clubs club = new Clubs(); club.setNom(comboBox2.Text); Adherents adherent = new Adherents(); adherent.setId(Int32.Parse(textID.Text)); adherent.setClub(club); adherent.setSexe(comboBox1.Text); adherent.setNom(textNom.Text); adherent.setPrenom(textPrenom.Text); adherent.setLicence(textLicence.Text); adherent.setNaissance(dateTimePicker1.Value); adherent.setAdresse(textAdresse.Text); adherent.setCPT(Int32.Parse(textCodePostal.Text)); adherent.setVille(textVille.Text); adherent.setCotisation(Int32.Parse(textCotisation.Text)); try { ModeleBDD bd = new ModeleBDD(); bd.UPDATEAdherent(adherent); comboBox1.Text = ""; comboBox2.Text = ""; textID.Text = ""; textNom.Text = ""; textPrenom.Text = ""; textLicence.Text = ""; //dateTimePicker1.Value = DateTime.Now; textAdresse.Text = ""; textCodePostal.Text = ""; textVille.Text = ""; textCotisation.Text = ""; label10.Text = adherent.getNom() + " a été modifié "; dataGridView1.ClearSelection(); FillDataGridView(); }catch (Exception e2) { MessageBox.Show("Message d'erreur : " + e2.Message + " \nType de l'exception " + e2.GetType() + " \nPile d'appel" + e2.StackTrace); } } else { MessageBox.Show("La licence doit être unique"); } } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
private void comboBox1_Click(object sender, EventArgs e) { comboBox1.Items.Clear(); ModeleBDD con = new ModeleBDD(); List <TypeClub> ListeType = con.getTypeClub(); foreach (TypeClub liste in ListeType) { comboBox1.Items.Add(liste.getLibelle().ToString()); } }
private void comboBox1_Click(object sender, EventArgs e) { comboBox1.Items.Clear(); ModeleBDD con = new ModeleBDD(); List <Clubs> ListeClubs = con.getClubs(); foreach (Clubs liste in ListeClubs) { comboBox1.Items.Add(liste.getNom().ToString()); } }
private void buttonSup_Click(object sender, EventArgs e) { ModeleBDD con = new ModeleBDD(); TypeClub Type = new TypeClub(); Type.setLibelle(textSport.Text); con.supTypeSport(Type); textSport.Text = ""; listBox1.Items.Clear(); FillList(); }
void FillList() { try { ModeleBDD con = new ModeleBDD(); List <TypeClub> ListType = con.getTypeClub(); foreach (TypeClub leType in ListType) { listBox1.Items.Add(leType.getLibelle().ToString()); } }catch (Exception e1) { MessageBox.Show("Message d'erreur : " + e1.Message + " \nType de l'exception " + e1.GetType() + " \nPile d'appel" + e1.StackTrace); } }
/// <summary> /// Ajoute un évènements /// </summary> /// <param name="sender"></param> /// <param name="e">l'évènement à ajouter</param> private void buttonInsertion_Click(object sender, EventArgs e) { if (condition()) { if (verifiLicence()) { Clubs club = new Clubs(); club.setNom(comboBox2.Text); Adherents adherent = new Adherents(); adherent.setClub(club); adherent.setSexe(comboBox1.Text); adherent.setNom(textNom.Text); adherent.setPrenom(textPrenom.Text); adherent.setLicence(textLicence.Text); adherent.setNaissance(dateTimePicker1.Value); adherent.setAdresse(textAdresse.Text); adherent.setCPT(Int32.Parse(textCodePostal.Text)); adherent.setVille(textVille.Text); adherent.setCotisation(Int32.Parse(textCotisation.Text)); ModeleBDD bd = new ModeleBDD(); bd.setAdherent(adherent); comboBox1.Text = ""; comboBox2.Text = ""; textNom.Text = ""; textPrenom.Text = ""; textLicence.Text = ""; //dateTimePicker1.Value = DateTime.Now; textAdresse.Text = ""; textCodePostal.Text = ""; textVille.Text = ""; textCotisation.Text = ""; label10.Text = adherent.getNom() + " a été ajouter avec succès "; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("La Licence doit être unique"); } } else { MessageBox.Show("Veuillez rmplir tout les champs"); } }
private void comboBox1_Click(object sender, EventArgs e) { comboBox1.Items.Clear(); try { ModeleBDD con = new ModeleBDD(); List <Clubs> ListeClubs = con.getClubs(); foreach (Clubs liste in ListeClubs) { comboBox1.Items.Add(liste.getNom().ToString()); } }catch (Exception e4) { MessageBox.Show("Message d'erreur : " + e4.Message + " \nType de l'exception " + e4.GetType() + " \nPile d'appel" + e4.StackTrace); } }
private void buttonInsert_Click(object sender, EventArgs e) { if (condition()) { TypeClub letype = new TypeClub(); letype.setLibelle(comboBox1.Text); Clubs club = new Clubs(); club.setLienSite(textLienSite.Text); club.setNom(textNom.Text); club.setMail(textEmail.Text); club.setType(letype); club.setAdresse(textAdresse.Text); club.setCPT(Int32.Parse(textCPT.Text)); club.setVille(textVille.Text); club.setTel(Int32.Parse(textTel.Text)); try { ModeleBDD bd = new ModeleBDD(); bd.setClub(club); textNom.Text = ""; textLienSite.Text = ""; comboBox1.Text = ""; textEmail.Text = ""; textAdresse.Text = ""; textCPT.Text = ""; textVille.Text = ""; textTel.Text = ""; labelInfo.Text = club.getNom() + " a été ajouter avec succès "; dataGridView1.ClearSelection(); FillDataGridView(); }catch (Exception e1) { MessageBox.Show("Message d'erreur : " + e1.Message + " \nType de l'exception " + e1.GetType() + " \nPile d'appel" + e1.StackTrace); } } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
private void button1_Click(object sender, EventArgs e) { try { if (comboBox1.ToString() != "") { string AVG = ""; ModeleBDD con = new ModeleBDD(); Clubs leclub = new Clubs(); leclub.setNom(comboBox1.ToString()); AVG = con.AVGCotisation(leclub); } } catch (Exception n) { MessageBox.Show("Message d'erreur : " + n.Message + " \nType de l'exception " + n.GetType() + " \nPile d'appel" + n.StackTrace); } }
private void Insert_Click(object sender, EventArgs e) { if (condition()) { Clubs club = new Clubs(); club.setNom(comboBox1.Text); Evenements Event = new Evenements(); Event.setTitre(textBox1.Text); Event.setLienSite(textBox2.Text); Event.setMoment(dateTimePicker1.Value); Event.setClub(club); Event.setType(comboBox2.Text); Event.setVille(textBox7.Text); Event.setCPT(Int32.Parse(textBox4.Text)); Event.setAdresse(textBox3.Text); try { ModeleBDD con = new ModeleBDD(); con.setEvent(Event); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; dateTimePicker1.Value = DateTime.Now; textBox7.Text = ""; comboBox1.Text = ""; comboBox2.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); }catch (Exception e1) { MessageBox.Show("Message d'erreur : " + e1.Message + " \nType de l'exception " + e1.GetType() + " \nPile d'appel" + e1.StackTrace); } } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
/// <summary> /// Vérifie que la licence est unique /// </summary> /// <returns></returns> private bool verifiLicence() { bool unique = false; ModeleBDD con = new ModeleBDD(); foreach (var adherent in con.VerifLicence()) { if (adherent.getLicence() == textLicence.Text) { unique = false; } else { unique = true; } } return(unique); }
private void Insert_Click(object sender, EventArgs e) { if (condition()) { Clubs club = new Clubs(); club.setNom(comboBox1.Text); Evenements Event = new Evenements(); Event.setTitre(textBox1.Text); Event.setLienSite(textBox2.Text); Event.setMoment(dateTimePicker1.Value); Event.setClub(club); Event.setType(comboBox2.Text); Event.setVille(textBox7.Text); Event.setCPT(Int32.Parse(textBox4.Text)); Event.setAdresse(textBox3.Text); ModeleBDD con = new ModeleBDD(); con.setEvent(Event); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; dateTimePicker1.Value = DateTime.Now; textBox7.Text = ""; comboBox1.Text = ""; comboBox2.Text = ""; dataGridView1.ClearSelection(); FillDataGridView(); } else { MessageBox.Show("Veuillez remplir tout les champs"); } }
/// <summary> /// Vérifie que la licence est unique /// </summary> /// <returns></returns> private bool verifiLicence() { bool unique = false; try { ModeleBDD con = new ModeleBDD(); foreach (var adherent in con.VerifLicence()) { if (adherent.getLicence() == textLicence.Text) { unique = false; } else { unique = true; } } }catch (Exception e5) { MessageBox.Show("Message d'erreur : " + e5.Message + " \nType de l'exception " + e5.GetType() + " \nPile d'appel" + e5.StackTrace); } return(unique); }
void FillDataGridView() { DataTable Table = new DataTable(); Table.Columns.Add("ID", typeof(int)); Table.Columns.Add("CLUB", typeof(string)); Table.Columns.Add("TITRE", typeof(string)); Table.Columns.Add("TYPE", typeof(string)); Table.Columns.Add("LIENSITE", typeof(string)); Table.Columns.Add("ADRESSE", typeof(string)); Table.Columns.Add("VILLE", typeof(string)); Table.Columns.Add("CODEPOSTAL", typeof(int)); Table.Columns.Add("DATE", typeof(DateTime)); ModeleBDD con = new ModeleBDD(); foreach (Evenements E in con.getEvent()) { Table.Rows.Add(E.getId(), E.getClub().getNom(), E.getTitre(), E.getType(), E.getLienSite(), E.getAdresse(), E.getVille(), E.getCPT(), E.getMoment()); } dataGridView1.DataSource = Table; dataGridView1.AutoResizeColumns(); }
void FillDataGridView() { DataTable Table = new DataTable(); Table.Columns.Add("ID", typeof(int)); Table.Columns.Add("NOM", typeof(string)); Table.Columns.Add("LIENSITE", typeof(string)); Table.Columns.Add("ADRESSE", typeof(string)); Table.Columns.Add("VILLE", typeof(string)); Table.Columns.Add("CODEPOSTAL", typeof(int)); Table.Columns.Add("TELEPHONE", typeof(int)); Table.Columns.Add("EMAIL", typeof(string)); Table.Columns.Add("TYPE", typeof(string)); ModeleBDD con = new ModeleBDD(); foreach (Clubs Club in con.getClubs()) { Table.Rows.Add(Club.getId(), Club.getNom(), Club.getLienSite(), Club.getAdresse(), Club.getVille(), Club.getCPT(), Club.getTel(), Club.getEMail(), Club.getType().getLibelle()); } dataGridView1.DataSource = Table; dataGridView1.AutoResizeColumns(); }