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
| [WebMethod]
[System.Web.Script.Services.ScriptMethod]
public string[] GetCompletionList(string prefixText, int count)
{
List<string> res = new List<string>();
RaisonSocialeCollection RSCollection=new RaisonSocialeCollection();
RSCollection = RaisonSocialeCollection.LoadAll();
int j = 0;
foreach(RaisonSociale rs in RSCollection)
{
if (rs.Nom != null)
{
j++;
if (j == 10)
break;
if (rs.Nom.IndexOf(prefixText) >= 0)
{
res.Add(rs.Nom);
}
}
}
j++;
return res.ToArray();
} |
Partager