public DataTable GetData(TableFilter filter) { using (var adapter = Database.CreateAdapter(this, filter)) { var data = new DataTable(Name); adapter.Fill(data); return(data); } }
private TableFilter(TableFilter baseFilter) { table = baseFilter.table; foreach (var filter in baseFilter.filters) { filters.Add(filter.Clone()); } }
private TableFilter(TableFilter baseFilter) { this.table = baseFilter.table; this.filters = new List <ColumnFilter>(); foreach (var filter in baseFilter.filters) { this.filters.Add(filter.Clone()); } }
public virtual string GetBaseSelectCommandText(TableFilter filter, bool excludeWhere) { var select = new StringBuilder(); select.Append("SELECT "); if (filter != null || filter.IsColumnFiltered) { filter.WriteColumnsProjection(select); } else { select.Append('*'); } select.Append(" FROM "); select.Append(QuotedName); if (filter != null && filter.IsRowFiltered && !excludeWhere) { select.Append(" WHERE "); filter.WriteWhereStatement(select); } return(select.ToString()); }
public virtual int GetRowCount(TableFilter filter) { var count = -1; using (var command = Database.CreateCommand()) { var sql = new StringBuilder(); sql.Append("SELECT COUNT(*) FROM "); sql.Append(QuotedName); if (filter != null && filter.IsRowFiltered) { sql.Append(" WHERE "); filter.WriteWhereStatement(sql); } command.CommandText = sql.ToString(); using (Database.CreateConnectionScope()) { count = Convert.ToInt32(command.ExecuteScalar()); } } return(count); }
public abstract DbDataAdapter CreateAdapter(Table table, TableFilter filter);
public string GetBaseSelectCommandText(TableFilter filter) { return(GetBaseSelectCommandText(filter, false)); }
public abstract DataTable GetData(int startIndex, int count, TableFilter filter, TableSort sort);
public DataTable GetData(int startIndex, int count, TableFilter filter) { return(GetData(startIndex, count, filter, null)); }