예제 #1
0
        protected bool Save()
        {
            if (_notifications.HasNotification())
            {
                return(false);
            }

            _uow.Save();
            return(true);
        }
예제 #2
0
        protected bool Salvar(string usuarioLogado)
        {
            if (_notifications.HasNotification())
            {
                return(false);
            }

            _unitOfWork.Salvar(usuarioLogado);
            return(true);
        }
예제 #3
0
        public bool Commit()
        {
            if (_notifications.HasNotification())
            {
                return(false);
            }
            var commandResponse = _uow.Commit();

            if (commandResponse.Success)
            {
                return(true);
            }
            AdicionarNovaNotificacao("Commit", "Erro ao atualizar o banco de dados ");
            return(false);
        }
        protected async Task <bool> Commit()
        {
            if (await _notification.HasNotification())
            {
                return(false);
            }
            if (await _uow.Commit())
            {
                return(true);
            }

            await _mediator.RaiseEvent(new DomainNotification(MethodInfo.GetCurrentMethod().Name, "Erro ao salvar dados no banco"));

            return(false);
        }
        protected bool Commit()
        {
            if (_notifications.HasNotification())
            {
                return(false);
            }

            var commandResponse = _uow.Commit();

            if (commandResponse.Success)
            {
                return(true);
            }

            _bus.RaiseEvent(new DomainNotification("Commit", "Ocorreu um erro ao Salvar os dados no banco!"));

            return(false);
        }
예제 #6
0
        protected bool Commit()
        {
            //TODO: Validar se há alguma validação de negócio com erro!
            if (_notifications.HasNotification())
            {
                return(false);
            }
            var commandResponse = _uow.Commit();

            if (commandResponse.Success)
            {
                return(true);
            }

            Console.WriteLine("Ocorreu um erro ao salvar os dados no banco!");
            _bus.RaiseEvent(new DomainNotification("Commit", "Ocorreu um erro ao salvar os dados no banco!"));
            return(false);
        }
        protected bool Commit()
        {
            if (_notifications.HasNotification())
            {
                return(false);
            }

            var commandResponse = _uow.Commit();

            if (commandResponse.Sucess)
            {
                return(true);
            }

            //mensagem de erro aqui
            _bus.RaiseEvent(new DomainNotification("Commit", "Ocorreu erro ao salvar mensagem no banco."));
            return(false);
        }
 protected bool OperacaoValida()
 {
     return(!_notifications.HasNotification());
 }
예제 #9
0
 protected bool Save()
 {
     return(!_notifications.HasNotification() && _uow.Save());
 }
예제 #10
0
 protected bool HasNotification()
 {
     return(_notifications.HasNotification());
 }