public void SalvarProdutoMovimento(FundosMovCotaInfo pResquest) { try { using (AcessaDados lAcessaDados = new AcessaDados()) { lAcessaDados.Conexao = new Conexao(); lAcessaDados.ConnectionStringName = "PlataformaInviXX"; using (DbCommand lCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "PRC_TBPRODUTOMOVIMENTOCOTA_INS")) { lAcessaDados.AddInParameter(lCommand, "@idProduto", DbType.Int32, pResquest.IdProduto); lAcessaDados.AddInParameter(lCommand, "@data", DbType.DateTime, pResquest.Data); lAcessaDados.AddInParameter(lCommand, "@VlrMinAplicInicial", DbType.Decimal, pResquest.ValorMinimoAplicacaoInicial); lAcessaDados.AddInParameter(lCommand, "@VlrMinAplicAdicional", DbType.Decimal, pResquest.ValorMinimoAplicacaoAdicional); lAcessaDados.AddInParameter(lCommand, "@VlrMinResgate", DbType.Decimal, pResquest.ValorMinimoResgate); lAcessaDados.AddInParameter(lCommand, "@VlrMinSaldo", DbType.Decimal, pResquest.ValorMinimoAplicacao); lAcessaDados.AddInParameter(lCommand, "@dataAtualizacao", DbType.DateTime, pResquest.DataHora); lAcessaDados.ExecuteNonQuery(lCommand); } } } catch (Exception ex) { gLogger.ErrorFormat("Erro encontrado no método SalvarProdutoMovimento - [{0}] ", ex.StackTrace); } }
private FundosMovCotaInfo RetornaFundosMovCotaInfo(string linha) { FundosMovCotaInfo lMovCota = new FundosMovCotaInfo(); try { string [] lMovCotaString = linha.Split('\t'); lMovCota.CodigoFundo = lMovCotaString[0].Replace("\n", ""); lMovCota.Data = Convert.ToDateTime(lMovCotaString[1], gCultura); lMovCota.DataHora = DateTime.Now; lMovCota.Identificador = lMovCotaString[6]; lMovCota.ValorMinimoAplicacao = Convert.ToDouble(lMovCotaString[5] == ""?"0":lMovCotaString[5], gCultura); lMovCota.ValorMinimoAplicacaoAdicional = Convert.ToDouble(lMovCotaString[3] == ""?"0":lMovCotaString[3], gCultura); lMovCota.ValorMinimoAplicacaoInicial = Convert.ToDouble(lMovCotaString[2] == ""?"0":lMovCotaString[2], gCultura); lMovCota.ValorMinimoResgate = Convert.ToDouble(lMovCotaString[4] == ""?"0":lMovCotaString[4], gCultura); } catch (Exception ex) { gLogger.ErrorFormat("Erro encontrado no método RetornaFundosMovCotaInfo - [{0}]", ex.StackTrace); } return(lMovCota); }