using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using DAL; using BLL; namespace IBRCAD { public partial class frm_consultaEmpresa : Form { public int codigo; public frm_consultaEmpresa() { InitializeComponent(); } private void btLocalizar_Click(object sender, EventArgs e) { DALLconexao cx = new DALLconexao(DadosDaConexao.StringDeConexao); BLLempresa bll = new BLLempresa(cx); if (rbNome.Checked == true) { dgvDados.DataSource = bll.Localizar(txtValor.Text); } else { dgvDados.DataSource = bll.LocalizarPorCnpj(txtValor.Text); } }//localizar private void dgvDados_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { this.codigo = Convert.ToInt32(dgvDados.Rows[e.RowIndex].Cells[0].Value); this.Close(); } }// double click private void btn_imprimir_Click(object sender, EventArgs e) { //printDGV.Print_DataGridView(dgvDados); } private void frm_consultaEmpresa_Load(object sender, EventArgs e) { this.btLocalizar_Click(sender, e); } private void pb__Click(object sender, EventArgs e) { this.Close(); } } }