public RowColumnsBindingBetweenTablesExpExt(DataTable tableS, DataTable tableD, string[] colS, string colD, string expresionRow, Type typeRow, string expresionAmangRow, Type typeAngRow, string expresionFinal, Object prevDef, IRowValidator filter)
            : base(tableS, filter)
        {
            columns      = colS;
            column       = colD;
            tableDest    = tableD;
            defaultAmang = prevDef;
            evaluatorRow = new ImplRowEvaluator();
            for (int i = 0; i < columns.Length; ++i)
            {
                evaluatorRow.addVar(columns[i], tableSource.Columns[columns[i]].DataType);
            }
            evaluatorRow.addExpression(expresionRow, typeRow);

            evaluatorAmangRow = new ImplRowEvaluator();
            evaluatorAmangRow.addVar(colPrevValue, typeAngRow);
            evaluatorAmangRow.addVar(colCurValue, typeAngRow);
            evaluatorAmangRow.addExpression(expresionAmangRow, typeAngRow);

            evaluatorFinal = new ImplRowEvaluator();
            evaluatorFinal.addVar(colAmangValue, typeAngRow);
            evaluatorFinal.addExpression(expresionFinal, tableD.Columns[column].DataType);

            tableSource.RowDeleted    += new DataRowChangeEventHandler(table_RowDeleted);
            tableSource.RowChanged    += new DataRowChangeEventHandler(table_RowChanged);
            tableSource.ColumnChanged += new DataColumnChangeEventHandler(table_ColumnChanged);
        }
 public RowsSelectorExp(string pExpU, string pExpB, DataTable pTable, IRowValidator pValidator)
 {
     evalU = new ImplRowEvaluator(pTable);
     evalU.addExpression(expName, expU = pExpU, typeof(string));
     evalB = new ImplRowEvaluator(pTable);
     evalB.addExpression(expName, expB = pExpB, typeof(string));
     validator = pValidator;
 }
Exemple #3
0
 public RowValidatorExp(DataTable pTable, string pExp)
 {
     exp = pExp;
     if (pTable != null)
     {
         eval = new ImplRowEvaluator(pTable);
         eval.addExpression(exp, typeof(bool));
     }
 }
Exemple #4
0
 public bool check(DataRow row)
 {
     if (eval == null)
     {
         eval = new ImplRowEvaluator(row.Table);
         eval.addExpression(exp, typeof(bool));
     }
     eval.setVar(row);
     return((bool)ToolCell.isNull(eval.getResult(), false));
 }
Exemple #5
0
        public static double sumExp(DataRow[] rows, string exp)
        {
            double res = 0;

            if ((rows != null) && (rows.Length > 0))
            {
                ImplRowEvaluator eval = new ImplRowEvaluator(rows[0].Table);
                eval.addExpression(exp, typeof(double));
                for (int i = 0; i < rows.Length; ++i)
                {
                    eval.setVar(rows[i]);
                    res += (double)ToolCell.isNull(eval.getResult(), 0.0);
                }
            }
            return(res);
        }