Exemplo n.º 1
0
        public Alertas.Lib.Mensagens.CadastrarAlertaResponse CadastrarAlerta(Alertas.Lib.Mensagens.CadastrarAlertaRequest request)
        {
            logger.Debug("Executando Cadastrar Alerta - IdCliente=[" + request.Alerta.IdCliente + "] " +
                         "Instrumento=[" + request.Alerta.Instrumento + "] " +
                         "TipoOperador=[" + (int)request.Alerta.TipoOperador + "] " +
                         "TipoOperando=[" + (int)request.Alerta.TipoOperando + "] " +
                         "Valor=[" + request.Alerta.Valor + "] "
                         );

            CadastrarAlertaResponse resp = new CadastrarAlertaResponse();

            try
            {
                IServicoAlertas servico = Ativador.GetByAddr <IServicoAlertas>(urlalertas);

                resp = servico.CadastrarAlerta(request);

                logger.Debug("Executando Cadastrar Alerta - IdCliente=[" + request.Alerta.IdCliente + "] alerta cadastrado");
            }
            catch (Exception ex)
            {
                logger.Error("Erro CadastrarAlerta(): " + ex.Message, ex);

                resp.StatusResposta = Library.MensagemResponseStatusEnum.ErroPrograma;
                resp.DescricaoErro  = ex.Message;
            }

            return(resp);
        }
Exemplo n.º 2
0
        public Alertas.Lib.Mensagens.MarcarComoExibidoResponse MarcarComoExibido(Alertas.Lib.Mensagens.MarcarComoExibidoRequest request)
        {
            logger.Debug("MarcarComoExibido: IdCliente = [" + request.IdCliente + "]");

            MarcarComoExibidoResponse response = new MarcarComoExibidoResponse();

            try
            {
                IServicoAlertas servico = Ativador.GetByAddr <IServicoAlertas>(urlalertas);

                response = servico.MarcarComoExibido(request);
            }
            catch (Exception ex)
            {
                logger.Error("Erro MarcarComoExibido(): " + ex.Message, ex);
                response.StatusResposta    = Library.MensagemResponseStatusEnum.ErroPrograma;
                response.DescricaoResposta = ex.Message;
            }

            return(response);
        }
Exemplo n.º 3
0
        public Alertas.Lib.Mensagens.ExcluirAlertaResponse ExcluirAlerta(Alertas.Lib.Mensagens.ExcluirAlertaRequest request)
        {
            logger.Debug("Excluir Alerta: IdCliente=[" + request.IdCliente + "] IdAlerta=[" + request.IdAlerta + "]");

            ExcluirAlertaResponse response = new ExcluirAlertaResponse();

            try
            {
                IServicoAlertas servico = Ativador.GetByAddr <IServicoAlertas>(urlalertas);
                response = servico.ExcluirAlerta(request);
                logger.Debug("Excluir Alerta: IdCliente=[" + request.IdCliente + "] IdAlerta=[" + request.IdAlerta + "] excluido");
            }
            catch (Exception ex)
            {
                logger.Error("Erro ExcluirAlerta(): " + ex.Message, ex);
                response.StatusResposta    = Library.MensagemResponseStatusEnum.ErroPrograma;
                response.DescricaoResposta = ex.Message;
            }

            return(response);
        }