This commit is contained in:
@@ -18,7 +18,7 @@ namespace AyaNova.DataList
|
||||
// Get the data list data requested
|
||||
//
|
||||
//
|
||||
internal static async Task<ApiDataListResponse> GetResponseAsync(AyContext ct, DataListTableOptions dataListTableOptions, AuthorizationRoles userRoles, ILogger log, long userId)
|
||||
internal static async Task<DataListReturnData> GetResponseAsync(AyContext ct, DataListTableOptions dataListTableOptions, AuthorizationRoles userRoles, ILogger log, long userId)
|
||||
{
|
||||
|
||||
var DataList = DataListFactory.GetAyaDataList(dataListTableOptions.DataListKey);
|
||||
@@ -37,8 +37,8 @@ namespace AyaNova.DataList
|
||||
|
||||
//STATIC filter options from server
|
||||
List<DataListFilterOption> StaticServerFilterOptions = new List<DataListFilterOption>();
|
||||
if (DataList is IAyaDataListServerCriteria)
|
||||
StaticServerFilterOptions = ((IAyaDataListServerCriteria)DataList).DataListServerCriteria(userId, userRoles, dataListTableOptions);
|
||||
if (DataList is IDataListInternalCriteria)
|
||||
StaticServerFilterOptions = ((IDataListInternalCriteria)DataList).DataListInternalCriteria(userId, userRoles, dataListTableOptions);
|
||||
|
||||
|
||||
// //Get the public field key names in a list from the listview
|
||||
@@ -85,7 +85,7 @@ namespace AyaNova.DataList
|
||||
|
||||
//RETURN OBJECTS
|
||||
int returnRowColumnCount = dataListTableOptions.Columns.Count();
|
||||
List<List<AyaFieldData>> rows = new List<List<AyaFieldData>>();
|
||||
List<List<DataListField>> rows = new List<List<DataListField>>();
|
||||
long totalRecordCount = 0;
|
||||
|
||||
//QUERY THE DB
|
||||
@@ -101,7 +101,7 @@ namespace AyaNova.DataList
|
||||
{
|
||||
while (dr.Read())
|
||||
{
|
||||
List<AyaFieldData> row = new List<AyaFieldData>(returnRowColumnCount);
|
||||
List<DataListField> row = new List<DataListField>(returnRowColumnCount);
|
||||
|
||||
|
||||
//INSERT REMAINING FIELDS FROM TEMPLATE INTO THE RETURN ROWS LIST
|
||||
@@ -109,17 +109,17 @@ namespace AyaNova.DataList
|
||||
{
|
||||
|
||||
//get the AyaObjectFieldDefinition
|
||||
AyaDataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(z => z.FieldKey == TemplateField);
|
||||
DataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(z => z.FieldKey == TemplateField);
|
||||
if (f.IsCustomField)
|
||||
{
|
||||
|
||||
AyaFieldData AyaField = new AyaFieldData();
|
||||
DataListField AyaField = new DataListField();
|
||||
var cust = dr.GetString(qSelect.map[f.GetSqlValueColumnName()]);
|
||||
if (!string.IsNullOrWhiteSpace(cust))
|
||||
{
|
||||
JObject j = JObject.Parse(cust);
|
||||
//convert field name to cust name then get value
|
||||
var InternalCustomFieldName = AyaFormFieldDefinitions.TranslateLTCustomFieldToInternalCustomFieldName(TemplateField);
|
||||
var InternalCustomFieldName = FormFieldReference.TranslateLTCustomFieldToInternalCustomFieldName(TemplateField);
|
||||
//Sometimes a custom field is specified but doesn't exist in the collection so don't assume it's there
|
||||
// AyaField.v = j[InternalCustomFieldName].Value<object>();
|
||||
JToken o = j[InternalCustomFieldName];
|
||||
@@ -152,7 +152,7 @@ namespace AyaNova.DataList
|
||||
}
|
||||
else
|
||||
{
|
||||
AyaFieldData AyaField = new AyaFieldData();
|
||||
DataListField AyaField = new DataListField();
|
||||
AyaField.v = dr.GetValue(qSelect.map[f.GetSqlValueColumnName()]);
|
||||
|
||||
if (f.IsRowId)
|
||||
@@ -232,7 +232,7 @@ namespace AyaNova.DataList
|
||||
|
||||
ColumnsJSON = DataList.GenerateReturnListColumns(dataListTableOptions.Columns);//<<<-----this next
|
||||
|
||||
return new ApiDataListResponse(rows, totalRecordCount, ColumnsJSON);
|
||||
return new DataListReturnData(rows, totalRecordCount, ColumnsJSON);
|
||||
|
||||
}
|
||||
|
||||
@@ -275,8 +275,8 @@ namespace AyaNova.DataList
|
||||
|
||||
//STATIC filter options from server
|
||||
List<DataListFilterOption> StaticServerFilterOptions = null;
|
||||
if (DataList is IAyaDataListServerCriteria)
|
||||
StaticServerFilterOptions = ((IAyaDataListServerCriteria)DataList).DataListServerCriteria(userId, userRoles, dataListSelectionOptions);
|
||||
if (DataList is IDataListInternalCriteria)
|
||||
StaticServerFilterOptions = ((IDataListInternalCriteria)DataList).DataListInternalCriteria(userId, userRoles, dataListSelectionOptions);
|
||||
|
||||
|
||||
// //Hard coded extra criteria from Client end
|
||||
|
||||
Reference in New Issue
Block a user