Ejemplo n.º 1
0
        private RuleStatementAction SetRuleAction(RuleStatementAction action, ActionObject actionObj)
        {
            CodeAssignStatement domDataValue = (CodeAssignStatement)action.CodeDomStatement;

            CodePropertyReferenceExpression expressionField = (CodePropertyReferenceExpression)domDataValue.Left;
            expressionField.PropertyName = actionObj.field;

            CodePrimitiveExpression expressionValue = (CodePrimitiveExpression)domDataValue.Right;
            expressionValue.Value = actionObj.value;

            return action;
        }
Ejemplo n.º 2
0
        private ActionObject RuleObjectAction(RuleStatementAction action)
        {
            ActionObject actionObj = new ActionObject();

            CodeAssignStatement domDataValue = (CodeAssignStatement)action.CodeDomStatement;

            CodeFieldReferenceExpression expressionField = (CodeFieldReferenceExpression)domDataValue.Left;
            actionObj.field = expressionField.FieldName;

            CodePrimitiveExpression expressionValue = (CodePrimitiveExpression)domDataValue.Right;
            actionObj.value = expressionValue.Value.ToString();

            return actionObj;
        }