This commit is contained in:
@@ -218,7 +218,7 @@ namespace AyaNova.Biz
|
||||
.AddText(obj.Address)
|
||||
.AddText(obj.City)
|
||||
.AddText(obj.Region)
|
||||
.AddText(obj.Country)
|
||||
.AddText(obj.Country)
|
||||
.AddCustomFields(obj.CustomFields);
|
||||
}
|
||||
|
||||
@@ -298,6 +298,7 @@ namespace AyaNova.Biz
|
||||
var batchResults = await ct.HeadOffice.AsNoTracking().Where(z => batch.Contains(z.Id)).ToArrayAsync();
|
||||
//order the results back into original
|
||||
var orderedList = from id in batch join z in batchResults on id equals z.Id select z;
|
||||
batchResults = null;
|
||||
foreach (HeadOffice w in orderedList)
|
||||
{
|
||||
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||
@@ -307,15 +308,25 @@ namespace AyaNova.Biz
|
||||
jo["CustomFields"] = JObject.Parse((string)jo["CustomFields"]);
|
||||
ReportData.Add(jo);
|
||||
}
|
||||
orderedList = null;
|
||||
}
|
||||
vc.Clear();
|
||||
return ReportData;
|
||||
}
|
||||
//request cache for viz fields
|
||||
private VizCache vc = new VizCache();
|
||||
|
||||
//populate viz fields from provided object
|
||||
private async Task PopulateVizFields(HeadOffice o)
|
||||
{
|
||||
if (o.ContractId != null)
|
||||
o.ContractViz = await ct.Contract.AsNoTracking().Where(x => x.Id == o.ContractId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
{
|
||||
if (!vc.Has("contract", o.ContractId))
|
||||
{
|
||||
vc.Add(await ct.Contract.AsNoTracking().Where(x => x.Id == o.ContractId).Select(x => x.Name).FirstOrDefaultAsync(), "contract", o.ContractId);
|
||||
}
|
||||
o.ContractViz = vc.Get("contract", o.ContractId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user