This commit is contained in:
@@ -155,7 +155,7 @@ namespace AyaNova.Biz
|
||||
AddError(ApiErrorCode.NOT_FOUND);
|
||||
return false;
|
||||
}
|
||||
await ValidateCanDelete(dbObject);
|
||||
await ValidateCanDelete(dbObject);
|
||||
if (HasErrors)
|
||||
return false;
|
||||
ct.PartWarehouse.Remove(dbObject);
|
||||
@@ -254,7 +254,7 @@ namespace AyaNova.Biz
|
||||
|
||||
private async Task ValidateCanDelete(PartWarehouse inObj)
|
||||
{
|
||||
|
||||
|
||||
//Can't delete the default warehouse
|
||||
if (inObj.Id == 1)
|
||||
{
|
||||
@@ -267,7 +267,7 @@ namespace AyaNova.Biz
|
||||
//PartInventory record?
|
||||
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));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user