public ActionResult Details()
        {
            var userId = User.Identity.GetUserId();
            var user   = ctx.Users.Find(userId);

            foreach (var position in user.Portofolio.Positions)
            {
                AVConnection AVC = new AVConnection();
                AVC.GetBasicStockInfo(position.Stock, ctx);
            }
            return(View(user.Portofolio));
        }
Exemple #2
0
 public ActionResult Details(int?id)
 {
     if (id.HasValue)
     {
         Stock stock = ctx.Stocks.Find(id);
         if (stock != null)
         {
             AVConnection AVC = new AVConnection();
             AVC.GetDetailedStockInfo(stock, ctx);
             ctx.SaveChanges();
             return(View(stock));
         }
         return(HttpNotFound("Couldn't find the book with id " + id.ToString() + "!"));
     }
     return(HttpNotFound("Missing stock id parameter!"));
 }