Exemple #1
0
 public virtual void InitTotalNPV1StocksProperties(NPV1Stock calculator)
 {
     //this is called during the initial calculator collections
     //it adds those initial calcs to correct agg stock
     //base calculator holds totals
     if (this.AnalyzerType
         == NPV1AnalyzerHelper.ANALYZER_TYPES.npvstat1.ToString())
     {
         this.Stat1 = new NPV1Stat1();
         //each analysis stores data according to analyzertype and nowehere else
         if (calculator.Stat1 != null)
         {
             this.Stat1.CalcParameters = new CalculatorParameters(calculator.Stat1.CalcParameters);
             this.Stat1.CopyCalculatorProperties(calculator.Stat1);
             this.Stat1.CopyTotalCostsProperties(calculator.Stat1);
             this.Stat1.CopyTotalBenefitsProperties(calculator.Stat1);
         }
     }
     else if (this.AnalyzerType
              == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeyr.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeid.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangealt.ToString())
     {
         this.Change1 = new NPV1Change1();
         if (calculator.Change1 != null)
         {
             this.Change1.CalcParameters = new CalculatorParameters(calculator.Change1.CalcParameters);
             this.Change1.CopyCalculatorProperties(calculator.Change1);
             this.Change1.CopyTotalCostsProperties(calculator.Change1);
             this.Change1.CopyTotalBenefitsProperties(calculator.Change1);
         }
     }
     else if (this.AnalyzerType
              == NPV1AnalyzerHelper.ANALYZER_TYPES.npvprogress1.ToString())
     {
         this.Progress1 = new NPV1Progress1();
         if (calculator.Progress1 != null)
         {
             this.Progress1.CalcParameters = new CalculatorParameters(calculator.Progress1.CalcParameters);
             this.Progress1.CopyCalculatorProperties(calculator.Progress1);
             this.Progress1.CopyTotalCostsProperties(calculator.Progress1);
             this.Progress1.CopyTotalBenefitsProperties(calculator.Progress1);
         }
     }
     else
     {
         this.Total1 = new NPV1Total1();
         if (calculator.Total1 != null)
         {
             this.Total1.CalcParameters = new CalculatorParameters(calculator.Total1.CalcParameters);
             this.Total1.CopyCalculatorProperties(calculator.Total1);
             this.Total1.CopyTotalCostsProperties(calculator.Total1);
             this.Total1.CopyTotalBenefitsProperties(calculator.Total1);
         }
     }
 }
Exemple #2
0
        public virtual void SetTotalNPV1StocksProperties(XElement calculator)
        {
            //remember that the analyzer inheriting from this must .SetAnalyzerProps
            string sAttNameExtension = string.Empty;

            if (this.AnalyzerType
                == NPV1AnalyzerHelper.ANALYZER_TYPES.npvstat1.ToString())
            {
                if (this.Stat1 == null)
                {
                    this.Stat1 = new NPV1Stat1();
                }
                this.Stat1.SetTotalNPV1Stat1Properties(
                    this.Stat1, sAttNameExtension, calculator);
            }
            else if (this.AnalyzerType
                     == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeyr.ToString() ||
                     this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeid.ToString() ||
                     this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangealt.ToString())
            {
                if (this.Change1 == null)
                {
                    this.Change1 = new NPV1Change1();
                }
                this.Change1.SetTotalNPV1Change1Properties(
                    this.Change1, sAttNameExtension, calculator);
            }
            else if (this.AnalyzerType
                     == NPV1AnalyzerHelper.ANALYZER_TYPES.npvprogress1.ToString())
            {
                if (this.Progress1 == null)
                {
                    this.Progress1 = new NPV1Progress1();
                }
                this.Progress1.SetTotalNPV1Progress1Properties(
                    this.Progress1, sAttNameExtension, calculator);
            }
            else
            {
                if (this.Total1 == null)
                {
                    this.Total1 = new NPV1Total1();
                }
                this.Total1.SetTotalNPV1Total1Properties(
                    this.Total1, sAttNameExtension, calculator);
            }
        }
