Пример #1
0
        private void listar()
        {
            Listas_Helper_CRUD lhc = new Listas_Helper_CRUD(App.ligacaoBD);

            _contentor = new ObservableCollection <Lista>(lhc.list());
            ListViewLists.ItemsSource = _contentor;
        }
Пример #2
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            if (txtName.Text != "" && txtDono.Text != "")
            {
                Listas_Helper_CRUD lhc = new Listas_Helper_CRUD(App.ligacaoBD);
                Lista l = new Lista();

                l.Nome = txtName.Text;
                l.Dono = txtDono.Text;

                string status = lhc.inserir(l);
                if (status != "")
                {
                    MessageBox.Show("Erro: " + status);
                }
                else
                {
                    resetForm();
                    listar();
                }
            }
            else
            {
                MessageBox.Show("Todos os campos devem ser preenchidos!!");
            }
        }