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