74 lines
2.6 KiB
C#
74 lines
2.6 KiB
C#
using System.Collections.Generic;
|
|
using AyaNova.Biz;
|
|
namespace AyaNova.DataList
|
|
{
|
|
internal class TranslationDataList : DataListProcessingBase
|
|
{
|
|
|
|
public TranslationDataList()
|
|
{
|
|
DefaultListObjectType = AyaType.Translation;
|
|
SQLFrom = "from atranslation";
|
|
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
|
|
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
|
|
|
// //Default ListView
|
|
// dynamic dlistView = new JArray();
|
|
|
|
// dynamic cm = new JObject();
|
|
// cm.fld = "name";
|
|
// cm.sort = "+";
|
|
// dlistView.Add(cm);
|
|
|
|
// cm = new JObject();
|
|
// cm.fld = "stock";
|
|
// dlistView.Add(cm);
|
|
|
|
// cm = new JObject();
|
|
// cm.fld = "cjkindex";
|
|
// dlistView.Add(cm);
|
|
|
|
// DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
|
|
|
DefaultColumns = new List<string>() { "name", "stock", "cjkindex" };
|
|
DefaultSortBy = new Dictionary<string, string>() { { "name", "+" } };
|
|
|
|
|
|
|
|
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined (in this case User) table need to be specified completely
|
|
FieldDefinitions = new List<DataListFieldDefinition>();
|
|
//DPRECATED FieldDefinitions.Add(new AyaDataListFieldDefinition { FieldKey = "df", AyaObjectType = (int)AyaType.User, SqlIdColumnName = "auser.id" });
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "Translation",
|
|
FieldKey = "name",
|
|
AyaObjectType = (int)AyaType.Translation,
|
|
UiFieldDataType = (int)UiFieldDataType.Text,
|
|
SqlIdColumnName = "atranslation.id",
|
|
SqlValueColumnName = "atranslation.name",
|
|
IsRowId = true
|
|
});
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "GlobalCJKIndex",
|
|
FieldKey = "cjkindex",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "atranslation.cjkindex"
|
|
});
|
|
|
|
|
|
|
|
FieldDefinitions.Add(new DataListFieldDefinition
|
|
{
|
|
TKey = "ReadOnly",
|
|
FieldKey = "stock",
|
|
UiFieldDataType = (int)UiFieldDataType.Bool,
|
|
SqlValueColumnName = "atranslation.stock"
|
|
});
|
|
|
|
|
|
|
|
}
|
|
}//eoc
|
|
}//eons |