This commit is contained in:
@@ -147,7 +147,7 @@ namespace AyaNova.Biz
|
||||
ValidateCanDelete(dbObject);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
{
|
||||
{
|
||||
var IDList = await ct.Review.AsNoTracking().Where(x => x.AType == AyaType.Memo && x.ObjectId == id).Select(x => x.Id).ToListAsync();
|
||||
if (IDList.Count() > 0)
|
||||
{
|
||||
@@ -215,7 +215,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
|
||||
//skip validation if seeding
|
||||
if(ServerBootConfig.SEEDING ) return;
|
||||
if (ServerBootConfig.SEEDING) return;
|
||||
|
||||
//Only can send a memo from your own account
|
||||
//with bypass for import if superuser
|
||||
@@ -290,6 +290,7 @@ namespace AyaNova.Biz
|
||||
var batchResults = await ct.Memo.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 (Memo w in orderedList)
|
||||
{
|
||||
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||
@@ -299,18 +300,29 @@ namespace AyaNova.Biz
|
||||
jo["CustomFields"] = JObject.Parse((string)jo["CustomFields"]);
|
||||
ReportData.Add(jo);
|
||||
}
|
||||
orderedList=null;
|
||||
}
|
||||
vc.Clear();
|
||||
return ReportData;
|
||||
}
|
||||
|
||||
}
|
||||
private VizCache vc = new VizCache();
|
||||
|
||||
//populate viz fields from provided object
|
||||
private async Task PopulateVizFields(Memo o)
|
||||
{
|
||||
if (o.ToId != null)
|
||||
o.ToViz = await ct.User.AsNoTracking().Where(x => x.Id == o.ToId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
{
|
||||
if (!vc.Has("user", o.ToId))
|
||||
vc.Add(await ct.User.AsNoTracking().Where(x => x.Id == o.ToId).Select(x => x.Name).FirstOrDefaultAsync(), "user", o.ToId);
|
||||
o.ToViz = vc.Get("user", o.ToId);
|
||||
}
|
||||
|
||||
if (o.FromId != null)
|
||||
o.FromViz = await ct.User.AsNoTracking().Where(x => x.Id == o.FromId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
{
|
||||
if (!vc.Has("user", o.FromId))
|
||||
vc.Add(await ct.User.AsNoTracking().Where(x => x.Id == o.FromId).Select(x => x.Name).FirstOrDefaultAsync(), "user", o.FromId);
|
||||
o.FromViz = vc.Get("user", o.FromId);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -448,7 +460,7 @@ namespace AyaNova.Biz
|
||||
public async Task HandlePotentialNotificationEvent(AyaEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
|
||||
{
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<MemoBiz>();
|
||||
if(ServerBootConfig.SEEDING || ServerBootConfig.MIGRATING) return;
|
||||
if (ServerBootConfig.SEEDING || ServerBootConfig.MIGRATING) return;
|
||||
log.LogDebug($"HandlePotentialNotificationEvent processing: [AyaType:{this.BizType}, AyaEvent:{ayaEvent}]");
|
||||
|
||||
bool isNew = currentObj == null;
|
||||
|
||||
Reference in New Issue
Block a user