This commit is contained in:
2022-12-23 00:04:47 +00:00
parent 5da208d0ee
commit 009781e95a
6 changed files with 115 additions and 5 deletions

View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Sockeye.Biz;
namespace Sockeye.PickList
{
internal class ProductPickList : AyaPickList
{
public ProductPickList()
{
DefaultListAType = SockType.Product;
SQLFrom = "from aproduct";
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();
cm.fld = "productname";
dTemplate.Add(cm);
cm = new JObject();
cm.fld = "producttags";
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 = "productactive",
ColumnDataType = UiFieldDataType.Bool,
SqlValueColumnName = "aproduct.active",
IsActiveColumn = true
});
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Name",
FieldKey = "productname",
ColumnDataType = UiFieldDataType.Text,
SqlIdColumnName = "aproduct.id",
SqlValueColumnName = "aproduct.name",
IsRowId = true
});
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Tags",
FieldKey = "producttags",
ColumnDataType = UiFieldDataType.Tags,
SqlValueColumnName = "aproduct.tags"
});
}
}//eoc
}//eons

View File

@@ -0,0 +1,56 @@
using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using Sockeye.Biz;
namespace Sockeye.PickList
{
internal class VendorPickList : AyaPickList
{
public VendorPickList()
{
DefaultListAType = SockType.Vendor;
SQLFrom = "from avendor";
AllowedRoles = BizRoles.GetRoleSet(DefaultListAType).Select;
dynamic dTemplate = new JArray();
dynamic cm = new JObject();
cm.fld = "vendorname";
dTemplate.Add(cm);
cm = new JObject();
cm.fld = "vendortags";
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 = "vendoractive",
ColumnDataType = UiFieldDataType.Bool,
SqlValueColumnName = "avendor.active",
IsActiveColumn = true
});
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Name",
FieldKey = "vendorname",
ColumnDataType = UiFieldDataType.Text,
SqlIdColumnName = "avendor.id",
SqlValueColumnName = "avendor.name",
IsRowId = true
});
ColumnDefinitions.Add(new AyaPickListFieldDefinition
{
TKey = "Tags",
FieldKey = "vendortags",
ColumnDataType = UiFieldDataType.Tags,
SqlValueColumnName = "avendor.tags"
});
}
}//eoc
}//eons