This commit is contained in:
2022-03-10 23:32:33 +00:00
parent 3591907b41
commit 0784313e6d
5 changed files with 62 additions and 17 deletions

View File

@@ -14,13 +14,8 @@ using Newtonsoft.Json;
namespace AyaNova.Biz
{
internal class UserBiz : BizObject, IJobObject, ISearchAbleObject, IReportAbleObject, IExportAbleObject, IImportAbleObject, INotifiableObject
{
internal UserBiz(AyContext dbcontext, long currentUserId, long userTranslationId, AuthorizationRoles userRoles)
{
ct = dbcontext;
@@ -1000,6 +995,8 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", pmtext + " - " + await Translate("WorkOrderItemTravel"));
if (await ct.CustomerServiceRequest.AnyAsync(m => m.RequestedByUserId == inObj.Id))
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("CustomerServiceRequest"));
if (await ct.FileAttachment.AnyAsync(m => m.AttachedByUserId == inObj.Id))
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await Translate("FileAttachment"));
}