Exemplo n.º 1
0
        private void Validacao(Pollux.MSG0169 xml)
        {
            if (String.IsNullOrEmpty(xml.CodigoContato))
            {
                throw new ArgumentException("(CRM) Código do contato não foi enviado.");
            }

            if (String.IsNullOrEmpty(xml.NomeFilaAtendimento))
            {
                throw new ArgumentException("(CRM) Nome da fila de atendimento não foi enviado.");
            }

            if (String.IsNullOrEmpty(xml.Assunto))
            {
                throw new ArgumentException("(CRM) Assunto não foi enviado.");
            }

            if (String.IsNullOrEmpty(xml.DescricaoEmail))
            {
                throw new ArgumentException("(CRM) Descrição do e-mail não foi enviada.");
            }

            if (xml.Direcao != 0 && xml.Direcao != 1)
            {
                throw new ArgumentException("(CRM) Direção inválida.");
            }

            if (String.IsNullOrEmpty(xml.Referente))
            {
                throw new ArgumentException("(CRM) Referente não foi enviado.");
            }

            if (xml.Referente == SDKore.Crm.Util.Utility.GetEntityName <Pedido>())
            {
                if (String.IsNullOrEmpty(xml.NumeroPedido))
                {
                    throw new ArgumentException("(CRM) Número do pedido não foi enviado.");
                }
            }
            else
            {
                if (String.IsNullOrEmpty(xml.CodigoObjeto))
                {
                    throw new ArgumentException("(CRM) Código do Objeto não foi enviado.");
                }
            }

            if (!System.Enum.IsDefined(typeof(Enum.Email.StatusEmail), xml.StatusEmail))
            {
                throw new ArgumentException("(CRM) Status de e-mail inválido.");
            }
        }
Exemplo n.º 2
0
        public ItemFila DefinirPropriedades(Intelbras.Message.Helper.MSG0169 xml)
        {
            var crm = new Model.ItemFila(this.Organizacao, this.IsOffline);

            return(crm);
        }