private void BtnConsultar_Click(object sender, EventArgs e) { try { EstoqueNegocios estoqueNegocios = new EstoqueNegocios(); if (rbArmazem.Checked) { if (txtEstoqueLocalidade.Text != string.Empty && txtEstoqueLocalidade.Text != "0") { dgvResultado.DataSource = estoqueNegocios.ConsultaPorEstoqueLocalidade(int.Parse(txtEstoqueLocalidade.Text)); } } else if (rbItem.Checked) { if (txtItem.Text != string.Empty && txtItem.Text != "0") { dgvResultado.DataSource = estoqueNegocios.ConsultaPorItem(int.Parse(txtItem.Text)); } } } catch (Exception ex) { } }