Esempio n. 1
0
        int IConsulta.InserirNovoEmailPj(string email, bool particular, int idStatus, int idUnitPj, int idLogin)
        {
            int           num     = 0;
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.AppendLine("[BIINTOUCH.INSERIR_NOVO_EMAIL_PJ] ");
                builder.AppendLine(string.Format(" @EMAIL='{0}', ", email));
                if (particular)
                {
                    builder.AppendLine(" @PARTICULAR=1, ");
                }
                else
                {
                    builder.AppendLine(" @PARTICULAR=0, ");
                }
                builder.AppendLine(string.Format(" @STATUS={0}, ", idStatus.ToString()));
                builder.AppendLine(string.Format(" @ID_UNIT_PJ={0}, ", idUnitPj.ToString()));
                builder.AppendLine(string.Format(" @ID_LOGIN={0}", idLogin.ToString()));
                num = Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString()));
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(num);
        }
Esempio n. 2
0
        int IConsulta.InserirNovoEndereco(string logradouro, string numero, string complemento, string bairro, string cidade, string uf, string cep, int idStatus, int idUnit, int idLogin, int hEndId, int tipoConsulta, int origem, int idCliente)
        {
            int num = 0;

            logradouro.Replace('\'', '\x00b4');
            StringBuilder builder = new StringBuilder();

            try
            {
                if (cep.Length == 8)
                {
                    builder.AppendLine("[BIINTOUCH.INSERIR_NOVO_ENDERECO] ");
                    builder.AppendLine(string.Format(" @LOGRADOURO='{0}', ", logradouro));
                    builder.AppendLine(string.Format(" @NUMERO='{0}', ", numero));
                    builder.AppendLine(string.Format(" @COMPLEMENTO='{0}', ", complemento));
                    builder.AppendLine(string.Format(" @BAIRRO='{0}', ", bairro));
                    builder.AppendLine(string.Format(" @CIDADE='{0}', ", cidade));
                    builder.AppendLine(string.Format(" @UF='{0}', ", uf));
                    builder.AppendLine(string.Format(" @CEP='{0}', ", cep));
                    builder.AppendLine(string.Format(" @STATUS={0}, ", idStatus.ToString()));
                    builder.AppendLine(string.Format(" @ID_UNIT={0}, ", idUnit.ToString()));
                    builder.AppendLine(string.Format(" @ID_LOGIN={0},", idLogin.ToString()));
                    builder.AppendLine(string.Format(" @H_END_ID={0}, ", hEndId.ToString()));
                    builder.AppendLine(string.Format(" @TIPOCONSULTA={0}, ", tipoConsulta.ToString()));
                    builder.AppendLine(string.Format(" @ORIGEM={0}, ", origem.ToString()));
                    builder.AppendLine(string.Format(" @ID_CLIENTE={0} ", idCliente.ToString()));
                    num = Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString()));
                }
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(num);
        }
Esempio n. 3
0
        int IConsulta.InserirInformacoesPf(string cpf, string nome, string sexo, string dataNasc, string idade, string estadoCivil, string nomeMae, int idUnit, int idLogin, bool obito)
        {
            int           num     = 0;
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.AppendLine("[BIINTOUCH.INSERIRINFORMACOES_PF] ");
                builder.AppendLine("'" + cpf.Replace(".", string.Empty).Replace("-", string.Empty).Replace("/", string.Empty) + "',");
                builder.AppendLine("'" + nome.TrimStart(new char[0]).TrimEnd(new char[0]) + "',");
                builder.AppendLine("'" + sexo + "',");
                builder.AppendLine("'" + dataNasc + "',");
                builder.AppendLine("'" + idade + "',");
                builder.AppendLine("'" + estadoCivil + "',");
                builder.AppendLine("'" + nomeMae.TrimStart(new char[0]).TrimEnd(new char[0]) + "',");
                builder.AppendLine(idUnit.ToString() + ",");
                builder.AppendLine(idLogin.ToString() + ",");
                builder.AppendLine(Convert.ToInt32(obito).ToString() ?? "");
                num = Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString()));
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(num);
        }
