This commit is contained in:
@@ -24,8 +24,10 @@ namespace AyaNova.PickList
|
|||||||
return new WidgetPickList() as IAyaPickList;
|
return new WidgetPickList() as IAyaPickList;
|
||||||
case AyaType.User:
|
case AyaType.User:
|
||||||
return new UserPickList() as IAyaPickList;
|
return new UserPickList() as IAyaPickList;
|
||||||
case AyaType.Vendor:
|
case AyaType.Vendor:
|
||||||
return new VendorPickList() as IAyaPickList;
|
return new VendorPickList() as IAyaPickList;
|
||||||
|
case AyaType.Project:
|
||||||
|
return new ProjectPickList() as IAyaPickList;
|
||||||
case AyaType.WorkOrderTemplate:
|
case AyaType.WorkOrderTemplate:
|
||||||
return new WorkOrderTemplatePickList() as IAyaPickList;
|
return new WorkOrderTemplatePickList() as IAyaPickList;
|
||||||
default:
|
default:
|
||||||
|
|||||||
56
server/AyaNova/PickList/ProjectPickList.cs
Normal file
56
server/AyaNova/PickList/ProjectPickList.cs
Normal 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
|
||||||
Reference in New Issue
Block a user