This commit is contained in:
2020-12-16 15:37:49 +00:00
parent 51567df61a
commit 4068e55358
2 changed files with 59 additions and 1 deletions

View File

@@ -24,8 +24,10 @@ namespace AyaNova.PickList
return new WidgetPickList() as IAyaPickList;
case AyaType.User:
return new UserPickList() as IAyaPickList;
case AyaType.Vendor:
case AyaType.Vendor:
return new VendorPickList() as IAyaPickList;
case AyaType.Project:
return new ProjectPickList() as IAyaPickList;
case AyaType.WorkOrderTemplate:
return new WorkOrderTemplatePickList() as IAyaPickList;
default:

View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.PickList
{
internal class ProjectPickList : AyaPickList
{
public ProjectPickList()
{
DefaultListObjectType = AyaType.Project;
SQLFrom = "from aproject";
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
dynamic dTemplate = new JArray();
dynamic 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<AyaPickListFieldDefinition>();
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