//Deal with the order public ActionResult SubmitOrder() { string strategyId = Request.Form["strategyId"]; string traderId = Request.Form["traderId"]; string orderBookId = Request.Form["orderBookId"]; string side = Request.Form["side"]; string quantity = Request.Form["quantity"]; string price = Request.Form["price"]; //Strategy strategy = new StrategyService().FindStrategyById(Convert.ToInt32(strategyId)); Trader trader = new TraderService().FindTraderById(Convert.ToInt32(traderId)); bool isBuy = false; if (side != null && side.Equals("B")) { isBuy = true; } //OrderBook orderBook = new OrderBookService().FindOrderBookById(Convert.ToInt32(orderBookId)); Order order = new Order(); order.DateTime = DateTime.Now; order.StrategyId = Convert.ToInt32(strategyId); order.Trader = trader; order.Quantity = Convert.ToInt32(quantity); order.IsBuy = isBuy; order.OrderBookId = Convert.ToInt32(orderBookId); if (price != null) { order.Price = Convert.ToDouble(price); } //orderService.AddOrder(order); //int id = orderService.GetOrderId(order); Execution execution = MakeTrade(order); executionService.AddExecution(execution); ViewData["orderExecution"] = execution; return(View("OrderDetail")); }