DevTreks.Extensions/NPVCalculators/BIs/BICalculator.cs
/// <summary>
/// Add child nodes to new growth period nodes.
/// The growth period gets 1 component, operation, outcome, output, and input node added
/// </summary>
Add child nodes to new growth period nodes.
The growth period gets 1 component, operation, outcome, output, and input node added
Add child nodes to new growth period nodes . The growth period gets 1 component operation outcome output and input node added
public void AddGrowthOutputChildren(CalculatorParameters calcParameters,
            string seriesType, string compName, int timeId,
            DateTime endOfGrowthPeriodDate, double timePrice4GPTotal,
            double timeInterest4GPTotal, double timeAmort4GPTotal,
            double timeAmort4IntTotal)
        {
            calcParameters.ParentOutcome = new Outcome();
            Output newOutput = new Output();
            int iCompAEId = INT_SEED;
            int iOutputAEId = INT_SEED;
            iOutputAEId = CalculatorHelpers.GetRandomInteger(calcParameters);
            iCompAEId = CalculatorHelpers.GetRandomInteger(calcParameters);
            calcParameters.ParentOutcome.AnnuityType = TimePeriod.ANNUITY_TYPES.regular;
            calcParameters.ParentOutcome.Id = iCompAEId;
            calcParameters.ParentOutcome.Name = compName;
            calcParameters.ParentOutcome.EffectiveLife = 1;
            calcParameters.ParentOutcome.SalvageValue = 0;
            calcParameters.ParentOutcome.Unit = seriesType;
            calcParameters.ParentOutcome.TotalAMR = timeAmort4GPTotal + timeAmort4IntTotal;
            calcParameters.ParentOutcome.TotalAMR_INT = timeAmort4IntTotal;
            calcParameters.ParentOutcome.TotalR = timePrice4GPTotal + timeInterest4GPTotal;
            calcParameters.ParentOutcome.TotalR_INT = timeInterest4GPTotal;
            calcParameters.ParentOutcome.Amount = 1;
            calcParameters.ParentOutcome.Date = endOfGrowthPeriodDate;
            calcParameters.ParentOutcome.IncentiveRate = 0;
            calcParameters.ParentOutcome.IncentiveAmount = 0;
            iOutputAEId = CalculatorHelpers.GetRandomInteger(calcParameters);
            newOutput.AnnuityType = TimePeriod.ANNUITY_TYPES.regular;
            newOutput.Id = iOutputAEId;
            newOutput.Name = Errors.MakeStandardErrorMsg("CALCULATOR_SEELAST_PERIOD");
            newOutput.Label = BudgetInvestment.ANNUITY;
            newOutput.Date = endOfGrowthPeriodDate;
            newOutput.TotalAMR = timeAmort4GPTotal;
            newOutput.TotalAMR_INT = timeAmort4IntTotal;
            newOutput.TotalR = timePrice4GPTotal;
            newOutput.TotalR_INT = timeInterest4GPTotal;
            newOutput.Amount = 1;
            newOutput.CompositionAmount = 1;
            newOutput.Times = 1;
            newOutput.Price = timePrice4GPTotal;
            newOutput.Unit = seriesType;
            newOutput.OutputGroupId = (int)TimePeriod.ANNUITY_TYPES.regular;
            newOutput.OutputGroupName = seriesType;
            newOutput.TypeId = (int)TimePeriod.ANNUITY_TYPES.regular;
            newOutput.Name = seriesType;
            if (calcParameters.ParentOutcome.Outputs == null)
                calcParameters.ParentOutcome.Outputs = new List<Output>();
            calcParameters.ParentOutcome.Outputs.Add(newOutput);
            if (calcParameters.ParentTimePeriod.Outcomes == null)
                calcParameters.ParentTimePeriod.Outcomes
                    = new List<Outcome>();
            calcParameters.ParentTimePeriod.Outcomes.Add(calcParameters.ParentOutcome);
        }
