private void seleciona_produto() { if (tabGerenciamento_entrega.SelectedIndex == 0) { if (GridPedidosP.SelectedCells[0].Value.ToString().Length > 0) { clsProduto teste = new clsProduto(); clsGerenciamentoEntregaBLL teste1 = new clsGerenciamentoEntregaBLL(); teste.Cod_Produto = Convert.ToInt32(GridPedidosP.SelectedCells[0].Value.ToString()); GridProdutosP.DataSource = teste1.SelectProdutos(teste); } } else { if (GridPedidosF.SelectedCells[0].Value.ToString().Length > 0) { clsProduto teste = new clsProduto(); clsGerenciamentoEntregaBLL teste1 = new clsGerenciamentoEntregaBLL(); teste.Cod_Produto = Convert.ToInt32(GridPedidosF.SelectedCells[0].Value.ToString()); GridProdutosF.DataSource = teste1.SelectProdutos(teste); } } }