public ViewResult CreateFund(int accountId) { CreateFundViewModel model = new CreateFundViewModel() { Name = String.Empty, BankAccountId = accountId }; return View(model); }
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); } }