89 lines
6.4 KiB
C#
89 lines
6.4 KiB
C#
using System.Collections.Generic;
|
|
using Newtonsoft.Json.Linq;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class PartAssemblyDataList : AyaDataList
|
|
{
|
|
public PartAssemblyDataList()
|
|
{
|
|
DefaultListObjectType = AyaType.PartAssembly;
|
|
SQLFrom = "from apartassembly";
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
|
|
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
|
//Default ListView
|
|
dynamic dlistView = new JArray();
|
|
dynamic cm = null;
|
|
|
|
cm = new JObject();
|
|
cm.fld = "partassemblyname";
|
|
cm.sort = "+";
|
|
dlistView.Add(cm);
|
|
|
|
|
|
DefaultListView = dlistView.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
|
|
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
|
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
{
|
|
TKey = "PartAssemblyName",
|
|
FieldKey = "partassemblyname",
|
|
AyaObjectType = (int)AyaType.PartAssembly,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "apartassembly.id",
|
|
SqlValueColumnName = "apartassembly.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
{
|
|
TKey = "PartAssemblyNotes",
|
|
FieldKey = "partassemblynotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apartassembly.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "partassemblyactive",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "apartassembly.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "partassemblytags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "apartassembly.tags"
|
|
});
|
|
|
|
|
|
|
|
//-----------
|
|
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom1", FieldKey = "partassemblycustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom2", FieldKey = "partassemblycustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom3", FieldKey = "partassemblycustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom4", FieldKey = "partassemblycustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom5", FieldKey = "partassemblycustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom6", FieldKey = "partassemblycustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom7", FieldKey = "partassemblycustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom8", FieldKey = "partassemblycustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom9", FieldKey = "partassemblycustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom10", FieldKey = "partassemblycustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom11", FieldKey = "partassemblycustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom12", FieldKey = "partassemblycustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom13", FieldKey = "partassemblycustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom14", FieldKey = "partassemblycustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom15", FieldKey = "partassemblycustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "PartAssemblyCustom16", FieldKey = "partassemblycustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
|
|
}
|
|
}//eoc
|
|
}//eons |