Exemple #1
0
        public string Enviar(ArquivoDeEstoqueGiro objModel, ref string nomeAbrevRet, ref string codigoClienteRet)
        {
            string retMsg = String.Empty;

            Intelbras.Message.Helper.MSG0186 mensagem = this.DefinirPropriedades(objModel);

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

            if (integracao.EnviarMensagemBarramento(mensagem.GenerateMessage(true), "1", "1", out retMsg))
            {
                Intelbras.Message.Helper.MSG0186R1 retorno = CarregarMensagem <Pollux.MSG0186R1>(retMsg);
                if (retorno.Resultado.Sucesso)
                {
                    //if (!String.IsNullOrEmpty(retorno.NomeAbreviado))
                    //    nomeAbrevRet = retorno.NomeAbreviado;
                    //if (retorno.CodigoCliente.HasValue)
                    //    codigoClienteRet = retorno.CodigoCliente.Value.ToString();
                }
                else
                {
                    throw new Exception(string.Concat(retorno.Resultado.Mensagem));
                }
            }
            else
            {
                Intelbras.Message.Helper.ERR0001 erro001 = CarregarMensagem <Pollux.ERR0001>(retMsg);
                throw new Exception(string.Concat(erro001.GenerateMessage(false)));
            }
            return(retMsg);
        }
Exemple #2
0
        public Pollux.MSG0186 DefinirPropriedades(ArquivoDeEstoqueGiro objModel)
        {
            #region Propriedades Crm->Xml

            Pollux.MSG0186 msg0186 = new Pollux.MSG0186(itb.RetornaSistema(itb.Sistema.CRM), Helper.Truncate(objModel.Nome, 40));
            //msg0162.CodigoArquivoSellout = objModel.

            #endregion

            return(msg0186);
        }
Exemple #3
0
        public ArquivoDeEstoqueGiro DefinirPropriedades(Intelbras.Message.Helper.MSG0186 xml)
        {
            var crm = new ArquivoDeEstoqueGiro(this.Organizacao, this.IsOffline);

            #region Propriedades Crm->Xml

            if (!String.IsNullOrEmpty(xml.CodigoArquivoEstoqueGiro))
            {
                crm.ID = new Guid(xml.CodigoArquivoEstoqueGiro);
            }

            if (xml.DataEnvio.HasValue)
            {
                crm.DataDeEnvio = xml.DataEnvio.Value;
            }
            else
            {
                resultadoPersistencia.Sucesso  = false;
                resultadoPersistencia.Mensagem = "Data de Envio não Informada.";
                return(crm);
            }

            if (xml.StatusProcessamento.HasValue)
            {
                if (xml.StatusProcessamento.Value != 2)
                {
                    crm.RazaoStatus = xml.StatusProcessamento.Value;
                }
            }
            else
            {
                resultadoPersistencia.Sucesso  = false;
                resultadoPersistencia.Mensagem = "Status de Processamento não Informada.";
                return(crm);
            }

            if (xml.Situacao.HasValue)
            {
                crm.Status = xml.Situacao.Value;
            }


            crm.Nome = xml.Nome;

            if (xml.DataProcessamento.HasValue)
            {
                crm.DataDeProcessamento = xml.DataProcessamento.Value;
            }



            if (!String.IsNullOrEmpty(xml.CodigoConta))
            {
                crm.Conta = new Lookup(new Guid(xml.CodigoConta.ToString()), "account");
            }
            else
            {
                resultadoPersistencia.Sucesso  = false;
                resultadoPersistencia.Mensagem = "Canal relacionado ao arquivo de Estoque Giro não Informada.";
                return(crm);
            }

            crm.IntegradoEm       = DateTime.Now;
            crm.IntegradoPor      = usuarioIntegracao.NomeCompleto;
            crm.UsuarioIntegracao = xml.LoginUsuario;
            crm.Origem            = xml.OrigemArquivo;

            #endregion

            return(crm);
        }
Exemple #4
0
 public string Enviar(ArquivoDeEstoqueGiro ArquivoDeEstoqueGiroObj)
 {
     return(String.Empty);
 }
Exemple #5
0
        public ArquivoDeEstoqueGiro DefinirPropriedades(Intelbras.Message.Helper.MSG0187 xml)
        {
            ArquivoDeEstoqueGiro retorno = new ArquivoDeEstoqueGiro(this.Organizacao, this.IsOffline);

            return(retorno);
        }
Exemple #6
0
        public string Enviar(ArquivoDeEstoqueGiro objModel)
        {
            string resposta = string.Empty;

            return(resposta);
        }