69 lines
2.3 KiB
C#
69 lines
2.3 KiB
C#
using System.Collections.Generic;
|
|
using Newtonsoft.Json.Linq;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.PickList
|
|
{
|
|
internal class LoanUnitPickList : AyaPickList
|
|
{
|
|
public LoanUnitPickList()
|
|
{
|
|
|
|
DefaultListObjectType = AyaType.LoanUnit;
|
|
SQLFrom = "from aloanunit";
|
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
|
dynamic dTemplate = new JArray();
|
|
dynamic cm = null;
|
|
|
|
cm = new JObject();
|
|
cm.fld = "LoanUnitName";
|
|
dTemplate.Add(cm);
|
|
|
|
cm = new JObject();
|
|
cm.fld = "LoanUnitSerial";
|
|
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 = "aloanunit.active",
|
|
IsActiveColumn = true
|
|
});
|
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitName",
|
|
FieldKey = "LoanUnitName",
|
|
ColumnDataType = UiFieldDataType.Text,
|
|
SqlIdColumnName = "aloanunit.id",
|
|
SqlValueColumnName = "aloanunit.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
|
{
|
|
TKey = "LoanUnitSerial",
|
|
FieldKey = "LoanUnitSerial",
|
|
ColumnDataType = UiFieldDataType.Integer,
|
|
SqlValueColumnName = "aloanunit.serial"
|
|
});
|
|
|
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "Tags",
|
|
ColumnDataType = UiFieldDataType.Tags,
|
|
SqlValueColumnName = "aloanunit.tags"
|
|
});
|
|
|
|
}
|
|
}//eoc
|
|
}//eons |