This commit is contained in:
2021-01-27 20:45:35 +00:00
parent f7563f4068
commit a6a2e0917c
2 changed files with 38 additions and 35 deletions

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz; using AyaNova.Biz;
namespace AyaNova.DataList namespace AyaNova.DataList
{ {
@@ -18,30 +17,31 @@ namespace AyaNova.DataList
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType); var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############ // //######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
//Default ListView // //Default ListView
dynamic dlistView = new JArray(); // dynamic dlistView = new JArray();
dynamic cm = null; // dynamic cm = null;
cm = new JObject(); // cm = new JObject();
cm.fld = "LoanUnitName"; // cm.fld = "LoanUnitName";
cm.sort = "+"; // cm.sort = "+";
dlistView.Add(cm); // dlistView.Add(cm);
cm = new JObject(); // cm = new JObject();
cm.fld = "LoanUnitSerial"; // cm.fld = "LoanUnitSerial";
dlistView.Add(cm); // dlistView.Add(cm);
cm = new JObject(); // cm = new JObject();
cm.fld = "Tags"; // cm.fld = "Tags";
dlistView.Add(cm); // dlistView.Add(cm);
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
DefaultColumns = new List<string>() { "LoanUnitName", "LoanUnitSerial", "Tags" };
DefaultSortBy = new Dictionary<string, string>() { { "LoanUnitName", "+" } };
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
FieldDefinitions = new List<AyaDataListFieldDefinition>(); FieldDefinitions = new List<AyaDataListFieldDefinition>();
FieldDefinitions.Add(new AyaDataListFieldDefinition FieldDefinitions.Add(new AyaDataListFieldDefinition
{ {
TKey = "LoanUnitName", TKey = "LoanUnitName",

View File

@@ -15,28 +15,31 @@ namespace AyaNova.DataList
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############ // //######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
//Default ListView // //Default ListView
dynamic dlistView = new JArray(); // dynamic dlistView = new JArray();
dynamic cm = new JObject(); // dynamic cm = new JObject();
cm.fld = "MemoSubject"; // cm.fld = "MemoSubject";
dlistView.Add(cm); // dlistView.Add(cm);
cm = new JObject(); // cm = new JObject();
cm.fld = "MemoFromID"; // cm.fld = "MemoFromID";
dlistView.Add(cm); // dlistView.Add(cm);
cm = new JObject(); // cm = new JObject();
cm.fld = "MemoSent"; // cm.fld = "MemoSent";
dlistView.Add(cm); // dlistView.Add(cm);
cm = new JObject(); // cm = new JObject();
cm.fld = "MemoViewed"; // cm.fld = "MemoViewed";
dlistView.Add(cm); // dlistView.Add(cm);
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
DefaultColumns = new List<string>() { "MemoSubject", "MemoFromID", "MemoSent", "MemoViewed" };
DefaultSortBy = new Dictionary<string, string>() { { "MemoSent", "-" } };//added but wasnt' in original
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely //NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely