예제 #1
0
 public DepotTransaction(Trader trader, MarketProduct marketProduct, int amountPieces)
 {
     Depot       = trader.Depot;
     DepotId     = trader.Depot.Id;
     Product     = marketProduct.Product;
     ProductCode = marketProduct.Product.Code;
     Amount      = amountPieces;
     Price       = marketProduct.Price;
     Time        = DateTime.UtcNow;
 }
예제 #2
0
 public BookingOrder(Trader trader, MarketProduct marketProduct, int amount, decimal threshold)
 {
     Trader        = trader;
     TraderId      = trader.Id;
     MarketProduct = marketProduct;
     ProductCode   = marketProduct.ProductCode;
     Amount        = amount;
     Threshold     = threshold;
     Booked        = false;
 }
예제 #3
0
 public void AddMarketProduct(MarketProduct marketProduct)
 {
     context.Market.Add(marketProduct);
     context.Products.Add(marketProduct.Product);
     context.SaveChanges();
 }