Esempio n. 4
0
        string ITratarDados.TratarEndereco(string endereco, string numero, string complemento, string bairro, string cidade, string estado, string cep)
        {
            StringBuilder builder = new StringBuilder();

            builder.Append(string.Format("SELECT DATAFOURLIB2010.DBO.FN_TRATA_ENDERECO('{0}', '{1}', '{2}', '{3}', '{4}')", new object[] { endereco + " " + numero + " " + complemento, bairro, cidade, estado, cep }));
            return(DbIntouch.ExecuteScalar(builder.ToString()));
        }
Esempio n. 5
0
        int IConsulta.InserirInformacoesPj(string cnpj, string razao, string nomeFantasia, string dataAbertura, string cnae, string qtdFuncionarios, string situacao, string njur, string porte, string qtdProprietarios, int idUnit, int idLogin)
        {
            int num = 0;

            if (qtdFuncionarios.Length == 0)
            {
                qtdFuncionarios = "0";
            }
            if (qtdProprietarios.Length == 0)
            {
                qtdProprietarios = "0";
            }
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.AppendLine("DECLARE @RETORNO AS INT ");
                builder.AppendLine("INSERT INTO UNITEMPRESAS..HISTORICO_PJ (");
                builder.AppendLine("CNPJ,");
                builder.AppendLine("RAZAO,");
                builder.AppendLine("NOME_FANTASIA,");
                builder.AppendLine("DT_ABERTURA,");
                builder.AppendLine("CNAE,");
                builder.AppendLine("QTD_FUNCIONARIOS,");
                builder.AppendLine("DESCR_SITUACAO_CAD,");
                builder.AppendLine("NJUR,");
                builder.AppendLine("PORTE,");
                builder.AppendLine("QTD_PROP,");
                builder.AppendLine("ID_UNIT_PJ,");
                builder.AppendLine("ID_LOGIN,");
                builder.AppendLine("DATA_ACESSO )");
                builder.AppendLine("VALUES (");
                builder.AppendLine("'" + cnpj + "',");
                builder.AppendLine("'" + razao + "',");
                builder.AppendLine("'" + nomeFantasia + "',");
                builder.AppendLine("'" + dataAbertura + "',");
                builder.AppendLine("'" + cnae + "',");
                builder.AppendLine(qtdFuncionarios.ToString() + ",");
                builder.AppendLine("'" + situacao + "',");
                builder.AppendLine("'" + njur + "',");
                builder.AppendLine("'" + porte + "',");
                builder.AppendLine(qtdProprietarios.ToString() + ",");
                builder.AppendLine(idUnit.ToString() + ",");
                builder.AppendLine(idLogin.ToString() + ",");
                builder.AppendLine("GETDATE())");
                builder.AppendLine("SET @RETORNO = @@IDENTITY ");
                builder.AppendLine("SELECT @RETORNO");
                num = Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString()));
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(num);
        }
Esempio n. 6
0
        bool ICampanhaAtualizeSuaSorte.CPFParticipanteValido(string CPFParticipante)
        {
            bool flag = false;

            try
            {
                flag = Convert.ToBoolean(Convert.ToInt32(DbIntouch.ExecuteScalar("[BIINTOUCH.VALIDACAO_CPF_PARTICIPANTE_CAMPANHA_ATUALIZE_SUA_SORTE] @CPF_PARTICIPANTE='" + CPFParticipante + "' ")));
            }
            catch (Exception)
            {
            }
            return(flag);
        }
Esempio n. 7
0
        string IConsulta.GetTipoDocumento(string documento)
        {
            string cmd  = "DATAFOURLIB2010..[BIINTOUCH.OBTEM_TIPODOCUMENTO] @DOCUMENTO='" + documento + "'";
            string str2 = "";

            try
            {
                str2 = DbIntouch.ExecuteScalar(cmd);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(str2);
        }
Esempio n. 8
0
        string IConsulta.GetIdUnit(string documento)
        {
            string cmd  = "[BIINTOUCH.GET_IDUNIT] @DOCUMENTO='" + documento + "'";
            string str2 = "";

            try
            {
                str2 = DbIntouch.ExecuteScalar(cmd);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(str2);
        }
Esempio n. 9
0
        int IDadosTelefone.InserirNovoTelefonePf(int idLogin, string idUnit, int idStatus, string ddd, string tel)
        {
            int num = 0;

            try
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("[BIINTOUCH.INSERIRNOVOTELEFONEPF] ");
                builder.Append("@ID_LOGIN = "******",");
                builder.Append("@ID_UNIT = " + idUnit + ",");
                builder.Append("@DDD = '" + ddd + "',");
                builder.Append("@TELEFONE = '" + tel + "',");
                builder.Append("@STATUS = " + idStatus);
                num = Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString()));
            }
            catch (Exception)
            {
            }
            return(num);
        }
