This commit is contained in:
@@ -242,6 +242,7 @@ namespace AyaNova.DataList
|
||||
//Get the field key names in a list from the listview
|
||||
List<string> ListViewFieldList = DataList.GetFieldListFromListView(ListViewArray);
|
||||
|
||||
|
||||
//BUILD THE QUERY
|
||||
//SELECT FRAGMENT COLUMNS FROM TEMPLATE
|
||||
var SelectBuild = DataListSqlSelectBuilder.BuildForReportIdListOnly(DataList.FieldDefinitions, ListViewFieldList);
|
||||
@@ -255,8 +256,7 @@ namespace AyaNova.DataList
|
||||
//WHERE CLAUSE - FILTER
|
||||
qWhere = DataListSqlFilterCriteriaBuilder.DataFilterToSQLCriteria(DataList.FieldDefinitions, ListViewArray);
|
||||
|
||||
//ORDER BY CLAUSE - SORT
|
||||
//BUILD ORDER BY
|
||||
//ORDER BY CLAUSE - SORT
|
||||
qOrderBy = DataListSqlFilterOrderByBuilder.DataFilterToSQLOrderBy(DataList.FieldDefinitions, ListViewArray);
|
||||
|
||||
|
||||
@@ -268,6 +268,19 @@ namespace AyaNova.DataList
|
||||
//RETURN OBJECTS
|
||||
var retList = new List<long>();
|
||||
|
||||
//GET ID COLUMN ORDINAL
|
||||
int IDColumnOrdinal = 0;
|
||||
foreach (string TemplateField in ListViewFieldList)
|
||||
{
|
||||
//get the AyaObjectFieldDefinition
|
||||
AyaDataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(z => z.FieldKey == TemplateField);
|
||||
if (f.IsRowId)
|
||||
{
|
||||
IDColumnOrdinal = SelectBuild.map[f.SqlIdColumnName];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//QUERY THE DB
|
||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||
{
|
||||
@@ -281,36 +294,21 @@ namespace AyaNova.DataList
|
||||
{
|
||||
while (dr.Read())
|
||||
{
|
||||
//todo: test this with a full on widget report
|
||||
if (!dr.IsDBNull(IDColumnOrdinal))
|
||||
retList.Add(dr.GetInt64(IDColumnOrdinal));
|
||||
// foreach (string TemplateField in ListViewFieldList)
|
||||
// {
|
||||
// //get the AyaObjectFieldDefinition
|
||||
// AyaDataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(z => z.FieldKey == TemplateField);
|
||||
// if (f.IsRowId)
|
||||
// {
|
||||
// var ordinal = SelectBuild.map[f.SqlIdColumnName];
|
||||
// if (!await dr.IsDBNullAsync(ordinal))
|
||||
// retList.Add(dr.GetInt64(ordinal));
|
||||
|
||||
// retList.Add(dr.GetInt64(0));
|
||||
// //INSERT REMAINING FIELDS FROM TEMPLATE INTO THE RETURN ROWS LIST
|
||||
foreach (string TemplateField in ListViewFieldList)
|
||||
{
|
||||
|
||||
//get the AyaObjectFieldDefinition
|
||||
AyaDataListFieldDefinition f = DataList.FieldDefinitions.FirstOrDefault(z => z.FieldKey == TemplateField);
|
||||
|
||||
|
||||
// AyaFieldData AyaField = new AyaFieldData();
|
||||
// AyaField.v = dr.GetValue(SelectBuild.map[f.GetSqlValueColumnName()]);
|
||||
|
||||
// if (f.IsRowId)
|
||||
// {
|
||||
// AyaField.rid = true;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// AyaField.rid = null;
|
||||
// }
|
||||
|
||||
if (f.IsRowId)
|
||||
{
|
||||
var ordinal = SelectBuild.map[f.SqlIdColumnName];
|
||||
if (!await dr.IsDBNullAsync(ordinal))
|
||||
retList.Add(dr.GetInt64(ordinal));
|
||||
|
||||
}
|
||||
}
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user