private static bool RowIsMatched(PageRequest request, ViewPage page, DataRow row) { foreach (string f in request.Filter) { Match m = Regex.Match(f, "^(?\'FieldName\'\\w+)\\:(?\'Operation\'=)(?\'Value\'.+)$"); if (m.Success) { string fieldName = m.Groups["FieldName"].Value; if (page.ContainsField(fieldName)) { string fieldValue = m.Groups["Value"].Value; if (fieldValue == "null") { fieldValue = String.Empty; } object fv = row[fieldName]; if (!((Convert.ToString(fv) == fieldValue))) { return(false); } } } } return(true); }
protected virtual DbDataReader ExecuteVirtualReader(PageRequest request, ViewPage page) { DataTable table = new DataTable(); foreach (DataField field in page.Fields) { table.Columns.Add(field.Name, typeof(int)); } DataRow r = table.NewRow(); if (page.ContainsField("PrimaryKey")) { r["PrimaryKey"] = 1; } table.Rows.Add(r); return(new DataTableReader(table)); }