using System.Collections.Generic; using AyaNova.Biz; namespace AyaNova.DataList { internal class ReportDataList : DataListProcessingBase { public ReportDataList(long translationId) { DefaultListAType = AyaType.Report; SQLFrom = "from aReport"; var RoleSet = BizRoles.GetRoleSet(DefaultListAType); AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change; DefaultColumns = new List() { "name", "aType", "ReportNotes", "active" }; DefaultSortBy = new Dictionary() { { "name", "+" } }; FieldDefinitions = new List(); 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