This commit is contained in:
2021-02-16 15:23:33 +00:00
parent 10271b75f9
commit 18d711d869

View File

@@ -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"));
}