This commit is contained in:
2021-04-01 18:44:42 +00:00
parent f222c9d4e2
commit 0c66cfb5cd

View File

@@ -1564,11 +1564,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -1814,11 +1816,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -2076,11 +2080,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -2328,11 +2334,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -2554,11 +2562,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -2781,11 +2791,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -3032,11 +3044,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -3284,11 +3298,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }
@@ -3536,11 +3552,13 @@ namespace AyaNova.Biz
AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId"); AddError(ApiErrorCode.VALIDATION_INVALID_VALUE, "WorkOrderItemId");
} }
//Check state if updatable right now //Check state if updatable right now
if(!isNew){ if (!isNew)
{
//Front end is coded to save the state first before any other updates if it has changed and it would not be //Front end is coded to save the state first before any other updates if it has changed and it would not be
//a part of this header update so it's safe to check it here as it will be most up to date //a part of this header update so it's safe to check it here as it will be most up to date
var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id); var CurrentWoStatus = await GetCurrentWorkOrderStatusFromRelatedAsync(proposedObj.AyaType, proposedObj.Id);
if(CurrentWoStatus.Locked){ if (CurrentWoStatus.Locked)
{
AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked")); AddError(ApiErrorCode.VALIDATION_NOT_CHANGEABLE, "generalerror", await Translate("WorkOrderErrorLocked"));
return;//this is a completely disqualifying error return;//this is a completely disqualifying error
} }