Пример #1
0
        private void AutoComplete1_LostFocus_1(object sender, RoutedEventArgs e)
        {
            string name = AutoComplete1.Text;

            if (name != " ")
            {
                idNentidade = name;
                string em = entidade.IDEntidadeByName(name);

                if (em != "")
                {
                    var a = projeto.Projetos_Entidade(em);

                    if (a.Count == 0)
                    {
                        a = projeto.getProjetos();
                    }
                    List <string> aux = new List <string>();

                    combo_projetos.ItemsSource = aux;

                    lock (ComboListProjetos)
                    {
                        ComboListProjetos.Clear();
                    }

                    try
                    {
                        ComboListProjetos.Add(" ");
                        foreach (Projetos f in a)
                        {
                            lock (ComboListProjetos)
                            {
                                ComboListProjetos.Add(f.Nome);
                            }
                        }

                        combo_projetos.ItemsSource = ComboListProjetos;
                    }
                    catch
                    { }
                }
            }
            else
            {
                idNentidade = " ";
            }
        }