コード例 #1
0
        public void CopiarDadosDe(Contato contatoACopiar)
        {
            if (contatoACopiar.Id != Guid.Empty)
            {
                this.Id = contatoACopiar.Id;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.CpfCnpj))
            {
                this.CpfCnpj = contatoACopiar.CpfCnpj;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Nome))
            {
                this.Nome = contatoACopiar.Nome;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Email1))
            {
                this.Email1 = contatoACopiar.Email1;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Endereco1Bairro))
            {
                this.Endereco1Bairro = contatoACopiar.Endereco1Bairro;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Endereco1Rua))
            {
                this.Endereco1Rua = contatoACopiar.Endereco1Rua;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Endereco1Numero))
            {
                this.Endereco1Numero = contatoACopiar.Endereco1Numero;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Endereco1Complemento))
            {
                this.Endereco1Complemento = contatoACopiar.Endereco1Complemento;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Endereco1CEP))
            {
                this.Endereco1CEP = contatoACopiar.Endereco1CEP;
            }

            if (contatoACopiar.Endereco1Estado != null)
            {
                this.Endereco1Estadoid = new Lookup((new CRM2013.Domain.Servicos.RepositoryService(OrganizationName, IsOffline)).Estado.ObterPor(contatoACopiar.Endereco1Estado).Id, contatoACopiar.Endereco1Estado, "itbc_estado");

                if (contatoACopiar.Endereco1Municipio != null)
                {
                    this.Endereco1Municipioid = new Lookup((new CRM2013.Domain.Servicos.RepositoryService(OrganizationName, IsOffline)).Municipio.ObterPor(this.Endereco1Estadoid.Id, contatoACopiar.Endereco1Municipio).Id, contatoACopiar.Endereco1Municipio, "itbc_municipio");
                }
            }

            if (!String.IsNullOrEmpty(contatoACopiar.TelefoneComercial))
            {
                this.TelefoneComercial = contatoACopiar.TelefoneComercial;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.TelefoneCelular))
            {
                this.TelefoneCelular = contatoACopiar.TelefoneCelular;
            }
            if (!String.IsNullOrEmpty(contatoACopiar.Fax))
            {
                this.Fax = contatoACopiar.Fax;
            }

            this.Endereco1Pais = new Lookup((new CRM2013.Domain.Servicos.RepositoryService(OrganizationName, IsOffline)).Pais.PesquisarPaisPor("BRASIL").Id, "BRASIL", "itbc_pais");
        }
コード例 #2
0
 public void Mesclar(Contato contato)
 {
     if (this.TelefoneComercial == null)
     {
         this.TelefoneComercial = contato.TelefoneComercial;
     }
     if (this.TelefoneCelular == null)
     {
         this.TelefoneCelular = contato.TelefoneCelular;
     }
     if (this.Nome == null)
     {
         this.Nome = contato.Nome;
     }
     if (this.Sobrenome == null)
     {
         this.Sobrenome = contato.Sobrenome;
     }
     if (this.NomeCompleto == null)
     {
         this.NomeCompleto = contato.NomeCompleto;
     }
     if (this.Email1 == null)
     {
         this.Email1 = contato.Email1;
     }
     if (this.Email2 == null)
     {
         this.Email2 = contato.Email2;
     }
     if (this.CpfCnpj == null)
     {
         this.CpfCnpj = contato.CpfCnpj;
     }
     if (this.Endereco1CEP == null)
     {
         this.Endereco1CEP = contato.Endereco1CEP;
     }
     if (this.Endereco1Bairro == null)
     {
         this.Endereco1Bairro = contato.Endereco1Bairro;
     }
     if (this.Endereco1Rua == null)
     {
         this.Endereco1Rua = contato.Endereco1Rua;
     }
     if (this.Endereco1Numero == null)
     {
         this.Endereco1Numero = contato.Endereco1Numero;
     }
     if (this.Endereco1Complemento == null)
     {
         this.Endereco1Complemento = contato.Endereco1Complemento;
     }
     if (this.Endereco1Municipio == null)
     {
         this.Endereco1Municipio = contato.Endereco1Municipio;
     }
     if (this.Endereco1Estado == null)
     {
         this.Endereco1Estado = contato.Endereco1Estado;
     }
     if (this.Endereco1Pais == null)
     {
         this.Endereco1Pais = contato.Endereco1Pais;
     }
 }
コード例 #3
0
 public void Update(Contato entity)
 {
     (new CRM2013.Domain.Servicos.RepositoryService(OrganizationName, IsOffline)).Contato.Update(entity);
 }
コード例 #4
0
 public List <Contato> ListarContatosPor(Contato contato)
 {
     return((new CRM2013.Domain.Servicos.RepositoryService(OrganizationName, IsOffline)).Contato.ListarContatosPor(contato));
 }