This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
using System.Threading.Tasks;
|
||||
using AyaNova.Biz;
|
||||
using Newtonsoft.Json.Linq;
|
||||
namespace AyaNova.Models
|
||||
{
|
||||
//Used to drive processes that rely on selections made at client from a datalist
|
||||
//either a preselected list of id's or a datalist key and listview filter object that can
|
||||
//be used to rehydrate a list of id's
|
||||
public class DataListSelection
|
||||
{
|
||||
public AyaType ObjectType { get; set; }
|
||||
@@ -9,7 +12,18 @@ namespace AyaNova.Models
|
||||
public string DataListKey { get; set; }
|
||||
public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
|
||||
|
||||
}
|
||||
|
||||
public bool IsEmpty
|
||||
{
|
||||
get
|
||||
{
|
||||
return SelectedRowIds.LongLength == 0 && string.IsNullOrWhiteSpace(DataListKey);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RehydrateIdList(AyContext ct, AuthorizationRoles userRoles, Microsoft.Extensions.Logging.ILogger log)
|
||||
{
|
||||
if (SelectedRowIds.Length == 0)
|
||||
SelectedRowIds = await AyaNova.DataList.DataListFetcher.GetIdListResponseAsync(DataListKey, ListView, ct, userRoles, log);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user