This commit is contained in:
@@ -14,9 +14,11 @@ namespace AyaNova.Biz
|
||||
{
|
||||
/*
|
||||
###############
|
||||
todo: Don't all *child items require a transaction to be passed for *any* crud op, i.e. including put and etc?
|
||||
As they might be called from a parent transaction?
|
||||
(wait until front end to decide this and do some testing etc grok it out)
|
||||
|
||||
|
||||
todo: remember, some users should not even have data sent from the server / scrubbed and not affect updating.
|
||||
for example a user may not be able to see part costs so that should not even be sent over the wire
|
||||
workorder will have to handle that as necessary and expect sometimes data is not forthcoming
|
||||
*/
|
||||
|
||||
internal class WorkOrderBiz : BizObject, IJobObject, ISearchAbleObject, IReportAbleObject, IExportAbleObject
|
||||
|
||||
@@ -41,11 +41,11 @@ namespace AyaNova.Biz
|
||||
if (HasErrors)
|
||||
return null;
|
||||
else
|
||||
{
|
||||
{
|
||||
await ct.WorkOrderStatus.AddAsync(newObject);
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, AyaEvent.Created), ct);
|
||||
await SearchIndexAsync(newObject, true);
|
||||
await SearchIndexAsync(newObject, true);
|
||||
return newObject;
|
||||
}
|
||||
}
|
||||
@@ -77,7 +77,7 @@ namespace AyaNova.Biz
|
||||
await ct.WorkOrderStatus.AddAsync(newObject);
|
||||
await ct.SaveChangesAsync();
|
||||
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, newObject.Id, BizType, AyaEvent.Created), ct);
|
||||
await SearchIndexAsync(newObject, true);
|
||||
await SearchIndexAsync(newObject, true);
|
||||
return newObject;
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace AyaNova.Biz
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
await ValidateAsync(putObject, dbObject);
|
||||
if (HasErrors) return null;
|
||||
ct.Replace(dbObject, putObject);
|
||||
@@ -228,7 +228,7 @@ namespace AyaNova.Biz
|
||||
private async Task ValidateCanDeleteAsync(WorkOrderStatus inObj)
|
||||
{
|
||||
//MIGRATE_OUTSTANDING - check workorder records once wo is coded here
|
||||
|
||||
await Task.CompletedTask;
|
||||
//Referential integrity
|
||||
//FOREIGN KEY CHECKS
|
||||
// if (await ct.PurchaseOrder.AnyAsync(m => m.WorkOrderStatusId == inObj.Id))
|
||||
|
||||
Reference in New Issue
Block a user