Пример #1
0
        public IActionResult AddMoney(int amount)
        {
            var     userLogic   = new UserLogic(_personContext);
            int     id          = HttpContext.Session.GetInt32(SessionId).GetValueOrDefault();
            decimal totalAmount = Convert.ToDecimal(HttpContext.Session.GetString(SessionBankBalance)) + Convert.ToDecimal(amount);

            userLogic.AddMoney(id, totalAmount);

            HttpContext.Session.SetString(SessionBankBalance, totalAmount.ToString());

            return(RedirectToAction("Index", "Home"));
        }