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 FFT; using BLL; namespace IBRCAD { public partial class frm_consultaundmedida : Form { public int codigo; public frm_consultaundmedida() { InitializeComponent(); } private void Frm_consultaundmedida_Load(object sender, EventArgs e) { this.Btn_localizar_Click(sender, e); this.orgCampos(dgv_dados); } private void Btn_localizar_Click(object sender, EventArgs e) { DALLconexao cx = new DALLconexao(DadosDaConexao.StringDeConexao); BLLUnidadeDeMedida bLLUnidade = new BLLUnidadeDeMedida(cx); dgv_dados.DataSource = bLLUnidade.Localizar(txt_pesquisa.Text); } private void orgCampos(DataGridView grid) { grid.Columns[0].Width = 60; grid.Columns[0].HeaderText = "Código"; grid.Columns[1].Width = 630; grid.Columns[1].HeaderText = "Unidade de medida"; }//organizar campos private void Dgv_dados_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex >= 0) { this.codigo = Convert.ToInt32(dgv_dados.Rows[e.RowIndex].Cells[0].Value); this.Close(); } } private void Btn_imprimir_Click(object sender, EventArgs e) { //printDGV.Print_DataGridView(dgv_dados); } } }