This commit is contained in:
@@ -12,8 +12,9 @@ namespace AyaNova.PickList
|
|||||||
SQLFrom = "from aproject";
|
SQLFrom = "from aproject";
|
||||||
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
dynamic dTemplate = new JArray();
|
dynamic dTemplate = new JArray();
|
||||||
|
dynamic cm = null;
|
||||||
|
|
||||||
dynamic cm = new JObject();
|
cm = new JObject();
|
||||||
cm.fld = "projectname";
|
cm.fld = "projectname";
|
||||||
dTemplate.Add(cm);
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
@@ -43,7 +44,7 @@ namespace AyaNova.PickList
|
|||||||
IsRowId = true
|
IsRowId = true
|
||||||
});
|
});
|
||||||
|
|
||||||
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
{
|
{
|
||||||
TKey = "Tags",
|
TKey = "Tags",
|
||||||
FieldKey = "projecttags",
|
FieldKey = "projecttags",
|
||||||
|
|||||||
114
server/AyaNova/PickList/UnitPickList.cs
Normal file
114
server/AyaNova/PickList/UnitPickList.cs
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Newtonsoft.Json.Linq;
|
||||||
|
using AyaNova.Biz;
|
||||||
|
namespace AyaNova.PickList
|
||||||
|
{
|
||||||
|
internal class UnitPickList : AyaPickList
|
||||||
|
{
|
||||||
|
public UnitPickList()
|
||||||
|
{
|
||||||
|
|
||||||
|
DefaultListObjectType = AyaType.Unit;
|
||||||
|
SQLFrom = "from aunit "
|
||||||
|
+ "left outer join aunitmodel on (aunit.unitmodelid=aunitmodel.id) "
|
||||||
|
+ "left outer join avendor on (aunitmodel.vendorid=avendor.id) ";
|
||||||
|
|
||||||
|
AllowedRoles = BizRoles.GetRoleSet(DefaultListObjectType).Select;
|
||||||
|
dynamic dTemplate = new JArray();
|
||||||
|
dynamic cm = null;
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "UnitSerial";
|
||||||
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "UnitModel";
|
||||||
|
dTemplate.Add(cm);
|
||||||
|
|
||||||
|
cm = new JObject();
|
||||||
|
cm.fld = "UnitModelVendorID";
|
||||||
|
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 = "unitactive",
|
||||||
|
ColumnDataType = UiFieldDataType.Bool,
|
||||||
|
SqlValueColumnName = "aunit.active",
|
||||||
|
IsActiveColumn = true
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "UnitSerial",
|
||||||
|
FieldKey = "UnitSerial",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "aunit.id",
|
||||||
|
SqlValueColumnName = "aunit.serial",
|
||||||
|
IsRowId = true
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
FieldKey = "UnitModelVendorID",
|
||||||
|
TKey = "UnitModelVendorID",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlIdColumnName = "avendor.id",
|
||||||
|
SqlValueColumnName = "avendor.name"
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "UnitDescription",
|
||||||
|
FieldKey = "UnitDescription",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "aunit.description"
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "UnitText1",
|
||||||
|
FieldKey = "UnitText1",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "aunit.text1"
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "UnitText2",
|
||||||
|
FieldKey = "UnitText2",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "aunit.text2"
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "UnitText3",
|
||||||
|
FieldKey = "UnitText3",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "aunit.text3"
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "UnitText4",
|
||||||
|
FieldKey = "UnitText4",
|
||||||
|
ColumnDataType = UiFieldDataType.Text,
|
||||||
|
SqlValueColumnName = "aunit.text4"
|
||||||
|
});
|
||||||
|
|
||||||
|
ColumnDefinitions.Add(new AyaPickListFieldDefinition
|
||||||
|
{
|
||||||
|
TKey = "Tags",
|
||||||
|
FieldKey = "unittags",
|
||||||
|
ColumnDataType = UiFieldDataType.Tags,
|
||||||
|
SqlValueColumnName = "aunit.tags"
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
}//eoc
|
||||||
|
}//eons
|
||||||
Reference in New Issue
Block a user