示例#1
0
        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);
        }
示例#2
0
 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);
     });
 }
示例#3
0
 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;
 }
示例#4
0
 public void Resolve(NullableSumExpression expression)
 {
     this.parent.Write(expression, this.name, this.writer, this.ticket);
 }
示例#5
0
        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);
        }
示例#6
0
 public void Resolve(NullableSumExpression expression)
 {
     this.Result = false;
 }
示例#7
0
 public CashFormula(NullableSumExpression targetTotalExpression)
 {
     this.targetTotalExpression = targetTotalExpression;
 }