private void PreencherDados() { try { Connection.Financeiro financeiro = new Connection.Financeiro(); financeiro.Id = Id; financeiro.Get(); dynamic fin = financeiro.Results[0]; textNome.Text = fin.Nome; combTipo.SelectedValue = Convert.ToInt32(fin.Tipo); combCentroCusto.SelectedValue = Convert.ToInt32(fin.CentroCusto); combFormaPagamento.SelectedValue = Convert.ToInt32(fin.FormaPagamento); combStatus.SelectedValue = Convert.ToInt32(fin.Status); timeDataEmissao.Text = fin.DataEmissao; timeDataVencimento.Text = fin.DataVencimento; textValor.Text = Converter.ToReais(fin.Valor); textDocumento.Text = fin.Documento; combOcorrencia.SelectedValue = Convert.ToInt32(fin.Ocorrencia); textQtdParcelas.Text = Convert.ToString(fin.QtdParcelas); PreencherGrids(Convert.ToString(fin.Parcelas)); if (!string.IsNullOrEmpty(Convert.ToString(fin.Referencia)) && fin.Referencia > 0) { combTipo.Enabled = false; combCentroCusto.Enabled = false; Referencia = fin.Id; } } catch (Exception e) { MessageBox.Show("Houve um erro ao preencher os dados (" + e.Message + ")."); } }