private void btnSearch_Click(object sender, EventArgs e) { IGestionEmployes gestionEmployes = GestionEmployesBuilderClassFactory.getInterface(); switch (comboBoxAttribut.Text) { case "Nom": dataEmployes.DataSource = gestionEmployes.findUsersByNom(textBoxSearch.Text); break; case "Prénom": dataEmployes.DataSource = gestionEmployes.findUsersByPrenom(textBoxSearch.Text); break; case "Rôle": int IdRole = Convert.ToInt32((comboBoxRole.SelectedItem as ComboboxItem).Value); dataEmployes.DataSource = gestionEmployes.findUsersByRole(IdRole); break; case "Date de début": dataEmployes.DataSource = gestionEmployes.findUsersByDateDebut(textBoxSearch.Text); break; case "Date de fin": dataEmployes.DataSource = gestionEmployes.findUsersByDateFin(textBoxSearch.Text); break; case "Statut": bool status = Convert.ToBoolean(comboBoxStatut.Text); dataEmployes.DataSource = gestionEmployes.findUsersByStatus(status); break; } }