This commit is contained in:
2021-03-02 00:30:51 +00:00
parent 7c1c946449
commit b3e75e4aea
2 changed files with 15 additions and 7 deletions

View File

@@ -325,6 +325,7 @@ namespace AyaNova.Biz
var orderedList = from id in batch join z in batchResults on id equals z.Id select z;
foreach (HeadOffice w in orderedList)
{
await PopulateVizFields(w);
var jo = JObject.FromObject(w);
if (!JsonUtil.JTokenIsNullOrEmpty(jo["CustomFields"]))
jo["CustomFields"] = JObject.Parse((string)jo["CustomFields"]);
@@ -334,12 +335,17 @@ namespace AyaNova.Biz
return ReportData;
}
//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();
}
////////////////////////////////////////////////////////////////////////////////////////////////
// IMPORT EXPORT
//
public async Task<JArray> GetExportData(long[] idList)
{
//for now just re-use the report data code

View File

@@ -29,12 +29,14 @@ namespace AyaNova.Models
public string AccountNumber { get; set; }
public bool UsesBanking { get; set; }
public long? ContractId { get; set; }
[NotMapped]
public string ContractViz { get; set; }
public DateTime? ContractExpires { get; set; }
public string Phone1 { get; set; }
public string Phone2 { get; set; }
public string Phone3 { get; set; }
public string Phone4 { get; set; }
public string Phone5 { get; set; }
public string Phone1 { get; set; }
public string Phone2 { get; set; }
public string Phone3 { get; set; }
public string Phone4 { get; set; }
public string Phone5 { get; set; }
public string EmailAddress { get; set; }
//POSTAL ADDRESS