This commit is contained in:
@@ -285,8 +285,14 @@ namespace AyaNova.Biz
|
|||||||
private async Task ValidateCanDeleteAsync(ServiceRate inObj)
|
private async Task ValidateCanDeleteAsync(ServiceRate inObj)
|
||||||
{
|
{
|
||||||
//FOREIGN KEY CHECKS
|
//FOREIGN KEY CHECKS
|
||||||
if (await ct.ContractServiceRate.AnyAsync(m => m.ServiceRateId == inObj.Id))
|
if (await ct.ContractServiceRate.AnyAsync(x => x.ServiceRateId == inObj.Id))
|
||||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Contract"));
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("Contract"));
|
||||||
|
|
||||||
|
if (await ct.WorkOrderItemLabor.AnyAsync(x => x.ServiceRateId == inObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("WorkOrderItemLabor"));
|
||||||
|
|
||||||
|
if (await ct.WorkOrderItemScheduledUser.AnyAsync(x => x.ServiceRateId == inObj.Id))
|
||||||
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("WorkOrderItemScheduledUser"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user