129 lines
7.9 KiB
C#
129 lines
7.9 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class TestWidgetDataList : DataListProcessingBase
|
|
{
|
|
public TestWidgetDataList()
|
|
{
|
|
DefaultListObjectType = AyaType.Widget;
|
|
SQLFrom = "from awidget left join auser on (awidget.userid=auser.id)";
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "widgetname", "widgetserial", "widgetdollaramount", "widgetusertype", "widgetstartdate", "widgetactive", "username" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "widgetname", "+" } };
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetName",
|
|
FieldKey = "widgetname",
|
|
AyaObjectType = (int)AyaType.Widget,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "awidget.id",
|
|
SqlValueColumnName = "awidget.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetSerial",
|
|
FieldKey = "widgetserial",
|
|
UiFieldDataType = (int)UiFieldDataType.Integer,
|
|
SqlValueColumnName = "awidget.serial"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetDollarAmount",
|
|
FieldKey = "widgetdollaramount",
|
|
UiFieldDataType = (int)UiFieldDataType.Currency,
|
|
SqlValueColumnName = "awidget.dollaramount"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetCount",
|
|
FieldKey = "widgetcount",
|
|
UiFieldDataType = (int)UiFieldDataType.Integer,
|
|
SqlValueColumnName = "awidget.count"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "UserType",
|
|
FieldKey = "widgetusertype",
|
|
UiFieldDataType = (int)UiFieldDataType.Enum,
|
|
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(UserType).ToString()),
|
|
SqlValueColumnName = "awidget.usertype"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetStartDate",
|
|
FieldKey = "widgetstartdate",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "awidget.startdate"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetEndDate",
|
|
FieldKey = "widgetenddate",
|
|
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
|
SqlValueColumnName = "awidget.enddate"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "WidgetNotes",
|
|
FieldKey = "widgetnotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "awidget.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
FieldKey = "username",
|
|
TKey = "User",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
AyaObjectType = (int)AyaType.User,
|
|
SqlIdColumnName = "auser.id",
|
|
SqlValueColumnName = "auser.name"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "widgetactive",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "awidget.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Tags",
|
|
FieldKey = "widgettags",
|
|
UiFieldDataType = (int)UiFieldDataType.Tags,
|
|
SqlValueColumnName = "awidget.tags"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom1", FieldKey = "widgetcustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom2", FieldKey = "widgetcustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom3", FieldKey = "widgetcustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom4", FieldKey = "widgetcustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom5", FieldKey = "widgetcustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom6", FieldKey = "widgetcustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom7", FieldKey = "widgetcustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom8", FieldKey = "widgetcustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom9", FieldKey = "widgetcustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom10", FieldKey = "widgetcustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom11", FieldKey = "widgetcustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom12", FieldKey = "widgetcustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom13", FieldKey = "widgetcustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom14", FieldKey = "widgetcustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom15", FieldKey = "widgetcustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition { TKey = "WidgetCustom16", FieldKey = "widgetcustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "awidget.customfields" });
|
|
}
|
|
}//eoc
|
|
}//eons |