This commit is contained in:
@@ -213,21 +213,24 @@ namespace AyaNova.Biz
|
|||||||
|
|
||||||
bool isNew = currentObj == null;
|
bool isNew = currentObj == null;
|
||||||
|
|
||||||
//Name required
|
//Name ("subject") is still required for a memo, empty subject not valid
|
||||||
|
//also, subject was required by biz rule in v7 so no need to worry about that on migrate
|
||||||
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
if (string.IsNullOrWhiteSpace(proposedObj.Name))
|
||||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
AddError(ApiErrorCode.VALIDATION_REQUIRED, "Name");
|
||||||
|
|
||||||
|
|
||||||
|
//Name does *NOT* need to be unique because for memo it's actually the subject line
|
||||||
|
//just kept internal naming the same to make coding easier with less workarounds
|
||||||
|
|
||||||
//If name is otherwise OK, check that name is unique
|
// //If name is otherwise OK, check that name is unique
|
||||||
if (!PropertyHasErrors("Name"))
|
// if (!PropertyHasErrors("Name"))
|
||||||
{
|
// {
|
||||||
//Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
|
// //Use Any command is efficient way to check existance, it doesn't return the record, just a true or false
|
||||||
if (await ct.Memo.AnyAsync(m => m.Name == proposedObj.Name && m.Id != proposedObj.Id))
|
// if (await ct.Memo.AnyAsync(m => m.Name == proposedObj.Name && m.Id != proposedObj.Id))
|
||||||
{
|
// {
|
||||||
AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
// AddError(ApiErrorCode.VALIDATION_NOT_UNIQUE, "Name");
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
//Any form customizations to validate?
|
//Any form customizations to validate?
|
||||||
|
|||||||
Reference in New Issue
Block a user