From d425a13267cca9f3b60ea3c4beef5a6ade3cbd94 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 27 Jan 2021 20:27:17 +0000 Subject: [PATCH] --- server/AyaNova/DataList/HeadOfficeDataList.cs | 36 ++++++------ server/AyaNova/DataList/InsideUserDataList.cs | 58 ++++++++----------- 2 files changed, 43 insertions(+), 51 deletions(-) diff --git a/server/AyaNova/DataList/HeadOfficeDataList.cs b/server/AyaNova/DataList/HeadOfficeDataList.cs index bd68b64a..7ad48cb7 100644 --- a/server/AyaNova/DataList/HeadOfficeDataList.cs +++ b/server/AyaNova/DataList/HeadOfficeDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -12,23 +11,26 @@ namespace AyaNova.DataList var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType); AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; - //######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############ - //Default ListView - dynamic dlistView = new JArray(); + // //######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############ + // //Default ListView + // dynamic dlistView = new JArray(); - dynamic cm = new JObject(); - cm.fld = "headofficename"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "headofficename"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "headofficephone1"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "headofficephone1"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "headofficeemail"; - dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // cm = new JObject(); + // cm.fld = "headofficeemail"; + // dlistView.Add(cm); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + + DefaultColumns = new List() { "headofficename", "headofficephone1", "headofficeemail" }; + DefaultSortBy = new Dictionary() { { "headofficename", "+" } }; //NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely @@ -76,7 +78,7 @@ namespace AyaNova.DataList UiFieldDataType = (int)UiFieldDataType.HTTP, SqlValueColumnName = "aheadoffice.webaddress" }); - + FieldDefinitions.Add(new AyaDataListFieldDefinition { @@ -270,6 +272,6 @@ namespace AyaNova.DataList FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "HeadOfficeCustom16", FieldKey = "headofficecustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "aheadoffice.customfields" }); } - + }//eoc }//eons \ No newline at end of file diff --git a/server/AyaNova/DataList/InsideUserDataList.cs b/server/AyaNova/DataList/InsideUserDataList.cs index d4862d59..62026d8a 100644 --- a/server/AyaNova/DataList/InsideUserDataList.cs +++ b/server/AyaNova/DataList/InsideUserDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -13,50 +12,41 @@ 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 = "employeenumber"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "employeenumber"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "active"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "active"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "usertype"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "usertype"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "lastlogin"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "lastlogin"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "roles"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "roles"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); - /* - Id = z.Id, - Active = z.Active, - Name = z.Name, - Roles = z.Roles, - UserType = z.UserType, - EmployeeNumber = z.EmployeeNumber, - LastLogin = z.LastLogin - */ + DefaultColumns = new List() { "name", "employeenumber", "active", "usertype", "lastlogin", "roles" }; + DefaultSortBy = new Dictionary() { { "name", "+" } }; - //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 = "User",