This commit is contained in:
@@ -143,8 +143,17 @@ namespace AyaNova.Biz
|
||||
//used to populate UI with picklist format display for items
|
||||
internal async Task<string> GetTemplatedNameAsync(AyaType ayaType, long id, string variant, ILogger log)
|
||||
{
|
||||
//short circuit for empty types
|
||||
if (id == 0)
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
long[] preIds = { id };
|
||||
var PickList = PickListFactory.GetAyaPickList(ayaType);
|
||||
|
||||
if (log == null)
|
||||
log = AyaNova.Util.ApplicationLogging.CreateLogger("PickListBiz::GetTemplatedNameAsync");
|
||||
|
||||
//Autocomplete and tagonly query terms now set for consumption by PickListFetcher, ready to fetch...
|
||||
List<NameIdActiveItem> items = await PickListFetcher.GetResponseAsync(PickList, null, null, true, preIds, variant, ct, log);
|
||||
if (items.Count == 0)
|
||||
@@ -154,7 +163,7 @@ namespace AyaNova.Biz
|
||||
return items[0].Name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//get picklist templates, basically all the object types that support picklists
|
||||
internal List<NameIdItem> GetListOfAllPickListTypes(long translationId)
|
||||
{
|
||||
|
||||
@@ -108,8 +108,9 @@ namespace AyaNova.Biz
|
||||
|
||||
//populate names for client ui
|
||||
var pl= new PickListBiz(ct,UserId,UserTranslationId,CurrentUserRoles);
|
||||
var log= AyaNova.Util.ApplicationLogging.CreateLogger("PickListBiz::GetTemplatedNameAsync");
|
||||
foreach(PurchaseOrderItem item in ret.Items){
|
||||
item.PartName= await pl.GetPickListAsync()
|
||||
item.PartName= await pl.GetTemplatedNameAsync(AyaType.Part,item.PartId,null,log);
|
||||
}
|
||||
if (logTheGetEvent && ret != null)
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, id, BizType, AyaEvent.Retrieved), ct);
|
||||
|
||||
Reference in New Issue
Block a user