Esempio n. 1
0
        private void EditAdherent_Load(object sender, EventArgs e)
        {
            tb_nom.Text       = test.getNom();
            tb_prenom.Text    = test.getPrenom();
            tb_prenom.Enabled = false;
            tb_cp.Text        = test.getCp();
            tb_rue.Text       = test.getRue();
            tb_ville.Text     = test.getVille();
            switch (test.getSexe().ToString())
            {
            case "F":
                rb_female.PerformClick();
                break;

            case "M":
                rb_male.PerformClick();
                break;
            }
            rb_male.Enabled      = false;
            rb_female.Enabled    = false;
            tb_naissance.Text    = test.getNaissance();
            tb_naissance.Enabled = false;
            // InitializeComponent();

            //tb_nom.Text = test.ToString();
        }
Esempio n. 2
0
        // Ajout d'un adhérent
        public static void AjouterAdherent(Adherent unAdhe)
        {
            string nom       = unAdhe.getNom();
            string prenom    = unAdhe.getPrenom();
            char   sexe      = unAdhe.getSexe();
            string rue       = unAdhe.getRue();
            string cp        = unAdhe.getCp();
            string ville     = unAdhe.getVille();
            string naissance = unAdhe.getNaissance();
            //connection base
            MySqlCommand maCommande = connection.CreateCommand();

            maCommande.CommandText = "INSERT INTO `adherent` (`nom`,`prenom`,`sexe`,`naissance`,`rueAdresse`,`cp`,`ville`,`cotisation`) VALUES ('" + nom + "','" + prenom + "','" + sexe + "','" + naissance + "','" + rue + "','" + cp + "','" + ville + "')";
            connection.Open();
            maCommande.ExecuteReader();
            connection.Close();
        }
        private void EditAdherent_Load(object sender, EventArgs e)
        {
            tb_nom.Text       = leAdhe.getNom();
            tb_prenom.Text    = leAdhe.getPrenom();
            tb_prenom.Enabled = false;
            tb_cp.Text        = leAdhe.getCp();
            tb_rue.Text       = leAdhe.getRue();
            tb_ville.Text     = leAdhe.getVille();
            tb_coti.Text      = leAdhe.getCoti().ToString();
            switch (leAdhe.getSexe().ToString())
            {
            case "F":
                rb_female.PerformClick();
                break;

            case "M":
                rb_male.PerformClick();
                break;
            }
            rb_male.Enabled      = false;
            rb_female.Enabled    = false;
            tb_naissance.Text    = leAdhe.getNaissance();
            tb_naissance.Enabled = false;
        }