Esempio n. 1
0
        DataTable IConsulta.CarregaDadosMae(string idUnit)
        {
            DataTable     table2;
            StringBuilder builder = new StringBuilder();
            DataTable     table   = new DataTable();

            try
            {
                builder.Length = 0;
                builder.AppendLine("EXECUTE INTOUCH.DBO.[BIINTOUCH.CARREGAINFORMACOES_MAE] ");
                builder.AppendLine("@ID_UNIT = '" + idUnit + "' ");
                table  = DbIntouch.ExecuteDataTable(builder.ToString());
                table2 = table.Copy();
            }
            catch
            {
                table2 = null;
            }
            finally
            {
                if (table != null)
                {
                    table.Dispose();
                }
            }
            return(table2);
        }
Esempio n. 2
0
        bool IConsulta.AutorizadoParaConsultar(string usuario, string Ip, string senha, string cliente, EnumProduto produto, ref int idLogin)
        {
            DataTable table = new DataTable();

            try
            {
                table = DbIntouch.ExecuteDataTable("PROJETO_FINANCEIRO..[BIINTOUCH.AUTORIZADOPARACONSULTAR] @USUARIO='" + usuario + "', @SENHA='" + senha + "', @CLIENTE='" + cliente + "', @IP='" + Ip + "', @ID_PRODUTO=" + Convert.ToInt32(produto).ToString());
            }
            catch (Exception exception)
            {
                base.Erro = exception.Message;
                return(false);
            }
            if (table != null)
            {
                foreach (DataRow row in table.Rows)
                {
                    if (row["ERRO"].ToString().Trim() != string.Empty)
                    {
                        base.Erro = row["ERRO"].ToString();
                        return(false);
                    }
                    idLogin = Convert.ToInt32(row["IDLOGIN"].ToString());
                }
            }
            return(true);
        }
Esempio n. 3
0
        DataTable IConsulta.GetMaisTelefone(string idUnit, string tipoPessoa)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                string str = tipoPessoa.ToUpper();
                if (str != null)
                {
                    if (!(str == "PF"))
                    {
                        if (str == "PJ")
                        {
                            goto Label_0051;
                        }
                    }
                    else
                    {
                        builder.Append("[BIINTOUCH.MAIS_TELEFONES_PF] '" + idUnit + "'");
                    }
                }
                goto Label_006A;
Label_0051:
                builder.Append("[BIINTOUCH.MAIS_TELEFONES_PJ] '" + idUnit + "'");
Label_006A:
                table = DbIntouch.ExecuteDataTable(builder.ToString());
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 4
0
        DataTable IConsulta.GetCcf(string cpf_cnpj)
        {
            DataTable table = new DataTable();
            string    cmd   = "[BIINTOUCH.GETCCF] @DOCUMENTO=" + cpf_cnpj;

            try
            {
                table = DbIntouch.ExecuteDataTable(cmd);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 5
0
        DataTable IConsulta.LocalizaVizinhos(string idUnit, string tipoPessoa, string melhorcep)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.AppendLine("[BIINTOUCH.PR_VIZINHOS_" + tipoPessoa + "_DESENV] @ID_UNIT = " + idUnit + ", @MELHORCEP='" + melhorcep + "'");
                table = DbIntouch.ExecuteDataTable(builder.ToString());
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 6
0
        DataTable IConsulta.GetVeiculo(string cpf_cnpj)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.Append("[BIINTOUCH.VEICULOS] '" + cpf_cnpj + "'");
                table = DbIntouch.ExecuteDataTable(builder.ToString());
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 7
0
        DataTable IConsulta.GetPerfilConsumo(string cpf)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.Append("[BIINTOUCH..GETPERFILCONSUMO] @CPF= '" + cpf + "'");
                table = DbIntouch.ExecuteDataTable(builder.ToString());
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 8
0
        DataTable IConsulta.CarregarDadosComerciasPj(string cnpj)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.AppendLine("[BIINTOUCH.SP_CARREGADADOSCOMERCIAIS_PJ] @CNPJ = '" + cnpj + "'");
                table = DbIntouch.ExecuteDataTable(builder.ToString());
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 9
0
        DataTable IHistoricoLogin.GetHistoricoLogin(int idCliente, int idUsuario)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                builder.AppendLine("[BIINTOUCH.GETHISTORICOLOGIN] " + idCliente.ToString() + "," + idUsuario.ToString() + ")");
                table = DbIntouch.ExecuteDataTable(builder.ToString());
            }
            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());
            }
            return(table);
        }