public void AddGrowthOutputChildren ( CalculatorParameters calcParameters , string seriesType , string compName , int timeId , DateTime endOfGrowthPeriodDate , double timePrice4GPTotal , double timeInterest4GPTotal , double timeAmort4GPTotal , double timeAmort4IntTotal ) { calcParameters . ParentOutcome = new Outcome ( ) ; Output newOutput = new Output ( ) ; int iCompAEId = INT_SEED ; int iOutputAEId = INT_SEED ; iOutputAEId = CalculatorHelpers . GetRandomInteger ( calcParameters ) ; iCompAEId = CalculatorHelpers . GetRandomInteger ( calcParameters ) ; calcParameters . ParentOutcome . AnnuityType = TimePeriod . ANNUITY_TYPES . regular ; calcParameters . ParentOutcome . Id = iCompAEId ; calcParameters . ParentOutcome . Name = compName ; calcParameters . ParentOutcome . EffectiveLife = 1 ; calcParameters . ParentOutcome . SalvageValue = 0 ; calcParameters . ParentOutcome . Unit = seriesType ; calcParameters . ParentOutcome . TotalAMR = timeAmort4GPTotal + timeAmort4IntTotal ; calcParameters . ParentOutcome . TotalAMR_INT = timeAmort4IntTotal ; calcParameters . ParentOutcome . TotalR = timePrice4GPTotal + timeInterest4GPTotal ; calcParameters . ParentOutcome . TotalR_INT = timeInterest4GPTotal ; calcParameters . ParentOutcome . Amount = 1 ; calcParameters . ParentOutcome . Date = endOfGrowthPeriodDate ; calcParameters . ParentOutcome . IncentiveRate = 0 ; calcParameters . ParentOutcome . IncentiveAmount = 0 ; iOutputAEId = CalculatorHelpers . GetRandomInteger ( calcParameters ) ; newOutput . AnnuityType = TimePeriod . ANNUITY_TYPES . regular ; newOutput . Id = iOutputAEId ; newOutput . Name = Errors . MakeStandardErrorMsg ( " " ) ; newOutput . Label = BudgetInvestment . ANNUITY ; newOutput . Date = endOfGrowthPeriodDate ; newOutput . TotalAMR = timeAmort4GPTotal ; newOutput . TotalAMR_INT = timeAmort4IntTotal ; newOutput . TotalR = timePrice4GPTotal ; newOutput . TotalR_INT = timeInterest4GPTotal ; newOutput . Amount = 1 ; newOutput . CompositionAmount = 1 ; newOutput . Times = 1 ; newOutput . Price = timePrice4GPTotal ; newOutput . Unit = seriesType ; newOutput . OutputGroupId = ( int ) TimePeriod . ANNUITY_TYPES . regular ; newOutput . OutputGroupName = seriesType ; newOutput . TypeId = ( int ) TimePeriod . ANNUITY_TYPES . regular ; newOutput . Name = seriesType ; if ( calcParameters . ParentOutcome . Outputs == null ) calcParameters . ParentOutcome . Outputs = new List < Output > ( ) ; calcParameters . ParentOutcome . Outputs . Add ( newOutput ) ; if ( calcParameters . ParentTimePeriod . Outcomes == null ) calcParameters . ParentTimePeriod . Outcomes = new List < Outcome > ( ) ; calcParameters . ParentTimePeriod . Outcomes . Add ( calcParameters . ParentOutcome ) ; }
Add child nodes to new growth period nodes.
Add child nodes to new growth period nodes .
//use ancestor objects for accumulating totals //note: interest has already been added to the totals for display //note: interest has already been added to the totals for display //set the attributes //note: interest has already been added to the totals for display //opcomp already has totals //add cumulative totals //SetOutcomeCalculations(calcParameters, calcParameters.ParentOutcome);
calcParameters
CalculatorParameters
seriesType
string
compName
string
timeId
int
endOfGrowthPeriodDate
DateTime
timePrice4GPTotal
double
timeInterest4GPTotal
double
timeAmort4GPTotal
double
timeAmort4IntTotal
double