This commit is contained in:
2021-03-10 21:49:09 +00:00
parent 715e35445b
commit 73ba204dc3
4 changed files with 24 additions and 27 deletions

View File

@@ -138,18 +138,7 @@ namespace AyaNova.Biz
else
AddError(ApiErrorCode.CONCURRENCY_CONFLICT);
return null;
}
catch (Microsoft.EntityFrameworkCore.DbUpdateException ex)
{
if (ex.InnerException != null && ex.InnerException.Message.Contains("unq_unitmodelnumbervendorid"))
{
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "number", "Model number plus VendorId combination must be unique");
return null;
}
throw;
}
}
await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserId, dbObject.Id, BizType, AyaEvent.Modified), ct);
await SearchIndexAsync(putObject, false);
await TagBiz.ProcessUpdateTagsInRepositoryAsync(ct, putObject.Tags, dbObject.Tags);

View File

@@ -715,6 +715,11 @@ namespace AyaNova.Biz
//TODO: Validation rules that require future other objects that aren't present yet:
/*
//MIGRATE_OUTSTANDING TODO: role changes when has things that require a role like notification subscriptions and others
//Don't allow to go from non scheduleable if there are any scheduled workorder items because
//it would damage the history
BrokenRules.Assert("UserType","User.Label.MustBeScheduleable","UserType",(mUserType==UserTypes.Schedulable) && (ScheduledUserCount(this.mID,false)>0));