Exemplo n.º 1
0
        public ActionResult Create(AccountViewModel account)
        {
            if (ModelState.IsValid)
            {
                var accountDomain = Mapper.Map<AccountViewModel, Account>(account);
                _accountAppService.Add(accountDomain);

                return RedirectToAction("Index");
            }

            return View(account);
        }
Exemplo n.º 2
0
        public ActionResult Edit(AccountViewModel accountViewModel)
        {
            try
            {
                var accountDomain = Mapper.Map<AccountViewModel,Account>(accountViewModel);
                _accountAppService.Update(accountDomain);

                return RedirectToAction("Index");
            }
            catch
            {
                return View(accountViewModel);
            }
        }