Ejemplo n.º 1
0
        public IActionResult Get()
        {
            //return new string[] { "value1", "value2" };
            var       email = User.Identity.Name;
            StockUser user  = new StockUser();

            user = _stockUserRepo.GetUserInfo(email);
            return(Ok(user.Id));
        }
Ejemplo n.º 2
0
        // GET: User/Create
        public ActionResult Create()
        {
            StockUserViewModel stockUser = new StockUserViewModel();

            stockUser.loginUserId = this.User.Identity.Name;
            stockUser.userTransId = 0;
            // stockUser.user.Id = 0;
            //lookup email--if exists, populate form with data
            StockUser userFound = _StockUserRepo.GetUserInfo(stockUser.loginUserId);

            if (userFound != null)
            {
                //populate view model with stockuser data
                stockUser.user.Id           = userFound.Id;
                stockUser.user.FName        = userFound.FName;
                stockUser.user.LName        = userFound.LName;
                stockUser.user.TotCash      = userFound.TotCash;
                stockUser.user.TotEquity    = userFound.TotEquity;
                stockUser.user.TotPortfolio = userFound.TotPortfolio;
            }

            return(View(stockUser));
        }