/// <summary> /// methode qui permet d'effectué suite a l'evenement click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConfirmerCB_Click(object sender, EventArgs e) { DBConnectTest db = new DBConnectTest(); string UPNom = textNomCB.Text; string UPAdresse = textAdresseCB.Text; string UPLieu = textLieuCB.Text; int UPcp = Convert.ToInt32(textCpCB.Text); int UPtelephones = Convert.ToInt32(textTelephoneCB.Text); string UPemail = textEmailCB.Text; string UPville = textVilleCB.Text; string UPsite = textSiteCB.Text; db.UpdateCB(UPNom, UPAdresse, UPville, UPAdresse, UPLieu, UPsite, UPcp, UPtelephones, ID); listClub.Items.Clear(); actuCB(); ConfirmerCB.Hide(); ModifierCB.Show(); supprimerCB.Show(); AjoutClub.Show(); textBoxClear(); ID = 0; }
private void AfConf_Click(object sender, EventArgs e) { DBConnectTest bb = new DBConnectTest(); bb.Liaison(id_ad, id_cd); AfConf.Hide(); BtAff.Show(); }
/// <summary> /// actualise la liste d'un club /// </summary> public void actuCB() { listInfoCB.Items.Clear(); DBConnectTest db = new DBConnectTest(); CB = db.ReadClub(); foreach (club unclub in CB) { listClub.Items.Add(unclub.GetNom()); } }
/// <summary> /// active aux moment de charger les fenetres /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void interfaceClub_Load(object sender, EventArgs e) { DBConnectTest db = new DBConnectTest(); CB = db.ReadClub(); foreach (club unclub in CB) { listClub.Items.Add(unclub.GetNom()); } ConfirmerCB.Hide(); }
/// <summary> /// actualise la liste d'adherent /// </summary> private void actuAD() { ListeAD.Items.Clear(); DBConnectTest db = new DBConnectTest(); bb = db.Read(); foreach (Adherent unAdherent in bb) { ListeAD.Items.Add(unAdherent.GetNom()); } }
/// <summary> /// Aux moment de la chargement de la page /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void interfaceAdherent_Load(object sender, EventArgs e) { DBConnectTest db = new DBConnectTest(); bb = db.Read(); foreach (Adherent unAdherent in bb) { ListeAD.Items.Add(unAdherent.GetNom()); } ConfirmeAD.Hide(); }
/// <summary> /// supprime un un objet de la liste d'adherent /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void DeleteAD_Click(object sender, EventArgs e) { int x = ListeAD.SelectedIndex; DBConnectTest db = new DBConnectTest(); ID = Convert.ToInt32(bb[x].GetID()); db.DeleteAD(ID); ListeInfo.Items.Clear(); actuAD(); }
/// <summary> /// Suprime un element de la listbox d'un club /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void supprimerCB_Click(object sender, EventArgs e) { int x = listClub.SelectedIndex; DBConnectTest Db = new DBConnectTest(); ID = Convert.ToInt32(CB[x].GetID()); Db.DeleteCB(ID); listInfoCB.Items.Clear(); listClub.Items.Clear(); textBoxClear(); actuCB(); }
/// <summary> /// recupére que les différents champs et les envoie dans la basse de donnée /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void AjoutClub_Click(object sender, EventArgs e) { DBConnectTest Db = new DBConnectTest(); string nom = textNomCB.Text; string ville = textVilleCB.Text; string email = textEmailCB.Text; string lieu = textLieuCB.Text; string adresse = textAdresseCB.Text; string site = textSiteCB.Text; int cp = Convert.ToInt32(textCpCB.Text); int telephone = Convert.ToInt32(textTelephoneCB.Text); Db.InsertCB(nom, email, ville, adresse, lieu, site, cp, telephone); listClub.Items.Clear(); textBoxClear(); actuCB(); }
/// <summary> /// bouton qui envoie les différents donnée des champs dans le base de donnée /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Envoyer_Click(object sender, EventArgs e) { DBConnectTest Db = new DBConnectTest(); string nom = textNomAD.Text; string prenom = textPrenomAD.Text; string adresse = textAdresseAD.Text; string ville = textVilleAD.Text; string sexe = textSexeAD.Text; int cotisation = Convert.ToInt32(textCotisationAD.Text); int CP = Convert.ToInt32(textCPAD.Text); int numLicence = Convert.ToInt32(textNumLicence.Text); DateTime DateNaissance = dateTimePicker1.Value; DateNaissance.Date.ToString("dd-MM-yyyy"); Db.InsertAD(nom, prenom, ville, adresse, sexe, CP, cotisation, DateNaissance, numLicence); textBoxClearAD(); ListeAD.Items.Clear(); actuAD(); }
/// <summary> /// envoie les champs modifier dans la base de donnée /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ConfirmeAD_Click(object sender, EventArgs e) { DBConnectTest db = new DBConnectTest(); string upNom = textNomAD.Text; string upPrenom = textPrenomAD.Text; DateTime upDate = dateTimePicker1.Value; string upSexe = textSexeAD.Text; string upVille = textVilleAD.Text; string upAdresse = textAdresseAD.Text; int upNumLicence = Convert.ToInt32(textNumLicence.Text); int upCP = Convert.ToInt32(textCPAD.Text); int upCotisation = Convert.ToInt32(textCotisationAD.Text); db.UpdateAD(upNom, upPrenom, upVille, upAdresse, upSexe, upCP, upCotisation, upDate, upNumLicence, ID); actuAD(); textBoxClearAD(); ConfirmeAD.Hide(); ModifierAD.Show(); ID = 0; }
private void InterfaceAffectation_Load(object sender, EventArgs e) { DBConnectTest bb = new DBConnectTest(); DBConnectTest dd = new DBConnectTest(); cd = bb.Read(); dc = dd.ReadClub(); foreach (Adherent unAdherent in cd) { AFlistAdherent.Items.Add(unAdherent.GetNom()); } foreach (club unClub in dc) { AFlistclub.Items.Add(unClub.GetNom()); } AfConf.Hide(); }
/// <summary> /// methode qui permet d'effectué suite a l'évenement click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ModifierCB_Click(object sender, EventArgs e) { int x = listClub.SelectedIndex; DBConnectTest db = new DBConnectTest(); textNomCB.Text = CB[x].GetNom(); textAdresseCB.Text = CB[x].GetAdresse(); textLieuCB.Text = CB[x].GetLieu(); textCpCB.Text = Convert.ToString(CB[x].GetCP()); textTelephoneCB.Text = Convert.ToString(CB[x].GetTelephone()); textEmailCB.Text = CB[x].GetEmail(); textVilleCB.Text = CB[x].GetVille(); textSiteCB.Text = CB[x].GetSiteWeb(); ID = CB[x].GetID(); ConfirmerCB.Show(); ModifierCB.Hide(); AjoutClub.Hide(); supprimerCB.Hide(); }
/// <summary> /// permet de recuperer les données de la base de donnée et les metre dans les champs et ainsi les modifier /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void ModifierAD_Click(object sender, EventArgs e) { int x = ListeAD.SelectedIndex; DBConnectTest db = new DBConnectTest(); textNomAD.Text = bb[x].GetNom(); textPrenomAD.Text = bb[x].GetPrenom(); dateTimePicker1.Text = Convert.ToString(bb[x].GetDateNaissance()); textSexeAD.Text = bb[x].GetSexe(); textVilleAD.Text = bb[x].GetVille(); textAdresseAD.Text = bb[x].GetAdresse(); textNumLicence.Text = Convert.ToString(bb[x].GetNumLicence()); textCPAD.Text = Convert.ToString(bb[x].GetCP()); textCotisationAD.Text = Convert.ToString(bb[x].GetCotisation()); ID = bb[x].GetID(); ConfirmeAD.Show(); ModifierAD.Hide(); // if () }