private void BtnPesquisa_Click_1(object sender, EventArgs e) { DAOCliente daocliente = new DAOCliente(); if (tbxnomepesquisa.Text == String.Empty && TbxCPFpesquisa.Text == String.Empty) { MySqlConnection conn = new ConnectionFactory().GetConnection(); conn.Open(); DtaGridClientes.DataSource = daocliente.PesquisarGeral(); conn.Close(); alterarNomesDtagridview(); } if (tbxnomepesquisa.Text == String.Empty) { MySqlConnection conn = new ConnectionFactory().GetConnection(); conn.Open(); DtaGridClientes.DataSource = daocliente.PesquisarPorCpf(cpf); conn.Close(); alterarNomesDtagridview(); } if (TbxCPFpesquisa.Text == String.Empty) { MySqlConnection conn = new ConnectionFactory().GetConnection(); conn.Open(); DtaGridClientes.DataSource = daocliente.PesquisarPorNome(nome); conn.Close(); alterarNomesDtagridview(); } }
private void VisualizarClientesCadastrados_Load(object sender, EventArgs e) { DAOCliente daocliente = new DAOCliente(); MySqlConnection conn = new ConnectionFactory().GetConnection(); conn.Open(); DtaGridClientes.DataSource = daocliente.PesquisarGeral(); conn.Close(); alterarNomesDtagridview(); }