Consolidate User Context

This commit is contained in:
2021-08-04 21:32:35 +01:00
parent b8cfd87860
commit afd38cea03
126 changed files with 2240 additions and 634 deletions
@@ -1,4 +1,5 @@
using Sarand.BusinessMgr.Net.Standard.Base.App;
using Sarand.BusinessMgr.Net.Standard.Base.Core;
using Sarand.Net.Standard.Base.Bus;
using Sarand.Net.Standard.Base.CodeTypes;
using Sarand.Net.Standard.Base.Core;
@@ -133,13 +134,13 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
//-------------------------------------------------------------------
// Construction.
public SbmCostEstimate(SbmUserContext userContext, Sbm.CostEstimateCategory costEstimateCategory) : base(userContext)
public SbmCostEstimate(ISbmUserContext userContext, Sbm.CostEstimateCategory costEstimateCategory) : base(userContext)
{
CostEstimateCategory = costEstimateCategory;
Status = DefaultStatus;
}
// Conversion from ItemLink.
public SbmCostEstimate(SbmUserContext userContext, String archive) : base(userContext)
public SbmCostEstimate(ISbmUserContext userContext, String archive) : base(userContext)
{
String[] data = archive.Split(new String[] { delimArchive }, StringSplitOptions.None);
costEstimateCategory = (Sbm.CostEstimateCategory)(data.Length > 0 ? StringUtil.ToShort(data[0]) : 0);
@@ -442,7 +443,7 @@ namespace Sarand.BusinessMgr.Net.Standard.Base.Bus
}
//-------------------------------------------------------------------
public static void SetCommodityCosts(this List<SbmCostEstimate> values, SbmUserContext userContext, SbmCommodity commodity, decimal quantity)
public static void SetCommodityCosts(this List<SbmCostEstimate> values, ISbmUserContext userContext, SbmCommodity commodity, decimal quantity)
{
// Retrieve costs from commodity and remove unwanted costs (for other quantities).
List<SbmCostEstimate> costEstimatesCommodity = commodity.GetCostEstimates();