This commit is contained in:
@@ -3,7 +3,7 @@ using Newtonsoft.Json.Linq;
|
||||
using AyaNova.Biz;
|
||||
namespace AyaNova.DataList
|
||||
{
|
||||
internal class MemoDataList : AyaDataList,IAyaDataListViewServerCriteria
|
||||
internal class MemoDataList : AyaDataList, IAyaDataListViewServerCriteria
|
||||
{
|
||||
public MemoDataList()
|
||||
{
|
||||
@@ -14,8 +14,6 @@ namespace AyaNova.DataList
|
||||
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
|
||||
|
||||
|
||||
|
||||
|
||||
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
|
||||
//Default ListView
|
||||
dynamic dlistView = new JArray();
|
||||
@@ -32,15 +30,18 @@ namespace AyaNova.DataList
|
||||
cm = new JObject();
|
||||
cm.fld = "MemoSent";
|
||||
dlistView.Add(cm);
|
||||
|
||||
cm = new JObject();
|
||||
cm.fld = "MemoViewed";
|
||||
dlistView.Add(cm);
|
||||
|
||||
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
|
||||
|
||||
|
||||
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
|
||||
FieldDefinitions = new List<AyaDataListFieldDefinition>();
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoSubject",
|
||||
FieldKey = "MemoSubject",
|
||||
@@ -51,11 +52,18 @@ FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
IsRowId = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoMessage",
|
||||
FieldKey = "MemoMessage",
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlValueColumnName = "amemo.notes"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "User",
|
||||
FieldKey = "username",
|
||||
TKey = "MemoFromID",
|
||||
FieldKey = "MemoFromID",
|
||||
AyaObjectType = (int)AyaType.User,
|
||||
UiFieldDataType = (int)UiFieldDataType.Text,
|
||||
SqlIdColumnName = "auser.id",
|
||||
@@ -63,25 +71,65 @@ FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
IsRowId = false
|
||||
});
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoSent",
|
||||
FieldKey = "MemoSent",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "amemo.sent"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoNoteDate",
|
||||
FieldKey = "notedate",
|
||||
UiFieldDataType = (int)UiFieldDataType.DateTime,
|
||||
SqlValueColumnName = "amemo.notedate"
|
||||
TKey = "MemoReplied",
|
||||
FieldKey = "MemoReplied",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "amemo.replied"
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "MemoViewed",
|
||||
FieldKey = "MemoViewed",
|
||||
UiFieldDataType = (int)UiFieldDataType.Bool,
|
||||
SqlValueColumnName = "amemo.viewed"
|
||||
});
|
||||
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
TKey = "Tags",
|
||||
FieldKey = "MemoTags",
|
||||
UiFieldDataType = (int)UiFieldDataType.Tags,
|
||||
SqlValueColumnName = "amemo.tags"
|
||||
});
|
||||
|
||||
//META column
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
{
|
||||
FieldKey = "metacustomer",
|
||||
SqlIdColumnName = "amemo.customerid",
|
||||
SqlValueColumnName = "amemo.customerid",
|
||||
FieldKey = "metamemoto",
|
||||
SqlIdColumnName = "amemo.toid",
|
||||
SqlValueColumnName = "amemo.toid",
|
||||
IsMeta = true
|
||||
});
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom1", FieldKey = "MemoCustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom2", FieldKey = "MemoCustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom3", FieldKey = "MemoCustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom4", FieldKey = "MemoCustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom5", FieldKey = "MemoCustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom6", FieldKey = "MemoCustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom7", FieldKey = "MemoCustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom8", FieldKey = "MemoCustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom9", FieldKey = "MemoCustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom10", FieldKey = "MemoCustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom11", FieldKey = "MemoCustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom12", FieldKey = "MemoCustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom13", FieldKey = "MemoCustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom14", FieldKey = "MemoCustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom15", FieldKey = "MemoCustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "MemoCustom16", FieldKey = "MemoCustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "amemo.customfields" });
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -89,30 +137,9 @@ FieldDefinitions.Add(new AyaDataListFieldDefinition
|
||||
|
||||
|
||||
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom1", FieldKey = "customercustom1", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom2", FieldKey = "customercustom2", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom3", FieldKey = "customercustom3", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom4", FieldKey = "customercustom4", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom5", FieldKey = "customercustom5", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom6", FieldKey = "customercustom6", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom7", FieldKey = "customercustom7", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom8", FieldKey = "customercustom8", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom9", FieldKey = "customercustom9", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom10", FieldKey = "customercustom10", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom11", FieldKey = "customercustom11", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom12", FieldKey = "customercustom12", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom13", FieldKey = "customercustom13", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom14", FieldKey = "customercustom14", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom15", FieldKey = "customercustom15", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
FieldDefinitions.Add(new AyaDataListFieldDefinition { TKey = "CustomerCustom16", FieldKey = "customercustom16", IsCustomField = true, IsFilterable = false, IsSortable = false, SqlValueColumnName = "acustomer.customfields" });
|
||||
|
||||
|
||||
|
||||
string IAyaDataListViewServerCriteria.ListViewServerCriteria(long userId)
|
||||
{
|
||||
//todo: take user id here and return additional criteria listview
|
||||
//ensuring only current user can view their own memo datalist
|
||||
throw new System.NotImplementedException();
|
||||
return "[{\"fld\":\"metamemoto\",\"filter\":{\"items\":[{\"op\":\"=\",\"value\":" + userId.ToString() + "}]}}]";
|
||||
}
|
||||
|
||||
}//eoc
|
||||
|
||||
Reference in New Issue
Block a user