protected object GetCalculateAgeExpression(TranslationContext context, object result)
		{
			var calculateAge = new CREFModel.CalculateAge();

			calculateAge.Items.Add(result);

			var binaryExpression = new CREFModel.BinaryExpression();

			// Returns as years, so multiply by days/year to get consistent results with the physical quantity translator
			binaryExpression.Operator = CREFModel.BinaryOperator.opMultiply;
			binaryExpression.OperatorSpecified = true;
			binaryExpression.Items.Add(calculateAge);

			var multiplier = new CREFModel.ValueExpression();
			multiplier.Type = CREFModel.ValueType.Decimal;
			multiplier.TypeSpecified = true;
			multiplier.Value = Convert.ToString(365.25m);

			binaryExpression.Items.Add(multiplier);

			return binaryExpression;
		}
Beispiel #2
0
        protected object GetCalculateAgeExpression(TranslationContext context, object result)
        {
            var calculateAge = new CREFModel.CalculateAge();

            calculateAge.Items.Add(result);

            var binaryExpression = new CREFModel.BinaryExpression();

            // Returns as years, so multiply by days/year to get consistent results with the physical quantity translator
            binaryExpression.Operator          = CREFModel.BinaryOperator.opMultiply;
            binaryExpression.OperatorSpecified = true;
            binaryExpression.Items.Add(calculateAge);

            var multiplier = new CREFModel.ValueExpression();

            multiplier.Type          = CREFModel.ValueType.Decimal;
            multiplier.TypeSpecified = true;
            multiplier.Value         = Convert.ToString(365.25m);

            binaryExpression.Items.Add(multiplier);

            return(binaryExpression);
        }