Exemple #1
0
        public void Salvar(Contato model)
        {
            if (string.IsNullOrWhiteSpace(model.Celular) &&
                string.IsNullOrWhiteSpace(model.Email) &&
                string.IsNullOrWhiteSpace(model.Observacao) &&
                string.IsNullOrWhiteSpace(model.Telefone))
            {
                throw new Exception("Não há nenhuma informação para salvar!");
            }

            if (model.Id == 0)
            {
                _repositorioContato.Adicionar(ref model);
            }
            else
            {
                _repositorioContato.Alterar(model);
            }
        }