Files
raven/server/AyaNova/DataList/PartAssemblyDataList.cs
2021-01-29 21:31:09 +00:00

91 lines
6.4 KiB
C#

using System.Collections.Generic;
using Newtonsoft.Json.Linq;
using AyaNova.Biz;
namespace AyaNova.DataList
{
internal class PartAssemblyDataList : DataListProcessingBase
{
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);
DefaultColumns = new List<string>() { "partassemblyname" };
DefaultSortBy = new Dictionary<string, string>() { { "partassemblyname", "+" } };
FieldDefinitions = new List<DataListFieldDefinition>();
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "PartAssemblyName",
FieldKey = "partassemblyname",
AyaObjectType = (int)AyaType.PartAssembly,
UiFieldDataType = (int)UiFieldDataType.Text,
SqlIdColumnName = "apartassembly.id",
SqlValueColumnName = "apartassembly.name",
IsRowId = true
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "PartAssemblyNotes",
FieldKey = "Notes",
UiFieldDataType = (int)UiFieldDataType.Text,
SqlValueColumnName = "apartassembly.notes"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "Active",
FieldKey = "partassemblyactive",
UiFieldDataType = (int)UiFieldDataType.Bool,
SqlValueColumnName = "apartassembly.active"
});
FieldDefinitions.Add(new DataListFieldDefinition
{
TKey = "Tags",
FieldKey = "partassemblytags",
UiFieldDataType = (int)UiFieldDataType.Tags,
SqlValueColumnName = "apartassembly.tags"
});
//-----------
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom1", FieldKey = "partassemblycustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom2", FieldKey = "partassemblycustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom3", FieldKey = "partassemblycustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom4", FieldKey = "partassemblycustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom5", FieldKey = "partassemblycustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom6", FieldKey = "partassemblycustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom7", FieldKey = "partassemblycustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom8", FieldKey = "partassemblycustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom9", FieldKey = "partassemblycustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom10", FieldKey = "partassemblycustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom11", FieldKey = "partassemblycustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom12", FieldKey = "partassemblycustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom13", FieldKey = "partassemblycustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom14", FieldKey = "partassemblycustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom15", FieldKey = "partassemblycustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartAssemblyCustom16", FieldKey = "partassemblycustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apartassembly.customfields" });
}
}//eoc
}//eons