예제 #1
0
        private void AtualizarTabela()
        {
            PlantaRepositorio repositorio = new PlantaRepositorio();
            string            busca       = txtBusca.Text;
            List <Planta>     plantas     = repositorio.ObterTodos(busca);

            dataGridView1.RowCount = 0;
            for (int i = 0; i < plantas.Count; i++)
            {
                Planta planta = plantas[i];
                dataGridView1.Rows.Add(new object[] { planta.Id, planta.Nome });
            }
        }
예제 #2
0
        private void AtualizarTabela()
        {
            PlantaRepositorio repopositorio = new PlantaRepositorio();
            string            busca         = txtBuscar.Text;
            List <Planta>     plantas       = repopositorio.ObterTodos(busca);

            dgvPlantas.RowCount = 0;
            for (int i = 0; i < plantas.Count; i++)
            {
                Planta planta = plantas[i];
                dgvPlantas.Rows.Add(new object[]
                {
                    planta.Id, planta.Nome, planta.Altura.ToString(), planta.Peso.ToString(), planta.Carnivora.ToString()
                });
            }
        }