This commit is contained in:
2022-05-23 21:16:36 +01:00
parent 25386026af
commit d631ad0223
41 changed files with 544 additions and 256 deletions
@@ -72,6 +72,9 @@ namespace Saxonite.Net.Standard.Base.Mgr
{
ClearErrorState();
// Some mandatory properties become optional if the address is deleted.
bool deleted = data.IsStatusDeleted;
//---------------------------------------------------------------
// Item Id.
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemId))
@@ -100,7 +103,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
errField.Line3 = SacsHierarchyItem.ValidValue.Invalid;
return false;
}
if (errField.Town != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Town, "town", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town), true))
if (errField.Town != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Town, "town", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town), !deleted))
{
errField.Town = SacsHierarchyItem.ValidValue.Invalid;
return false;
@@ -119,7 +122,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
errField.RegionIdCountry = SacsHierarchyItem.ValidValue.Invalid;
return SetErrorState("Country region must be specified");
}
if (errField.Country != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Country, "country", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country), true))
if (errField.Country != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Country, "country", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country), !deleted))
{
errField.Country = SacsHierarchyItem.ValidValue.Invalid;
return false;
@@ -176,7 +179,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
//---------------------------------------------------------------
// Associated data.
if (data.Status != SaStatus.Deleted)
if (!data.IsStatusDeleted)
{
// Item must exists.
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && ItemId.IsValid(data.ItemId))