public ActionResult Create(ClienteTelefoneEnderecoViewModel clienteEnderecoViewModel) { if (ModelState.IsValid) { clienteEnderecoViewModel = _clienteApplication.Adicionar(clienteEnderecoViewModel); if (!clienteEnderecoViewModel.ValidationResult.IsValid) { foreach (var erro in clienteEnderecoViewModel.ValidationResult.Erros) { ModelState.AddModelError(string.Empty, erro.Message); } return(View(clienteEnderecoViewModel)); } if (!clienteEnderecoViewModel.ValidationResult.Message.IsNullOrWhiteSpace()) { ViewBag.Sucesso = clienteEnderecoViewModel.ValidationResult.Message; return(View(clienteEnderecoViewModel)); } return(RedirectToAction("Index")); } return(View(clienteEnderecoViewModel)); }
public ClienteTelefoneEnderecoViewModel Criar(ClienteTelefoneEnderecoViewModel clienteTelefoneEnderecoViewModel) { return(_clienteApplication.Adicionar(clienteTelefoneEnderecoViewModel)); }