コード例 #1
0
        public ActionResult ChangeBasicInformations(string userId)
        {
            if (!String.IsNullOrEmpty(userId))
            {
                var user      = _readUser.GetUserById(userId);
                var binder    = new ToUserEditViewModel();
                var viewModel = binder.GetViewModel(user);

                return(View("ChangeBasicInformations", viewModel));
            }

            return(View("Error"));
        }
コード例 #2
0
        public ActionResult Create(BankAccountCreateViewModel viewModel)
        {
            if (ModelState.IsValid && User.Identity.GetUserId() == viewModel.UserId)
            {
                var binder = new FromBankAccountCreateViewModel();
                var user   = _readUser.GetUserById(viewModel.UserId);
                var model  = binder.GetBankAccount(viewModel, user);
                _writeBankAccount.Create(model);

                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(viewModel));
            }
        }