public ActionResult Transfer2(TransferViewModel model) { if (!ModelState.IsValid) { return View(model); } var currentAccount = Accounts.GetCurrent(); var to = Accounts.Get(model.To); if (currentAccount.Tranfer(model.Amount, to)) { return RedirectToAction("Transfer2", "Home"); } ModelState.AddModelError("Amount", "You don't have this amount of batcoins"); return View(model); }
public ActionResult Transfer() { var model = new TransferViewModel(); return View(model); }