コード例 #1
0
        protected override void Execute(CodeActivityContext executionContext)
        {
            var error = false;

            try
            {
                var value = Convert.ToDouble(Value.Get <string>(executionContext));

                FloatValue.Set(executionContext, value);

                DecimalValue.Set(executionContext, Convert.ToDecimal(Math.Round(value, 2)));

                MoneyValue.Set(executionContext, new Money {
                    Value = Convert.ToDecimal(Math.Round(value, 2))
                });

                TruncatedValue.Set(executionContext, Convert.ToInt32(Math.Truncate(value)));

                RoundedValue.Set(executionContext, Convert.ToInt32(Math.Round(value, 0)));
            }
            catch
            {
                error = true;
            }

            ProcessingError.Set(executionContext, error);
        }