172 lines
9.5 KiB
C#
172 lines
9.5 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class PartDataList : DataListProcessingBase
|
|
{
|
|
public PartDataList()
|
|
{
|
|
DefaultListAType = AyaType.Part;
|
|
SQLFrom = "from viewpartsdatalist ";
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "PartPartNumber", "PartName", "PartManufacturerID", "PartWholesalerID", "Tags" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "PartPartNumber", "+" } };
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartPartNumber",
|
|
FieldKey = "PartPartNumber",
|
|
AType = (int)AyaType.Part,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "apart.id",
|
|
SqlValueColumnName = "apart.partnumber",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartName",
|
|
FieldKey = "PartName",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartNotes",
|
|
FieldKey = "PartNotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "Active",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "apart.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "Tags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "apart.tags"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartCost",
|
|
FieldKey = "PartCost",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "apart.cost"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartRetail",
|
|
FieldKey = "PartRetail",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "apart.retail"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
FieldKey = "PartManufacturerID",
|
|
TKey = "PartManufacturerID",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AType = (int)AyaType.Vendor,
|
|
SqlIdColumnName = "aman.id",
|
|
SqlValueColumnName = "aman.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
FieldKey = "PartWholesalerID",
|
|
TKey = "PartWholesalerID",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AType = (int)AyaType.Vendor,
|
|
SqlIdColumnName = "awhole.id",
|
|
SqlValueColumnName = "awhole.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
FieldKey = "PartAlternativeWholesalerID",
|
|
TKey = "PartAlternativeWholesalerID",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AType = (int)AyaType.Vendor,
|
|
SqlIdColumnName = "aaltwhole.id",
|
|
SqlValueColumnName = "aaltwhole.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartManufacturerNumber",
|
|
FieldKey = "PartManufacturerNumber",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.manufacturernumber"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartWholesalerNumber",
|
|
FieldKey = "PartWholesalerNumber",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.wholesalernumber"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartAlternativeWholesalerNumber",
|
|
FieldKey = "PartAlternativeWholesalerNumber",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.alternativewholesalernumber"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "UnitOfMeasure",
|
|
FieldKey = "UnitOfMeasure",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.unitofmeasure"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartUPC",
|
|
FieldKey = "PartUPC",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "apart.upc"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "PartSerialNumbersAvailable",
|
|
FieldKey = "PartSerialNumbersAvailable",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "(select array_to_string(array_agg(serial),', ') from apartserial where partid=apart.id group by partid) as sub_serials"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom1", FieldKey = "partcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom2", FieldKey = "partcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom3", FieldKey = "partcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom4", FieldKey = "partcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom5", FieldKey = "partcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom6", FieldKey = "partcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom7", FieldKey = "partcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom8", FieldKey = "partcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom9", FieldKey = "partcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom10", FieldKey = "partcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom11", FieldKey = "partcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom12", FieldKey = "partcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom13", FieldKey = "partcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom14", FieldKey = "partcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom15", FieldKey = "partcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "PartCustom16", FieldKey = "partcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "apart.customfields" });
|
|
}
|
|
}//eoc
|
|
}//eons |