This commit is contained in:
@@ -5294,10 +5294,14 @@ namespace AyaNova.Biz
|
||||
bool isNew = currentObj == null;
|
||||
|
||||
if (proposedObj.WorkOrderItemId == 0)
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "WorkOrderItemId");
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
else if (!await ItemExistsAsync(proposedObj.WorkOrderItemId))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
//Check state if updatable right now
|
||||
if (!isNew)
|
||||
@@ -5551,10 +5555,14 @@ namespace AyaNova.Biz
|
||||
bool isNew = currentObj == null;
|
||||
|
||||
if (proposedObj.WorkOrderItemId == 0)
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_REQUIRED, "WorkOrderItemId");
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
else if (!await ItemExistsAsync(proposedObj.WorkOrderItemId))
|
||||
{
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
//Check state if updatable right now
|
||||
if (!isNew)
|
||||
@@ -5567,9 +5575,14 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
|
||||
return;//this is a completely disqualifying error
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (proposedObj.UnitId<1 || !await ct.Unit.AnyAsync(x => x.Id == proposedObj.UnitId))
|
||||
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "UnitId");
|
||||
|
||||
|
||||
|
||||
|
||||
//Any form customizations to validate?
|
||||
var FormCustomization = await ct.FormCustom.AsNoTracking().SingleOrDefaultAsync(z => z.FormKey == AyaType.WorkOrderItemUnit.ToString());
|
||||
if (FormCustomization != null)
|
||||
|
||||
Reference in New Issue
Block a user