Esempio n. 1
0
        public ViewResult CreateFund(int accountId)
        {
            CreateFundViewModel model = new CreateFundViewModel()
            {
                Name = String.Empty,
                BankAccountId = accountId
            };

            return View(model);
        }
Esempio n. 2
0
        public ActionResult CreateFund(CreateFundViewModel model)
        {
            if (ModelState.IsValid)
            {
                Fund fund = new Fund
                {
                    Name = model.Name,
                    BankAccountId = model.BankAccountId
                };

                fundRepository.InsertFund(fund);

                return RedirectToAction("Details", new { accountId = model.BankAccountId });
            }
            else
            {
                return View(model);
            }
        }