This commit is contained in:
@@ -300,12 +300,11 @@ namespace AyaNova.Biz
|
||||
private async Task ValidateCanDeleteAsync(HeadOffice inObj)
|
||||
{
|
||||
//Referential integrity
|
||||
//FOREIGN KEY CHECKS
|
||||
if (await ct.User.AnyAsync(m => m.HeadOfficeId == inObj.Id))
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("User"));
|
||||
if (await ct.Customer.AnyAsync(z => z.HeadOfficeId == inObj.Id) == true)
|
||||
{
|
||||
//Note: errorbox will ensure it appears in the general errror box and not field specific
|
||||
//the translation key is to indicate what the linked object is that is causing the error
|
||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Customer"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user