This commit is contained in:
@@ -160,7 +160,7 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.NOT_FOUND);
|
||||
return false;
|
||||
}
|
||||
ValidateCanDelete(dbObject);
|
||||
await ValidateCanDeleteAsync(dbObject);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
if (HasErrors)
|
||||
@@ -266,9 +266,12 @@ namespace AyaNova.Biz
|
||||
|
||||
}
|
||||
|
||||
private void ValidateCanDelete(TaxCode inObj)
|
||||
private async Task ValidateCanDeleteAsync(TaxCode inObj)
|
||||
{
|
||||
//whatever needs to be check to delete this object
|
||||
//Referential integrity
|
||||
//FOREIGN KEY CHECKS
|
||||
if (await ct.PurchaseOrderItem.AnyAsync(m => m.PurchaseTaxCodeId == inObj.Id))
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("PurchaseOrder"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user