コード例 #1
0
ファイル: Ajout.cs プロジェクト: Nibelu/Projet-Club
        private void buttonCreerClub_Click(object sender, EventArgs e)
        {
            int CP;

            if (textBoxNom.Text != "Nom du club" && textBoxAdresse.Text != "Adresse du club" && textBoxCP.Text != "Code Postal" && textBoxVille.Text != "Ville" && textBoxtelephone.Text != "N°" && textBoxMail.Text != "email" && int.TryParse(textBoxCP.Text, out CP))
            {
                BDD  newClub     = new BDD();
                Club nouveauClub = new Club(0, textBoxNom.Text, textBoxAdresse.Text, CP, textBoxVille.Text, textBoxtelephone.Text, textBoxMail.Text, textBoxSite.Text);
                newClub.InsertClub(nouveauClub);
                Close();
            }
            else
            {
                erreur = new ErrAjout();
                erreur.ShowDialog();
            }
        }
コード例 #2
0
ファイル: Ajout.cs プロジェクト: Nibelu/Projet-Club
        private void buttonCreerAdherent_Click(object sender, EventArgs e)
        {
            int      CP;
            int      cot;
            DateTime thisDay = DateTime.Today;

            if (dateTimePickerNewNaissanceAdherent.Value != thisDay && textBoxNewNomAdherent.Text != "Nom de l'adhérent" && textBoxNewPrenomAdherent.Text != "Prénom de l'adhérent" && textBoxNewSexAdherent.Text != "Sexe" && textBoxNewLicenceAdherent.Text != "N° de licence" && textBoxNewAdressAdherent.Text != "Adresse de l'adhérent" && textBoxNewCPAdherent.Text != "Code Postal" && textBoxNewVilleAdherent.Text != "Ville" && textBoxNewCotisationAdherent.Text != "Montant de la cotisation" && int.TryParse(textBoxNewCPAdherent.Text, out CP) && int.TryParse(textBoxNewCotisationAdherent.Text, out cot))
            {
                BDD      newAdherent    = new BDD();
                Adherent nouvelAdherent = new Adherent(0, textBoxNewNomAdherent.Text, textBoxNewPrenomAdherent.Text, dateTimePickerNewNaissanceAdherent.Value, textBoxNewSexAdherent.Text, textBoxNewLicenceAdherent.Text, textBoxNewAdressAdherent.Text, CP, textBoxNewVilleAdherent.Text, cot, idClub);
                newAdherent.InsertAdherent(nouvelAdherent);
                Close();
            }
            else
            {
                erreur = new ErrAjout();
                erreur.ShowDialog();
            }
        }
コード例 #3
0
ファイル: Ajout.cs プロジェクト: Nibelu/Projet-Club
        private void buttonCreateEvent_Click(object sender, EventArgs e)
        {
            int      CP;
            DateTime thisDay = DateTime.Today;

            if (dateTimePickerNewDebutEvent.Value >= thisDay && dateTimePickerNewFinEvent.Value > dateTimePickerNewDebutEvent.Value &&
                !string.IsNullOrEmpty(textBoxNewNomEvent.Text) && !string.IsNullOrEmpty(textBoxNewAdresseEvent.Text) &&
                !string.IsNullOrEmpty(textBoxNewCPEvent.Text) && !string.IsNullOrEmpty(textBoxNewVilleEvent.Text) &&
                !string.IsNullOrEmpty(textBoxNewTypeEvent.Text) && !string.IsNullOrEmpty(textBoxNewStieEvent.Text) &&
                int.TryParse(textBoxNewCPEvent.Text, out CP))
            {
                BDD       newEvent        = new BDD();
                Evenement nouvelEvenement = new Evenement(0, textBoxNewTypeEvent.Text, textBoxNewNomEvent.Text, textBoxNewAdresseEvent.Text, CP, textBoxNewVilleEvent.Text, textBoxNewStieEvent.Text, dateTimePickerNewDebutEvent.Value, dateTimePickerNewFinEvent.Value, 0, idClub);
                newEvent.InsertEvent(nouvelEvenement);
                Close();
            }
            else
            {
                erreur = new ErrAjout();
                erreur.ShowDialog();
            }
        }