예제 #1
0
 public static void AddFoodCalcsToStock(this MNSR01Stock baseStat,
                                        List <MNC1Calculator> calcs)
 {
     if (calcs != null)
     {
         if (baseStat.FoodNutritionCalcs == null)
         {
             baseStat.FoodNutritionCalcs = new List <MNC1Calculator>();
         }
         foreach (MNC1Calculator calc in calcs)
         {
             if (calc.CalculatorType
                 == MN1CalculatorHelper.CALCULATOR_TYPES.foodnutSR01.ToString())
             {
                 MNC1Calculator mnc = new MNC1Calculator();
                 if (calc.GetType().Equals(mnc.GetType()))
                 {
                     MNC1Calculator mncInput = (MNC1Calculator)calc;
                     mnc.CopyMNC1Properties(mncInput);
                     baseStat.FoodNutritionCalcs.Add(mnc);
                 }
             }
         }
     }
 }
예제 #2
0
 public static void AddInputCalcToStock(this MNSR01Stock baseStat, Calculator1 calc)
 {
     if (calc.CalculatorType
         == MN1CalculatorHelper.CALCULATOR_TYPES.foodnutSR01.ToString())
     {
         MNC1Calculator mnc = new MNC1Calculator();
         if (calc.GetType().Equals(mnc.GetType()))
         {
             MNC1Calculator mncInput = (MNC1Calculator)calc;
             mnc.CopyMNC1Properties(mncInput);
             baseStat.FoodNutritionCalcs.Add(mnc);
         }
     }
 }