Пример #1
0
 public void SetOutputDiscountedAttributes(CalculatorParameters calcParameters,
                                           ref XElement currentCalculationsElement, ref XElement currentElement,
                                           IDictionary <string, string> updates)
 {
     //set the base output's new calculations
     this.SetOutputAttributes(calcParameters, ref currentElement, updates);
     //use the same attributes within the calculator as well
     this.SetNewOutputAttributes(calcParameters, ref currentCalculationsElement);
     //and the totals
     this.SetTotalBenefitsAttributes(string.Empty, ref currentCalculationsElement);
     CalculatorHelpers.SetAttributeBool(currentCalculationsElement,
                                        BudgetInvestment.ISDISCOUNTED, this.IsDiscounted);
     CalculatorHelpers.SetAttributeDateS(currentCalculationsElement,
                                         OperationComponent.ENDOFPERIOD_DATE, this.EndOfPeriodDate);
 }
Пример #2
0
 //growth periods and other new tps that don't affect db 
 public void SetNewTimePeriodAttributes(CalculatorParameters calcParameters,
     ref XElement currentCalculationsElement, ref XElement currentElement,
     IDictionary<string, string> updates)
 {
     CalculatorHelpers.SetAttribute(currentElement,
        DataAppHelpers.General.NAME2, this.Name2);
     if (currentElement.Name.LocalName.StartsWith(
         DataAppHelpers.Economics1.BUDGET_TYPES.budget.ToString()))
     {
         CalculatorHelpers.SetAttributeDoubleF4(currentElement,
             DataAppHelpers.Economics1.BUDGET_TPENTERPRISE_AMOUNT, this.Amount);
     }
     else
     {
         CalculatorHelpers.SetAttributeDoubleF4(currentElement,
             DataAppHelpers.Economics1.INVEST_TPENTERPRISE_AMOUNT, this.Amount);
     }
     CalculatorHelpers.SetAttributeDateS(currentElement,
        Calculator1.cDate, this.Date);
     CalculatorHelpers.SetAttribute(currentElement,
        DataAppHelpers.General.UNIT, this.Unit);
     CalculatorHelpers.SetAttributeBool(currentElement,
        DataAppHelpers.Economics1.ISDISCOUNTED, this.IsDiscounted);
     CalculatorHelpers.SetAttributeBool(currentElement,
        DataAppHelpers.Economics1.ISCOMMON_REFERENCE, this.IsCommonReference);
     CalculatorHelpers.SetAttributeInt(currentElement,
       DataAppHelpers.Economics1.GROWTH_PERIODS, this.GrowthPeriods);
     CalculatorHelpers.SetAttributeInt(currentElement,
        DataAppHelpers.Economics1.GROWTH_TYPE_ID, this.GrowthTypeId);
     CalculatorHelpers.SetAttributeDoubleF4(currentElement,
         DataAppHelpers.Economics1.OVERHEAD_FACTOR, this.OverheadFactor);
     CalculatorHelpers.SetAttributeDoubleF4(currentElement,
         DataAppHelpers.General.INCENTIVE_AMOUNT, this.IncentiveAmount);
     CalculatorHelpers.SetAttributeDoubleF4(currentElement,
        DataAppHelpers.General.INCENTIVE_RATE, this.IncentiveRate);
     CalculatorHelpers.SetAttribute(currentElement,
        DataAppHelpers.Economics1.ANNUITY_TYPE, this.AnnuityType.ToString());
     //any outcome annuities on hand are serialized using:
     AddOutcomesToTimePeriod(calcParameters,
         this.Outcomes, currentCalculationsElement, ref currentElement);
     //any opcomp annuities on hand are serialized using:
     AddOpCompsToTimePeriod(calcParameters,
         this.OperationComponents, currentCalculationsElement, ref currentElement);
 }
Пример #3
0
 public static void SetInputAllAttributes(Input input,
                                          ref XElement elementNeedingAttributes)
 {
     CalculatorHelpers.SetAttributeInt(elementNeedingAttributes,
                                       Calculator1.cId, input.Id);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    Calculator1.cName, input.Name.ToString());
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    Calculator1.cDescription, input.Description.ToString());
     CalculatorHelpers.SetAttributeDateS(elementNeedingAttributes,
                                         DataAppHelpers.Prices.INPUT_DATE, input.Date);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.OC_AMOUNT, input.OCAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.OC_PRICE, input.OCPrice);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.OC_UNIT, input.OCUnit);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.AOH_AMOUNT, input.AOHAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.AOH_PRICE, input.AOHPrice);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.AOH_UNIT, input.AOHUnit);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.CAP_AMOUNT, input.CAPAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.CAP_PRICE, input.CAPPrice);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.CAP_UNIT, input.CAPUnit);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.General.INCENTIVE_AMOUNT, input.IncentiveAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.General.INCENTIVE_RATE, input.IncentiveRate);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.INPUT_TIMES, input.Times);
     CalculatorHelpers.SetAttributeBool(elementNeedingAttributes,
                                        DataAppHelpers.Prices.USE_AOH, input.UseAOH);
     CalculatorHelpers.SetAttributeInt(elementNeedingAttributes,
                                       DataAppHelpers.Prices.INPUT_GROUP_ID, input.InputGroupId);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.INPUT_GROUP_NAME, input.InputGroupName.ToString());
 }
