This commit is contained in:
2021-06-24 22:47:09 +00:00
parent b7c69cb8cf
commit 600fc09b39
4 changed files with 21 additions and 5 deletions

View File

@@ -189,9 +189,17 @@ namespace AyaNova.DataList
/////////////////////////////////////////////////////////////////
// Get a list of id's of the datalist results for reporting
// (and other uses like job ops, exporting etc)
// called from RehydrateIdList only
//
//
internal static async Task<long[]> GetIdListResponseAsync(AyContext ct, DataListSelectedProcessingOptions dataListSelectionOptions, IDataListProcessing DataList, AuthorizationRoles userRoles, ILogger log, long userId)
internal static async Task<long[]> GetIdListResponseAsync(
AyContext ct,
DataListSelectedProcessingOptions dataListSelectionOptions,
IDataListProcessing DataList,
AuthorizationRoles userRoles,
ILogger log,
long userId,
bool limitForReportDesigner)
{
//#BUILD THE QUERY
@@ -210,10 +218,15 @@ namespace AyaNova.DataList
//ORDER BY CLAUSE - SORT
qOrderBy = DataListSqlFilterOrderByBuilder.DataFilterToSQLOrderBy(DataList.FieldDefinitions, dataListSelectionOptions);
//LIMIT (if report designer)
var qLimit = string.Empty;
if (limitForReportDesigner)
qLimit = "LIMIT 5";
//PUT IT ALL TOGETHER
string qDataQuery = string.Empty;
qDataQuery = $"{qSelect} {qFrom} {qWhere} {qOrderBy} ".Replace(" ", " ");
qDataQuery = $"{qSelect} {qFrom} {qWhere} {qOrderBy} {qLimit} ".Replace(" ", " ");
//RETURN OBJECTS
var retList = new List<long>();