public int Alterar(Cliente cliente)
{
try
{
InstanciarClienteBO();
int retorno = Insucesso;
if (_clienteBO.VerificarSeJaExisteNaAlteracao(cliente) == NaoExiste)
{
_banco.Entry(cliente).State = EntityState.Modified;
retorno = _banco.SaveChanges() == Sucesso ? Sucesso : Sucesso;
}
return retorno;
}
catch (CustomException erro)
{
throw new CustomException(erro.Message);
}
catch (Exception erro)
{
throw new Exception(erro.Message);
}
}