Esempio n. 10
0
        DataTable IHistoricoLogin.GetLogUsuario(int idCliente, string acao, string dataInicio, string dataFim)
        {
            DataTable     table   = new DataTable();
            StringBuilder builder = new StringBuilder();

            try
            {
                table = DbIntouch.ExecuteDataTable("[BIINTOUCH.LOGUSUARIO] @ID_CLIENTE = " + idCliente.ToString() + ", @ACAO = " + acao + ", @DATA_INICIO = '" + dataInicio + "', @DATA_FIM = '" + dataFim + "'");
            }
            catch (Exception)
            {
                Dictionary <string, string> dictionary  = new Dictionary <string, string>();
                Dictionary <string, string> dictionary2 = dictionary;
                dictionary2.Add("idCliente", idCliente.ToString());
                dictionary2.Add("acao", acao.ToString());
                dictionary2.Add("dataInicio", dataInicio.ToString());
                dictionary2.Add("dataFim", dataFim.ToString());
            }
            return(table);
        }
Esempio n. 11
0
        DataTable IConsulta.CarregaEmpresasLigadas(string idUnitPj, Usuario usuario, int idHistoricoLogin)
        {
            DataTable table = new DataTable();
            string    cmd   = "[BIINTOUCH.CARREGAEMPRESASLIGADAS] @ID_UNIT_PJ=" + idUnitPj;
            object    obj2  = "INTOUCH..[BIINTOUCH.COBRARCONSULTA] @ID_CLIENTE = " + usuario.IdCliente.ToString();
            string    str2  = string.Concat(new object[] { obj2, ", @ID_LOGIN="******", @ID_UNIT='", idUnitPj, "' , @TIPO_CONSULTA=3,@ID_HISTORICO_LOGIN=", idHistoricoLogin });

            try
            {
                table = DbIntouch.ExecuteDataTable(cmd);
                if (table != null)
                {
                    DbIntouch.ExecuteNonQuery(str2);
                }
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(table);
        }
Esempio n. 12
0
        DataTable IConsulta.BuscaApresentacao(string tipoPessoa, string nome, string dataInicial, string dataFinal, string idadeInicial, string idadeFinal, string endereco, string numero, string complemento, string bairro, string cidade, string uf, string cep, string ddd, string telefone)
        {
            StringBuilder builder = new StringBuilder();

            builder.AppendLine("[BIINTOUCH.LOCALIZA_BUSCA_APRESENTACAO_" + tipoPessoa + "] ");
            builder.AppendLine("@NOME = '" + nome + "',");
            if ((dataInicial != string.Empty) & (dataFinal != string.Empty))
            {
                builder.AppendLine("@DATAINICIAL = '" + DateTime.ParseExact(dataInicial, "dd/MM/yyyy", null).ToString("yyyy/MM/dd") + "',");
                builder.AppendLine("@DATAFINAL = '" + DateTime.ParseExact(dataFinal, "dd/MM/yyyy", null).ToString("yyyy/MM/dd") + "',");
            }
            builder.AppendLine("@IDADEINICIAL = '" + idadeInicial + "',");
            builder.AppendLine("@IDADEFINAL = '" + idadeFinal + "',");
            builder.AppendLine("@ENDERECO = '" + endereco + "', ");
            builder.AppendLine("@NUMERO = '" + numero + "', ");
            builder.AppendLine("@COMPLEMENTO = '" + complemento + "',");
            builder.AppendLine("@BAIRRO = '" + bairro + "',");
            builder.AppendLine("@CIDADE = '" + cidade + "',");
            builder.AppendLine("@UF = '" + uf + "',");
            builder.AppendLine("@CEP = '" + cep.Replace("-", "") + "',");
            builder.AppendLine("@DDD = " + ((ddd == string.Empty) ? "0" : ddd) + ",");
            builder.AppendLine("@TELEFONE = " + ((telefone == string.Empty) ? "0" : telefone));
            return(DbIntouch.ExecuteDataTable(builder.ToString()));
        }
Esempio n. 13
0
 public static DataTable GetAgendamentoRelatorioByCliente(int idCliente)
 {
     return(DbIntouch.ExecuteDataTable("[BIINTOUCH.GETAGENDAMENTORELATORIO_BY_CLIENTE] " + idCliente.ToString()));
 }
Esempio n. 14
0
 DataTable IAgendamentoRelatorio.GetTotalConsultaClienteRelatorio(string tabela)
 {
     return(DbIntouch.ExecuteDataTable("[BIINTOUCH.GETTOTALCONSULTA_CLIENTERELATORIO] '" + tabela + "'"));
 }
Esempio n. 15
0
 DataTable IAgendamentoRelatorio.GetRelatorio(string tabela)
 {
     return(DbIntouch.ExecuteDataTable("[BINTOUCH.GETRELATORIO] " + tabela));
 }