This commit is contained in:
2021-01-27 20:18:21 +00:00
parent 05877d0a3e
commit ecfb5dcea5
4 changed files with 64 additions and 38 deletions

View File

@@ -14,24 +14,27 @@ namespace AyaNova.DataList
var RoleSet = BizRoles.GetRoleSet(DefaultListObjectType);
AllowedRoles = RoleSet.ReadFullRecord | RoleSet.Change;
//######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
//Default ListView
dynamic dlistView = new JArray();
// //######## DEFAULT VIEW WHEN NO VIEW CHOSEN ############
// //Default ListView
// dynamic dlistView = new JArray();
dynamic cm = new JObject();
cm.fld = "notedate";
cm.sort = "-";
dlistView.Add(cm);
// dynamic cm = new JObject();
// cm.fld = "notedate";
// cm.sort = "-";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "notes";
dlistView.Add(cm);
// cm = new JObject();
// cm.fld = "notes";
// dlistView.Add(cm);
cm = new JObject();
cm.fld = "username";
dlistView.Add(cm);
DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
// cm = new JObject();
// cm.fld = "username";
// dlistView.Add(cm);
// DefaultListView = dlistView.ToString(Newtonsoft.Json.Formatting.None);
DefaultColumns = new List<string>() { "notedate", "notes", "username" };
DefaultSortBy = new Dictionary<string, string>() { { "notedate", "-" } };
//NOTE: Due to the join, all the sql id and name fields that can conflict with the joined table need to be specified completely
@@ -78,10 +81,25 @@ namespace AyaNova.DataList
});
}
public string DataListServerCriteria(AyaNova.Models.AyContext ct, long currentUserId, DataListOptions dataListOptions)
public List<DataListFilterOption> DataListServerCriteria(long currentUserId, AuthorizationRoles userRoles, DataListBase dataListBase)
{
throw new System.NotImplementedException();
List<DataListFilterOption> ret = new List<DataListFilterOption>();
//ClientCriteria MUST be CustomerId
if (string.IsNullOrWhiteSpace(dataListBase.ClientCriteria))
throw new System.ArgumentNullException("CustomerNoteDataList - ClientCriteria is empty, should be Customer ID");
DataListFilterOption FilterOption = new DataListFilterOption() { Column = "metacustomer" };
DataListColumnFilter ColumnFilter = new DataListColumnFilter();
ColumnFilter.value = dataListBase.ClientCriteria;
ColumnFilter.op = "=";
FilterOption.items.Add(ColumnFilter);
ret.Add(FilterOption);
return ret;
}
}//eoc
}//eons