private TaxaAdministracaoInfo RetornaFundosTaxaAdm(string linha) { TaxaAdministracaoInfo lTaxaAdm = new TaxaAdministracaoInfo(); try { string[] lTaxaAdmString = linha.Split('\t'); lTaxaAdm.CodigoFundo = lTaxaAdmString[0].Replace("\n", ""); lTaxaAdm.DataInicio = Convert.ToDateTime(lTaxaAdmString[1], gCultura); lTaxaAdm.TaxaFixa = Convert.ToDouble(lTaxaAdmString[2] == "" ? "0" : lTaxaAdmString[2], gCultura); lTaxaAdm.CobraTaxaPerfomance = Convert.ToChar(lTaxaAdmString[3]); lTaxaAdm.TaxaPerfomance = lTaxaAdmString[4]; lTaxaAdm.RegraTaxaPerformance = lTaxaAdmString[5]; lTaxaAdm.TaxaEntrada = lTaxaAdmString[6]; lTaxaAdm.TaxaSaida = lTaxaAdmString[7]; lTaxaAdm.PeriodoCobTxPerf = Convert.ToInt32(lTaxaAdmString[8] == "" ? "0" : lTaxaAdmString[8]); lTaxaAdm.Unidade = Convert.ToChar(lTaxaAdmString[9]); lTaxaAdm.TaxaComposta = Convert.ToChar(lTaxaAdmString[10]); lTaxaAdm.DataHora = DateTime.Now; } catch (Exception ex) { gLogger.Error("Erro encontrado no método RetornaFundosTaxaAdm - ", ex); } return(lTaxaAdm); }
public void SalvarTaxaAdministrador(TaxaAdministracaoInfo pRequest) { using (AcessaDados lAcessaDados = new AcessaDados()) { lAcessaDados.Conexao = new Conexao(); lAcessaDados.ConnectionStringName = "PlataformaInviXX"; try { using (DbCommand lCommand = lAcessaDados.CreateCommand(CommandType.StoredProcedure, "PRC_TAXAADMINISTRADOR_INS")) { lAcessaDados.AddInParameter(lCommand, "@CodigoFundo", DbType.String, pRequest.CodigoFundo); lAcessaDados.AddInParameter(lCommand, "@DataInicio", DbType.DateTime, pRequest.DataInicio); lAcessaDados.AddInParameter(lCommand, "@TaxaFixa", DbType.Double, pRequest.TaxaFixa); lAcessaDados.AddInParameter(lCommand, "@CobraTaxaPerfomance", DbType.String, pRequest.CobraTaxaPerfomance); lAcessaDados.AddInParameter(lCommand, "@TaxaPerfomance", DbType.String, pRequest.TaxaPerfomance); lAcessaDados.AddInParameter(lCommand, "@RegraTaxaPerformance", DbType.String, pRequest.RegraTaxaPerformance); lAcessaDados.AddInParameter(lCommand, "@TaxaEntrada", DbType.String, pRequest.TaxaEntrada); lAcessaDados.AddInParameter(lCommand, "@TaxaSaida", DbType.String, pRequest.TaxaSaida); lAcessaDados.AddInParameter(lCommand, "@PeriodoCobTxPerf", DbType.Int32, pRequest.PeriodoCobTxPerf); lAcessaDados.AddInParameter(lCommand, "@Unidade", DbType.String, pRequest.Unidade); lAcessaDados.AddInParameter(lCommand, "@TaxaComposta", DbType.String, pRequest.TaxaComposta); lAcessaDados.AddInParameter(lCommand, "@DataHora", DbType.DateTime, pRequest.DataHora); lAcessaDados.ExecuteNonQuery(lCommand); } } catch (Exception ex) { gLogger.ErrorFormat("Erro encontrado no método SalvarRentabilidadeMes - [{0}]", ex.StackTrace); } } }