This commit is contained in:
56
server/AyaNova/PickList/ServiceRatePickList.cs
Normal file
56
server/AyaNova/PickList/ServiceRatePickList.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.PickList
|
||||
{
|
||||
internal class ServiceRatePickList : AyaPickList
|
||||
{
|
||||
public ServiceRatePickList()
|
||||
{
|
||||
|
||||
DefaultListObjectType = AyaType.ServiceRate;
|
||||
SQLFrom = "from aservicerate";
|
||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||
dynamic dTemplate = new JArray();
|
||||
|
||||
dynamic cm = new JObject();
|
||||
cm.fld = "Name";
|
||||
dTemplate.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "Tags";
|
||||
dTemplate.Add(cm);
|
||||
|
||||
base.DefaultTemplate = dTemplate.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
|
||||
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "Active",
|
||||
ColumnDataType = UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "aservicerate.active",
|
||||
IsActiveColumn = true
|
||||
});
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Name",
|
||||
FieldKey = "Name",
|
||||
ColumnDataType = UiFieldDataType.Text,
|
||||
SqlIdColumnName = "aservicerate.id",
|
||||
SqlValueColumnName = "aservicerate.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
ColumnDataType = UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "aservicerate.tags"
|
||||
});
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
56
server/AyaNova/PickList/TravelRatePickList.cs
Normal file
56
server/AyaNova/PickList/TravelRatePickList.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.PickList
|
||||
{
|
||||
internal class TravelRatePickList : AyaPickList
|
||||
{
|
||||
public TravelRatePickList()
|
||||
{
|
||||
|
||||
DefaultListObjectType = AyaType.TravelRate;
|
||||
SQLFrom = "from atravelrate";
|
||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||
dynamic dTemplate = new JArray();
|
||||
|
||||
dynamic cm = new JObject();
|
||||
cm.fld = "Name";
|
||||
dTemplate.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "Tags";
|
||||
dTemplate.Add(cm);
|
||||
|
||||
base.DefaultTemplate = dTemplate.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
|
||||
ColumnDefinitions = new List<AyaPickListFieldDefinition>();
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Active",
|
||||
FieldKey = "Active",
|
||||
ColumnDataType = UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "atravelrate.active",
|
||||
IsActiveColumn = true
|
||||
});
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Name",
|
||||
FieldKey = "Name",
|
||||
ColumnDataType = UiFieldDataType.Text,
|
||||
SqlIdColumnName = "atravelrate.id",
|
||||
SqlValueColumnName = "atravelrate.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
ColumnDataType = UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "atravelrate.tags"
|
||||
});
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
Reference in New Issue
Block a user