Esempio n. 1
0
        DataSet IConsulta.CarregaDadosPf(string idUnit, bool filtroProcon)
        {
            DataSet set = new DataSet();

            try
            {
                set = DbIntouch.ExecuteDataset(string.Concat(new object[] { "INTOUCH..[BIINTOUCH.CARREGAINFORMACOES_PF_DESENV2] @ID_UNIT='", idUnit, "', @FILTRO_PROCON=", Convert.ToInt32(filtroProcon) }));
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(set);
        }
Esempio n. 2
0
        DataSet IConsulta.LocalizarPessoaMarcondes(string[] opcoesAvancadas, bool filtroProcon)
        {
            string  cmd = "[BIINTOUCH.LOCALIZA_" + opcoesAvancadas[0].ToUpper() + "_DESENV2]";
            DataSet set = new DataSet();

            try
            {
                if ((opcoesAvancadas[0] == "PF") && (opcoesAvancadas[1] == "POR_CPF"))
                {
                    cmd = (cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@CPF = '" + opcoesAvancadas[2].Replace(".", string.Empty).Replace("-", string.Empty).Replace("/", string.Empty) + "' ";
                    cmd = string.Concat(new object[] { cmd, ",@FILTRO_PROCON=", Convert.ToInt32(filtroProcon), " " });
                }
                else if ((opcoesAvancadas[0] == "PJ") && (opcoesAvancadas[1] == "POR_CNPJ"))
                {
                    cmd = (cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@CNPJ = '" + opcoesAvancadas[2].Replace(".", string.Empty).Replace("-", string.Empty).Replace("/", string.Empty) + "' ";
                    cmd = string.Concat(new object[] { cmd, ",@FILTRO_PROCON=", Convert.ToInt32(filtroProcon), " " });
                }
                else
                {
                    string str2 = opcoesAvancadas[1];
                    if (str2 != null)
                    {
                        if (!(str2 == "POR_NOME"))
                        {
                            if (str2 == "POR_TELEFONE")
                            {
                                goto Label_0267;
                            }
                            if (str2 == "POR_CEP")
                            {
                                goto Label_02DE;
                            }
                            if (str2 == "POR_ENDERECO")
                            {
                                goto Label_0341;
                            }
                            if (str2 == "POR_PLACA_VEICULO")
                            {
                                goto Label_03F1;
                            }
                        }
                        else
                        {
                            cmd = ((((cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@NOME = '" + opcoesAvancadas[2] + "', ") + "@BAIRRO = '" + opcoesAvancadas[3] + "', ") + "@CIDADE = '" + opcoesAvancadas[4] + "', ") + "@UF = '" + opcoesAvancadas[5] + "' ";
                        }
                    }
                }
                goto Label_0452;
Label_0267:
                cmd = ((cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@DDD = '" + opcoesAvancadas[2] + "', ") + "@TELEFONE = '" + opcoesAvancadas[3] + "' ";
                cmd = string.Concat(new object[] { cmd, ",@FILTRO_PROCON=", Convert.ToInt32(filtroProcon), " " });
                goto Label_0452;
Label_02DE:
                cmd = (cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@CEP = '" + opcoesAvancadas[2] + "' ";
                cmd = string.Concat(new object[] { cmd, ",@FILTRO_PROCON=", Convert.ToInt32(filtroProcon), " " });
                goto Label_0452;
Label_0341:
                cmd = (((((cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@ENDERECO = '" + opcoesAvancadas[2] + "', ") + "@NUMERO = '" + opcoesAvancadas[3] + "', ") + "@BAIRRO = '" + opcoesAvancadas[4] + "', ") + "@CIDADE = '" + opcoesAvancadas[5] + "', ") + "@UF = '" + opcoesAvancadas[6] + "' ";
                cmd = string.Concat(new object[] { cmd, ",@FILTRO_PROCON=", Convert.ToInt32(filtroProcon), " " });
                goto Label_0452;
Label_03F1:
                cmd = (cmd + "@PESQ_AVANCADA = '" + opcoesAvancadas[1] + "', ") + "@PLACA_VEICULO = '" + opcoesAvancadas[2] + "' ";
                cmd = string.Concat(new object[] { cmd, ",@FILTRO_PROCON=", Convert.ToInt32(filtroProcon), " " });
Label_0452:
                set = DbIntouch.ExecuteDataset(cmd);
            }
            catch (Exception exception)
            {
                throw new Exception(exception.Message);
            }
            return(set);
        }