private void form_ConsAtendimento_Load(object sender, EventArgs e) { ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão); AtendimentoBLL bll = new AtendimentoBLL(conexao); dgv_ate.DataSource = bll.PesquisarTodosAtendimentos(); //------CONFIG DO PESQUISAR ------// btnPesquisar_Click(sender, e); //------ DEFINE DGV COR TEXTO E FUNDO----- // this.dgv_ate.DefaultCellStyle.Font = new Font("Verdana", 11); this.dgv_ate.DefaultCellStyle.ForeColor = Color.Black; this.dgv_ate.DefaultCellStyle.BackColor = Color.White; }
private void btnPesquisar_Click(object sender, EventArgs e) { if (cbFiltrarAtendimento.Text == "Pesquisar Todos") { ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão); AtendimentoBLL bll = new AtendimentoBLL(conexao); dgv_ate.DataSource = bll.PesquisarTodosAtendimentos(); } if (cbFiltrarAtendimento.Text == "Pesquisar por Cliente") { ConexaoDAL conexao = new ConexaoDAL(DadosConexaoDAL.StringDeConexão); AtendimentoBLL bll = new AtendimentoBLL(conexao); ClienteBLL cbll = new ClienteBLL(conexao); // dgv_ate.DataSource = bll.PesquisarNomeCliente(cli_nome); } }