示例#1
0
 public clValue(decimal value, Well well, Pollution pollution,
                ValueNorm valueNorm = null,
                CalculationFormula calculationFormula = null,
                CoefficientValue coefficientValue     = null,
                PriceNorm priceNorm = null)
 {
     this.Value              = Math.Round(value, pollution.Round, MidpointRounding.AwayFromZero);
     this.Pollution          = pollution;
     this.Well               = well;
     this.ValueNorm          = valueNorm;
     this.CoefficientValue   = coefficientValue;
     this.CalculationFormula = calculationFormula;
     this.PriceNorm          = priceNorm;
 }
示例#2
0
        /// <summary>Получение стоимости нормамы</summary>
        protected IEnumerable <clValue> CompareWithPriceNorm(IEnumerable <clValue> Values)
        {
            List <clValue> result = new List <clValue>();

            foreach (var one in Values)
            {
                PriceNorm PNorm = PollutionBase_Class.AllPriceNorm.FirstOrDefault
                                      (x =>
                                      x.ResolutionClarify.ID == _resolutionClarify.ID &&
                                      x.Pollution.ID == one.Pollution.ID
                                      );
                if (PNorm == null)
                {
                    result.Add(one);
                }
                else
                {
                    result.Add(new clValue(one.Value, one.Well, one.Pollution, one.ValueNorm, one.CalculationFormula, one.CoefficientValue, PNorm));
                }
            }
            return(result.ToArray());
        }