Пример #1
0
        public override string Evaluate(SimpleExpressionEvaluator.Evaluation.IExpressionContext context)
        {
            Variable variable = Arguments[0] as Variable;
            string   retval   = string.Empty;

            ISinglePage singlePage = context.ContextObject as SinglePage;

            if (singlePage != null)
            {
                return(ExtractValueFromSinglePage(ref variable, singlePage, ref retval));
            }

            DataRow row = context.ContextObject as DataRow;

            if (row != null)
            {
                return(ExtractValueFromDataRow(ref variable, retval, row));
            }
            return(variable.VariableName);
        }
Пример #2
0
        public override string Evaluate(SimpleExpressionEvaluator.Evaluation.IExpressionContext context)
        {
            ISinglePage singlePage = context.ContextObject as SinglePage;
            Variable    variable   = Arguments[0] as Variable;

            if (singlePage.IDataNavigator.CurrentRow > -1)
            {
                var dataRow = singlePage.IDataNavigator.GetDataRow();
                var item    = dataRow.Find(variable.VariableName);

                string retval;
                if (item != null)
                {
                    retval = item.Value.ToString();
                }
                else
                {
                    retval = GlobalValues.UnkownFunctionMessage(variable.VariableName);
                }
                return(retval);
            }
            return(variable.VariableName);
        }