BusinessMgr

This commit is contained in:
Andy Howard
2024-11-26 11:35:04 +00:00
parent 804a3bd853
commit 48348d64b5
19 changed files with 247 additions and 261 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ namespace Sarand.Net.Standard.Base.Bus
/// <returns></returns>
public static String Concat(this ICollection<SysId> values, String delimiter, bool ignoreInvalid = true)
{
List<String> ids = new List<string>();
HashSet<String> ids = new HashSet<string>();
foreach (SysId id in values.Where(id => !ignoreInvalid || SysId.IsValid(id)))
ids.Add(id.ToString());
return ids.Concat(delimiter);
@@ -263,8 +263,8 @@ namespace Sarand.Net.Standard.Base.ReferenceData
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IncludedIds { get; } = new List<SysId>();
public List<SysId> ExcludedIds { get; } = new List<SysId>();
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
// Currency.
public String Code { get; set; }
public String CodePartial { get; set; }
@@ -185,9 +185,9 @@ namespace Sarand.Net.Standard.Base.ReferenceData
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IncludedIds { get; } = new List<SysId>();
public List<SysId> ExcludedIds { get; } = new List<SysId>();
// Language.
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
// Item properties.
public String Code { get; set; }
public String CodePartial { get; set; }
public String Name { get; set; }
@@ -178,8 +178,8 @@ namespace Sarand.Net.Standard.Base.ReferenceData
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IncludedIds { get; } = new List<SysId>();
public List<SysId> ExcludedIds { get; } = new List<SysId>();
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
// Region.
public SaRegionType RegionType { get; set; } = SaRegionType.Unknown;
public String Name { get; set; }
@@ -279,8 +279,8 @@ namespace Sarand.Net.Standard.Base.ReferenceData
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IncludedIds { get; } = new List<SysId>();
public List<SysId> ExcludedIds { get; } = new List<SysId>();
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
// Tax Code properties.
public String Code { get; set; }
public String CodePartial { get; set; }
@@ -319,15 +319,13 @@ namespace Sarand.Net.Standard.Base.ReferenceData
public new class Params : SacsHierarchyItem.Params
{
// List filtering.
public List<SysId> IncludedIds { get; } = new List<SysId>();
public List<SysId> ExcludedIds { get; } = new List<SysId>();
public List<SysId> IdsIncluded { get; } = new List<SysId>();
public List<SysId> IdsExcluded { get; } = new List<SysId>();
// UnitMeasure.
public SaUomCategory Category { get; set; }
public SaUomType UnitType { get; set; }
public String Code { get; set; }
public String CodePartial { get; set; }
public String Desc { get; set; }
public String DescPartial { get; set; }
public String NotesPartial { get; set; }
public StatusCat StatusCat { get; set; } = StatusCat.Any;
}
@@ -436,8 +436,8 @@ namespace Sarand.Net.Standard.Base.Security
/// </summary>
public new class Params : SacsHierarchyItem.Params
{
public List<SysId> IncludedIds { get; } = new List<SysId>();
public List<SysId> ExcludedIds { get; } = new List<SysId>();
public HashSet<SysId> IdsIncluded { get; } = new HashSet<SysId>();
public HashSet<SysId> IdsExcluded { get; } = new HashSet<SysId>();
public SaSecurity.ItemType SecurityItemType { get; set; } = SaSecurity.ItemType.Any;
public String Code { get; set; }
public String CodePartial { get; set; }
@@ -445,7 +445,7 @@ namespace Sarand.Net.Standard.Base.Security
public String EmailAddressPartial { get; set; }
public String Description { get; set; }
public String DescriptionPartial { get; set; }
public List<SysId> IncludedGroupIds { get; } = new List<SysId>();
public HashSet<SysId> GroupIdsIncluded { get; } = new HashSet<SysId>();
public StatusCat StatusCat { get; set; } = StatusCat.EnabledOnly;
}
@@ -66,7 +66,7 @@ namespace Sarand.Net.Standard.Base.Utils
/// <summary>Does the list have any entries.</summary>
public static bool IsEmpty (this ICollection<String> values)
{
return (values.Count == 0);
return !values.Any();
}
/// <summary>Case-insensitive contains.</summary>
public static bool ContainsCI (this IEnumerable<String> values, String value)
@@ -207,6 +207,7 @@ namespace Sarand.Net.Standard.Base.Utils
if (!Decimal.TryParse(value, out number)) return false;
return (allowNegative || number >= 0);
}
//-------------------------------------------------------------------
/// <summary>Test for Hex character.</summary>
public static bool IsHex(this char c)