public void AddBuyTaxLine(TaxLine buyTaxLine) { if (buyTaxLine.TradeOrder.Type != OrderType.Buy) { throw new OrderTypeMismatchException(); } buyTaxLine.TaxEvent = this; BuyTaxLines.Add(buyTaxLine); }
public TaxEvent(TaxLine sellTaxLine) { if (sellTaxLine.TradeOrder.Type != OrderType.Sell) { throw new OrderTypeMismatchException(); } sellTaxLine.TaxEvent = this; this.SellTaxLine = sellTaxLine; BuyTaxLines = new List <TaxLine>(); }
public bool TryAddTaxLine(out TaxLine taxLine) { if (IsTaxed) { taxLine = TaxLine; return(false); } else { TaxLine = new TaxLine(this, TradeAmount); taxLine = TaxLine; return(true); } }
public TaxLine AddTaxLine(decimal tradeAmount) { decimal remaining = TaxableAmountRemaining; if (tradeAmount == 0 || remaining == 0) { return(null); } TaxLine newLine = null; if (tradeAmount <= remaining) { newLine = new TaxLine(this, tradeAmount); } else { newLine = new TaxLine(this, TradeAmount); } this.TaxLines.Add(newLine); return(newLine); }