This commit is contained in:
@@ -267,7 +267,7 @@ namespace AyaNova.Biz
|
|||||||
//PartInventory record?
|
//PartInventory record?
|
||||||
if (await ct.PartInventory.AnyAsync(m => m.PartWarehouseId == inObj.Id))
|
if (await ct.PartInventory.AnyAsync(m => m.PartWarehouseId == inObj.Id))
|
||||||
{
|
{
|
||||||
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", "LT:PartInventoryTransaction");
|
AddError(ApiErrorCode.VALIDATION_REFERENTIAL_INTEGRITY, "generalerror", await TranslationBiz.GetTranslationStaticAsync("PartInventoryTransaction", UserTranslationId, ct));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -372,6 +372,19 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////////////////////////////////////////////////////
|
||||||
|
// Get translation of one key for specified translation id
|
||||||
|
// Used for internal error message translation to return
|
||||||
|
// during object validation etc. Intended to be as efficient as possible
|
||||||
|
//
|
||||||
|
internal static async Task<string> GetTranslationStaticAsync(string translationKey, long translationId, AyContext ct)
|
||||||
|
{
|
||||||
|
#if (DEBUG)
|
||||||
|
TrackRequestedKey(translationKey);
|
||||||
|
#endif
|
||||||
|
return await ct.TranslationItem.Where(z => z.TranslationId == translationId && z.Key == translationKey).AsNoTracking().Select(z => z.Display).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user