예제 #1
0
        private void txtRendimentos_TextChanged(object sender, EventArgs e)
        {
            TextBox txt = ((TextBox)sender);

            Funcoes.Moeda(ref txt);
        }
예제 #2
0
        private void txtValorInicial_TextChanged(object sender, EventArgs e)
        {
            TextBox txt = ((TextBox)sender);

            Funcoes.Moeda(ref txt);
        }
예제 #3
0
        private void txtAporteMensal_TextChanged(object sender, EventArgs e)
        {
            TextBox txt = ((TextBox)sender);

            Funcoes.Moeda(ref txt);
        }
예제 #4
0
        private void Calcular()
        {
            string  texto           = "";
            decimal valorRendimento = 0;
            decimal valorInicial    = Convert.ToDecimal(txtValorInicial.Text);
            decimal aporte          = Convert.ToDecimal(txtAporteMensal.Text);
            decimal redimento       = Convert.ToDecimal(txtRendimentos.Text);
            decimal periodo         = Convert.ToInt32(txtPeriodo.Text);

            for (int i = 0; i < periodo; i++)
            {
                valorRendimento = valorInicial + aporte + Funcoes.CalcularRendimentos(valorInicial, redimento);


                texto += String.Format(Funcoes.MENSAGEM, Convert.ToString(i + 1), Funcoes.FormatarValor(valorRendimento)) + "\r\n";


                Funcoes.AtualizarGraficoControle(chart1, Convert.ToString(i + 1), valorRendimento);


                Funcoes.AtualizarValoresControle(txtResultado, "Text", texto);

                valorInicial = valorRendimento;
            }

            Funcoes.AtualizarValoresControle(lblMontante, "Text", String.Format(Funcoes.LBL_MONTANTE, Funcoes.FormatarValor(valorRendimento)));
        }