Esempio n. 10
0
        DataTable ICampanhaAtualizeSuaSorte.InformacoesParticipanteCampanha(string CPFParticipante)
        {
            DataTable table = new DataTable();

            try
            {
                string str  = this.ExecuteScalar("[PR_GET_INFORMACOES_PARTICIPANTE_CAMPANHA_ATUALIZE_SUA_SORTE] @CPF = '" + CPFParticipante + "'");
                string str2 = DbIntouch.ExecuteScalar("[BIINTOUCH.GET_QTD_PONTOS_CAMPANHA_ATUALIZE_SUA_SORTE] @CPF_PARTICIPANTE = '" + CPFParticipante + "'");
                table.Columns.Add("NOME_PARTICIPANTE");
                table.Columns.Add("QTD_CUPOM");
                DataRow row = table.NewRow();
                row["NOME_PARTICIPANTE"] = str;
                row["QTD_CUPOM"]         = str2;
                table.Rows.Add(row);
            }
            catch (Exception)
            {
            }
            return(table);
        }
Esempio n. 11
0
        string ICampanhaAtualizeSuaSorte.PontuarCampanha(string CPFParticipante, EnumTipoInformacao enumTipoInformacao, int identificadorInformacao)
        {
            string str = string.Empty;

            try
            {
                string        str2    = this.ExecuteScalar("[PR_GET_RASPADINHA]  ");
                StringBuilder builder = new StringBuilder();
                builder.Append("[BIINTOUCH.INSERIR_PONTOS_CAMPANHA_ATUALIZE_SUA_SORTE] ");
                builder.Append("@CPF_PARTICIPANTE='" + CPFParticipante + "',");
                builder.Append("@ID_TIPO_INFORMACAO=" + ((int)enumTipoInformacao) + ",");
                builder.Append("@IDENTIFICADOR_INFORMACAO=" + identificadorInformacao + ",");
                builder.Append("@CODIGO_RASPADINHA='" + str2 + "'");
                DbIntouch.ExecuteNonQuery(builder.ToString());
                str = DbIntouch.ExecuteScalar("[BIINTOUCH.GET_QTD_PONTOS_CAMPANHA_ATUALIZE_SUA_SORTE] @CPF_PARTICIPANTE = '" + CPFParticipante + "'");
            }
            catch (Exception)
            {
            }
            return(str);
        }
Esempio n. 12
0
        int IDadosEmpresa.InserirEmpresa(int idStatus, string cpf, string cnpj, string tipo, string pct, string dataEntrada, int idLogin)
        {
            int num = 0;

            try
            {
                StringBuilder builder = new StringBuilder();
                builder.Append("[BIINTOUCH.HISTORICO_STATUS_EMPRESAS] ");
                builder.Append("@STATUS = " + idStatus + ",");
                builder.Append("@CPF = '" + cpf + "',");
                builder.Append("@CNPJ = '" + cnpj + "',");
                builder.Append("@TIPO = '" + tipo + "',");
                builder.Append("@PCT = '" + pct + "',");
                builder.Append("@DATA_ENTRADA = '" + dataEntrada + "',");
                builder.Append("@ID_LOGIN = " + idLogin);
                num = Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString()));
            }
            catch (Exception)
            {
            }
            return(num);
        }
Esempio n. 13
0
        int IHistoricoLogin.InserirHistoricoLogin(int idCliente, int idUsuario, string Ip)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.Append("[BIINTOUCH.CRIARHISTORICOLOGIN] ");
                builder.Append(idCliente.ToString() + ",");
                builder.Append(idUsuario.ToString() + ",");
                builder.Append("'" + Ip + "'");
            }
            catch (Exception)
            {
                Dictionary <string, string> dictionary  = new Dictionary <string, string>();
                Dictionary <string, string> dictionary2 = dictionary;
                dictionary2.Add("idCliente", idCliente.ToString());
                dictionary2.Add("idUsuario", idUsuario.ToString());
                dictionary2.Add("idUsuario", idUsuario.ToString());
            }
            return(Convert.ToInt32(DbIntouch.ExecuteScalar(builder.ToString())));
        }