public virtual DatalistData FormDatalistData(IQueryable <T> filtered, IQueryable <T> selected, IQueryable <T> notSelected) { DatalistData data = new DatalistData(); data.FilteredRows = Filter.TotalRows; data.Columns = Columns; foreach (T model in selected.ToArray().Concat(notSelected).ToArray()) { data.Rows.Add(FormData(model)); } return(data); }
public virtual DatalistData FormDatalistData(IQueryable <T> filtered, IQueryable <T> selected, IQueryable <T> notSelected) { DatalistData data = new DatalistData(); data.FilteredRows = filtered.Count(); data.Columns = Columns; foreach (T model in selected.ToArray().Concat(notSelected).ToArray()) { Dictionary <String, String> row = new Dictionary <String, String>(); AddId(row, model); AddAutocomplete(row, model); AddData(row, model); data.Rows.Add(row); } return(data); }
protected virtual DatalistData FormDatalistData(IQueryable <T> models) { DatalistData data = new DatalistData(); data.FilteredRecords = models.Count(); data.Columns = Columns; IQueryable <T> pagedModels = models .Skip(CurrentFilter.Page * CurrentFilter.RecordsPerPage) .Take(CurrentFilter.RecordsPerPage); foreach (T model in pagedModels) { Dictionary <String, String> row = new Dictionary <String, String>(); AddId(row, model); AddAutocomplete(row, model); AddColumns(row, model); AddAdditionalData(row, model); data.Rows.Add(row); } return(data); }