Example #1
0
 public void CopyTotalNPV1Total1RProperties(NPV1Total1 calculator)
 {
     if (calculator != null)
     {
         this.CopyTotalBenefitsPsandQsProperties(calculator);
     }
 }
Example #2
0
        public void SetTotalNPV1Total1Attributes(NPV1Total1 ind, string attNameExtension, ref XmlWriter writer)
        {
            bool bIsCostNode    = CalculatorHelpers.IsCostNode(this.CalcParameters.CurrentElementNodeName);
            bool bIsBenefitNode = CalculatorHelpers.IsBenefitNode(this.CalcParameters.CurrentElementNodeName);
            bool bIsBoth        = (bIsBenefitNode == false && bIsCostNode == false) ? true : false;

            if (bIsCostNode || bIsBoth)
            {
                ind.SetTotalCostsSummaryAttributes(attNameExtension, ref writer);
                if (this.CalcParameters.SubApplicationType == Constants.SUBAPPLICATION_TYPES.inputprices)
                {
                    //limited ps and qs
                    ind.SetTotalOCPricePsandQsAttributes(attNameExtension, ref writer);
                }
                else
                {
                    if (this.CalcParameters.SubApplicationType != Constants.SUBAPPLICATION_TYPES.componentprices &&
                        this.CalcParameters.SubApplicationType != Constants.SUBAPPLICATION_TYPES.operationprices)
                    {
                        ind.SetTotalCostsSummaryNetsAttributes(attNameExtension, ref writer);
                    }
                    if (this.CalcParameters.CurrentElementNodeName.Contains(Input.INPUT_PRICE_TYPES.input.ToString()))
                    {
                        //limited ps and qs
                        ind.SetTotalCostsPsandQsAttributes(attNameExtension, ref writer);
                    }
                }
            }
            if (bIsBenefitNode || bIsBoth)
            {
                ind.SetTotalBenefitsSummaryAttributes(attNameExtension, ref writer);
                ind.SetTotalBenefitsPsandQsAttributes(attNameExtension, ref writer);
            }
        }
Example #3
0
        public string GetTotalNPV1Total1Property(NPV1Total1 ind, string attName)
        {
            string sPropertyValue = string.Empty;

            ind.GetTotalBenefitsProperty(attName);
            ind.GetTotalCostsProperty(attName);
            return(sPropertyValue);
        }
Example #4
0
 public void InitTotalNPV1Total1Properties(NPV1Total1 ind)
 {
     ind.ErrorMessage = string.Empty;
     //includes summary data
     ind.InitTotalBenefitsProperties();
     ind.InitTotalCostsProperties();
     ind.CalcParameters = new CalculatorParameters();
 }
Example #5
0
 public void CopyTotalNPV1Total1Properties(NPV1Total1 ind,
                                           NPV1Stock calculator)
 {
     if (calculator != null)
     {
         ind.ErrorMessage = calculator.ErrorMessage;
         //includes summary data
         ind.CopyCalculatorProperties(calculator);
         ind.CopyTotalBenefitsProperties(calculator);
         ind.CopyTotalCostsProperties(calculator);
         if (calculator.CalcParameters == null)
         {
             calculator.CalcParameters = new CalculatorParameters();
         }
         if (ind.CalcParameters == null)
         {
             ind.CalcParameters = new CalculatorParameters();
         }
         ind.CalcParameters = new CalculatorParameters(calculator.CalcParameters);
     }
 }
Example #6
0
        public bool AddSubTotalToTotalStock(NPV1Total1 totStock, double multiplier,
                                            NPV1Total1 stock)
        {
            bool bHasCalculations = false;

            //costs
            totStock.TotalAMOC     += stock.TotalAMOC * multiplier;
            totStock.TotalAMAOH    += stock.TotalAMAOH * multiplier;
            totStock.TotalAMCAP    += stock.TotalAMCAP * multiplier;
            totStock.TotalAMINCENT += stock.TotalAMINCENT * multiplier;
            totStock.TotalAMTOTAL  += stock.TotalAMTOTAL * multiplier;
            //these are only used with inputprices but no harm in setting them for other apps
            totStock.TotalOCAmount += stock.TotalOCAmount * multiplier;
            totStock.TotalOCPrice  += stock.TotalOCPrice;
            totStock.TotalOCName    = stock.TotalOCName;
            totStock.TotalOCUnit    = stock.TotalOCUnit;
            //benefits
            totStock.TotalAMR       += stock.TotalAMR * multiplier;
            totStock.TotalAMRINCENT += stock.TotalAMRINCENT * multiplier;
            //totals are on always on hand (because BIAnalyzer sets them for the initial output)
            //cost effectiveness analysis
            totStock.TotalRAmount += stock.TotalRAmount * multiplier;
            //compos is independent of ramount and can be used to study head of cattle ...
            totStock.TotalRCompositionAmount += stock.TotalRCompositionAmount * multiplier;
            //don't adjust prices by multiplier
            totStock.TotalRPrice += stock.TotalRPrice;
            //display the r (ancestors of outs put name in first calc)
            if (!string.IsNullOrEmpty(stock.TotalRName))
            {
                totStock.TotalRName            = stock.TotalRName;
                totStock.TotalRUnit            = stock.TotalRUnit;
                totStock.TotalRCompositionUnit = stock.TotalRCompositionUnit;
            }
            //nets
            totStock.TotalAMNET        = totStock.TotalAMR - totStock.TotalAMTOTAL;
            totStock.TotalAMINCENT_NET = totStock.TotalAMRINCENT - totStock.TotalAMINCENT;
            bHasCalculations           = true;
            return(bHasCalculations);
        }
Example #7
0
 public void SetTotalNPV1Total1Property(NPV1Total1 ind,
                                        string attName, string attValue)
 {
     ind.SetTotalBenefitsProperty(attName, attValue);
     ind.SetTotalCostsProperty(attName, attValue);
 }
Example #8
0
 public void SetTotalNPV1Total1Properties(NPV1Total1 ind,
                                          string attNameExtension, XElement calculator)
 {
     ind.SetTotalBenefitsProperties(attNameExtension, calculator);
     ind.SetTotalCostsProperties(attNameExtension, calculator);
 }
Example #9
0
 //copy constructor
 public NPV1Total1(NPV1Total1 calculator)
     : base(calculator)
 {
     CopyTotalNPV1Total1Properties(this, calculator);
 }