Ejemplo n.º 1
0
        private void btnCalculate_Click(object sender, EventArgs e)
        {
            FutureValueCalculatorClient fvCalculator = new FutureValueCalculatorClient();
            double dblTotalChequing = 0;
            double dblTotalSavings = 0;
            double dblTotalRRSP = 0;
            double dblPresentValue = 0;
            double dblInterestRate = 0;
            int intTermInYears = 0;
            double dblFutureValue = 0;

            if (ValidateFields())
            {
                dblTotalChequing = double.Parse(txtTotalChequing.Text);
                dblTotalSavings = double.Parse(txtTotalSavings.Text);
                dblTotalRRSP = double.Parse(txtTotalRRSP.Text);
                dblInterestRate = double.Parse(txtInterestRate.Text);
                intTermInYears = int.Parse(txtTermInYears.Text);

                dblPresentValue = dblTotalChequing + dblTotalSavings + dblTotalRRSP;
                dblFutureValue = fvCalculator.Calculate(dblPresentValue, dblInterestRate, intTermInYears);

                txtFutureValue.Text = "" + dblFutureValue;
            }
        }
Ejemplo n.º 2
0
        private void btnCalculate_Click(object sender, EventArgs e)
        {
            FutureValueCalculatorClient fvCalculator = new FutureValueCalculatorClient();
            double dblTotalChequing = 0;
            double dblTotalSavings  = 0;
            double dblTotalRRSP     = 0;
            double dblPresentValue  = 0;
            double dblInterestRate  = 0;
            int    intTermInYears   = 0;
            double dblFutureValue   = 0;


            if (ValidateFields())
            {
                dblTotalChequing = double.Parse(txtTotalChequing.Text);
                dblTotalSavings  = double.Parse(txtTotalSavings.Text);
                dblTotalRRSP     = double.Parse(txtTotalRRSP.Text);
                dblInterestRate  = double.Parse(txtInterestRate.Text);
                intTermInYears   = int.Parse(txtTermInYears.Text);

                dblPresentValue = dblTotalChequing + dblTotalSavings + dblTotalRRSP;
                dblFutureValue  = fvCalculator.Calculate(dblPresentValue, dblInterestRate, intTermInYears);

                txtFutureValue.Text = "" + dblFutureValue;
            }
        }