public ActionResult GetStocks()
        {
            var availStocks = new AvailableStocks(_dal.AvailableStocks());
            var jsonResult  = Json(availStocks, JsonRequestBehavior.AllowGet);

            return(jsonResult);
        }
        public ActionResult UpdateStocks()
        {
            bool didWork     = _dal.UpdateStocks();
            var  availStocks = new AvailableStocks(_dal.AvailableStocks());
            var  jsonResult  = Json(availStocks, JsonRequestBehavior.AllowGet);

            return(jsonResult);
        }
        public ActionResult BuyStock(int userId, int stockId, int shares)
        {
            bool isSuccess = false;

            if (shares > 0)
            {
                isSuccess = _dal.AddUserStock(userId, stockId, shares);
            }
            else if (shares < 0)
            {
                isSuccess = _dal.SellStock(userId, stockId, shares * -1);
            }
            JsonResult jsonResult = null;

            if (isSuccess)
            {
                //bool didWork = _dal.UpdateStocks();
                var availStocks = new AvailableStocks(_dal.AvailableStocks());
                jsonResult = Json(availStocks, JsonRequestBehavior.AllowGet);
            }
            return(jsonResult);
        }