public IExpression <Decimal?> CreateCashExpression(NullableSumExpression targetTotalExpression) { var formula = new CashFormula(targetTotalExpression); var result = new Expression <Decimal?>("Cash", formula, this.commonParts.NullableDecimalValueAdapter, this.commonParts.ValidateNonNegativeOrNull); return(result); }
public void Write(NullableSumExpression expression, String name, IJsonWriter writer, CalculationTicket ticket) { writer.Write(name, delegate { var value = expression.Value(ticket); var issues = expression.Validate(ticket); writer.Write(value, "value"); this.validationSerializer.SerializeValidationIssuesIfAny(issues, writer); }); }
public RootModel( String porfolioId, BuPortfolioSecurityTargetChangesetInfo latestChangesetInfo, IEnumerable <ItemModel> items, NullableSumExpression targetTotalExpression, IExpression <Decimal?> cashExpression ) { this.PortfolioId = porfolioId; this.LatestChangeset = latestChangesetInfo; this.Items = items.ToList(); this.TargetTotal = targetTotalExpression; this.Cash = cashExpression; }
public void Resolve(NullableSumExpression expression) { this.parent.Write(expression, this.name, this.writer, this.ticket); }
public IExpression <Decimal?> CreateBaseActiveTotalExpression(List <SecurityModel> securityModels) { var baseActiveTotalExpression = new NullableSumExpression(ValueNames.BaseActiveTotal, securityModels.Select(s => s.BaseActive), this.defaultValues.DefaultBaseActive, this.commonParts.ValidateWhatever); return(baseActiveTotalExpression); }
public void Resolve(NullableSumExpression expression) { this.Result = false; }
public CashFormula(NullableSumExpression targetTotalExpression) { this.targetTotalExpression = targetTotalExpression; }