From 829f225c21f3ce8b982db03b07db8fa2e74f7d2c Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Wed, 27 Jan 2021 22:49:31 +0000 Subject: [PATCH] --- server/AyaNova/DataList/TestWidgetDataList.cs | 67 ++++++++----------- .../AyaNova/DataList/TranslationDataList.cs | 30 +++++---- server/AyaNova/DataList/TravelRateDataList.cs | 45 +++++++------ server/AyaNova/DataList/UnitDataList.cs | 39 +++++------ server/AyaNova/DataList/UnitModelDataList.cs | 40 +++++------ server/AyaNova/DataList/VendorDataList.cs | 43 ++++++------ 6 files changed, 128 insertions(+), 136 deletions(-) diff --git a/server/AyaNova/DataList/TestWidgetDataList.cs b/server/AyaNova/DataList/TestWidgetDataList.cs index 84978f94..4cdedbd4 100644 --- a/server/AyaNova/DataList/TestWidgetDataList.cs +++ b/server/AyaNova/DataList/TestWidgetDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -12,56 +11,46 @@ 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 = "widgetname"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "widgetname"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "widgetserial"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "widgetserial"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "widgetdollaramount"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "widgetdollaramount"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "widgetusertype"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "widgetusertype"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "widgetstartdate"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "widgetstartdate"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "widgetactive"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "widgetactive"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "username"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "username"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); - DefaultColumns="" + // DefaultColumns="" + + DefaultColumns = new List() { "widgetname", "widgetserial", "widgetdollaramount", "widgetusertype", "widgetstartdate", "widgetactive", "username" }; + DefaultSortBy = new Dictionary() { { "widgetname", "+" } }; - - // DefaultDataListView = @" - // { - // [{key:""COLUMN UNIQUE KEY ID",sort:"-" or "+",filter:{any:true/false,items:[{FILTER OBJECT SEE BELOW}]} }, {key:"second column unique key"},{...etc...}] - - // ""full"":[""widgetname"",""widgetserial"",""widgetdollaramount"",""widgetusertype"",""widgetstartdate"",""widgetactive"",""username""], - - // } - // "; - - //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(); - //DEPRECATED: FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id", IsFilterable = false, IsSortable = false, }); - FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "WidgetName", diff --git a/server/AyaNova/DataList/TranslationDataList.cs b/server/AyaNova/DataList/TranslationDataList.cs index ed6fab06..24b9ce33 100644 --- a/server/AyaNova/DataList/TranslationDataList.cs +++ b/server/AyaNova/DataList/TranslationDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -13,23 +12,26 @@ 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 = "stock"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "stock"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "cjkindex"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "cjkindex"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + + DefaultColumns = new List() { "name", "stock", "cjkindex" }; + DefaultSortBy = new Dictionary() { { "name", "+" } }; diff --git a/server/AyaNova/DataList/TravelRateDataList.cs b/server/AyaNova/DataList/TravelRateDataList.cs index 1b17e728..366ee5cd 100644 --- a/server/AyaNova/DataList/TravelRateDataList.cs +++ b/server/AyaNova/DataList/TravelRateDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -12,35 +11,37 @@ 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 = "Name"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "Name"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "Cost"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "Cost"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "RateCharge"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "RateCharge"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "RateUnitChargeDescriptionID"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "RateUnitChargeDescriptionID"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "Active"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "Active"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // 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 table need to be specified completely + DefaultColumns = new List() { "Name", "Cost", "RateCharge", "RateUnitChargeDescriptionID", "Active" }; + DefaultSortBy = new Dictionary() { { "Name", "+" } }; + FieldDefinitions = new List(); FieldDefinitions.Add(new AyaDataListFieldDefinition diff --git a/server/AyaNova/DataList/UnitDataList.cs b/server/AyaNova/DataList/UnitDataList.cs index 7b7b6898..ce7a7208 100644 --- a/server/AyaNova/DataList/UnitDataList.cs +++ b/server/AyaNova/DataList/UnitDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -19,32 +18,34 @@ 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 = "UnitSerial"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "UnitSerial"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "UnitModel"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "UnitModel"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "Customer"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "Customer"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "Active"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "Active"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // 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 table need to be specified completely + DefaultColumns = new List() { "UnitSerial", "UnitModel", "Customer", "Active" }; + DefaultSortBy = new Dictionary() { { "UnitSerial", "+" } }; + FieldDefinitions = new List(); FieldDefinitions.Add(new AyaDataListFieldDefinition diff --git a/server/AyaNova/DataList/UnitModelDataList.cs b/server/AyaNova/DataList/UnitModelDataList.cs index 769b20be..5a286566 100644 --- a/server/AyaNova/DataList/UnitModelDataList.cs +++ b/server/AyaNova/DataList/UnitModelDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -12,33 +11,34 @@ 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 = "UnitModelModelNumber"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "UnitModelModelNumber"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "Name"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "Name"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "UnitModelVendorID"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "UnitModelVendorID"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "Active"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "Active"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + + DefaultColumns = new List() { "UnitModelModelNumber", "Name", "UnitModelVendorID", "Active" }; + DefaultSortBy = new Dictionary() { { "UnitModelModelNumber", "+" } }; - //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(); - FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "UnitModelModelNumber", diff --git a/server/AyaNova/DataList/VendorDataList.cs b/server/AyaNova/DataList/VendorDataList.cs index 3405aba0..3aa4fa35 100644 --- a/server/AyaNova/DataList/VendorDataList.cs +++ b/server/AyaNova/DataList/VendorDataList.cs @@ -1,5 +1,4 @@ using System.Collections.Generic; -using Newtonsoft.Json.Linq; using AyaNova.Biz; namespace AyaNova.DataList { @@ -12,33 +11,33 @@ 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 = "vendorname"; - cm.sort = "+"; - dlistView.Add(cm); + // dynamic cm = new JObject(); + // cm.fld = "vendorname"; + // cm.sort = "+"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "vendorphone1"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "vendorphone1"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "vendoremail"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "vendoremail"; + // dlistView.Add(cm); - cm = new JObject(); - cm.fld = "vendortags"; - dlistView.Add(cm); + // cm = new JObject(); + // cm.fld = "vendortags"; + // dlistView.Add(cm); - DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + // DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None); + DefaultColumns = new List() { "vendorname", "vendorphone1", "vendoremail", "vendortags" }; + DefaultSortBy = new Dictionary() { { "vendorname", "+" } }; - //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(); - FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "VendorName", @@ -81,7 +80,7 @@ namespace AyaNova.DataList UiFieldDataType = (int)UiFieldDataType.HTTP, SqlValueColumnName = "avendor.webaddress" }); - + FieldDefinitions.Add(new AyaDataListFieldDefinition { @@ -91,7 +90,7 @@ namespace AyaNova.DataList SqlValueColumnName = "avendor.accountnumber" }); - + FieldDefinitions.Add(new AyaDataListFieldDefinition {