Ejemplo n.º 1
0
        public ActionResult Create([Bind(Include = "Id,Amount,Description,TransactionType,Category,WalletId")] Transaction transaction)
        {
            if (ModelState.IsValid)
            {
                transaction.UserId = AppUserManager.GetUser().Id;
                db.Transactions.Add(transaction);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(transaction));
        }
Ejemplo n.º 2
0
        public ActionResult Create([Bind(Include = "Id,Title,Description")] Wallet wallet)
        {
            var user = AppUserManager.GetUser();

            wallet.UserId = user.Id;
            if (ModelState.IsValid)
            {
                db.Wallets.Add(wallet);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(wallet));
        }