This commit is contained in:
2021-02-18 20:39:22 +00:00
parent bc0c255ee3
commit 83f238702d
2 changed files with 12 additions and 2 deletions

View File

@@ -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)
{

View File

@@ -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);