This commit is contained in:
57
server/AyaNova/PickList/PartWarehousePickList.cs
Normal file
57
server/AyaNova/PickList/PartWarehousePickList.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.PickList
|
||||
{
|
||||
internal class PartWarehousePickList : AyaPickList
|
||||
{
|
||||
public PartWarehousePickList()
|
||||
{
|
||||
|
||||
DefaultListObjectType = AyaType.PartWarehouse;
|
||||
SQLFrom = "from apartwarehouse";
|
||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||
dynamic dTemplate = new JArray();
|
||||
dynamic cm = null;
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "PartWarehouseName";
|
||||
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 = "apartwarehouse.active",
|
||||
IsActiveColumn = true
|
||||
});
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "PartWarehouseName",
|
||||
FieldKey = "PartWarehouseName",
|
||||
ColumnDataType = UiFieldDataType.Text,
|
||||
SqlIdColumnName = "apartwarehouse.id",
|
||||
SqlValueColumnName = "apartwarehouse.name",
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "Tags",
|
||||
ColumnDataType = UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "apartwarehouse.tags"
|
||||
});
|
||||
|
||||
}
|
||||
}//eoc
|
||||
}//eons
|
||||
@@ -28,6 +28,8 @@ namespace AyaNova.PickList
|
||||
return new VendorPickList() as IAyaPickList;
|
||||
case AyaType.Part:
|
||||
return new PartPickList() as IAyaPickList;
|
||||
case AyaType.PartWarehouse:
|
||||
return new PartWarehousePickList() as IAyaPickList;
|
||||
case AyaType.PartAssembly:
|
||||
return new PartAssemblyPickList() as IAyaPickList;
|
||||
case AyaType.Project:
|
||||
|
||||
Reference in New Issue
Block a user