예제 #1
0
파일: MSG0165.cs 프로젝트: ertprs/crm_fonte
        public Pollux.MSG0165 DefinirPropriedadesPlugin(BeneficioDoCanal objModel)
        {
            Pollux.MSG0165          retMsgProp         = new Pollux.MSG0165(Domain.Enum.Sistemas.RetornaSistema(Domain.Enum.Sistemas.Sistema.CRM), objModel.ID.ToString());
            BeneficioService        benefService       = new BeneficioService(this.Organizacao, this.IsOffline);
            StatusBeneficiosService statusBenefService = new StatusBeneficiosService(this.Organizacao, this.IsOffline);

            retMsgProp.CodigoBeneficioCanal = objModel.ID.ToString();
            retMsgProp.NomeBeneficioCanal   = objModel.Nome;
            retMsgProp.CodigoConta          = objModel.Canal.Id.ToString();
            retMsgProp.CodigoBeneficio      = objModel.Beneficio.Id.ToString();

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

            retMsgProp.BeneficioCodigo      = benefObj.Codigo;
            retMsgProp.NomeBeneficio        = benefObj.Nome;
            retMsgProp.CodigoCategoria      = objModel.Categoria.Id.ToString();
            retMsgProp.CategoriaCodigo      = Int32.Parse(objModel.CategoriaObj.CodigoCategoria);
            retMsgProp.NomeCategoria        = objModel.CategoriaObj.Nome;
            retMsgProp.CodigoUnidadeNegocio = objModel.UnidadeNegocioObj.ChaveIntegracao;
            retMsgProp.NomeUnidadeNegocio   = objModel.UnidadeNegocioObj.Nome;

            if (objModel.StatusBeneficio != null)
            {
                retMsgProp.CodigoStatusBeneficio = objModel.StatusBeneficio.Id.ToString();
                StatusBeneficios statusBenefObj = statusBenefService.ObterPor(objModel.StatusBeneficio.Id);
                retMsgProp.NomeStatusBeneficio = statusBenefObj.Nome;
            }

            retMsgProp.CalcularVerba               = objModel.CalculaVerba;
            retMsgProp.AcumularVerba               = objModel.AcumulaVerba;
            retMsgProp.PassivelSolicitacao         = objModel.BeneficioObj.PassivelDeSolicitacao;
            retMsgProp.PossuiControleContaCorrente = objModel.BeneficioObj.PossuiControleContaCorrente;
            retMsgProp.Situacao         = objModel.Status;
            retMsgProp.Proprietario     = "259A8E4F-15E9-E311-9420-00155D013D39";
            retMsgProp.TipoProprietario = "systemuser";

            return(retMsgProp);
        }
예제 #2
0
파일: MSG0165.cs 프로젝트: ertprs/crm_fonte
        public string Enviar(BeneficioDoCanal objModel)
        {
            string resposta;

            Intelbras.Message.Helper.MSG0165 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.MSG0165R1 retorno = CarregarMensagem <Pollux.MSG0165R1>(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);
        }
예제 #3
0
파일: MSG0165.cs 프로젝트: ertprs/crm_fonte
 public BeneficioDoCanal DefinirPropriedades(Intelbras.Message.Helper.MSG0165 xml)
 {
     throw new NotImplementedException();
 }