Files
raven/server/AyaNova/PickList/TaskGroupPickList.cs
2021-05-25 13:58:34 +00:00

49 lines
1.6 KiB
C#

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