46 lines
1.6 KiB
C#
46 lines
1.6 KiB
C#
using System.Collections.Generic;
|
|
using Newtonsoft.Json.Linq;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.PickList
|
|
{
|
|
internal class WorkOrderTemplatePickList : AyaPickList
|
|
{
|
|
public WorkOrderTemplatePickList()
|
|
{
|
|
|
|
DefaultListAType = AyaType.WorkOrderTemplate;
|
|
SQLFrom = "from aworkordertemplate";
|
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
|
|
dynamic dTemplate = new JArray();
|
|
|
|
dynamic cm = new JObject();
|
|
cm.fld = "name";
|
|
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 = "aworkordertemplate.active",
|
|
IsActiveColumn = true
|
|
});
|
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
|
{
|
|
TKey = "Name",
|
|
FieldKey = "name",
|
|
ColumnDataType = UiFieldDataType.Text,
|
|
SqlIdColumnName = "aworkordertemplate.id",
|
|
SqlValueColumnName = "aworkordertemplate.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
}
|
|
}//eoc
|
|
}//eons |