This commit is contained in:
@@ -213,7 +213,7 @@ namespace AyaNova.Biz
|
||||
{
|
||||
if (obj != null)
|
||||
searchParams.AddText(obj.Notes)
|
||||
.AddText(obj.Name)
|
||||
.AddText(obj.Name)
|
||||
.AddText(obj.UPC)
|
||||
.AddText(obj.WarrantyTerms)
|
||||
.AddText(obj.Wiki)
|
||||
@@ -232,7 +232,7 @@ namespace AyaNova.Biz
|
||||
|
||||
bool isNew = currentObj == null;
|
||||
|
||||
//Name required
|
||||
//Name required
|
||||
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//Any form customizations to validate?
|
||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.UnitModel.ToString());
|
||||
@@ -288,6 +288,7 @@ namespace AyaNova.Biz
|
||||
var batchResults = await ct.UnitModel.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 (UnitModel w in orderedList)
|
||||
{
|
||||
if (!ReportRenderManager.KeepGoing(jobId)) return null;
|
||||
@@ -297,15 +298,22 @@ 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(UnitModel o)
|
||||
{
|
||||
if (o.VendorId != null)
|
||||
o.VendorViz = await ct.Vendor.AsNoTracking().Where(x => x.Id == o.VendorId).Select(x => x.Name).FirstOrDefaultAsync();
|
||||
{
|
||||
if (!vc.Has("vendorname", o.VendorId))
|
||||
vc.Add(await ct.Vendor.AsNoTracking().Where(x => x.Id == o.VendorId).Select(x => x.Name).FirstOrDefaultAsync(), "vendorname", o.VendorId);
|
||||
o.VendorViz = vc.Get("vendorname", o.VendorId);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -439,7 +447,7 @@ namespace AyaNova.Biz
|
||||
public async Task HandlePotentialNotificationEvent(AyaEvent ayaEvent, ICoreBizObjectModel proposedObj, ICoreBizObjectModel currentObj = null)
|
||||
{
|
||||
ILogger log = AyaNova.Util.ApplicationLogging.CreateLogger<UnitModelBiz>();
|
||||
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