This commit is contained in:
57
server/AyaNova/PickList/ContractPickList.cs
Normal file
57
server/AyaNova/PickList/ContractPickList.cs
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.PickList
|
||||||
|
{
|
||||||
|
internal class ContractPickList : AyaPickList
|
||||||
|
{
|
||||||
|
public ContractPickList()
|
||||||
|
{
|
||||||
|
|
||||||
|
DefaultListObjectType = AyaType.Contract;
|
||||||
|
SQLFrom = "from acontract";
|
||||||
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
|
dynamic dTemplate = new JArray();
|
||||||
|
|
||||||
|
dynamic cm = new JObject();
|
||||||
|
cm.fld = "contractname";
|
||||||
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "contracttags";
|
||||||
|
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 = "contractactive",
|
||||||
|
ColumnDataType = UiFieldDataType.Bool,
|
||||||
|
SqlValueColumnName = "acontract.active",
|
||||||
|
IsActiveColumn = true
|
||||||
|
});
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Name",
|
||||||
|
FieldKey = "contractname",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "acontract.id",
|
||||||
|
SqlValueColumnName = "acontract.name",
|
||||||
|
IsRowId = true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Tags",
|
||||||
|
FieldKey = "contracttags",
|
||||||
|
ColumnDataType = UiFieldDataType.Tags,
|
||||||
|
SqlValueColumnName = "acontract.tags"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}//eoc
|
||||||
|
}//eons
|
||||||
56
server/AyaNova/PickList/HeadOfficePickList.cs
Normal file
56
server/AyaNova/PickList/HeadOfficePickList.cs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.PickList
|
||||||
|
{
|
||||||
|
internal class HeadOfficePickList : AyaPickList
|
||||||
|
{
|
||||||
|
public HeadOfficePickList()
|
||||||
|
{
|
||||||
|
|
||||||
|
DefaultListObjectType = AyaType.HeadOffice;
|
||||||
|
SQLFrom = "from aheadoffice";
|
||||||
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
|
dynamic dTemplate = new JArray();
|
||||||
|
|
||||||
|
dynamic cm = new JObject();
|
||||||
|
cm.fld = "headofficename";
|
||||||
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "headofficetags";
|
||||||
|
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 = "headofficeactive",
|
||||||
|
ColumnDataType = UiFieldDataType.Bool,
|
||||||
|
SqlValueColumnName = "aheadoffice.active",
|
||||||
|
IsActiveColumn = true
|
||||||
|
});
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Name",
|
||||||
|
FieldKey = "headofficename",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "aheadoffice.id",
|
||||||
|
SqlValueColumnName = "aheadoffice.name",
|
||||||
|
IsRowId = true
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Tags",
|
||||||
|
FieldKey = "headofficetags",
|
||||||
|
ColumnDataType = UiFieldDataType.Tags,
|
||||||
|
SqlValueColumnName = "aheadoffice.tags"
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}//eoc
|
||||||
|
}//eons
|
||||||
@@ -14,6 +14,10 @@ namespace AyaNova.PickList
|
|||||||
switch (ayaType)
|
switch (ayaType)
|
||||||
{
|
{
|
||||||
//CoreBizObject add here
|
//CoreBizObject add here
|
||||||
|
case AyaType.Contract:
|
||||||
|
return new ContractPickList() as IAyaPickList;
|
||||||
|
case AyaType.HeadOffice:
|
||||||
|
return new HeadOfficePickList() as IAyaPickList;
|
||||||
case AyaType.Widget:
|
case AyaType.Widget:
|
||||||
return new WidgetPickList() as IAyaPickList;
|
return new WidgetPickList() as IAyaPickList;
|
||||||
case AyaType.User:
|
case AyaType.User:
|
||||||
|
|||||||
Reference in New Issue
Block a user