Ejemplo n.º 1
0
        protected void table_DistributeValues(DataRow[] topRows, DataRow[] subRows)
        {
            object topTotal = topOperDef;

            for (int i = 0; i < topRows.Length; ++i)
            {
                evalOnTopAny.setVarAll(ToolRow.copyRowToArr(columnsVars, topRows[i]));
                object tmpRes = evalOnTopAny.getResult();
                evalOnTopAnyResult.setVarAll(new object[] { topTotal, tmpRes });
                topTotal = evalOnTopAnyResult.getResult();
            }
            for (int i = 0; i < subRows.Length; ++i)
            {
                object[]   vals;
                object     tmp;
                DataRow    row    = subRows[i];
                string     oldest = toucher.getOldest(columnsCalc, row);
                IEvaluator eval   = evalOnSubCalc[Array.IndexOf <string>(columnsCalc, oldest)];
                vals = ToolRow.copyRowToArr(columnsVars, row);
                vals = ToolArray.resize <object>(vals, vals.Length + 1);

                vals[vals.Length - 1] = topTotal;
                eval.setVarAll(vals);
                tmp = eval.getResult();
                ToolCell.set(row, oldest, tmp);

                vals = ToolRow.copyRowToArr(columnsVars, row);
                vals = ToolArray.resize <object>(vals, vals.Length + 1);

                vals[vals.Length - 1] = topTotal;
                evalOnSubCorrect.setVarAll(vals);
                topTotal = evalOnSubCorrect.getResult();
            }
        }
Ejemplo n.º 2
0
        void calcColumn(DataRow pRow, string pCol)
        {
            IEvaluator eval = evals[Array.IndexOf <string>(columnsCalc, pCol)];

            object[] vals = ToolRow.copyRowToArr(columnsVars, pRow);
            eval.setVarAll(vals);
            ToolCell.set(pRow, pCol, eval.getResult());
        }
Ejemplo n.º 3
0
        private string[] compareData(DataRowView row, DataColumn[] cols, string[] values)
        {
            bool sameData = true;

            string[] curValsStr = new string[values.Length];
            object[] curValues  = ToolRow.copyRowToArr(cols, row.Row);
            for (int i = 0; i < curValues.Length; ++i)
            {
                curValsStr[i] = (string)curValues[i];
                if (sameData)
                {
                    if ((string)curValues[i] != values[i])
                    {
                        sameData = false;
                    }
                }
            }
            return(sameData ? null : curValsStr);
        }