This commit is contained in:
65
server/AyaNova/DataList/TestWidgetUserEmailDataList.cs
Normal file
65
server/AyaNova/DataList/TestWidgetUserEmailDataList.cs
Normal file
@@ -0,0 +1,65 @@
|
||||
using System.Collections.Generic;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class TestWidgetUserEmailDataList : IAyaDataList
|
||||
{
|
||||
/*
|
||||
Select awidget.id, awidget.name, auser.name, auser.id, auseroptions.emailaddress
|
||||
from awidget
|
||||
left outer join auser on (awidget.userid=auser.id)
|
||||
left outer join auseroptions on (auser.id=auseroptions.userid)
|
||||
order by auseroptions.emailaddress desc
|
||||
*/
|
||||
public string ListKey => nameof(TestWidgetUserEmailDataList);
|
||||
|
||||
public string SQLFrom => "from awidget left outer join auser on (awidget.userid=auser.id) left outer join auseroptions on (auser.id=auseroptions.userid)";
|
||||
|
||||
public List<AyaDataListFieldDefinition> FieldDefinitions
|
||||
{
|
||||
get
|
||||
{
|
||||
List<AyaDataListFieldDefinition> l = new List<AyaDataListFieldDefinition>();
|
||||
l.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.Widget, SqlIdColumnName = "awidget.id" });
|
||||
l.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
FieldKey = "widgetname",
|
||||
LtKey = "WidgetName",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||
AyaObjectType = (int)AyaType.Widget,
|
||||
SqlIdColumnName = "awidget.id",
|
||||
SqlValueColumnName = "awidget.name"
|
||||
});
|
||||
l.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
FieldKey = "username",
|
||||
LtKey = "User",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Text,
|
||||
AyaObjectType = (int)AyaType.User,
|
||||
SqlIdColumnName = "auser.id",
|
||||
SqlValueColumnName = "auser.name"
|
||||
});
|
||||
l.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "UserEmailAddress",
|
||||
FieldKey = "emailaddress",
|
||||
SqlValueColumnName = "auseroptions.emailaddress",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.EmailAddress
|
||||
});
|
||||
l.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
LtKey = "Active",
|
||||
FieldKey = "widgetactive",
|
||||
SqlValueColumnName = "awidget.active",
|
||||
UiFieldDataType = (int)AyaUiFieldDataType.Bool
|
||||
});
|
||||
return l;
|
||||
}
|
||||
}
|
||||
|
||||
public AuthorizationRoles AllowedRoles => AuthorizationRoles.AllInternalStaff;//anyone but clients and subcontractors (just for test)
|
||||
public AyaType DefaultListObjectType => AyaType.Widget;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user