From 67d89b1d3222600534fb341d451697467ce03ce6 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 27 Jan 2021 22:24:56 +0000 Subject: [PATCH] --- server/AyaNova/DataList/ReminderDataList.cs | 11 ++++-- server/AyaNova/DataList/ReportDataList.cs | 38 ++++++++++----------- 2 files changed, 26 insertions(+), 23 deletions(-) diff --git a/server/AyaNova/DataList/ReminderDataList.cs b/server/AyaNova/DataList/ReminderDataList.cs index 0b841020..8a4f6268 100644 --- a/server/AyaNova/DataList/ReminderDataList.cs +++ b/server/AyaNova/DataList/ReminderDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Models; using AyaNova.Biz; namespace AyaNova.DataList @@ -117,9 +116,15 @@ namespace AyaNova.DataList } //Ensure only current user can fetch their reminders - string IAyaDataListServerCriteria.DataListServerCriteria(AyaNova.Models.AyContext ct, long currentUserId, DataListOptions dataListOptions) + public List DataListServerCriteria(long currentUserId, AuthorizationRoles userRoles, DataListBase dataListBase) { - return "[{\"fld\":\"metareminderuser\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":" + currentUserId.ToString() + "}]}}]"; + List ret = new List(); + + DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metareminderuser" }; + FilterOption.items.Add(new DataListColumnFilter() { value = currentUserId.ToString(), op = DataListFilterComparisonOperator.Equality }); + + ret.Add(FilterOption); + return ret; } }//eoc diff --git a/server/AyaNova/DataList/ReportDataList.cs b/server/AyaNova/DataList/ReportDataList.cs index 6bdf0cd9..8bd4854c 100644 --- a/server/AyaNova/DataList/ReportDataList.cs +++ b/server/AyaNova/DataList/ReportDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -13,31 +12,30 @@ namespace AyaNova.DataList var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType); AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; - //Default ListView - dynamic dlistView = new JArray(); + // //Default ListView + // dynamic dlistView = new JArray(); - dynamic cm = new JObject(); - cm.fld = "name"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "name"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "objecttype"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "objecttype"; + // dlistView.Add(cm); + + // cm = new JObject(); + // cm.fld = "active"; + // dlistView.Add(cm); + + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + + DefaultColumns = new List() { "name", "objecttype", "active" }; + DefaultSortBy = new Dictionary() { { "name", "+" } }; - cm = new JObject(); - cm.fld = "active"; - dlistView.Add(cm); - - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); - - - - //NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely FieldDefinitions = new List(); - //DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" }); FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "Report",