1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
| public DataTable ListeCollabos(string nom, string prenom, string filiale, string pays, string societe, string site, string filiere, string sous_filiere, string fonction, string etablissement)
{
DataTable dtListeCollabos = new DataTable();
ArrayList al_param = new ArrayList();
//Définition des variables pour la requete
OleDbParameter param = null; //Parametre
#region Gestion des filtres
[...]
#endregion
#region Ecriture de la requete (variables definies dans gestion des filtres
string sqlCmd = "SELECT " + colonnes + " FROM " + tables + " WHERE " + filtre + " " + cond_jointures + " ORDER BY " + orderby;
#endregion
#region Ajout des paramètres
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = nom.ToUpper() + "%";
al_param.Add(param);
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = prenom + "%";
al_param.Add(param);
if (filiale != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = filiale;
al_param.Add(param);
}
if (pays != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = pays;
al_param.Add(param); }
if (societe != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = societe;
al_param.Add(param);
}
if (site != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = site;
al_param.Add(param);
}
if (filiere != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = filiere;
al_param.Add(param);
}
if (sous_filiere != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = sous_filiere;
al_param.Add(param);
}
if (fonction != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = fonction;
al_param.Add(param);
}
if (etablissement != "-1")
{
param = new OleDbParameter("", OleDbType.VarChar);
param.Direction = ParameterDirection.Input;
param.Value = etablissement;
al_param.Add(param);
}
#endregion
dtListeCollabos = this.ObtenirListeFiltree(sqlCmd, al_param);
if (dtListeCollabos == null)
{
#region Creation de la structure du dataset renvoye dans le cas d'un objet vide
[...]
#endregion
}
return dtListeCollabos;
} |
Partager