Example #1
0
        /// <summary>
        /// performs execution of the If...Then...Else command
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (this.Context.CurrentDataRow == null)
            {
                List <System.Data.DataRow> DT = this.Context.GetOutput(IfClause, this.ExecuteThenClause, this.ExecuteElseClause);
            }
            else
            {
                if (IfClause.Execute().ToString().Equals("true", StringComparison.CurrentCultureIgnoreCase))
                {
                    result = ThenClause.Execute();
                }
                else
                {
                    if (ElseClause != null)
                    {
                        result = ElseClause.Execute();
                    }
                }
            }

            return(result);
        }
Example #2
0
        /// <summary>
        /// connects the execution of Rule_Statments
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (statements != null && !Context.isCancelRequest)
            {
                Context.NextRule = statement;
                result           = statements.Execute();
            }

            if (!Context.RunOneCommand && !Context.isCancelRequest)
            {
                if (statement != null)
                {
                    result = statement.Execute();
                }
            }
            else
            {
                if (Context.CurrentDataRow == null)
                {
                    if (!Context.OneCommandHasRun && !Context.isCancelRequest)
                    {
                        if (statement != null)
                        {
                            result = statement.Execute();
                            Context.OneCommandHasRun = true;
                        }
                    }
                }
                else
                {
                    if (!Context.isCancelRequest)
                    {
                        if (statement != null)
                        {
                            result = statement.Execute();
                        }
                    }
                }
            }

            return(result);
        }
Example #3
0
        /// <summary>
        /// executes the enclosed expressions
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object results = null;

            if (this.statements != null)
            {
                results = statements.Execute();
            }

            return(results);
        }
        /// <summary>
        /// performs the negation or pass-thru operation
        /// </summary>
        /// <returns>object</returns>
        public override object Execute()
        {
            object result = null;

            if (this.op != null)
            {
                if (this.op == "-")
                {
                    result = -1.0 * double.Parse(Value.Execute().ToString());
                }
                else
                {
                    result = double.Parse(Value.Execute().ToString());
                }
            }
            else
            {
                result = Value.Execute();
            }

            return(result);
        }