This commit is contained in:
2021-02-16 15:19:41 +00:00
parent 2d7c921713
commit 10271b75f9
6 changed files with 18 additions and 7 deletions

View File

@@ -293,6 +293,8 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("UnitModel"));
if (await ct.Unit.AnyAsync(m => m.PurchasedFromVendorId == inObj.Id))
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Unit"));
//part has three potential references, if any match that's good enough since it's the same message
if (await ct.Part.AnyAsync(z => z.ManufacturerId == inObj.Id) == true)
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Part"));
@@ -300,6 +302,9 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Part"));
else if (await ct.Part.AnyAsync(z => z.AlternativeWholeSalerId == inObj.Id) == true)
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Part"));
if (await ct.PurchaseOrder.AnyAsync(m => m.VendorId == inObj.Id))
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("PurchaseOrder"));
}