This commit is contained in:
@@ -242,6 +242,7 @@ namespace AyaNova.DataList
|
|||||||
//Get the field key names in a list from the listview
|
//Get the field key names in a list from the listview
|
||||||
List<string> ListViewFieldList = DataList.GetFieldListFromListView(ListViewArray);
|
List<string> ListViewFieldList = DataList.GetFieldListFromListView(ListViewArray);
|
||||||
|
|
||||||
|
|
||||||
//BUILD THE QUERY
|
//BUILD THE QUERY
|
||||||
//SELECT FRAGMENT COLUMNS FROM TEMPLATE
|
//SELECT FRAGMENT COLUMNS FROM TEMPLATE
|
||||||
var SelectBuild = DataListSqlSelectBuilder.BuildForReportIdListOnly(DataList.FieldDefinitions, ListViewFieldList);
|
var SelectBuild = DataListSqlSelectBuilder.BuildForReportIdListOnly(DataList.FieldDefinitions, ListViewFieldList);
|
||||||
@@ -256,7 +257,6 @@ namespace AyaNova.DataList
|
|||||||
qWhere = DataListSqlFilterCriteriaBuilder.DataFilterToSQLCriteria(DataList.FieldDefinitions, ListViewArray);
|
qWhere = DataListSqlFilterCriteriaBuilder.DataFilterToSQLCriteria(DataList.FieldDefinitions, ListViewArray);
|
||||||
|
|
||||||
//ORDER BY CLAUSE - SORT
|
//ORDER BY CLAUSE - SORT
|
||||||
//BUILD ORDER BY
|
|
||||||
qOrderBy = DataListSqlFilterOrderByBuilder.DataFilterToSQLOrderBy(DataList.FieldDefinitions, ListViewArray);
|
qOrderBy = DataListSqlFilterOrderByBuilder.DataFilterToSQLOrderBy(DataList.FieldDefinitions, ListViewArray);
|
||||||
|
|
||||||
|
|
||||||
@@ -268,6 +268,19 @@ namespace AyaNova.DataList
|
|||||||
//RETURN OBJECTS
|
//RETURN OBJECTS
|
||||||
var retList = new List<long>();
|
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
|
//QUERY THE DB
|
||||||
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
using (var command = ct.Database.GetDbConnection().CreateCommand())
|
||||||
{
|
{
|
||||||
@@ -281,36 +294,21 @@ namespace AyaNova.DataList
|
|||||||
{
|
{
|
||||||
while (dr.Read())
|
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