public Etat_tache(utilisateur user) { InitializeComponent(); this.user = user; this.list = new List <tache>(); methodes m = new methodes(); DateTime date1 = System.DateTime.Now; DateTime dateOnly = date1.Date; List <tache> l = m.etat(user.getid_utilis(), dateOnly); this.todo = new List <tache>(); this.doing = new List <tache>(); this.did = new List <tache>(); foreach (tache t in l) { switch (t.get_etat()) { case "Non réalisée": this.todo.Add(t); break; case "En cours": this.doing.Add(t); break; case "Réalisée": this.did.Add(t); break; } } affich_list(todo, faire); affich_list(doing, cours); affich_list(did, faite); }