65 lines
2.5 KiB
C#
65 lines
2.5 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class ReportDataList : DataListProcessingBase
|
|
{
|
|
public ReportDataList()
|
|
{
|
|
DefaultListAType = AyaType.Report;
|
|
SQLFrom = "from aReport";
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListAType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
DefaultColumns = new List<string>() { "name", "aType", "ReportNotes", "active" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Report",
|
|
FieldKey = "name",
|
|
AType = (int)AyaType.Report,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "aReport.id",
|
|
SqlValueColumnName = "aReport.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "AyaType",
|
|
FieldKey = "aType",
|
|
UiFieldDataType = (int)UiFieldDataType.Enum,
|
|
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AyaType).ToString()),
|
|
SqlValueColumnName = "areport.AType"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "ReportNotes",
|
|
FieldKey = "ReportNotes",
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlValueColumnName = "areport.notes"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Active",
|
|
FieldKey = "active",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "aReport.active"
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "SelectRoles",
|
|
FieldKey = "roles",
|
|
UiFieldDataType = (int)UiFieldDataType.Roles,
|
|
//NOTE: not technically an enum list but this will trigger datagrid at client to fetch roles for special handling
|
|
EnumType = AyaNova.Util.StringUtil.TrimTypeName(typeof(AuthorizationRoles).ToString()),
|
|
SqlValueColumnName = "areport.roles"
|
|
});
|
|
|
|
}
|
|
}//eoc
|
|
}//eons |