1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| private void button1_Click(object sender, EventArgs e)
{
employe.Nom = textBox1.Text;
employe.Fonction = textBox2.text;
employe.TypeEmployé = comboBox1.Text;
employe.DateEmbauche = dateTimePicker2.Value;
employe.DateNaissance = dateTimePicker1.Value;
Employé.Liste.Add(employe);
// afficher la liste dans une listBox :
for (int i = 0; i < Employé.Liste.Count;i++)
{
listBox1.Items.Add("" + Employé.Liste[i].Nom + "" + Employé.Liste[i].TypeEmployé + "" + Employé.Liste[i].DateNaissance);
}
} |
Partager