private void AtualizarTabela() { RemedioRepositorio repositorio = new RemedioRepositorio(); List <Remedio> remedios = repositorio.ObterTodos(); dataGridView1.Rows.Clear(); for (int i = 0; i < remedios.Count; i++) { Remedio remedio = remedios[i]; dataGridView1.Rows.Add(new object[] { remedio.Id, remedio.Nome, remedio.Faixa, remedio.Categoria, remedio.Receita }); } }
public void AtualixzarTabela() { RemedioRepositorio repositorio = new RemedioRepositorio(); List <Remedio> remedios = repositorio.ObterTodos(); dataGridView1.Rows.Clear(); for (int i = 0; i < remedios.Count; i++) { Remedio remedio = remedios[i]; dataGridView1.Rows.Add( new object[] { remedio.Id, remedio.Generico, remedio.Nome, remedio.Categoria, remedio.Solido, remedio.ContraIndicacoes, remedio.Bula, remedio.Faixa, remedio.PrecisaReceita } ); } }
private void AtualizarTabela() { RemedioRepositorio repositorio = new RemedioRepositorio(); List <Remedio> remedios = repositorio.ObterTodos(); dataGridView1.Rows.Clear(); for (int i = 0; i < remedios.Count; i++) { Remedio remedio = remedios[i]; string genericoTexto = ""; if (remedio.Generico == true) { genericoTexto = "Sim"; } else { genericoTexto = "Não"; } dataGridView1.Rows.Add(new object[] { remedio.Id, remedio.Nome, remedio.Categoria, remedio.Faixa, genericoTexto }); } }