This commit is contained in:
2021-01-29 21:51:34 +00:00
parent 740323c67d
commit 3bc7aba2c2
14 changed files with 32 additions and 35 deletions

View File

@@ -0,0 +1,31 @@
using System.Threading.Tasks;
using AyaNova.Biz;
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 DataListSelectedProcessingOptions : DataListProcessingBase
{
public AyaType ObjectType { get; set; }
public long[] SelectedRowIds { get; set; }
// public string DataListKey { get; set; }
// public string ListView { get; set; }//optional, if null or empty will use default list view built into DataList
// public string MetaView { get; set; }//optional meta list view to integrate into the standard list view. Used by client to add "meta" filter conditions above the user's choices e.g. customer notes customer id
public bool IsEmpty
{
get
{
return SelectedRowIds.LongLength == 0 && string.IsNullOrWhiteSpace(DataListKey);
}
}
public async Task RehydrateIdList(AyContext ct, AuthorizationRoles userRoles, Microsoft.Extensions.Logging.ILogger log, long userId)
{
if (SelectedRowIds.Length == 0)
SelectedRowIds = await AyaNova.DataList.DataListFetcher.GetIdListResponseAsync(ct, this, userRoles, log, userId);
}
}
}