This commit is contained in:
2021-01-27 20:27:17 +00:00
parent 77cb0ef98a
commit d425a13267
2 changed files with 43 additions and 51 deletions

View File

@@ -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<string>() { "headofficename", "headofficephone1", "headofficeemail" };
DefaultSortBy = new Dictionary<string, string>() { { "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

View File

@@ -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<string>() { "name", "employeenumber", "active", "usertype", "lastlogin", "roles" };
DefaultSortBy = new Dictionary<string, string>() { { "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<AyaDataListFieldDefinition>();
//DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" });
FieldDefinitions.Add(new AyaDataListFieldDefinition
{
TKey = "User",