Пример #4
0
 public void SetInputDiscountedAttributes(CalculatorParameters calcParameters,
                                          ref XElement currentCalculationsElement, ref XElement currentElement,
                                          IDictionary <string, string> updates)
 {
     //set the base input's new calculations
     this.SetInputAttributes(calcParameters, ref currentElement, updates);
     //use the same attributes within the calculator as well
     this.SetNewInputAttributes(calcParameters, ref currentCalculationsElement);
     //and the totals
     this.SetTotalCostsAttributes(string.Empty, ref currentCalculationsElement);
     CalculatorHelpers.SetAttributeBool(currentCalculationsElement,
                                        BudgetInvestment.ISDISCOUNTED, this.IsDiscounted);
     CalculatorHelpers.SetAttributeDateS(currentCalculationsElement,
                                         OperationComponent.ENDOFPERIOD_DATE, this.EndOfPeriodDate);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            OperationComponent.EFFECTIVE_LIFE, this.EffectiveLife);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            OperationComponent.SALVAGE_VALUE, this.SalvageValue);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            Input.INPUT_TIMES, this.Times);
 }
Пример #5
0
 public void SetHealthBenefit1Attributes(string attNameExtension,
                                         ref XElement currentCalculationsElement)
 {
     if (Demographics == null)
     {
         Demographics = new Demog1();
     }
     Demographics.SetDemog1Attributes(attNameExtension, ref currentCalculationsElement);
     //don't set any input attributes; each calculator should set what's needed separately
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cOutputCost, attNameExtension), this.OutputCost);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cBenefitAdjustment, attNameExtension), this.BenefitAdjustment);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cAdjustedBenefit, attNameExtension), this.AdjustedBenefit);
     CalculatorHelpers.SetAttribute(currentCalculationsElement,
                                    string.Concat(cOutputEffect1Name, attNameExtension), this.OutputEffect1Name);
     CalculatorHelpers.SetAttribute(currentCalculationsElement,
                                    string.Concat(cOutputEffect1Unit, attNameExtension), this.OutputEffect1Unit);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cOutputEffect1Amount, attNameExtension), this.OutputEffect1Amount);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cOutputEffect1Price, attNameExtension), this.OutputEffect1Price);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cOutputEffect1Cost, attNameExtension), this.OutputEffect1Cost);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cAverageBenefitRating, attNameExtension), this.AverageBenefitRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cPhysicalHealthRating, attNameExtension), this.PhysicalHealthRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cEmotionalHealthRating, attNameExtension), this.EmotionalHealthRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cSocialHealthRating, attNameExtension), this.SocialHealthRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cEconomicHealthRating, attNameExtension), this.EconomicHealthRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cHealthCareDeliveryRating, attNameExtension), this.HealthCareDeliveryRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cBeforeQOLRating, attNameExtension), this.BeforeQOLRating);
     CalculatorHelpers.SetAttributeInt(currentCalculationsElement,
                                       string.Concat(cAfterQOLRating, attNameExtension), this.AfterQOLRating);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            string.Concat(cBeforeYears, attNameExtension), this.BeforeYears);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            string.Concat(cAfterYears, attNameExtension), this.AfterYears);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            string.Concat(cAfterYearsProb, attNameExtension), this.AfterYearsProb);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            string.Concat(cTimeTradeoffYears, attNameExtension), this.TimeTradeoffYears);
     CalculatorHelpers.SetAttributeDoubleF2(currentCalculationsElement,
                                            string.Concat(cEquityMultiplier, attNameExtension), this.EquityMultiplier);
     CalculatorHelpers.SetAttribute(currentCalculationsElement,
                                    string.Concat(cBenefitAssessment, attNameExtension), this.BenefitAssessment);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cQALY, attNameExtension), this.QALY);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cICERQALY, attNameExtension), this.ICERQALY);
     CalculatorHelpers.SetAttributeDoubleF3(currentCalculationsElement,
                                            string.Concat(cTTOQALY, attNameExtension), this.TTOQALY);
     CalculatorHelpers.SetAttributeBool(currentCalculationsElement,
                                        string.Concat(cWillDoSurvey, attNameExtension), this.WillDoSurvey);
 }