// Must be the initial call to retrieve the order creaion process...we are returning the OrderSeetings which is used to create orders public ActionResult StartOrderCreation(int traderId) { var model = new OrderSettings(); return Json(model, JsonRequestBehavior.AllowGet); }
public ActionResult UpdateOrder(int traderId, OrderSettings settings) { throw new Exception("Not supported yet!!!"); //var order = _ordersRepository.Update(settings); //return Json(new OrderViewModel(traderId, order), JsonRequestBehavior.AllowGet); }
public ActionResult CreateOrder(int traderId, OrderSettings settings) { //TODO: KLUDGE - determine the order buyer index from the settings contract var contract = _contractsRepository.FindById(settings.ContractId); if (contract.TraderOne.Id == traderId) settings.BuyerIndexInContract = 0; else settings.BuyerIndexInContract = 1; // END OF KLUDGE var order = _ordersRepository.Create(settings); return Json(new OrderViewModel(traderId, order), JsonRequestBehavior.AllowGet); }