Exemple #3
0
 public virtual void InitTotalNPV1StocksProperties()
 {
     if (this.Total1 == null)
     {
         this.Total1 = new NPV1Total1();
     }
     if (this.Stat1 == null)
     {
         this.Stat1 = new NPV1Stat1();
     }
     if (this.Change1 == null)
     {
         this.Change1 = new NPV1Change1();
     }
     if (this.Progress1 == null)
     {
         this.Progress1 = new NPV1Progress1();
     }
     if (this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvstat1.ToString())
     {
         //this.Stat1 = new NPV1Stat1();
         this.Stat1.InitTotalNPV1Stat1Properties(this.Stat1);
     }
     else if (this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeyr.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeid.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangealt.ToString())
     {
         //this.Change1 = new NPV1Change1();
         this.Change1.InitTotalNPV1Change1Properties(this.Change1);
     }
     else if (this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvprogress1.ToString())
     {
         //this.Progress1 = new NPV1Progress1();
         this.Progress1.InitTotalNPV1Progress1Properties(this.Progress1);
     }
     else
     {
         //default are total indicators
         //this.Total1 = new NPV1Total1();
         this.Total1.InitTotalNPV1Total1Properties(this.Total1);
     }
 }
Exemple #4
0
 public virtual void InitTotalNPV1StocksProperties(CostBenefitCalculator baseElement)
 {
     //this is called during the initial calculator collections
     //it adds those initial calcs to correct agg stock
     //base calculator holds totals
     //each agg has to set CalcParameters during object construction
     if (this.AnalyzerType
         == NPV1AnalyzerHelper.ANALYZER_TYPES.npvstat1.ToString())
     {
         this.Stat1 = new NPV1Stat1();
         this.Stat1.CopyCalculatorProperties(baseElement);
         this.Stat1.CopyTotalCostsProperties(baseElement);
         this.Stat1.CopyTotalBenefitsProperties(baseElement);
     }
     else if (this.AnalyzerType
              == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeyr.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeid.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangealt.ToString())
     {
         this.Change1 = new NPV1Change1();
         this.Change1.CopyCalculatorProperties(baseElement);
         this.Change1.CopyTotalCostsProperties(baseElement);
         this.Change1.CopyTotalBenefitsProperties(baseElement);
     }
     else if (this.AnalyzerType
              == NPV1AnalyzerHelper.ANALYZER_TYPES.npvprogress1.ToString())
     {
         this.Progress1 = new NPV1Progress1();
         this.Progress1.CopyCalculatorProperties(baseElement);
         this.Progress1.CopyTotalCostsProperties(baseElement);
         this.Progress1.CopyTotalBenefitsProperties(baseElement);
     }
     else
     {
         this.Total1 = new NPV1Total1();
         this.Total1.CopyCalculatorProperties(baseElement);
         this.Total1.CopyTotalCostsProperties(baseElement);
         this.Total1.CopyTotalBenefitsProperties(baseElement);
     }
 }
Exemple #5
0
 public virtual void CopyTotalNPV1StocksProperties(
     NPV1Stock calculator)
 {
     //this is called after the initial calculator collections have been built
     //it adds those initial calcs to correct agg stock
     this.CopyCalculatorProperties(calculator);
     this.CalcParameters = calculator.CalcParameters;
     //base calculator holds totals (always inits with calculator.Total)
     if (this.AnalyzerType
         == NPV1AnalyzerHelper.ANALYZER_TYPES.npvstat1.ToString())
     {
         this.Stat1 = new NPV1Stat1();
         this.Stat1.CopyTotalNPV1Stat1Properties(
             this.Stat1, calculator.Stat1);
     }
     else if (this.AnalyzerType
              == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeyr.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangeid.ToString() ||
              this.AnalyzerType == NPV1AnalyzerHelper.ANALYZER_TYPES.npvchangealt.ToString())
     {
         this.Change1 = new NPV1Change1();
         this.Change1.CopyTotalNPV1Change1Properties(
             this.Change1, calculator.Change1);
     }
     else if (this.AnalyzerType
              == NPV1AnalyzerHelper.ANALYZER_TYPES.npvprogress1.ToString())
     {
         this.Progress1 = new NPV1Progress1();
         this.Progress1.CopyTotalNPV1Progress1Properties(
             this.Progress1, calculator.Progress1);
     }
     else
     {
         //calculator stores starting npv totals in calculator.Total1
         this.Total1 = new NPV1Total1();
         this.Total1.CopyTotalNPV1Total1Properties(
             this.Total1, calculator.Total1);
     }
 }