Ejemplo n.º 1
0
        private void pesquisar(Solicitacao objSolicitacao, Interlocutor objInterlocutor)
        {
            var objPesquisa = objInterlocutor.getObjJson <PesquisaInterlocutor>();

            if (objPesquisa == null)
            {
                throw new NullReferenceException();
            }

            if (string.IsNullOrEmpty(objPesquisa.sqlTabelaNome))
            {
                throw new NullReferenceException();
            }

            var tbl = this.dbe[objPesquisa.sqlTabelaNome];

            if (tbl == null)
            {
                throw new Exception("Tabela não encontrada.");
            }

            // TODO: Validar permissão de acesso a esses dados.

            objInterlocutor.addJson(tbl.pesquisar(objPesquisa.arrFil) ?? null);
        }
Ejemplo n.º 2
0
        private void cancelarEmail(Interlocutor objInterlocutor)
        {
            var objEmailRegistro = objInterlocutor.getObjJson <EmailRegistroDominio>();

            if (objEmailRegistro == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(objEmailRegistro.strEmail))
            {
                return;
            }

            if (string.IsNullOrEmpty(objEmailRegistro.dirDocumentacao))
            {
                return;
            }

            if (this.lstObjEmailRegistro == null)
            {
                return;
            }

            if (this.lstObjEmailRegistro.Count < 1)
            {
                return;
            }

            foreach (var objEmailRegistroLocal in this.lstObjEmailRegistro)
            {
                if (this.cancelarEmail(objInterlocutor, objEmailRegistro, objEmailRegistroLocal))
                {
                    return;
                }
            }
        }
Ejemplo n.º 3
0
        private void registrarEmail(Interlocutor objInterlocutor)
        {
            var objEmailRegistro = objInterlocutor.getObjJson <EmailRegistroDominio>();

            if (objEmailRegistro == null)
            {
                return;
            }

            if (string.IsNullOrEmpty(objEmailRegistro.strEmail))
            {
                return;
            }

            if (!objEmailRegistro.strEmail.Contains("@"))
            {
                return;
            }

            foreach (var objEmailRegistroLocal in this.lstObjEmailRegistro)
            {
                if (!this.registrarEmailValidar(objInterlocutor, objEmailRegistro, objEmailRegistroLocal))
                {
                    return;
                }
            }

            objEmailRegistro.dttAtualizacao = DateTime.Now;
            objEmailRegistro.dttCadastro    = DateTime.Now;

            this.lstObjEmailRegistro.Add(objEmailRegistro);

            this.salvarArquivo();

            objInterlocutor.objData = string.Format("Email \"{0}\" cadastrado com sucesso!", objEmailRegistro.strEmail);
        }