Ejemplo n.º 1
0
 public JsonResult GetConnectionStatus(ToolkitInputModel toolkitInputModel)
 {
     restClientController = new RestClientController(toolkitInputModel.EndPoint, toolkitInputModel.HttpMethod);
     restClientController.MakeRequest();
     toolkitViewModel.ConnectionStatus = (restClientController.GetResponse() == "{}") ? true : false;
     return(Json(toolkitViewModel, JsonRequestBehavior.AllowGet));
 }
Ejemplo n.º 2
0
        public JsonResult Refresh(StandardTradeToolInputModel standardTradeToolInputModel)
        {
            restClientController = new RestClientController(standardTradeToolInputModel.EndPoint, standardTradeToolInputModel.HttpMethod);
            restClientController.MakeRequest();
            //ECurrencyPair currencyPair = new ECurrencyPair();
            //decimal tickerPrice = 0.0M;

            //exchangeDataModel.CurrencyPair = currencyPair;
            //exchangeDataModel.TickerPrice = tickerPrice;
            //InitiateTrade();
            string        rawTicker    = restClientController.GetResponse();
            ECurrencyPair currencyPair = ECurrencyPair.NOT_SELECTED;
            decimal       amount       = 0.0m;

            ExchangeController.ProcessRawData(rawTicker, ref currencyPair, ref amount);
            standardTradeToolViewModel.CurrencyPair = currencyPair.ToString();
            standardTradeToolViewModel.Amount       = amount;
            return(Json(standardTradeToolViewModel, JsonRequestBehavior.AllowGet));
        }