Example #1
0
        public string[] GetVerenigingen(string prefixText, int count, string contextKey)
        {
            List <string> results = new List <string>();

            try
            {
                ClubCloudServiceClient client = new ClubCloudServiceClient(SPServiceContext.Current);

                List <ClubCloud_Vereniging> verenigingen = client.GetVerenigingenBySearch(prefixText, count, contextKey);

                if (verenigingen != null && verenigingen.Count > 0)
                {
                    foreach (ClubCloud_Vereniging vereniging in verenigingen)
                    {
                        results.Add((new JavaScriptSerializer()).Serialize(new Pair(string.Format("{0} - {1}", vereniging.Nummer, vereniging.Naam), vereniging.Nummer)));
                    }

                    return(results.ToArray());
                }

                return(results.ToArray());;
            }
            catch { };

            return(default(string[]));
        }