/// <summary> /// Implementação parcial e simplificada da tradução da lista para eventual necessidade /// </summary> /// <param name="pLista"></param> /// <returns></returns> public List <FundosInfo> TraduzirListaFinancial(AtlasPosicaoCotista[] pLista) { var lRetorno = new List <FundosInfo>(); for (int i = 0; i < pLista.Count(); i++) { var lTrans = new FundosInfo(); if (pLista[i].ValorBruto == 0) { continue; } lTrans.DataAtualizacao = pLista[i].DataConversao; lTrans.NomeFundo = pLista[i].Nome; lTrans.IR = pLista[i].ValorIR; lTrans.Quantidade = pLista[i].Quantidade; lTrans.ValorBruto = pLista[i].ValorBruto; lTrans.Cota = pLista[i].CotaDia; lTrans.ValorLiquido = pLista[i].ValorLiquido; lTrans.IOF = pLista[i].ValorIOF; //lTrans.CodigoFundo = lFundo.IdProduto; lRetorno.Add(lTrans); } return(lRetorno); }
public static ConsultarObjetosResponse <FundosInfo> ConsultarFundoTermo(ConsultarEntidadeRequest <FundosInfo> pParametros) { try { ConsultarObjetosResponse <FundosInfo> lRetorno = new ConsultarObjetosResponse <FundosInfo>(); ConexaoDbHelper lAcessaDados = new ConexaoDbHelper(); lAcessaDados.ConnectionStringName = gNomeConexaoFundos; using (DbCommand lDbCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "prc_fundo_termo_sel")) { lAcessaDados.AddInParameter(lDbCommand, "@CodigoClienteFundo", DbType.Int32, pParametros.Objeto.CodigoClienteFundo); DataTable lDataTable = lAcessaDados.ExecuteDbDataTable(lDbCommand); if (null != lDataTable && lDataTable.Rows.Count > 0) { var lFundo = new FundosInfo(); for (int i = 0; i <= lDataTable.Rows.Count - 1; i++) { lFundo = new FundosInfo(); lFundo.CodigoClienteFundo = lDataTable.Rows[i]["idCliente"].DBToInt32(); lFundo.CodigoFundo = lDataTable.Rows[i]["idFundo"].DBToInt32(); lFundo.CodigoFundoAnbima = lDataTable.Rows[i]["CodigoAnbima"].DBToString(); lFundo.CodigoFundoTermo = lDataTable.Rows[i]["idTermo"].DBToInt32(); lFundo.NomeFundo = lDataTable.Rows[i]["NomeFundo"].DBToString(); lFundo.DataAdesao = lDataTable.Rows[i]["DataAdesao"].DBToDateTime(); lFundo.Origem = lDataTable.Rows[i]["Origem"].DBToString(); lFundo.UsuarioLogado = lDataTable.Rows[i]["UsuarioLogado"].DBToString(); lFundo.CodigoUsuarioLogado = lDataTable.Rows[i]["CodigoUsuarioLogado"].DBToInt32(); lRetorno.Resultado.Add(lFundo); } } } return(lRetorno); } catch (Exception ex) { LogCadastro.Logar(pParametros.Objeto, pParametros.IdUsuarioLogado, pParametros.DescricaoUsuarioLogado, LogCadastro.eAcao.Consultar, ex); throw ex; } }
public void SalvarCadastroFundos(FundosInfo pRequest) { using (AcessaDados lAcessaDados = new AcessaDados()) { lAcessaDados.Conexao = new Conexao(); lAcessaDados.ConnectionStringName = "PlataformaInviXX"; try { using (DbCommand lCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "PRC_ANBIMA_FUNDOS_INS")) { lAcessaDados.AddInParameter(lCommand, "@CodigoFundo", DbType.String, pRequest.CodigoFundo); lAcessaDados.AddInParameter(lCommand, "@CodigoInstituicao", DbType.String, pRequest.CodInst); lAcessaDados.AddInParameter(lCommand, "@NomeFanatasia", DbType.String, pRequest.NomeFantasia); lAcessaDados.AddInParameter(lCommand, "@Gestor", DbType.String, pRequest.Gestor); lAcessaDados.AddInParameter(lCommand, "@CodigoTipo", DbType.Int32, pRequest.CodigoTipo); lAcessaDados.AddInParameter(lCommand, "@DataInicial", DbType.DateTime, pRequest.DataInicioFundo); lAcessaDados.AddInParameter(lCommand, "@DataFim", DbType.DateTime, (pRequest.DataFimFundo.HasValue ? pRequest.DataFimFundo.Value : new Nullable <DateTime>())); lAcessaDados.AddInParameter(lCommand, "@DataInfo", DbType.DateTime, (pRequest.DataInfo.HasValue ? pRequest.DataInfo.Value : new Nullable <DateTime>())); lAcessaDados.AddInParameter(lCommand, "@PerfilCota", DbType.String, pRequest.PerfilCota); lAcessaDados.AddInParameter(lCommand, "@DataDiv", DbType.DateTime, pRequest.DataDiv); lAcessaDados.AddInParameter(lCommand, "@RazaoSocial", DbType.String, pRequest.RazaoSocial); lAcessaDados.AddInParameter(lCommand, "@CNPJ", DbType.String, pRequest.DsCnpj); lAcessaDados.AddInParameter(lCommand, "@Aberto", DbType.String, pRequest.Aberto); lAcessaDados.AddInParameter(lCommand, "@Exclusivo", DbType.String, pRequest.Exclusivo); lAcessaDados.AddInParameter(lCommand, "@PrazoEmissaoCotas", DbType.String, pRequest.PrazoEmissaoCotas); lAcessaDados.AddInParameter(lCommand, "@PrazoConvResg", DbType.String, pRequest.PrazoConvResg); lAcessaDados.AddInParameter(lCommand, "@PrazoPagtoResg", DbType.String, pRequest.PrazoPgtoResg); lAcessaDados.AddInParameter(lCommand, "@CarenciaUniversal", DbType.Int32, pRequest.CarenciaUniversal); lAcessaDados.AddInParameter(lCommand, "@CarenciaCiclica", DbType.Int32, pRequest.CarenciaCiclica); lAcessaDados.AddInParameter(lCommand, "@CotaAbertura", DbType.String, pRequest.CotaAbertura); lAcessaDados.AddInParameter(lCommand, "@PeriodoDivulgacao", DbType.Int32, pRequest.PeriodoDivulg); lAcessaDados.AddInParameter(lCommand, "@DataHora", DbType.DateTime, pRequest.DataHora); lAcessaDados.ExecuteNonQuery(lCommand); } } catch (Exception ex) { gLogger.ErrorFormat("Erro encontrado no método SalvarIndicadoresMes - [{0}]", ex.StackTrace); } } }
public static List <FundosInfo> ListarFundos() { var lRetorno = new List <FundosInfo>(); try { ConexaoDbHelper lAcessaDados = new ConexaoDbHelper(); lAcessaDados.ConnectionStringName = gNomeConexaoFundos; string lSql = "select idProduto, dsNomeProduto from tbProduto order by dsNomeProduto asc"; using (DbCommand lDbCommand = lAcessaDados.CreateCommand(CommandType.Text, lSql)) { DataTable lDataTable = lAcessaDados.ExecuteDbDataTable(lDbCommand); if (null != lDataTable && lDataTable.Rows.Count > 0) { var lFundo = new FundosInfo(); for (int i = 0; i <= lDataTable.Rows.Count - 1; i++) { lFundo = new FundosInfo(); lFundo.CodigoFundo = lDataTable.Rows[i]["idProduto"].DBToInt32(); lFundo.NomeFundo = lDataTable.Rows[i]["dsNomeProduto"].DBToString(); lRetorno.Add(lFundo); } } } } catch (Exception ex) { throw ex; } return(lRetorno); }
private FundosInfo RetornaFundos(string linha) { FundosInfo lFundo = new FundosInfo(); try { string[] lCadFundoString = linha.Split('\t'); lFundo.CodigoFundo = lCadFundoString[0].Replace("\n", ""); lFundo.CodInst = lCadFundoString[1].ToString(); lFundo.NomeFantasia = lCadFundoString[2].ToString(); lFundo.CodigoTipo = lCadFundoString[3].DBToInt32(); lFundo.DataInicioFundo = lCadFundoString[4].DBToDateTime(); lFundo.DataFimFundo = lCadFundoString[5].DBToDateTime(eDateNull.Permite); lFundo.DataInfo = lCadFundoString[6].DBToDateTime(eDateNull.Permite); lFundo.PerfilCota = lCadFundoString[7].DBToChar(); lFundo.DataDiv = lCadFundoString[8].DBToDateTime(); lFundo.RazaoSocial = lCadFundoString[9].ToString(); lFundo.DsCnpj = lCadFundoString[10].ToString(); lFundo.Aberto = lCadFundoString[11].DBToChar(); lFundo.Exclusivo = lCadFundoString[12].DBToChar(); lFundo.PrazoEmissaoCotas = lCadFundoString[13].ToString(); lFundo.PrazoConvResg = lCadFundoString[14].ToString(); lFundo.PrazoPgtoResg = lCadFundoString[15].ToString(); lFundo.CarenciaUniversal = lCadFundoString[16].DBToInt32(); lFundo.CarenciaCiclica = lCadFundoString[17].DBToInt32(); lFundo.CotaAbertura = lCadFundoString[18].DBToChar(); lFundo.PeriodoDivulg = lCadFundoString[19].DBToChar(); lFundo.DataHora = DateTime.Now; } catch (Exception ex) { gLogger.ErrorFormat("Erro encontrado no método RetornaFundosMes - [{0}] ", ex.StackTrace); } return(lFundo); }
/// <summary> /// /// </summary> /// <param name="pRequest"></param> /// <returns></returns> public List <FundosInfo> ConsultarClientesFundosItau(ListarFundosRequest pRequest) { List <FundosInfo> lRetorno = new List <FundosInfo>(); AcessaDados acesso = new AcessaDados(); acesso.ConnectionStringName = "Cadastro"; string cpfcnpj = ""; using (DbCommand cmd = acesso.CreateCommand(CommandType.StoredProcedure, "cpfcnpj_sel_sp")) { acesso.AddInParameter(cmd, "@cd_codigo", DbType.Int32, pRequest.IdCliente); DataTable table = acesso.ExecuteDbDataTable(cmd); if (table.Rows.Count > 0) { DataRow dr = table.Rows[0]; cpfcnpj = dr["ds_cpfcnpj"].DBToString().PadLeft(15, '0'); } } logger.Debug("Obteve CPF/CNPJ [" + cpfcnpj + "]"); acesso = new AcessaDados(); acesso.ConnectionStringName = "FundosItau"; using (DbCommand cmd = acesso.CreateCommand(CommandType.StoredProcedure, "prc_sel_posicao_cotista")) { acesso.AddInParameter(cmd, "@dsCpfCnpj", DbType.String, cpfcnpj); DataTable table = acesso.ExecuteDbDataTable(cmd); foreach (DataRow dr in table.Rows) { FundosInfo fundo = new FundosInfo(); fundo.IdCliente = pRequest.IdCliente; fundo.Cota = dr["valorCota"].DBToDecimal(); fundo.DataAtualizacao = dr["dtReferencia"].DBToDateTime(); fundo.IOF = dr["valorIOF"].DBToDecimal(); fundo.IR = dr["valorIR"].DBToDecimal(); fundo.NomeFundo = dr["dsRazaoSocial"].DBToString(); fundo.Quantidade = dr["quantidadeCotas"].DBToDecimal(); fundo.ValorBruto = dr["valorBruto"].DBToDecimal(); fundo.ValorLiquido = dr["valorLiquido"].DBToDecimal(); fundo.Cnpj = dr["dsCnpj"].DBToString(); //info.Agencia = lRow["Agencia"].ToString(); //info.BancoCli = lRow["Banco"].ToString(); //info.Conta = lRow["Conta"].ToString(); //info.CPFCNPJ = lRow["dsCpfCnpj"].ToString(); //info.DataProcessamento = lRow["dtProcessamento"].DBToDateTime(); //info.DataReferencia = lRow["dtReferencia"].DBToDateTime(); //info.DigitoConta = lRow["DigitoConta"].ToString(); //info.IDCotista = lRow["idCotista"].ToString(); //info.IDFundo = lRow["idFundo"].DBToInt32(); //info.IDMovimento = lRow["idMovimento"].DBToInt32(); //info.IDProcessamento = lRow["idProcessamento"].DBToInt32(); //info.QtdeCotas = lRow["quantidadeCotas"].DBToDecimal(); //info.ValorBruto = lRow["valorBruto"].DBToDecimal(); //info.ValorCota = lRow["valorCota"].DBToDecimal(); //info.ValorIR = lRow["valorIR"].DBToDecimal(); //info.ValorLiquido = lRow["valorLiquido"].DBToDecimal(); lRetorno.Add(fundo); } } return(lRetorno); }