public bool Matches(DataSet dataSet, VirtualRow virtualRow)
        {
            object leftValue = virtualRow.GetColumnValue(_leftColumn);
            object rightValue = virtualRow.GetColumnValue(_rightColumn);

            return !leftValue.Equals(rightValue);
        }
        public bool Matches(DataSet dataSet, VirtualRow virtualRow)
        {
            foreach (ICriteria criteria in _criteria)
            {
                if (criteria.Matches(dataSet, virtualRow))
                {
                    return true;
                }
            }

            return false;
        }
        public IActionResult AddRow([FromQuery] long tableId, [FromForm] VirtualRow row)
        {
            var table = _context.Set <VirtualTable>().Include(r => r.Rows)
                        .Include(c => c.Columns)
                        .FirstOrDefault(p => p.Id == tableId);

            table.Rows.Add(row);
            _context.SaveChanges();

            var afterUpdate = _context.Set <VirtualTable>().Include(p => p.Rows).FirstOrDefault(p => p.Id == tableId);

            return(RedirectToAction("Row", new { id = tableId }));
        }
        public IActionResult Row(int id)
        {
            var modelTable = _context.Set <VirtualTable>().Include(table => table.Rows)
                             .ThenInclude(row => row.Values)
                             .Include(c => c.Columns)
                             .FirstOrDefault(p => p.Id == id);

            var newRow = new VirtualRow {
                Table = modelTable
            };

            newRow.Values = modelTable.Columns.Select(c => new VirtualValue {
                Column = c, Row = newRow
            }).ToList();

            return(View("Row", newRow));
        }
        public bool Matches(DataSet dataSet, VirtualRow virtualRow)
        {
            // TODO: It's only necessary to execute this query for each row if it's
            // a correlated subquery. Is there a way to execute it once and then cache it
            // if it's not correlated?

            DataTable subQueryResults = _subQuery.ExecuteDataTable(dataSet, virtualRow);

            object leftValue = virtualRow.GetColumnValue(_column);

            foreach (DataRow row in subQueryResults.Rows)
            {
                object rightValue = row[0];

                if (leftValue.Equals(rightValue))
                {
                    return true;
                }
            }

            return false;
        }
        public bool Matches(DataSet dataSet, VirtualRow virtualRow)
        {
            object value = _column.GetValue(dataSet, virtualRow);

            return DataType.IsNotNull(value);
        }
 public bool Matches(DataSet dataSet, VirtualRow virtualRow)
 {
     throw new Exception("The method or operation is not implemented.");
 }
Exemple #8
0
 internal DataTable ExecuteDataTable(DataSet dataSet, VirtualRow outerRow)
 {
     return new SelectEvaluator(this).ExecuteDataTable(dataSet, outerRow);
 }