Ejemplo n.º 1
0
        public Pollux.MSG0166 DefinirPropriedadesPlugin(ParametroBeneficio objModel)
        {
            Pollux.MSG0166         retMsgProp     = new Pollux.MSG0166(Domain.Enum.Sistemas.RetornaSistema(Domain.Enum.Sistemas.Sistema.CRM), objModel.ID.ToString());
            BeneficioService       benefService   = new BeneficioService(this.Organizacao, this.IsOffline);
            UnidadeNegocioService  unidNegService = new UnidadeNegocioService(this.Organizacao, this.IsOffline);
            EstabelecimentoService estabService   = new EstabelecimentoService(this.Organizacao, this.IsOffline);

            retMsgProp.CodigoBeneficio          = objModel.Beneficio.Id.ToString();
            retMsgProp.CodigoParametroBeneficio = objModel.ID.ToString();

            var benefObj = benefService.ObterPor(objModel.Beneficio.Id);

            retMsgProp.BeneficioCodigo = benefObj.Codigo;

            var unidNegObj = unidNegService.BuscaUnidadeNegocio(objModel.UnidadeNegocio.Id);

            retMsgProp.CodigoUnidadeNegocio = unidNegObj.ChaveIntegracao;

            var estabObj = estabService.BuscaEstabelecimento(objModel.Estabelecimento.Id);

            retMsgProp.CodigoEstabelecimento = estabObj.Codigo;

            retMsgProp.TipoFluxoFinanceiro       = objModel.TipoFluxoFinanceiro;
            retMsgProp.EspecieDocumento          = objModel.EspecieDocumento;
            retMsgProp.ContaContabil             = objModel.ContaContabil;
            retMsgProp.CentroCusto               = objModel.CentroCusto;
            retMsgProp.PercentualAtingimentoMeta = objModel.AtingimentoMetaPrevisto;
            retMsgProp.PercentualCusto           = objModel.Custo;
            retMsgProp.Situacao         = objModel.Status;
            retMsgProp.Proprietario     = "259A8E4F-15E9-E311-9420-00155D013D39";
            retMsgProp.TipoProprietario = "systemuser";

            return(retMsgProp);
        }
Ejemplo n.º 2
0
        public string Enviar(ParametroBeneficio objModel)
        {
            string resposta;

            Intelbras.Message.Helper.MSG0166 mensagem = DefinirPropriedadesPlugin(objModel);

            Domain.Servicos.Integracao integracao = new Servicos.Integracao(this.Organizacao, this.IsOffline);

            if (integracao.EnviarMensagemBarramento(mensagem.GenerateMessage(true), "1", "1", out resposta))
            {
                Intelbras.Message.Helper.MSG0166R1 retorno = CarregarMensagem <Pollux.MSG0166R1>(resposta);
                if (!retorno.Resultado.Sucesso)
                {
                    throw new ArgumentException("(CRM) " + retorno.Resultado.Mensagem);
                }
            }
            else
            {
                Intelbras.Message.Helper.ERR0001 erro001 = CarregarMensagem <Pollux.ERR0001>(resposta);
                throw new ArgumentException("(CRM) " + erro001.GenerateMessage(false));
            }
            return(resposta);
        }
Ejemplo n.º 3
0
 public ParametroBeneficio DefinirPropriedades(Intelbras.Message.Helper.MSG0166 xml)
 {
     throw new NotImplementedException();
 }