Exemple #1
0
        private void btnAjouterCommanditaire_Click(object sender, EventArgs e)
        {
            string iDCommanditaire = txtIDCommanditaire.Text.Trim();
            string prenom          = txtPrenomCommanditaire.Text.Trim();
            string surnom          = txtNomCommanditaire.Text.Trim();

            if (!String.IsNullOrEmpty(iDCommanditaire) && !String.IsNullOrEmpty(prenom) && !String.IsNullOrEmpty(surnom))
            {
                Commandiatire centraindentre = new Commandiatire(iDCommanditaire, prenom, surnom);
                if (gste.VerifierCommanditaire(centraindentre))
                {
                    gste.Commanditaires.Add(centraindentre);
                    Commandiatire.All_file += centraindentre.ToFile() + "\r\n";;

                    rtbArea.Text                = "Le commanditaire est ajoute";
                    txtIDCommanditaire.Text     = String.Empty;
                    txtPrenomCommanditaire.Text = String.Empty;
                    txtNomCommanditaire.Text    = String.Empty;
                    txtIDCommanditaire.Focus();

                    rtbArea.Text = gste.AfficherCommanditaires();
                }
                else
                {
                    rtbArea.Text = "Le commanditaire n'est pas ajoute";
                }
            }
            else
            {
                DialogResult reponse = MessageBox.Show("Vous devez remplir tous les donnes! ",
                                                       "Attention", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
Exemple #2
0
 private void btnAfficherCommanditaire_Click(object sender, EventArgs e)
 {
     rtbArea.Text = gste.AfficherCommanditaires();
 }