Example #1
0
        public void HandleInsert(EstadosVsCustas message)
        {
            if (message != null)
            {
                if (!message.IsValid())
                {
                    NotificarValidacoesErro(message.ValidationResult);
                    return;
                }

                var result = _repository.AdicionarCusta(message);
                if (!result.Success)
                {
                    _notifications.AddNotification(new DomainNotification(message.MessageType, result.Message));
                }
                else
                {
                    _notifications.AddNotification(new DomainNotification(message.MessageType, "Custa Adicionada com Sucesso!"));
                }
            }
            else
            {
                _notifications.AddNotification(new DomainNotification("", "Favor Preencher todos os campos"));
            }
        }