Example #1
0
        public StockSplit CreateStockSplit(StockSplit stockSplit)
        {
            Guard.AgainstNull(() => stockSplit);

            stockSplit.Validate();

            using (var uow = _uowFactory.Create())
            {
                uow.RepoOf<StockSplit>().Add(stockSplit);
                uow.SaveChanges();
                return stockSplit;
            }
        }
Example #2
0
        public void UpdateStockSplit(StockSplit stockSplit)
        {
            Guard.AgainstNull(() => stockSplit);

            stockSplit.Validate();

            using (var uow = _uowFactory.Create())
            {
                uow.RepoOf<StockSplit>().UpdateAll(stockSplit);
                uow.SaveChanges();
            }
        }
 private StockSplitViewModel GetStockSplitViewModel(StockSplit stockSplit)
 {
     return new StockSplitViewModel
     {
         Id = stockSplit.Id,
         Date = stockSplit.Date,
         OldStock = _cache.GetStock(stockSplit.OldStockID),
         NewStock = _cache.GetStock(stockSplit.NewStockID),
         RatioFrom = stockSplit.RatioFrom,
         RatioTo = stockSplit.RatioTo
     };
 }