Ejemplo n.º 1
0
        public ActionResult Update(EnderecoCliente enderecoCliente)
        {
            EnderecoClienteValidator validator = new EnderecoClienteValidator();
            var result = validator.Validate(enderecoCliente);

            if (!result.IsValid)
            {
                var errors = new Dictionary <string, string>();
                foreach (var error in result.Errors)
                {
                    string message  = error.ErrorMessage;
                    string property = error.PropertyName;
                    errors.Add(property, message);
                }
                return(BadRequest(Json(errors)));
            }

            return(Json(new { id = repository.Update(enderecoCliente) }));
        }
 public ActionResult CadastroEndereco(int idEnderecoCliente, EnderecoCliente enderecoCliente)
 {
     _enderecoClienteRepo.IncludeEndereco(enderecoCliente);
     return(RedirectToAction("Index"));
 }
 public ClienteBasic()
 {
     endereco = new EnderecoCliente();
 }
 public ClienteVIP()
 {
     endereco = new EnderecoCliente();
 }