public ActionResult Create(ClienteViewModel clienteVM)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    Cliente cliente = Mapper.Map<ClienteViewModel, Cliente>(clienteVM);
                    identityService.CadastrarUsuario(cliente,User.Identity.Name);
                }
                catch (BusinessException ex)
                {
                    HttpNotFound(ex.Message);
                }
            }

            clienteVM.PessoaID = User.Identity.Name;
            return View(clienteVM);
        }
 public ActionResult Create()
 {
     ClienteViewModel clienteVM = new ClienteViewModel();
     clienteVM.PessoaID = User.Identity.Name;
     return View(clienteVM);
 }
        public ActionResult Edit(ClienteViewModel clienteVM)
        {
            if (ModelState.IsValid)
            {
                try
                {
                    Cliente cliente = Mapper.Map<ClienteViewModel, Cliente>(clienteVM);
                    service.Editar(cliente);
                    return RedirectToAction("Index");
                }
                catch (BusinessException)
                {
                    HttpNotFound();
                }
            }

            return View(clienteVM);
        }