private void btnAdicionar_Click(object sender, EventArgs e) { int id = Convert.ToInt32(drigEmpresas.CurrentRow.Cells["CÓDIGO"].Value); Empresa empresa = new Empresa(); if (id > 0) { empresa = empresa.BuscarPorId(id); Contrato.CarregarEmpresa(empresa, BotaoClicado); Contrato.Id = 1; this.Close(); } else { MessageBox.Show("Algo deu errado tente novamente"); } }