コード例 #1
0
        /// <summary>
        /// Uncompleate. Planned to add factory
        /// </summary>
        /// <param name="arg"></param>
        private void AddStockCommandExecute(object dummy)
        {
            ExternalDTOs.Stock stock;
            switch (StockType)
            {
            case StockType.Bond:
                stock = new ExternalDTOs.Bond();
                break;

            case StockType.Equity:
                stock = new ExternalDTOs.Equity();
                break;

            default:
                stock = new ExternalDTOs.Bond();
                break;
            }
            stock.Price    = Convert.ToDecimal(this.PriceString);
            stock.Quantity = Convert.ToDecimal(this.QuantityString);
            var id = stocksService.AddStock(stock);

            eventAggregator.GetEvent <NewStockAdded>().Publish(id);
        }
コード例 #2
0
 public static Bond Convert(ExternalDTOs.Bond serviceDto)
 {
     return(Mapper.Map <Bond>(serviceDto));
 }