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