This commit is contained in:
@@ -12,24 +12,11 @@ namespace AyaNova.DataList
|
||||
internal static class DataListSqlSelectBuilder
|
||||
{
|
||||
|
||||
//Build the SELECT portion of a list query based on the template, mini or full and the object key in question
|
||||
internal static string Build(List<AyaDataListFieldDefinition> objectFieldsList, JArray listViewArray)
|
||||
//Build the SELECT portion of a list query based on the ListView fields
|
||||
internal static string Build(List<AyaDataListFieldDefinition> objectFieldsList, List<string> listViewFieldList)
|
||||
{
|
||||
|
||||
|
||||
|
||||
//convert to strings array (https://stackoverflow.com/a/33836599/8939)
|
||||
// [{key:"COLUMN UNIQUE KEY ID",sort:"-" or "+",filter:{any:true/false,items:[{FILTER OBJECT SEE BELOW}]} }, {key:"second column unique key"},{...etc...}]
|
||||
string[] templateFieldList;
|
||||
if (mini!=null && mini==true)
|
||||
{
|
||||
templateFieldList = ((JArray)jtemplate["mini"]).ToObject<string[]>();
|
||||
}
|
||||
else
|
||||
{
|
||||
templateFieldList = ((JArray)jtemplate["full"]).ToObject<string[]>();
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("SELECT ");
|
||||
|
||||
@@ -50,7 +37,7 @@ namespace AyaNova.DataList
|
||||
|
||||
sb.Append(" AS df");
|
||||
|
||||
foreach (string ColumnName in templateFieldList)
|
||||
foreach (string ColumnName in listViewFieldList)
|
||||
{
|
||||
AyaDataListFieldDefinition o = objectFieldsList.FirstOrDefault(x => x.FieldKey == ColumnName);
|
||||
#if (DEBUG)
|
||||
|
||||
Reference in New Issue
Block a user