56 lines
1.9 KiB
C#
56 lines
1.9 KiB
C#
using System.Collections.Generic;
|
|
using Newtonsoft.Json.Linq;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.PickList
|
|
{
|
|
internal class TaxCodePickList : AyaPickList
|
|
{
|
|
public TaxCodePickList()
|
|
{
|
|
|
|
DefaultListAType = AyaType.TaxCode;
|
|
SQLFrom = "from ataxcode";
|
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).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 = "ataxcode.active",
|
|
IsActiveColumn = true
|
|
});
|
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
|
{
|
|
TKey = "Name",
|
|
FieldKey = "Name",
|
|
ColumnDataType = UiFieldDataType.Text,
|
|
SqlIdColumnName = "ataxcode.id",
|
|
SqlValueColumnName = "ataxcode.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "Tags",
|
|
ColumnDataType = UiFieldDataType.Tags,
|
|
SqlValueColumnName = "ataxcode.tags"
|
|
});
|
|
|
|
}
|
|
}//eoc
|
|
}//eons |