Ejemplo n.º 1
0
        public AutocompleteItem[] GetLookupDisplayNames(int reportTableFieldID, string term)
        {
            List <AutocompleteItem>  result = new List <AutocompleteItem>();
            Dictionary <int, string> values = LookupField.GetValues(TSAuthentication.GetLoginUser(), reportTableFieldID, term, 10);

            result.Add(new AutocompleteItem("Unassigned", "-1"));
            if (values != null)
            {
                foreach (KeyValuePair <int, string> pair in values)
                {
                    bool found = false;
                    foreach (AutocompleteItem item in result)
                    {
                        if (item.label.ToLower().Trim() == pair.Value.ToLower().Trim())
                        {
                            found = true;
                            break;
                        }
                    }

                    if (!found)
                    {
                        result.Add(new AutocompleteItem(pair.Value, pair.Key.ToString()));
                    }
                }
            }
            return(result.ToArray());
        }
Ejemplo n.º 2
0
        public AutocompleteItem[] GetLookupValues(int reportTableFieldID, string term)
        {
            List <AutocompleteItem>  result = new List <AutocompleteItem>();
            Dictionary <int, string> values = LookupField.GetValues(TSAuthentication.GetLoginUser(), reportTableFieldID, term, 10);

            result.Add(new AutocompleteItem("Unassigned", "-1"));
            if (values != null)
            {
                foreach (KeyValuePair <int, string> pair in values)
                {
                    result.Add(new AutocompleteItem(pair.Value, pair.Key.ToString()));
                }
            }
            return(result.ToArray());
        }