This commit is contained in:
2021-03-02 15:34:05 +00:00
parent 054f25efbe
commit c1cccba712
9 changed files with 58 additions and 18 deletions

View File

@@ -300,6 +300,7 @@ namespace AyaNova.Biz
var orderedList = from id in batch join z in batchResults on id equals z.Id select z;
foreach (UnitModel w in orderedList)
{
await PopulateVizFields(w);
var jo = JObject.FromObject(w);
if (!JsonUtil.JTokenIsNullOrEmpty(jo["CustomFields"]))
jo["CustomFields"] = JObject.Parse((string)jo["CustomFields"]);
@@ -309,12 +310,17 @@ namespace AyaNova.Biz
return ReportData;
}
//populate viz fields from provided object
private async Task PopulateVizFields(UnitModel o)
{
if (o.VendorId != null)
o.VendorViz = await ct.Vendor.AsNoTracking().Where(x => x.Id == o.VendorId).Select(x => x.Name).FirstOrDefaultAsync();
}
////////////////////////////////////////////////////////////////////////////////////////////////
// IMPORT EXPORT
//
public async Task<JArray> GetExportData(long[] idList)
{
//for now just re-use the report data code
@@ -322,9 +328,6 @@ namespace AyaNova.Biz
return await GetReportData(idList);
}
public async Task<List<string>> ImportData(JArray ja)
{
List<string> ImportResult = new List<string>();